lkml.org 
[lkml]   [2022]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v5 006/104] KVM: TDX: Add placeholders for TDX VM/vcpu structure
From
On 3/4/22 20:48, isaku.yamahata@intel.com wrote:
> +void __init tdx_pre_kvm_init(unsigned int *vcpu_size,
> + unsigned int *vcpu_align, unsigned int *vm_size)
> +{
> + *vcpu_size = sizeof(struct vcpu_tdx);
> + *vcpu_align = __alignof__(struct vcpu_tdx);
> +
> + if (sizeof(struct kvm_tdx) > *vm_size)
> + *vm_size = sizeof(struct kvm_tdx);
> +}

No need for this function, I would just do

vcpu_size = max(sizeof vcpu_vmx, sizeof vcpu_tdx);
vcpu_align = max(...);
vt_x86_ops.vm_size = max(...);

in vt_init.

Paolo

\
 
 \ /
  Last update: 2022-03-13 14:57    [W:1.592 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site