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 13:13:36 +0300 Message-ID: <4F8BF0D0.2090109@redhat.com> References: <1334515144-26485-1-git-send-email-afaerber@suse.de> <1334515144-26485-9-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Overall , "Marcelo Tosatti \(supporter:Overall\)" , qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, qemu-ppc@nongnu.org, David Gibson To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Return-path: In-Reply-To: <1334515144-26485-9-git-send-email-afaerber@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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 features= as > found on the hardware, regardless of whether these features are actuall= y > usable under TCG or KVM. We already have cases where the information f= rom > the cpu table must be fixed up to account for limitations in the emulat= ion > method we're using. e.g. TCG does not support the DFP and VSX instruct= ions > 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 by > consolidating them into a pair of functions specifically for the purpos= e. > > env->check_pow =3D def->check_pow; > + > + if (kvm_enabled()) { > + if (kvmppc_fixup_cpu(env) !=3D 0) { > + fprintf(stderr, "Unable to virtualize selected CPU with KV= M\n"); > + exit(1); > + } > + } else { > + if (ppc_fixup_cpu(env) !=3D 0) { > + fprintf(stderr, "Unable to emulate selected CPU with TCG\n= "); > + exit(1); > + } > + } > + > I wish we had an error like that for x86. Right now we silently add and drop cpu features. --=20 error compiling committee.c: too many arguments to function