From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 08/20] target-ppc: Add hooks for handling tcg and kvm limitations Date: Mon, 16 Apr 2012 15:31:43 +0300 Message-ID: <4F8C112F.1070502@redhat.com> References: <1334515144-26485-1-git-send-email-afaerber@suse.de> <1334515144-26485-9-git-send-email-afaerber@suse.de> <4F8BF0D0.2090109@redhat.com> <4F8BF242.2080807@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, blauwirbel@gmail.com, agraf@suse.de, David Gibson , "Marcelo Tosatti (supporter:Overall)" , open@suse.de, "list@suse.de:Overall" To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45367 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753627Ab2DPMb5 (ORCPT ); Mon, 16 Apr 2012 08:31:57 -0400 In-Reply-To: <4F8BF242.2080807@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 04/16/2012 01:19 PM, Andreas F=C3=A4rber wrote: > Am 16.04.2012 12:13, schrieb Avi Kivity: > > On 04/15/2012 09:38 PM, Andreas F=C3=A4rber wrote: > >> From: David Gibson > >> > >> On target-ppc, our table of CPU types and features encodes the fea= tures as > >> found on the hardware, regardless of whether these features are ac= tually > >> usable under TCG or KVM. We already have cases where the informat= ion from > >> the cpu table must be fixed up to account for limitations in the e= mulation > >> method we're using. e.g. TCG does not support the DFP and VSX ins= tructions > >> and KVM needs different numbering of the CPUs in order to tell it = the > >> correct thread to core mappings. > >> > >> This patch cleans up these hacks to handle emulation limitations b= y > >> consolidating them into a pair of functions specifically for the p= urpose. > >> > >> env->check_pow =3D def->check_pow; > >> + > >> + if (kvm_enabled()) { > >> + if (kvmppc_fixup_cpu(env) !=3D 0) { > >> + fprintf(stderr, "Unable to virtualize selected CPU wi= th KVM\n"); > >> + exit(1); > >> + } > >> + } else { > >> + if (ppc_fixup_cpu(env) !=3D 0) { > >> + fprintf(stderr, "Unable to emulate selected CPU with = TCG\n"); > >> + exit(1); > >> + } > >> + } > >> + > >> > >=20 > > I wish we had an error like that for x86. Right now we silently ad= d and > > drop cpu features. > > x86 has an ,+enforce option for that, doesn't it? > So it does. And one day it will be the default. --=20 error compiling committee.c: too many arguments to function