From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Wed, 20 Apr 2016 02:01:23 +0000 Subject: Re: [kvm-unit-tests PATCH 1/2] powerpc: use well known kernel start address Message-Id: <20160420120123.11621b70@voom.fritz.box> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Sig_/=Pqd3eaK0os+HxMMu/OGJCH" List-Id: References: <1461086788-3102-1-git-send-email-lvivier@redhat.com> <1461086788-3102-2-git-send-email-lvivier@redhat.com> In-Reply-To: <1461086788-3102-2-git-send-email-lvivier@redhat.com> To: Laurent Vivier Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com, thuth@redhat.com, pbonzini@redhat.com --Sig_/=Pqd3eaK0os+HxMMu/OGJCH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 19 Apr 2016 19:26:27 +0200 Laurent Vivier wrote: > As we know where QEMU will load the kernel, it seems an useless > pain to try to compute it instead of using the well known value. >=20 > Signed-off-by: Laurent Vivier Hmm.. I'm a little dubious about whether it's a good idea to require that kernel load address to remain fixed in qemu. I don't think it's something we really have an interface guarantee for. It might be ok given that we're just talking about the test shim here, though. > --- > powerpc/boot_rom.S | 3 ++- > powerpc/cstart64.S | 6 +++--- > powerpc/spapr.h | 6 ++++++ > 3 files changed, 11 insertions(+), 4 deletions(-) > create mode 100644 powerpc/spapr.h >=20 > diff --git a/powerpc/boot_rom.S b/powerpc/boot_rom.S > index ae2c08d..266d61f 100644 > --- a/powerpc/boot_rom.S > +++ b/powerpc/boot_rom.S > @@ -1,4 +1,5 @@ > -#define SPAPR_KERNEL_LOAD_ADDR 0x400000 > +#include "spapr.h" > + > .text > .globl start > start: > diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S > index ceb6397..c47b67d 100644 > --- a/powerpc/cstart64.S > +++ b/powerpc/cstart64.S > @@ -11,6 +11,8 @@ > #include > #include > =20 > +#include "spapr.h" > + > .section .init > =20 > /* > @@ -25,9 +27,7 @@ start: > * so we just linked at zero. This means the first thing to do is > * to find our stack and toc, and then do a relocate. > */ > - bl 0f > -0: mflr r31 > - subi r31, r31, 0b - start /* QEMU's kernel load address */ > + LOAD_REG_IMMEDIATE(r31, SPAPR_KERNEL_LOAD_ADDR) > ld r1, (p_stack - start)(r31) > ld r2, (p_toc - start)(r31) > add r1, r1, r31 > diff --git a/powerpc/spapr.h b/powerpc/spapr.h > new file mode 100644 > index 0000000..b41aece > --- /dev/null > +++ b/powerpc/spapr.h > @@ -0,0 +1,6 @@ > +#ifndef _ASMPOWERPC_SPAPR_H_ > +#define _ASMPOWERPC_SPAPR_H_ > + > +#define SPAPR_KERNEL_LOAD_ADDR 0x400000 > + > +#endif /* _ASMPOWERPC_SPAPR_H_ */ > --=20 > 2.5.5 >=20 --=20 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/=Pqd3eaK0os+HxMMu/OGJCH Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXFuLzAAoJEGw4ysog2bOSqN8QAJe4JcwBy0BR6TGF4GI1mBC2 HDA8oPBGt4UtgX70guv2MCXR2TPVVjhZ9LCmv40b9iZKbkGfkLt64re9BmXiasIu g6dPoK6p7ZGyTmCjXjCUHFxoVGmaW/iCFbUFzXKRyalh5tGASj85UEKl1HdOodeY nKaPECkP7x7Q+PIp+wXCsRRr4XTTm+S8VGc5ARiOZo90Ml5g4HMpLJbmFw3QDiXZ hd7tdfztdoItkjotP3cbl/N3eLPtiQ6e/vDFRUz7nMIEA2R/lcT4YKYJD4Z//u3r AmnzBuaAD+JJFpSj5RT91E+9hWLUlUWP3DOF+jurHC39xH4NEGE+oyXUNuxPMmk9 Rh6ebFFZ6Abhcj+zIPV9qkPkESufGdwrC/s9QqKAVSF3neaGol5AweKcUug6Agw9 P47xpAO3k2AVvyFRVqBzNX0t2TI6BvI7iNV/NcS5TY2bArhppsOoL6gXm71WYT+i iULtVinZ4x3a2QPAAYfIIE0w0M7F9ryojxyZ8Hfnp+V/g6HuInNcALaabz7IRTge dYVqIXarVpIu4tbPyDEKhVp0BZE7KHG3vebCsENgvq09BlCpeC5DG1BJnnWDe42a MmH4Z7zeU/PGAUicDVJ3jI6xk2KLmhj47ZEjo/yK8DM58jv1OXhkXAxfeIIDJU5I kQnlgZU9ydeH3jJk0EMm =uWnG -----END PGP SIGNATURE----- --Sig_/=Pqd3eaK0os+HxMMu/OGJCH-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [kvm-unit-tests PATCH 1/2] powerpc: use well known kernel start address Date: Wed, 20 Apr 2016 12:01:23 +1000 Message-ID: <20160420120123.11621b70@voom.fritz.box> References: <1461086788-3102-1-git-send-email-lvivier@redhat.com> <1461086788-3102-2-git-send-email-lvivier@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/=Pqd3eaK0os+HxMMu/OGJCH"; protocol="application/pgp-signature" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com, thuth@redhat.com, pbonzini@redhat.com To: Laurent Vivier Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35118 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753752AbcDTCAM (ORCPT ); Tue, 19 Apr 2016 22:00:12 -0400 In-Reply-To: <1461086788-3102-2-git-send-email-lvivier@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --Sig_/=Pqd3eaK0os+HxMMu/OGJCH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 19 Apr 2016 19:26:27 +0200 Laurent Vivier wrote: > As we know where QEMU will load the kernel, it seems an useless > pain to try to compute it instead of using the well known value. >=20 > Signed-off-by: Laurent Vivier Hmm.. I'm a little dubious about whether it's a good idea to require that kernel load address to remain fixed in qemu. I don't think it's something we really have an interface guarantee for. It might be ok given that we're just talking about the test shim here, though. > --- > powerpc/boot_rom.S | 3 ++- > powerpc/cstart64.S | 6 +++--- > powerpc/spapr.h | 6 ++++++ > 3 files changed, 11 insertions(+), 4 deletions(-) > create mode 100644 powerpc/spapr.h >=20 > diff --git a/powerpc/boot_rom.S b/powerpc/boot_rom.S > index ae2c08d..266d61f 100644 > --- a/powerpc/boot_rom.S > +++ b/powerpc/boot_rom.S > @@ -1,4 +1,5 @@ > -#define SPAPR_KERNEL_LOAD_ADDR 0x400000 > +#include "spapr.h" > + > .text > .globl start > start: > diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S > index ceb6397..c47b67d 100644 > --- a/powerpc/cstart64.S > +++ b/powerpc/cstart64.S > @@ -11,6 +11,8 @@ > #include > #include > =20 > +#include "spapr.h" > + > .section .init > =20 > /* > @@ -25,9 +27,7 @@ start: > * so we just linked at zero. This means the first thing to do is > * to find our stack and toc, and then do a relocate. > */ > - bl 0f > -0: mflr r31 > - subi r31, r31, 0b - start /* QEMU's kernel load address */ > + LOAD_REG_IMMEDIATE(r31, SPAPR_KERNEL_LOAD_ADDR) > ld r1, (p_stack - start)(r31) > ld r2, (p_toc - start)(r31) > add r1, r1, r31 > diff --git a/powerpc/spapr.h b/powerpc/spapr.h > new file mode 100644 > index 0000000..b41aece > --- /dev/null > +++ b/powerpc/spapr.h > @@ -0,0 +1,6 @@ > +#ifndef _ASMPOWERPC_SPAPR_H_ > +#define _ASMPOWERPC_SPAPR_H_ > + > +#define SPAPR_KERNEL_LOAD_ADDR 0x400000 > + > +#endif /* _ASMPOWERPC_SPAPR_H_ */ > --=20 > 2.5.5 >=20 --=20 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/=Pqd3eaK0os+HxMMu/OGJCH Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXFuLzAAoJEGw4ysog2bOSqN8QAJe4JcwBy0BR6TGF4GI1mBC2 HDA8oPBGt4UtgX70guv2MCXR2TPVVjhZ9LCmv40b9iZKbkGfkLt64re9BmXiasIu g6dPoK6p7ZGyTmCjXjCUHFxoVGmaW/iCFbUFzXKRyalh5tGASj85UEKl1HdOodeY nKaPECkP7x7Q+PIp+wXCsRRr4XTTm+S8VGc5ARiOZo90Ml5g4HMpLJbmFw3QDiXZ hd7tdfztdoItkjotP3cbl/N3eLPtiQ6e/vDFRUz7nMIEA2R/lcT4YKYJD4Z//u3r AmnzBuaAD+JJFpSj5RT91E+9hWLUlUWP3DOF+jurHC39xH4NEGE+oyXUNuxPMmk9 Rh6ebFFZ6Abhcj+zIPV9qkPkESufGdwrC/s9QqKAVSF3neaGol5AweKcUug6Agw9 P47xpAO3k2AVvyFRVqBzNX0t2TI6BvI7iNV/NcS5TY2bArhppsOoL6gXm71WYT+i iULtVinZ4x3a2QPAAYfIIE0w0M7F9ryojxyZ8Hfnp+V/g6HuInNcALaabz7IRTge dYVqIXarVpIu4tbPyDEKhVp0BZE7KHG3vebCsENgvq09BlCpeC5DG1BJnnWDe42a MmH4Z7zeU/PGAUicDVJ3jI6xk2KLmhj47ZEjo/yK8DM58jv1OXhkXAxfeIIDJU5I kQnlgZU9ydeH3jJk0EMm =uWnG -----END PGP SIGNATURE----- --Sig_/=Pqd3eaK0os+HxMMu/OGJCH--