All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs
@ 2017-04-06 13:22 Ladi Prosek
  2017-04-06 14:11 ` David Hildenbrand
  2017-04-12 19:16 ` Radim Krčmář
  0 siblings, 2 replies; 3+ messages in thread
From: Ladi Prosek @ 2017-04-06 13:22 UTC (permalink / raw)
  To: kvm; +Cc: joro

Hyper-V writes 0x800000000000 to MSR_AMD64_DC_CFG when running on AMD CPUs
as recommended in erratum 383, analogous to our svm_init_erratum_383.

By ignoring the MSR, this patch enables running Hyper-V in L1 on AMD.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
---
 arch/x86/kvm/x86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ccbd45e..44814b5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2155,6 +2155,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 	case MSR_VM_HSAVE_PA:
 	case MSR_AMD64_PATCH_LOADER:
 	case MSR_AMD64_BU_CFG2:
+	case MSR_AMD64_DC_CFG:
 		break;
 
 	case MSR_EFER:
@@ -2417,6 +2418,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 	case MSR_FAM10H_MMIO_CONF_BASE:
 	case MSR_AMD64_BU_CFG2:
 	case MSR_IA32_PERF_CTL:
+	case MSR_AMD64_DC_CFG:
 		msr_info->data = 0;
 		break;
 	case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3:
-- 
2.9.3

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

* Re: [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs
  2017-04-06 13:22 [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs Ladi Prosek
@ 2017-04-06 14:11 ` David Hildenbrand
  2017-04-12 19:16 ` Radim Krčmář
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2017-04-06 14:11 UTC (permalink / raw)
  To: Ladi Prosek, kvm; +Cc: joro

On 06.04.2017 15:22, Ladi Prosek wrote:
> Hyper-V writes 0x800000000000 to MSR_AMD64_DC_CFG when running on AMD CPUs
> as recommended in erratum 383, analogous to our svm_init_erratum_383.
> 
> By ignoring the MSR, this patch enables running Hyper-V in L1 on AMD.
> 
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
>  arch/x86/kvm/x86.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index ccbd45e..44814b5 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2155,6 +2155,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>  	case MSR_VM_HSAVE_PA:
>  	case MSR_AMD64_PATCH_LOADER:
>  	case MSR_AMD64_BU_CFG2:
> +	case MSR_AMD64_DC_CFG:
>  		break;
>  
>  	case MSR_EFER:
> @@ -2417,6 +2418,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>  	case MSR_FAM10H_MMIO_CONF_BASE:
>  	case MSR_AMD64_BU_CFG2:
>  	case MSR_IA32_PERF_CTL:
> +	case MSR_AMD64_DC_CFG:
>  		msr_info->data = 0;
>  		break;
>  	case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3:
> 

Looks good to me!

-- 

Thanks,

David

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

* Re: [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs
  2017-04-06 13:22 [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs Ladi Prosek
  2017-04-06 14:11 ` David Hildenbrand
@ 2017-04-12 19:16 ` Radim Krčmář
  1 sibling, 0 replies; 3+ messages in thread
From: Radim Krčmář @ 2017-04-12 19:16 UTC (permalink / raw)
  To: Ladi Prosek; +Cc: kvm, joro

2017-04-06 15:22+0200, Ladi Prosek:
> Hyper-V writes 0x800000000000 to MSR_AMD64_DC_CFG when running on AMD CPUs
> as recommended in erratum 383, analogous to our svm_init_erratum_383.
> 
> By ignoring the MSR, this patch enables running Hyper-V in L1 on AMD.
> 
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---

Dirty, but I don't see a reason to overengineer this ...

Applied to kvm/queue, thanks.

> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> @@ -2417,6 +2418,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>  	case MSR_FAM10H_MMIO_CONF_BASE:
>  	case MSR_AMD64_BU_CFG2:
>  	case MSR_IA32_PERF_CTL:
> +	case MSR_AMD64_DC_CFG:

This will change L1 KVM's behavior to set erratum_383_found, but L0 will
kill it anyway after hitting the errata in L2.

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

end of thread, other threads:[~2017-04-12 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 13:22 [PATCH] KVM: x86: Add MSR_AMD64_DC_CFG to the list of ignored MSRs Ladi Prosek
2017-04-06 14:11 ` David Hildenbrand
2017-04-12 19:16 ` Radim Krčmář

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.