From: Yu Zhang Subject: Re: [PATCH v1 4/4] KVM: MMU: Expose the LA57 feature to VM. Date: Thu, 17 Aug 2017 19:53:04 +0800 Message-ID: <040155e8-510a-3ada-9d83-f4b489d0981f@linux.intel.com> References: <1502544906-1108-1-git-send-email-yu.c.zhang@linux.intel.com> <1502544906-1108-5-git-send-email-yu.c.zhang@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, xiaoguangrong@tencent.com, joro@8bytes.org To: Paolo Bonzini , kvm@vger.kernel.org Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 8/17/2017 7:57 PM, Paolo Bonzini wrote: > On 12/08/2017 15:35, Yu Zhang wrote: >> index a98b88a..50107ae 100644 >> --- a/arch/x86/kvm/emulate.c >> +++ b/arch/x86/kvm/emulate.c >> @@ -694,7 +694,7 @@ static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt, >> switch (mode) { >> case X86EMUL_MODE_PROT64: >> *linear = la; >> - if (is_noncanonical_address(la)) >> + if (emul_is_noncanonical_address(la, ctxt)) >> goto bad; >> >> *max_size = min_t(u64, ~0u, (1ull << 48) - la); > Oops, you missed one here. Probably best to use ctxt_virt_addr_bits and > then "inline" emul_is_noncanonical_address as "get_canonical(la, > va_bits) != la". Sorry, I just sent out the v2 patch set without noticing this reply. :-) The emul_is_noncanonical() is defined in x86.h so that no ctxt_virt_addr_bits needed in emulate.c, are you suggesting to use ctx_virt_addr_bits in this file each time before emul_is_noncanonical_address() is called? Yu > Paolo >