Re: [PATCH 1/2] kvm/x86: Move MSR_K7_HWCR to svm.c

From: Jim Mattson
Date: Mon Mar 25 2019 - 14:06:02 EST


On Mon, Mar 25, 2019 at 10:17 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> From: Borislav Petkov <bp@xxxxxxx>
>
> This is an AMD-specific MSR. Put it where it belongs.
>
> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> Tested-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
> ---
> arch/x86/kvm/svm.c | 14 ++++++++++++++
> arch/x86/kvm/x86.c | 12 ------------
> 2 files changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index b5b128a0a051..00eb44a2a377 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -4201,6 +4201,9 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> case MSR_F10H_DECFG:
> msr_info->data = svm->msr_decfg;
> break;
> + case MSR_K7_HWCR:
> + msr_info->data = 0;
> + break;

If the guest has written a non-zero value to this MSR, shouldn't it be
able to read that value back?