* [Qemu-devel] [PATCH STABLE 0/7]
@ 2009-05-20 18:36 Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 1/7] Introduce kvm_check_extension to check if KVM extensions are supported Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
Here it goes again, a series with all the patches needed (and two fixes sent afterwards)
for cpuid trimming in kvm. They are backported to the stable branch.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 1/7] Introduce kvm_check_extension to check if KVM extensions are supported
2009-05-20 18:36 [Qemu-devel] [PATCH STABLE 0/7] Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 2/7] kvm: Add support for querying supported cpu features Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
From: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
kvm-all.c | 39 ++++++++++++++++++++++-----------------
kvm.h | 2 ++
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 2b7d535..8c1afb0 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -280,6 +280,18 @@ int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
return ret;
}
+int kvm_check_extension(KVMState *s, unsigned int extension)
+{
+ int ret;
+
+ ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, extension);
+ if (ret < 0) {
+ ret = 0;
+ }
+
+ return ret;
+}
+
int kvm_init(int smp_cpus)
{
KVMState *s;
@@ -325,10 +337,8 @@ int kvm_init(int smp_cpus)
* just use a user allocated buffer so we can use phys_ram_base
* unmodified. Make sure we have a sufficiently modern version of KVM.
*/
- ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY);
- if (ret <= 0) {
- if (ret == 0)
- ret = -EINVAL;
+ if (!kvm_check_extension(s, KVM_CAP_USER_MEMORY)) {
+ ret = -EINVAL;
fprintf(stderr, "kvm does not support KVM_CAP_USER_MEMORY\n");
goto err;
}
@@ -336,11 +346,8 @@ int kvm_init(int smp_cpus)
/* There was a nasty bug in < kvm-80 that prevents memory slots from being
* destroyed properly. Since we rely on this capability, refuse to work
* with any kernel without this capability. */
- ret = kvm_ioctl(s, KVM_CHECK_EXTENSION,
- KVM_CAP_DESTROY_MEMORY_REGION_WORKS);
- if (ret <= 0) {
- if (ret == 0)
- ret = -EINVAL;
+ if (!kvm_check_extension(s, KVM_CAP_DESTROY_MEMORY_REGION_WORKS)) {
+ ret = -EINVAL;
fprintf(stderr,
"KVM kernel module broken (DESTROY_MEMORY_REGION)\n"
@@ -348,11 +355,10 @@ int kvm_init(int smp_cpus)
goto err;
}
- s->coalesced_mmio = 0;
#ifdef KVM_CAP_COALESCED_MMIO
- ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_MMIO);
- if (ret > 0)
- s->coalesced_mmio = ret;
+ s->coalesced_mmio = kvm_check_extension(s, KVM_CAP_COALESCED_MMIO);
+#else
+ s->coalesced_mmio = 0;
#endif
ret = kvm_arch_init(s, smp_cpus);
@@ -650,11 +656,10 @@ int kvm_has_sync_mmu(void)
#ifdef KVM_CAP_SYNC_MMU
KVMState *s = kvm_state;
- if (kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_MMU) > 0)
- return 1;
-#endif
-
+ return kvm_check_extension(s, KVM_CAP_SYNC_MMU);
+#else
return 0;
+#endif
}
void kvm_setup_guest_memory(void *start, size_t size)
diff --git a/kvm.h b/kvm.h
index 5a52f51..cf6c799 100644
--- a/kvm.h
+++ b/kvm.h
@@ -78,4 +78,6 @@ int kvm_arch_init(KVMState *s, int smp_cpus);
int kvm_arch_init_vcpu(CPUState *env);
+int kvm_check_extension(KVMState *s, unsigned int extension);
+
#endif
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 2/7] kvm: Add support for querying supported cpu features
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 1/7] Introduce kvm_check_extension to check if KVM extensions are supported Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 3/7] Make x86 cpuid feature names available in file scope Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Avi Kivity
From: Avi Kivity <avi@redhat.com>
kvm does not support all cpu features; add support for dunamically querying
the supported feature set.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
kvm.h | 2 +
target-i386/kvm.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/kvm.h b/kvm.h
index cf6c799..27465a9 100644
--- a/kvm.h
+++ b/kvm.h
@@ -80,4 +80,6 @@ int kvm_arch_init_vcpu(CPUState *env);
int kvm_check_extension(KVMState *s, unsigned int extension);
+uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function,
+ int reg);
#endif
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index c46900e..5b52de3 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -33,6 +33,86 @@
do { } while (0)
#endif
+#ifdef KVM_CAP_EXT_CPUID
+
+static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
+{
+ struct kvm_cpuid2 *cpuid;
+ int r, size;
+
+ size = sizeof(*cpuid) + max * sizeof(*cpuid->entries);
+ cpuid = (struct kvm_cpuid2 *)qemu_mallocz(size);
+ cpuid->nent = max;
+ r = kvm_ioctl(s, KVM_GET_SUPPORTED_CPUID, cpuid);
+ if (r < 0) {
+ if (r == -E2BIG) {
+ qemu_free(cpuid);
+ return NULL;
+ } else {
+ fprintf(stderr, "KVM_GET_SUPPORTED_CPUID failed: %s\n",
+ strerror(-r));
+ exit(1);
+ }
+ }
+ return cpuid;
+}
+
+uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg)
+{
+ struct kvm_cpuid2 *cpuid;
+ int i, max;
+ uint32_t ret = 0;
+ uint32_t cpuid_1_edx;
+
+ if (!kvm_check_extension(env->kvm_state, KVM_CAP_EXT_CPUID)) {
+ return -1U;
+ }
+
+ max = 1;
+ while ((cpuid = try_get_cpuid(env->kvm_state, max)) == NULL) {
+ max *= 2;
+ }
+
+ for (i = 0; i < cpuid->nent; ++i) {
+ if (cpuid->entries[i].function == function) {
+ switch (reg) {
+ case R_EAX:
+ ret = cpuid->entries[i].eax;
+ break;
+ case R_EBX:
+ ret = cpuid->entries[i].ebx;
+ break;
+ case R_ECX:
+ ret = cpuid->entries[i].ecx;
+ break;
+ case R_EDX:
+ ret = cpuid->entries[i].edx;
+ if (function == 0x80000001) {
+ /* On Intel, kvm returns cpuid according to the Intel spec,
+ * so add missing bits according to the AMD spec:
+ */
+ cpuid_1_edx = kvm_arch_get_supported_cpuid(env, 1, R_EDX);
+ ret |= cpuid_1_edx & 0xdfeff7ff;
+ }
+ break;
+ }
+ }
+ }
+
+ qemu_free(cpuid);
+
+ return ret;
+}
+
+#else
+
+uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg)
+{
+ return -1U;
+}
+
+#endif
+
int kvm_arch_init_vcpu(CPUState *env)
{
struct {
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 3/7] Make x86 cpuid feature names available in file scope
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 2/7] kvm: Add support for querying supported cpu features Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 4/7] Fix x86 feature modifications for features that set multiple bits Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Avi Kivity
From: Avi Kivity <avi@redhat.com>
To be used later.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/helper.c | 55 +++++++++++++++++++++++++------------------------
1 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 8213703..3eb9697 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -32,39 +32,40 @@
//#define DEBUG_MMU
+/* feature flags taken from "Intel Processor Identification and the CPUID
+ * Instruction" and AMD's "CPUID Specification". In cases of disagreement
+ * about feature names, the Linux name is used. */
+static const char *feature_name[] = {
+ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
+ "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
+ "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, NULL, "ds" /* Intel dts */, "acpi", "mmx",
+ "fxsr", "sse", "sse2", "ss", "ht" /* Intel htt */, "tm", "ia64", "pbe",
+};
+static const char *ext_feature_name[] = {
+ "pni" /* Intel,AMD sse3 */, NULL, NULL, "monitor", "ds_cpl", "vmx", NULL /* Linux smx */, "est",
+ "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
+ NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+};
+static const char *ext2_feature_name[] = {
+ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
+ "cx8" /* AMD CMPXCHG8B */, "apic", NULL, "syscall", "mtrr", "pge", "mca", "cmov",
+ "pat", "pse36", NULL, NULL /* Linux mp */, "nx" /* Intel xd */, NULL, "mmxext", "mmx",
+ "fxsr", "fxsr_opt" /* AMD ffxsr */, "pdpe1gb" /* AMD Page1GB */, "rdtscp", NULL, "lm" /* Intel 64 */, "3dnowext", "3dnow",
+};
+static const char *ext3_feature_name[] = {
+ "lahf_lm" /* AMD LahfSahf */, "cmp_legacy", "svm", "extapic" /* AMD ExtApicSpace */, "cr8legacy" /* AMD AltMovCr8 */, "abm", "sse4a", "misalignsse",
+ "3dnowprefetch", "osvw", NULL /* Linux ibs */, NULL, "skinit", "wdt", NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+};
+
static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
uint32_t *ext_features,
uint32_t *ext2_features,
uint32_t *ext3_features)
{
int i;
- /* feature flags taken from "Intel Processor Identification and the CPUID
- * Instruction" and AMD's "CPUID Specification". In cases of disagreement
- * about feature names, the Linux name is used. */
- static const char *feature_name[] = {
- "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
- "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
- "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, NULL, "ds" /* Intel dts */, "acpi", "mmx",
- "fxsr", "sse", "sse2", "ss", "ht" /* Intel htt */, "tm", "ia64", "pbe",
- };
- static const char *ext_feature_name[] = {
- "pni" /* Intel,AMD sse3 */, NULL, NULL, "monitor", "ds_cpl", "vmx", NULL /* Linux smx */, "est",
- "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
- NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- };
- static const char *ext2_feature_name[] = {
- "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
- "cx8" /* AMD CMPXCHG8B */, "apic", NULL, "syscall", "mtrr", "pge", "mca", "cmov",
- "pat", "pse36", NULL, NULL /* Linux mp */, "nx" /* Intel xd */, NULL, "mmxext", "mmx",
- "fxsr", "fxsr_opt" /* AMD ffxsr */, "pdpe1gb" /* AMD Page1GB */, "rdtscp", NULL, "lm" /* Intel 64 */, "3dnowext", "3dnow",
- };
- static const char *ext3_feature_name[] = {
- "lahf_lm" /* AMD LahfSahf */, "cmp_legacy", "svm", "extapic" /* AMD ExtApicSpace */, "cr8legacy" /* AMD AltMovCr8 */, "abm", "sse4a", "misalignsse",
- "3dnowprefetch", "osvw", NULL /* Linux ibs */, NULL, "skinit", "wdt", NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- };
for ( i = 0 ; i < 32 ; i++ )
if (feature_name[i] && !strcmp (flagname, feature_name[i])) {
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 4/7] Fix x86 feature modifications for features that set multiple bits
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 3/7] Make x86 cpuid feature names available in file scope Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 5/7] kvm: Trim cpu features not supported by kvm Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Avi Kivity
From: Avi Kivity <avi@redhat.com>
QEMU allows adding or removing cpu features by using the syntax '-cpu +feature'
or '-cpu -feature'. Some cpuid features cause more than one bit to be set or
cleared; but QEMU stops after just one bit has been modified, causing the
feature bits to be inconsistent.
Fix by allowing all feature bits corresponding to a given name to be set.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/helper.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 3eb9697..1433857 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -66,28 +66,31 @@ static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
uint32_t *ext3_features)
{
int i;
+ int found = 0;
for ( i = 0 ; i < 32 ; i++ )
if (feature_name[i] && !strcmp (flagname, feature_name[i])) {
*features |= 1 << i;
- return;
+ found = 1;
}
for ( i = 0 ; i < 32 ; i++ )
if (ext_feature_name[i] && !strcmp (flagname, ext_feature_name[i])) {
*ext_features |= 1 << i;
- return;
+ found = 1;
}
for ( i = 0 ; i < 32 ; i++ )
if (ext2_feature_name[i] && !strcmp (flagname, ext2_feature_name[i])) {
*ext2_features |= 1 << i;
- return;
+ found = 1;
}
for ( i = 0 ; i < 32 ; i++ )
if (ext3_feature_name[i] && !strcmp (flagname, ext3_feature_name[i])) {
*ext3_features |= 1 << i;
- return;
+ found = 1;
}
- fprintf(stderr, "CPU feature %s not found\n", flagname);
+ if (!found) {
+ fprintf(stderr, "CPU feature %s not found\n", flagname);
+ }
}
typedef struct x86_def_t {
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 5/7] kvm: Trim cpu features not supported by kvm
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 4/7] Fix x86 feature modifications for features that set multiple bits Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 6/7] Remove noisy printf when KVM masks CPU features Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Avi Kivity
From: Avi Kivity <avi@redhat.com>
Remove cpu features that are not supported by kvm from the cpuid features
reported to the guest.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/helper.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 1433857..c98cdcc 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -93,6 +93,21 @@ static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
}
}
+static void kvm_trim_features(uint32_t *features, uint32_t supported,
+ const char *names[])
+{
+ int i;
+ uint32_t mask;
+
+ for (i = 0; i < 32; ++i) {
+ mask = 1U << i;
+ if ((*features & mask) && !(supported & mask)) {
+ printf("Processor feature %s not supported by kvm\n", names[i]);
+ *features &= ~mask;
+ }
+ }
+}
+
typedef struct x86_def_t {
const char *name;
uint32_t level;
@@ -1674,5 +1689,20 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
#endif
if (kvm_enabled())
kvm_init_vcpu(env);
+ if (kvm_enabled()) {
+ kvm_trim_features(&env->cpuid_features,
+ kvm_arch_get_supported_cpuid(env, 1, R_EDX),
+ feature_name);
+ kvm_trim_features(&env->cpuid_ext_features,
+ kvm_arch_get_supported_cpuid(env, 1, R_ECX),
+ ext_feature_name);
+ kvm_trim_features(&env->cpuid_ext2_features,
+ kvm_arch_get_supported_cpuid(env, 0x80000001, R_EDX),
+ ext2_feature_name);
+ kvm_trim_features(&env->cpuid_ext3_features,
+ kvm_arch_get_supported_cpuid(env, 0x80000001, R_ECX),
+ ext3_feature_name);
+ }
+
return env;
}
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 6/7] Remove noisy printf when KVM masks CPU features
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 5/7] kvm: Trim cpu features not supported by kvm Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 7/7] kvm: work around supported cpuid ioctl() brokenness Glauber Costa
0 siblings, 1 reply; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
From: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/helper.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index c98cdcc..e714994 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -102,7 +102,6 @@ static void kvm_trim_features(uint32_t *features, uint32_t supported,
for (i = 0; i < 32; ++i) {
mask = 1U << i;
if ((*features & mask) && !(supported & mask)) {
- printf("Processor feature %s not supported by kvm\n", names[i]);
*features &= ~mask;
}
}
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH STABLE 7/7] kvm: work around supported cpuid ioctl() brokenness
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 6/7] Remove noisy printf when KVM masks CPU features Glauber Costa
@ 2009-05-20 18:36 ` Glauber Costa
0 siblings, 0 replies; 8+ messages in thread
From: Glauber Costa @ 2009-05-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Mark McLoughlin, aliguori
From: Mark McLoughlin <markmc@redhat.com>
KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG
when it runs out of entries. Detect this by always trying again
with a bigger table if the ioctl() fills the table.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/kvm.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 5b52de3..eb61598 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -44,6 +44,9 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
cpuid = (struct kvm_cpuid2 *)qemu_mallocz(size);
cpuid->nent = max;
r = kvm_ioctl(s, KVM_GET_SUPPORTED_CPUID, cpuid);
+ if (r == 0 && cpuid->nent >= max) {
+ r = -E2BIG;
+ }
if (r < 0) {
if (r == -E2BIG) {
qemu_free(cpuid);
--
1.6.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-20 18:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 18:36 [Qemu-devel] [PATCH STABLE 0/7] Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 1/7] Introduce kvm_check_extension to check if KVM extensions are supported Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 2/7] kvm: Add support for querying supported cpu features Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 3/7] Make x86 cpuid feature names available in file scope Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 4/7] Fix x86 feature modifications for features that set multiple bits Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 5/7] kvm: Trim cpu features not supported by kvm Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 6/7] Remove noisy printf when KVM masks CPU features Glauber Costa
2009-05-20 18:36 ` [Qemu-devel] [PATCH STABLE 7/7] kvm: work around supported cpuid ioctl() brokenness Glauber Costa
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).