From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwDlT-0001sO-Hn for qemu-devel@nongnu.org; Mon, 08 Jul 2013 11:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwDlS-0003Ye-50 for qemu-devel@nongnu.org; Mon, 08 Jul 2013 11:54:11 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:37708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwDlR-0003YK-IH for qemu-devel@nongnu.org; Mon, 08 Jul 2013 11:54:10 -0400 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Jul 2013 01:44:50 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 4A0CD3578050 for ; Tue, 9 Jul 2013 01:54:03 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r68Fcvjf6488514 for ; Tue, 9 Jul 2013 01:38:58 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r68Fs2ng008604 for ; Tue, 9 Jul 2013 01:54:02 +1000 Message-ID: <51DADF6F.6010006@linux.vnet.ibm.com> Date: Mon, 08 Jul 2013 21:19:03 +0530 From: Prerna Saxena MIME-Version: 1.0 References: <1373118856-30171-1-git-send-email-aik@ozlabs.ru> <1373118856-30171-19-git-send-email-aik@ozlabs.ru> <20130708010917.GD2696@voom.redhat.com> <51DA8023.20503@suse.de> In-Reply-To: <51DA8023.20503@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 18/19] target-ppc: Enhance the CPU node labels for the guest device tree for pseries. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de Cc: qemu-devel@nongnu.org On 07/08/2013 02:32 PM, Andreas Färber wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Am 08.07.2013 03:09, schrieb David Gibson: >> On Sat, Jul 06, 2013 at 11:54:15PM +1000, Alexey Kardashevskiy >> wrote: >>> @@ -1342,6 +1346,13 @@ static void >>> ppc_spapr_init(QEMUMachineInitArgs *args) >>> register_savevm_live(NULL, "spapr/htab", -1, 1, >>> &savevm_htab_handlers, spapr); >>> >>> + /* Ensure that cpu_model is correctly reflected for a KVM >>> guest */ + if (kvm_enabled() && !strcmp(cpu_model, "host")) { >>> + asm ("mfpvr %0" + : "=r"(pvr)); + >>> cpu_model = ppc_cpu_alias_by_pvr(pvr); >> >> This needs to be protected by an ifdef CONFIG_KVM or similar. If >> the compiler optimization level is turned down, so that it doesn't >> recognize that the kvm_enabled() is always false, then this could >> attempt to compile the ppc asm instructions on an x86 (or >> whatever) host. > > This hunk can be completely replaced by QOM mechanisms - just didn't > get to replying yet... > Hi Andreas, Sorry I already sent out a v2, and only then saw your message. Could you pls explain how I could use QOM to replace this code block ? Regards, -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India