[PATCH v4 13/25] KVM: arm64: Instantiate pKVM hypervisor VM and vCPU structures from EL1
Quentin Perret
qperret at google.com
Wed Oct 19 08:46:37 PDT 2022
On Monday 17 Oct 2022 at 12:51:57 (+0100), Will Deacon wrote:
> +struct kvm_protected_vm {
> + pkvm_handle_t handle;
> + struct mutex vm_lock;
> +
> + struct {
> + void *pgd;
> + void *vm;
> + void *vcpus[KVM_MAX_VCPUS];
That's memory that's 'wasted' for everyone :/
> + } hyp_donations;
> +};
> +
> struct kvm_arch {
> struct kvm_s2_mmu mmu;
>
> @@ -170,10 +181,10 @@ struct kvm_arch {
> struct kvm_smccc_features smccc_feat;
>
> /*
> - * For an untrusted host VM, 'pkvm_handle' is used to lookup
> + * For an untrusted host VM, 'pkvm.handle' is used to lookup
> * the associated pKVM instance in the hypervisor.
> */
> - pkvm_handle_t pkvm_handle;
> + struct kvm_protected_vm pkvm;
Maybe make this a pointer that will be !NULL only when pKVM is enabled?
> };
More information about the linux-arm-kernel
mailing list