From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Date: Fri, 10 Mar 2017 08:53:35 +0000 Subject: Re: [kvm-unit-tests PATCH 2/2] powerpc: Add Special Purpose Register persistency test Message-Id: <5d28fcc2-8a6d-f975-5f35-d0dc7dc044da@kaod.org> List-Id: References: <1489080427-27103-1-git-send-email-thuth@redhat.com> <1489080427-27103-3-git-send-email-thuth@redhat.com> <72045e4d-84b7-54d6-4497-803846e495db@kaod.org> In-Reply-To: <72045e4d-84b7-54d6-4497-803846e495db@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Thomas Huth , kvm@vger.kernel.org, Laurent Vivier , Drew Jones Cc: kvm-ppc@vger.kernel.org, Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= On 03/10/2017 09:48 AM, C=E9dric Le Goater wrote: > On 03/09/2017 06:27 PM, Thomas Huth wrote: >> This test has two purposes: First, check whether the hypervisor can be >> destabilized by writing random values into the SPRs of the PowerPC CPU >> (this indeed revealed a bug last year, see CVE-2016-3044). >> Second, this test can be used to check whether the SPRs are synchronized >> properly between the KVM host CPU and QEMU, e.g. when migrating the VM >> from one QEMU instance to another. >> The test first fills the various SPRs with some non-zero value, then rea= ds >> the values back into a first array. It then either sleeps a short period >> of time (for testing without migration, in the hope that we're reschedul= ed >> on another host CPU), or it waits for a key or NMI (with the '-w' option) >> so that it is possible to migrate the VM before continuing. The test then >> finally reads the values from the SPRs back into another array and then >> compares them with the initial values. >> Currently the test only supports the SPRs from the PowerISA v2.01 >> (PowerPC 970) and PowerISA v2.07 specification (i.e. POWER8 CPUs), >> but other versions should be pretty easy to add later. >> >> Signed-off-by: Thomas Huth >=20 > It looks good to me. I gave it a try and it worked fine with some > extra tuning in the migration script. =20 >=20 > LDFLAGS needs fix for binutils 2.28 but that is another issue. An here's the "fix" for it. I haven't studied deeply the question=20 though. =20 Thanks, C. From 820e2d614d63bf1cd911d13396b44a5ff8fb7bdc Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?C=C3=A9dric Le Goater?=3D Date: Fri, 10 Mar 2017 08:54:26 +0100 Subject: [PATCH] powerpc: add -N to LDFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit ld 2.28 complains with : ld -EL -nostdlib -pie -o powerpc/selftest.elf \ -T powerpc/flat.lds --build-id=3Dnone \ powerpc/selftest.o powerpc/cstart64.o powerpc/reloc64.o lib/libcflat.a lib= /libfdt/libfdt.a powerpc/selftest.aux.o ld: powerpc/selftest.elf: Not enough room for program headers, try linking = with -N ld: final link failed: Bad value Signed-off-by: C=E9dric Le Goater --- powerpc/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common index 92809a5468ea..6c62ac85311a 100644 --- a/powerpc/Makefile.common +++ b/powerpc/Makefile.common @@ -43,7 +43,7 @@ cflatobjs +=3D lib/powerpc/smp.o =20 FLATLIBS =3D $(libcflat) $(LIBFDT_archive) %.elf: CFLAGS +=3D $(arch_CFLAGS) -%.elf: LDFLAGS =3D $(arch_LDFLAGS) -nostdlib -pie +%.elf: LDFLAGS =3D $(arch_LDFLAGS) -nostdlib -pie -N %.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o) $(CC) $(CFLAGS) -c -o $(@:.elf=3D.aux.o) lib/auxinfo.c -DPROGNAME=3D\"$@\" $(LD) $(LDFLAGS) -o $@ \ --=20 2.7.4