Commit 59000b53 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras
Browse files

[POWERPC] spufs: Correctly calculate the size of the local-store to dump



The routine to dump the local store, __spufs_mem_read(), does not take the
spu_lslr_RW value into account - so we shouldn't check it when we're
calculating the size either.

Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Acked-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d464fb44
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -66,11 +66,6 @@ static int spufs_dump_seek(struct file *file, loff_t off)
	return 1;
}

static u64 ctx_ls_size(struct spu_context *ctx)
{
	return ctx->csa.priv2.spu_lslr_RW + 1;
}

static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
{
	int i, sz, total = 0;
@@ -85,9 +80,6 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)

		total += sizeof(struct elf_note);
		total += roundup(strlen(fullname) + 1, 4);
		if (!strcmp(name, "mem"))
			total += roundup(ctx_ls_size(ctx), 4);
		else
		total += roundup(sz, 4);
	}

@@ -164,10 +156,6 @@ static void spufs_arch_write_note(struct spu_context *ctx, int i,
		return;

	name = spufs_coredump_read[i].name;

	if (!strcmp(name, "mem"))
		sz = ctx_ls_size(ctx);
	else
	sz = spufs_coredump_read[i].size;

	sprintf(fullname, "SPU/%d/%s", dfd, name);