Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbdHXQvs (ORCPT ); Thu, 24 Aug 2017 12:51:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39310 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803AbdHXQvp (ORCPT ); Thu, 24 Aug 2017 12:51:45 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81EB4883CE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH v3 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width. To: Yu Zhang , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, xiaoguangrong@tencent.com, joro@8bytes.org References: <1503577676-12345-1-git-send-email-yu.c.zhang@linux.intel.com> <1503577676-12345-3-git-send-email-yu.c.zhang@linux.intel.com> <0bce2df3-79ac-599b-19fa-8ebeaff23623@redhat.com> <35e285e7-168a-25e6-1053-c005da18c103@redhat.com> <7f3a513f-e55e-c431-c2ef-b0b5816844eb@linux.intel.com> From: Paolo Bonzini Message-ID: <5239a3ba-f324-3362-f257-f6c655c50f2a@redhat.com> Date: Thu, 24 Aug 2017 18:51:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <7f3a513f-e55e-c431-c2ef-b0b5816844eb@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 24 Aug 2017 16:51:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 31 On 24/08/2017 18:21, Yu Zhang wrote: > > > On 8/25/2017 12:27 AM, Paolo Bonzini wrote: >> On 24/08/2017 17:38, Yu Zhang wrote: >>>> >>>> In practice, MAXPHYADDR will never be 59 even because the PKRU bits are >>>> at bits 59..62. >>> Thanks, Paolo. >>> I see. I had made an assumption that MAXPHYADDR shall not exceed the >>> physical one, >>> which is 52 I believe. But I'm not sure there's any place to check this. >>> Maybe we should make sure the vcpu->arch.maxphyaddr will not be greater >>> than the value of the host? >> That's a separate change anyway. In any case, since currently the >> MAXPHYADDR is not validated, your change to rsvd_bits makes sense. > > Thanks, Paolo. > As to this patch series, any change I need do? No, it's fine. > BTW, I have written a patch for kvm-unit-test access test, but the test > failed. > Not sure if my patch is erroneous or due to a simulator error. I'll send > out the > test patch after it works.:-) Try to send it. I can also test it with QEMU TCG. Paolo