[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f9910665-8330-6db6-ee0a-2db9a69d6c95@redhat.com>
Date: Fri, 13 Nov 2020 12:30:57 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Babu Moger <babu.moger@....com>
Cc: junaids@...gle.com, wanpengli@...cent.com, kvm@...r.kernel.org,
joro@...tes.org, x86@...nel.org, linux-kernel@...r.kernel.org,
sean.j.christopherson@...el.com, mingo@...hat.com, bp@...en8.de,
hpa@...or.com, tglx@...utronix.de, vkuznets@...hat.com,
jmattson@...gle.com
Subject: Re: [PATCH v2 2/2] KVM:SVM: Update cr3_lm_rsvd_bits for AMD SEV
guests
On 12/11/20 23:18, Babu Moger wrote:
> + /*
> + * For sev guests, update the cr3_lm_rsvd_bits to mask the memory
> + * encryption bit from reserved bits
> + */
Say why in the comment, don't repeat what the code already says (ok,
technically the code didn't say that CPUID[0x8000001F].ebx hosts the
memory encryption bit). I changed this to:
/* For sev guests, the memory encryption bit is not reserved in CR3. */
and queued the patches,
Paolo
> + if (sev_guest(vcpu->kvm)) {
> + best = kvm_find_cpuid_entry(vcpu, 0x8000001F, 0);
> + if (best)
> + vcpu->arch.cr3_lm_rsvd_bits &= ~(1UL << (best->ebx & 0x3f));
> + }
> +
Powered by blists - more mailing lists