public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/8] KVM: SVM: fix comment
  2018-01-09 12:03 [PATCH v2 0/8] KVM: x86: expose CVE-2017-5715 ("Spectre variant 2") mitigations to guest Paolo Bonzini
@ 2018-01-09 12:03 ` Paolo Bonzini
  2018-01-15  9:53   ` David Hildenbrand
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2018-01-09 12:03 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: rkrcmar, liran.alon, jmattson, aliguori, thomas.lendacky, dwmw,
	bp, x86

If always==true, then read/write bits are cleared from
the MSR permission bitmap, thus passing-through the MSR.
Fix the comment to match reality.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 55dde3896898..31ace8d7774a 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -236,7 +236,7 @@ struct amd_svm_iommu_ir {
 
 static const struct svm_direct_access_msrs {
 	u32 index;   /* Index of the MSR */
-	bool always; /* True if intercept is always on */
+	bool always; /* True if intercept is always off */
 } direct_access_msrs[] = {
 	{ .index = MSR_STAR,				.always = true  },
 	{ .index = MSR_IA32_SYSENTER_CS,		.always = true  },
-- 
1.8.3.1

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

* Re: [PATCH 5/8] KVM: SVM: fix comment
@ 2018-01-09 13:17 Liran Alon
  0 siblings, 0 replies; 3+ messages in thread
From: Liran Alon @ 2018-01-09 13:17 UTC (permalink / raw)
  To: pbonzini
  Cc: jmattson, x86, dwmw, bp, thomas.lendacky, aliguori, rkrcmar,
	linux-kernel, kvm


----- pbonzini@redhat.com wrote:

> If always==true, then read/write bits are cleared from
> the MSR permission bitmap, thus passing-through the MSR.
> Fix the comment to match reality.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/svm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 55dde3896898..31ace8d7774a 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -236,7 +236,7 @@ struct amd_svm_iommu_ir {
>  
>  static const struct svm_direct_access_msrs {
>  	u32 index;   /* Index of the MSR */
> -	bool always; /* True if intercept is always on */
> +	bool always; /* True if intercept is always off */
>  } direct_access_msrs[] = {
>  	{ .index = MSR_STAR,				.always = true  },
>  	{ .index = MSR_IA32_SYSENTER_CS,		.always = true  },
> -- 
> 1.8.3.1

Reviewed-by: Liran Alon <liran.alon@oracle.com>

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

* Re: [PATCH 5/8] KVM: SVM: fix comment
  2018-01-09 12:03 ` [PATCH 5/8] KVM: SVM: fix comment Paolo Bonzini
@ 2018-01-15  9:53   ` David Hildenbrand
  0 siblings, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2018-01-15  9:53 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm
  Cc: rkrcmar, liran.alon, jmattson, aliguori, thomas.lendacky, dwmw,
	bp, x86

On 09.01.2018 13:03, Paolo Bonzini wrote:
> If always==true, then read/write bits are cleared from
> the MSR permission bitmap, thus passing-through the MSR.
> Fix the comment to match reality.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/svm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 55dde3896898..31ace8d7774a 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -236,7 +236,7 @@ struct amd_svm_iommu_ir {
>  
>  static const struct svm_direct_access_msrs {
>  	u32 index;   /* Index of the MSR */
> -	bool always; /* True if intercept is always on */
> +	bool always; /* True if intercept is always off */
>  } direct_access_msrs[] = {
>  	{ .index = MSR_STAR,				.always = true  },
>  	{ .index = MSR_IA32_SYSENTER_CS,		.always = true  },
> 

The function set_msr_interception() is really named confusingly.

If we pass in a "1", we clear the bit, resulting in no interception.

So 1==no intercept, 0==intercept. This function would be better named
"disable_msr_interception" or sth. like that.

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

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

end of thread, other threads:[~2018-01-15  9:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09 13:17 [PATCH 5/8] KVM: SVM: fix comment Liran Alon
  -- strict thread matches above, loose matches on Subject: below --
2018-01-09 12:03 [PATCH v2 0/8] KVM: x86: expose CVE-2017-5715 ("Spectre variant 2") mitigations to guest Paolo Bonzini
2018-01-09 12:03 ` [PATCH 5/8] KVM: SVM: fix comment Paolo Bonzini
2018-01-15  9:53   ` David Hildenbrand

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