Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615AbdHQMrg (ORCPT ); Thu, 17 Aug 2017 08:47:36 -0400 Received: from mga14.intel.com ([192.55.52.115]:64156 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbdHQMrf (ORCPT ); Thu, 17 Aug 2017 08:47:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,387,1498546800"; d="scan'208";a="1004786040" Subject: Re: [PATCH v2 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width. To: Paolo Bonzini , kvm@vger.kernel.org References: <1502999558-2517-1-git-send-email-yu.c.zhang@linux.intel.com> <1502999558-2517-3-git-send-email-yu.c.zhang@linux.intel.com> <28276aa5-76e5-1826-5b1f-e18a62cd903d@redhat.com> Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, xiaoguangrong@tencent.com, joro@8bytes.org From: Yu Zhang Message-ID: <8c3819cb-1c1f-5a83-02eb-226aea0f329f@linux.intel.com> Date: Thu, 17 Aug 2017 20:25:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <28276aa5-76e5-1826-5b1f-e18a62cd903d@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 485 Lines: 19 On 8/17/2017 8:31 PM, Paolo Bonzini wrote: > On 17/08/2017 21:52, Yu Zhang wrote: >> + if (efer & EFER_LMA) { >> + u64 maxphyaddr; >> + u32 eax = 0x80000008; >> + >> + if (ctxt->ops->get_cpuid(ctxt, &eax, NULL, NULL, NULL, >> + NO_CHECK_LIMIT)) { >> + maxphyaddr = eax & 0xff; >> + rsvd = rsvd_bits(maxphyaddr, 62); >> + } > You should use 36 here if ctxt->ops->get_cpuid returns false, for > consistency with cpuid_query_maxphyaddr. Oh, right. Thanks! :-) Yu