public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v5 3/4] Mask function7 ebx against host capability word9
@ 2011-05-30  3:01 Yang, Wei Y
  2011-05-30 11:44 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Yang, Wei Y @ 2011-05-30  3:01 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm@vger.kernel.org


This patch masks CPUID leaf 7 ebx against host capability word9.
 
 Signed-off-by: Yang, Wei <wei.y.yang@intel.com>
 Signed-off-by: Shan, Haitao <haitao.shan@intel.com>
 Signed-off-by: Li, Xin <xin.li@intel.com>

---
 arch/x86/kvm/x86.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 91bfc40..6e90d71 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2387,7 +2387,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		}
 		break;
 	}
-	/* function 4 and 0xb have additional index. */
+	/* function 4 has additional index. */
 	case 4: {
 		int i, cache_type;

@@ -2404,6 +2404,11 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		}
 		break;
 	}
+	case 7:
+		/* Mask ebx against host capability word 9 */
+		if (index == 0) cpuid_mask(&entry->ebx, 9);
+		break;
+	/* function 0xb has additional index. */
 	case 0xb: {
 		int i, level_type;

--
1.7.4.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch v5 3/4] Mask function7 ebx against host capability word9
  2011-05-30  3:01 [Patch v5 3/4] Mask function7 ebx against host capability word9 Yang, Wei Y
@ 2011-05-30 11:44 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-05-30 11:44 UTC (permalink / raw)
  To: Yang, Wei Y; +Cc: kvm@vger.kernel.org

On 05/30/2011 06:01 AM, Yang, Wei Y wrote:
> This patch masks CPUID leaf 7 ebx against host capability word9.
>
>   		}
>   		break;
>   	}
> +	case 7:
> +		/* Mask ebx against host capability word 9 */
> +		if (index == 0) cpuid_mask(&entry->ebx, 9);
> +		break;
> +	/* function 0xb has additional index. */
>   	case 0xb: {
>   		int i, level_type;
>

It's not just masking leaf 7.  It's enabling it - before we passed 0 
every time.

So we need to give it the same treatment as other leaves.  We expose a 
bit only if we explicitly support it in kvm, and it is enabled in the 
host.  See kvm_supported_word[01456] features for examples.

btw, we could also expose fsgsbase and rep/movsb (but in a separate 
patch, please).

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-30 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-30  3:01 [Patch v5 3/4] Mask function7 ebx against host capability word9 Yang, Wei Y
2011-05-30 11:44 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox