From patchwork Fri Mar 10 08:53:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 737325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vfgzQ58jqz9s80 for ; Fri, 10 Mar 2017 19:53:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755362AbdCJIxy (ORCPT ); Fri, 10 Mar 2017 03:53:54 -0500 Received: from 10.mo68.mail-out.ovh.net ([46.105.79.203]:45974 "EHLO 10.mo68.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755330AbdCJIxx (ORCPT ); Fri, 10 Mar 2017 03:53:53 -0500 X-Greylist: delayed 350 seconds by postgrey-1.27 at vger.kernel.org; Fri, 10 Mar 2017 03:53:53 EST Received: from player789.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo68.mail-out.ovh.net (Postfix) with ESMTP id AA4EE43A23 for ; Fri, 10 Mar 2017 09:53:46 +0100 (CET) Received: from zorba.kaod.org (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: postmaster@kaod.org) by player789.ha.ovh.net (Postfix) with ESMTPSA id 560DE260097; Fri, 10 Mar 2017 09:53:40 +0100 (CET) Subject: Re: [kvm-unit-tests PATCH 2/2] powerpc: Add Special Purpose Register persistency test To: Thomas Huth , kvm@vger.kernel.org, Laurent Vivier , Drew Jones 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> Cc: kvm-ppc@vger.kernel.org, Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <5d28fcc2-8a6d-f975-5f35-d0dc7dc044da@kaod.org> Date: Fri, 10 Mar 2017 09:53:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <72045e4d-84b7-54d6-4497-803846e495db@kaod.org> X-Ovh-Tracer-Id: 7609394521583619063 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrgeejgddufedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org On 03/10/2017 09:48 AM, Cédric 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 reads >> 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 rescheduled >> 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 > > It looks good to me. I gave it a try and it worked fine with some > extra tuning in the migration script. > > 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 though. Thanks, C. From 820e2d614d63bf1cd911d13396b44a5ff8fb7bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= 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=UTF-8 Content-Transfer-Encoding: 8bit ld 2.28 complains with : ld -EL -nostdlib -pie -o powerpc/selftest.elf \ -T powerpc/flat.lds --build-id=none \ 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édric 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 += lib/powerpc/smp.o FLATLIBS = $(libcflat) $(LIBFDT_archive) %.elf: CFLAGS += $(arch_CFLAGS) -%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie +%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -N %.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o) $(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) lib/auxinfo.c -DPROGNAME=\"$@\" $(LD) $(LDFLAGS) -o $@ \