From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bV9ap-0007oe-Eg for qemu-devel@nongnu.org; Wed, 03 Aug 2016 23:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bV9an-0000tN-92 for qemu-devel@nongnu.org; Wed, 03 Aug 2016 23:45:10 -0400 Date: Thu, 4 Aug 2016 12:38:00 +1000 From: David Gibson Message-ID: <20160804023800.GE9189@voom.fritz.box> References: <1470254107-14842-1-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0QFb0wBpEddLcDHQ" Content-Disposition: inline In-Reply-To: <1470254107-14842-1-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH] ppc64: fix compressed dump with pseries kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Alexander Graf , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --0QFb0wBpEddLcDHQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 03, 2016 at 09:55:07PM +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 > Signed-off-by: Laurent Vivier > --- > target-ppc/arch_dump.c | 5 +++++ > 1 file changed, 5 insertions(+) Urgh.. so, really the page size used by the guest kernel is a guest-side detail, and it's certainly possible to build a 4kiB page guest kernel, although 64kiB is the norm. This might be the best we can do, but it'd be nice if we could probe or otherwise avoid relying on this assumption about the guest kernel. >=20 > diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c > index df1fd8c..ad37a59 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 page size default for pseries kernel */ > + if (strncmp(object_get_typename(qdev_get_machine()), > + "pseries-", 8) =3D=3D 0) { > + info->page_size =3D (1U << 16); > + } > =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 --0QFb0wBpEddLcDHQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXoqqIAAoJEGw4ysog2bOSXboP/2BsE0cz2iZdk8L3ZhLCdMCg gKqZaSavUq45QWf0v/CnXJIovL9KdK4qrcKqMGZDFFb8A7SDb2eLkeXe2o61Eulu VeRpiKMrhEltytZfEQvUHQpBx1WiwMO+qYqvG2Xs/jZW2BnvlHKOLPvKGlTNmU75 LGuAHx4LzM9zjNwO1Ny8yBjsEPwOaf0njkUqo73pTgQVn6GCROGvHPqaM5+VZfeg y7WuCAPV762wR+1DUUTvfVKzmHLaLmFzhztq4j85tbqeZ5dCnS8MNPgcsJjaUB1w OEA9TcVRbQ/x2PVaBVPu8JlQ0qfAunkSg4L7CIP2+gQ5xBEw/mfAv5zuHmnajCVT 4gPjPrLaDhC1gV5M1agf/JeDeandulBCJKUZS2693eUEw1NCRMDPCvBWz4vbWG6d bugIfi6Nfbj38k5FjiDc4HujsMq2jy32dhUhOnLvEL63JqPhh+Pnc/SqZmCh6uKW r/68Rmv/84pEs3O6HpcJn2GoH75g3SgBP54dRfzGSVD2vb7SFsa3yR33iKijmiSe 57ySTnqm1VgTkYHULcxiiemeeJsON3DsoyHgOio9jv8TCzs8ZcRzYYAKjxrUaMRm 1Ha4CMsaEJIehGzwkNvRjQ8dgzMvxd5awYintGEma7GeFoHHILSyo5IWbsQKEuVW HM3DqsUTRhKJm9kf58ND =FlFv -----END PGP SIGNATURE----- --0QFb0wBpEddLcDHQ--