[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7ce232b-0a54-0039-7009-8e92e8078791@redhat.com>
Date: Thu, 21 Nov 2019 11:18:48 +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 6/9] vmx: spp: Set up SPP paging table at
vmentry/vmexit
On 19/11/19 09:49, Yang Weijiang wrote:
> + if (spte & PT_SPP_MASK) {
> + fault_handled = true;
> + vcpu->run->exit_reason = KVM_EXIT_SPP;
> + vcpu->run->spp.addr = gva;
> + kvm_skip_emulated_instruction(vcpu);
Do you really want to skip the current instruction? Who will do the write?
> + pr_info("SPP - SPPT entry missing! gfn = 0x%llx\n", gfn);
Please replace pr_info with a tracepoint.
> + slot = gfn_to_memslot(vcpu->kvm, gfn);
> + if (!slot)
> + return -EFAULT;
You want either a goto to the misconfig case, so that there is a warn
> + spp_info.base_gfn = gfn;
> + spp_info.npages = 1;
> +
> + spin_lock(&vcpu->kvm->mmu_lock);
> + ret = kvm_spp_get_permission(vcpu->kvm, &spp_info);
> + if (ret == 1) {
Can you clarify when ret will not be 1? In this case you already have a
slot, so it seems to me that you do not need to go through
kvm_spp_get_permission and you can just test "if
(kvm->arch.spp_active)". But then, spp_active should be 1 if you get
here, I think?
> + pr_alert("SPP - SPPT Misconfiguration!\n");
> + return 0;
pr_alert not needed since you've just warned.
Paolo
Powered by blists - more mailing lists