From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Subject: Re: [PATCH 08/20] target-ppc: Add hooks for handling tcg and kvm limitations Date: Mon, 16 Apr 2012 12:19:46 +0200 Message-ID: <4F8BF242.2080807@suse.de> References: <1334515144-26485-1-git-send-email-afaerber@suse.de> <1334515144-26485-9-git-send-email-afaerber@suse.de> <4F8BF0D0.2090109@redhat.com> 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: Avi Kivity Return-path: Received: from cantor2.suse.de ([195.135.220.15]:39829 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415Ab2DPKTt (ORCPT ); Mon, 16 Apr 2012 06:19:49 -0400 In-Reply-To: <4F8BF0D0.2090109@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 featu= res as >> found on the hardware, regardless of whether these features are actu= ally >> usable under TCG or KVM. We already have cases where the informatio= n from >> the cpu table must be fixed up to account for limitations in the emu= lation >> method we're using. e.g. TCG does not support the DFP and VSX instr= uctions >> and KVM needs different numbering of the CPUs in order to tell it th= e >> 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 pur= pose. >> >> 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= KVM\n"); >> + exit(1); >> + } >> + } else { >> + if (ppc_fixup_cpu(env) !=3D 0) { >> + fprintf(stderr, "Unable to emulate selected CPU with TC= G\n"); >> + exit(1); >> + } >> + } >> + >> >=20 > I wish we had an error like that for x86. Right now we silently add = and > drop cpu features. x86 has an ,+enforce option for that, doesn't it? Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg