Received: from eggs.gnu.org ([208.118.235.92]:34261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMkhG-0007xO-Ed for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMkhC-0007yP-HM for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMkhC-0007yJ-9l for qemu-devel@nongnu.org; Mon, 01 Apr 2013 15:47:10 -0400 From: Eduardo Habkost Date: Mon, 1 Apr 2013 16:46:46 -0300 Message-Id: <1364845609-10543-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1364845609-10543-1-git-send-email-ehabkost@redhat.com> References: <1364845609-10543-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [RFC 1/4] target-i386: Add ECX information to FeatureWordInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Igor Mammedov , Jiri Denemark , =?UTF-8?q?Andreas=20F=C3=A4rber?= FEAT_7_0_EBX uses ECX as input, so we have to take that into account when reporting feature word values. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 4b43759..974a8c6 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -151,8 +151,10 @@ static const char *cpuid_7_0_ebx_feature_name[] = { typedef struct FeatureWordInfo { const char **feat_names; - uint32_t cpuid_eax; /* Input EAX for CPUID */ - int cpuid_reg; /* R_* register constant */ + uint32_t cpuid_eax; /* Input EAX for CPUID */ + bool cpuid_needs_ecx; /* CPUID instruction uses ECX as input */ + uint32_t cpuid_ecx; /* Input ECX value for CPUID */ + int cpuid_reg; /* output register (R_* constant) */ } FeatureWordInfo; static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { @@ -186,7 +188,9 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { }, [FEAT_7_0_EBX] = { .feat_names = cpuid_7_0_ebx_feature_name, - .cpuid_eax = 7, .cpuid_reg = R_EBX, + .cpuid_eax = 7, + .cpuid_needs_ecx = true, .cpuid_ecx = 0, + .cpuid_reg = R_EBX, }, }; -- 1.8.1.4