Re: [PATCH v7 4/9] mmu: spp: Add functions to create/destroy SPP bitmap block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/11/19 09:49, Yang Weijiang wrote:
>  
> +/*
> + * all vcpus share the same SPPT, vcpu->arch.mmu->sppt_root points to same
> + * SPPT root page, so any vcpu will do.
> + */
> +static struct kvm_vcpu *kvm_spp_get_vcpu(struct kvm *kvm)
> +{
> +	struct kvm_vcpu *vcpu = NULL;
> +	int idx;

Is this true?  Perhaps you need one with
VALID_PAGE(vcpu->arch.mmu->sppt_root) for kvm_spp_set_permission?

Also, since vcpu->arch.mmu->sppt_root is the same for all vCPUs, perhaps
it should be kvm->arch.sppt_root instead?

If you can get rid of this function, it would be much better (but if you
cannot, kvm_get_vcpu(kvm, 0) should give the same result).

> 
> +	if (npages > SUBPAGE_MAX_BITMAP)
> +		return -EFAULT;

This is not needed here, the restriction only applies to the ioctl.

Paolo





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux