From: Don Slutz <Don@CloudSwitch.Com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Igor Mammedov" <imammedo@redhat.com>,
qemu-devel@nongnu.org, "Anthony Liguori" <anthony@codemonkey.ws>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 3/5] i386: cpu: replace EXT2_FEATURE_MASK with CPUID_EXT2_AMD_ALIASES
Date: Tue, 11 Sep 2012 15:53:01 -0400 [thread overview]
Message-ID: <504F969D.2040406@CloudSwitch.Com> (raw)
In-Reply-To: <1346961939-32338-4-git-send-email-ehabkost@redhat.com>
On 09/06/12 16:05, Eduardo Habkost wrote:
> Both constants have the same value, but CPUID_EXT2_AMD_ALIASES is
> defined without using magic numbers.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> target-i386/cpu.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 7c0953f..682895b 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -258,7 +258,6 @@ typedef struct x86_def_t {
> CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \
> CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \
> CPUID_PAE | CPUID_SEP | CPUID_APIC)
> -#define EXT2_FEATURE_MASK 0x0183F3FF
>
> #define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \
> CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \
> @@ -276,7 +275,7 @@ typedef struct x86_def_t {
> /* missing:
> CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
> CPUID_EXT_TM2, CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_XSAVE */
> -#define TCG_EXT2_FEATURES ((TCG_FEATURES & EXT2_FEATURE_MASK) | \
> +#define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
> CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
> CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
> /* missing:
> @@ -305,7 +304,7 @@ static x86_def_t builtin_x86_defs[] = {
> CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA |
> CPUID_PSE36,
> .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT,
> - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) |
> + .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) |
> CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
> .ext3_features = CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM |
> CPUID_EXT3_ABM | CPUID_EXT3_SSE4A,
> @@ -325,7 +324,7 @@ static x86_def_t builtin_x86_defs[] = {
> CPUID_PSE36 | CPUID_VME | CPUID_HT,
> .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_CX16 |
> CPUID_EXT_POPCNT,
> - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) |
> + .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) |
> CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX |
> CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | CPUID_EXT2_MMXEXT |
> CPUID_EXT2_FFXSR | CPUID_EXT2_PDPE1GB | CPUID_EXT2_RDTSCP,
> @@ -373,7 +372,7 @@ static x86_def_t builtin_x86_defs[] = {
> /* Missing: CPUID_EXT_POPCNT, CPUID_EXT_MONITOR */
> .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_CX16,
> /* Missing: CPUID_EXT2_PDPE1GB, CPUID_EXT2_RDTSCP */
> - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) |
> + .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) |
> CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX,
> /* Missing: CPUID_EXT3_LAHF_LM, CPUID_EXT3_CMP_LEG, CPUID_EXT3_EXTAPIC,
> CPUID_EXT3_CR8LEG, CPUID_EXT3_ABM, CPUID_EXT3_SSE4A,
> @@ -402,7 +401,7 @@ static x86_def_t builtin_x86_defs[] = {
> .features = PPRO_FEATURES |
> CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | CPUID_PSE36,
> .ext_features = CPUID_EXT_SSE3,
> - .ext2_features = PPRO_FEATURES & EXT2_FEATURE_MASK,
> + .ext2_features = PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES,
> .ext3_features = 0,
> .xlevel = 0x80000008,
> .model_id = "Common 32-bit KVM processor"
> @@ -467,8 +466,10 @@ static x86_def_t builtin_x86_defs[] = {
> .family = 6,
> .model = 2,
> .stepping = 3,
> - .features = PPRO_FEATURES | CPUID_PSE36 | CPUID_VME | CPUID_MTRR | CPUID_MCA,
> - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT,
> + .features = PPRO_FEATURES | CPUID_PSE36 | CPUID_VME | CPUID_MTRR |
> + CPUID_MCA,
> + .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) |
> + CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT,
> .xlevel = 0x80000008,
> },
> {
> @@ -484,7 +485,8 @@ static x86_def_t builtin_x86_defs[] = {
> /* Some CPUs got no CPUID_SEP */
> .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 |
> CPUID_EXT_DSCPL | CPUID_EXT_EST | CPUID_EXT_TM2 | CPUID_EXT_XTPR,
> - .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_NX,
> + .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) |
> + CPUID_EXT2_NX,
> .ext3_features = CPUID_EXT3_LAHF_LM,
> .xlevel = 0x8000000A,
> .model_id = "Intel(R) Atom(TM) CPU N270 @ 1.60GHz",
Reviewed-by: Don Slutz <Don@CloudSwitch.com>
next prev parent reply other threads:[~2012-09-11 19:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 20:05 [Qemu-devel] [PATCH 0/5] i386: cpu: remove duplicate feature names Eduardo Habkost
2012-09-06 20:05 ` [Qemu-devel] [PATCH 1/5] i386: kvm: bit 10 of CPUID[8000_0001].EDX is reserved Eduardo Habkost
2012-09-11 19:51 ` Don Slutz
2012-09-06 20:05 ` [Qemu-devel] [PATCH 2/5] i386: kvm: use a #define for the set of alias feature bits Eduardo Habkost
2012-09-11 19:51 ` Don Slutz
2012-09-06 20:05 ` [Qemu-devel] [PATCH 3/5] i386: cpu: replace EXT2_FEATURE_MASK with CPUID_EXT2_AMD_ALIASES Eduardo Habkost
2012-09-11 19:53 ` Don Slutz [this message]
2012-09-06 20:05 ` [Qemu-devel] [PATCH 4/5] i386: cpu: eliminate duplicate feature names Eduardo Habkost
2012-09-11 19:53 ` Don Slutz
2012-09-06 20:05 ` [Qemu-devel] [PATCH 5/5] i386: -cpu help: remove reference to specific CPUID leaves/registers Eduardo Habkost
2012-09-11 19:54 ` Don Slutz
2012-09-26 13:33 ` [Qemu-devel] [PATCH 0/5] i386: cpu: remove duplicate feature names Igor Mammedov
2012-09-30 12:19 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=504F969D.2040406@CloudSwitch.Com \
--to=don@cloudswitch.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).