lkml.org 
[lkml]   [2020]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] KVM:SVM: Update cr3_lm_rsvd_bits for AMD SEV guests
From
Date
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));
> + }
> +

\
 
 \ /
  Last update: 2020-11-13 12:33    [W:0.061 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site