[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ad27209-cc28-0503-da0e-bead63b28a83@redhat.com>
Date: Thu, 21 Nov 2019 11:43:10 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Yang Weijiang <weijiang.yang@...el.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, jmattson@...gle.com,
sean.j.christopherson@...el.com
Cc: yu.c.zhang@...ux.intel.com, alazar@...defender.com,
edwin.zhai@...el.com
Subject: Re: [PATCH v7 4/9] mmu: spp: Add functions to create/destroy SPP
bitmap block
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
Powered by blists - more mailing lists