Received: from eggs.gnu.org ([2001:4830:134:3::10]:41299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWxiL-0001rV-Ao for qemu-devel@nongnu.org; Mon, 08 Aug 2016 23:28:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWxiJ-0002PZ-Ui for qemu-devel@nongnu.org; Mon, 08 Aug 2016 23:28:25 -0400 Date: Tue, 9 Aug 2016 13:09:35 +1000 From: David Gibson Message-ID: <20160809030935.GD9057@voom.fritz.box> References: <1470661733-22154-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM" Content-Disposition: inline In-Reply-To: <1470661733-22154-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] ppc64: fix compressed dump with pseries kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: agraf@suse.de, qemu-ppc@nongnu.org, thuth@redhat.com, qemu-devel@nongnu.org, drjones@redhat.com --+B+y8wtTXqdUj1xM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 08, 2016 at 03:08:53PM +0200, Laurent Vivier wrote: > If we don't provide the page size in target-ppc:cpu_get_dump_info(), > the default one (TARGET_PAGE_SIZE, 4KB) is used to create > the compressed dump. It works fine with Macintosh, but not with > pseries as the kernel default page size is 64KB. >=20 > Without this patch, if we generate a compressed dump in the QEMU monitor: >=20 > (qemu) dump-guest-memory -z qemu.dump >=20 > This dump cannot be read by crash: >=20 > # crash vmlinux qemu.dump > ... > WARNING: cannot translate vmemmap kernel virtual addresses: > commands requiring page structure contents will fail > ... >=20 > Page_size is used to determine the dumpfile's block size. The > block size needs to be at least the page size, but a multiple of page > size works fine too. For PPC64, linux supports either 4KB or 64KB software > page size. So we define the page_size to 64KB. >=20 > Signed-off-by: Laurent Vivier > Reviewed-by: Andrew Jones > --- > v2: Update commit and source comments about the max page size I've applied this to ppc-for-2.7 for now, since it definitely improves matters. >=20 > target-ppc/arch_dump.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c > index df1fd8c..ea3d1a3 100644 > --- a/target-ppc/arch_dump.c > +++ b/target-ppc/arch_dump.c > @@ -220,6 +220,11 @@ int cpu_get_dump_info(ArchDumpInfo *info, > } else { > info->d_endian =3D ELFDATA2LSB; > } > + /* 64KB is the max page size for pseries kernel */ > + if (strncmp(object_get_typename(qdev_get_machine()), > + "pseries-", 8) =3D=3D 0) { > + info->page_size =3D (1U << 16); > + } However, I think doing this based on machine type actually isn't great. It's entirely plausible that a modern kernel built for Mac would also have 64KiB page size - especially if it's a multiplatform kernel that can run on both Mac and pSeries. Still, that's something we can polish later. > =20 > return 0; > } --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --+B+y8wtTXqdUj1xM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXqUlvAAoJEGw4ysog2bOSUUgQAMzRyboJiQWsZTkk58S4uiu2 2utrdF0/07VMgA6VV8BCOXcAbtmowDh26gyZsgethJV8e7a1HV8KH++hFzm5Iey8 XJ5SUoNa9IWmuL1ArzKc/O2uWRMWdbtXoaR6vlDpXI6wik0d2m6bwTjJ++HtsUFJ TxanVOqM+/MyBGM9yfGydEYyb4x8FjBYwsTA3KE8jCdY5e+YBdt1j2bNur4rmvTx RGEy/IQVWI1PIVGOa/RfDA73QdPMisGvCb9zQfFerzwmkbKAOiQWm1GFNzxE+PXe 5ioYmn4B/18x1XdnkJobgWFrbDT2mDyAfW6cH7Xg9rxk6Bw/4+5LxGrrVEC+voJL yXxSy008Ri8G2BIac6OOGUaKhIZak69sdjG4wf/Jhl/9L6uhiFETNWZKtDfktJSn 8O4gVdMm4NZa7tvRCimeSlhtHkJDU7UNTffRrYZwSE46ahSF2AEEQt3u1fdNX20v PuTKRx958Ij/rGwHcgjNp/T9Evmh0PWsYBcasfpOT2NGfLHQCQAirUZ9zfjcuEOy KEBesJ3xPcOuZp6Nbx9GA4uh/J1mUQt8SVUyRffT4gTwE7CB3JsK2E1NREhTnGIz gZhijPYUyd471itPsqJLOi0MwsTiqpXGL5aeWyESpO4h3QyYB0DHJbjM6FTFB3Hj ySC3bB2UZVMXbSQddlsj =MCY6 -----END PGP SIGNATURE----- --+B+y8wtTXqdUj1xM--