lkml.org 
[lkml]   [2022]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v5 102/104] KVM: TDX: Add methods to ignore accesses to CPU state
From
On 4/12/2022 2:52 PM, Paolo Bonzini wrote:
> On 4/12/22 08:49, Xiaoyao Li wrote:
>>
>>> +void tdx_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg)
>>> +{
>>> +    kvm_register_mark_available(vcpu, reg);
>>> +    switch (reg) {
>>> +    case VCPU_REGS_RSP:
>>> +    case VCPU_REGS_RIP:
>>> +    case VCPU_EXREG_PDPTR:
>>> +    case VCPU_EXREG_CR0:
>>> +    case VCPU_EXREG_CR3:
>>> +    case VCPU_EXREG_CR4:
>>> +        break;
>>> +    default:
>>> +        KVM_BUG_ON(1, vcpu->kvm);
>>> +        break;
>>> +    }
>>> +}
>>
>> Isaku,
>>
>> We missed one case that some GPRs are accessible by KVM/userspace for
>> TDVMCALL exit.
>
> If a register is not in the VMX_REGS_LAZY_LOAD_SET it will never be
> passed to tdx_cache_reg.  As far as I understand those TDVMCALL
> registers do not include either RSP or RIP.

Sorry, I should not keep the code snippet of tdx_cache_reg() as
reference to mislead you and other people.

I just want to remind that in the certain case of TDVMCALL, GPRs might
be accessible.

> Paolo
>

\
 
 \ /
  Last update: 2022-04-12 11:29    [W:0.200 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site