Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1075261imu; Wed, 23 Jan 2019 10:19:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN5D5wqkOheOsRPK6LP1fQ0kmshszdKzALdUNsTw5CNqWV3y0kGtNJcUJq2Ad/3pYzCQCpvr X-Received: by 2002:a63:1204:: with SMTP id h4mr2930018pgl.51.1548267545169; Wed, 23 Jan 2019 10:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548267545; cv=none; d=google.com; s=arc-20160816; b=vjtUHHKotepp2Zc1z078HHLEYdF1lb07mRcO9jPlIcmbMCPvqcqZ39Q5jLyQeo0Dpf jXPNtYbNUR6hZ2TDMO3gfU4f11UjhDpnrQX/vYvG4G8IRsT8K9XBFhyx1ClphqkssDxi vREM+4TRChwCI588e66+pUpFj2/7hS6Q95a/xGl6BWlRqeM6IrauCmc2JPzeCgUTTXGo OdAw4yAeYRQyRi6ijiCclv7IGvzMmopdSIe5rCQbroKYYZPlirrMtshmlYneyMD77wan s8K4odYg9c+sruykGphCfkUoVrLFDPnNhqbeogwcCjzNpeNa3RxMTGY4cG87BRjt9uAv fnmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PEO+aGSI1e6bWoYsMqiXF8S8alvOI+II99jL3BO+F04=; b=AxulyZAENDN6mvPry+mrY5PAaXWSJ3vkNed6CdDEPqT4OIH2vjIaxPpYBaM9QeU2LT gTXT8dUyZ0I5LQH/6FerEtzuVfX6FD//J344MPzgKhrxKOc+TpvKlcFUZwqGA4wDbif+ KHhmgNGg1/niQz8I/hnOE3bfrh+Jkd68+fDvsbpanEgaQ32GSI9jGmsnIMuIIEuV7k89 dot9ecmyo8uc9vyNW8cQH7jdIVL5LIsJlRNNz6APYRbeDHY1QVb7EM9IeBndHdk+Bkpg DB4kTYLIjCCe5boZTpIpN7BvCFO7NxqLgjs6Q54zueXGVtFX6vf/XFYVUs6LxP5nEmSR gGSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=aefkn7m1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u91si20893424plb.237.2019.01.23.10.18.49; Wed, 23 Jan 2019 10:19:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=aefkn7m1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726611AbfAWSSa (ORCPT + 99 others); Wed, 23 Jan 2019 13:18:30 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:45240 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbfAWSSa (ORCPT ); Wed, 23 Jan 2019 13:18:30 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0NI44sD067414; Wed, 23 Jan 2019 18:18:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=PEO+aGSI1e6bWoYsMqiXF8S8alvOI+II99jL3BO+F04=; b=aefkn7m1rJuJvC8gQzjvQnxfYkJbaU0QKakIE5UhXRj4EDh0nExflBDXcDCWZCuAj7JI CSusHqIt/nvEpbwZUb8q1eYVqwSZPh9DPGZof6EY4ovZRtkXdReZD+fpQ78Z+2ing8st 0I2S4QEnbAycNgc0PNIaZL+kOwxYEs38ruxUziOh3I5mpByxAFgarbJ2G+VMtPK+KgB2 BdpHBli5SSBeKf2d0XeZmN46wFfIIyjF7SGYAeWrbqZBYCvlN47QK/puB+A5zvJIjMLC zgntOzR034pU60Ye+Zm2lCCZlHoaG4w8R1t9Lq0ZwHu5FrkiEzUJVy2TGc9NGe6ajmaQ Xg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2q3sdekrbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 18:18:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0NIINXK019577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 18:18:24 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0NIIM4v020326; Wed, 23 Jan 2019 18:18:22 GMT Received: from Konrads-MacBook-Pro.local (/75.104.64.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Jan 2019 10:18:22 -0800 Date: Wed, 23 Jan 2019 13:18:09 -0500 From: Konrad Rzeszutek Wilk To: KarimAllah Ahmed Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com Subject: Re: [PATCH v5 13/13] KVM/nVMX: Use page_address_valid in a few more locations Message-ID: <20190123181807.GS19289@Konrads-MacBook-Pro.local> References: <1547026933-31226-1-git-send-email-karahmed@amazon.de> <1547026933-31226-14-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547026933-31226-14-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9145 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901230134 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 10:42:13AM +0100, KarimAllah Ahmed wrote: > Use page_address_valid in a few more locations that is already checking for > a page aligned address that does not cross the maximum physical address. Where is this page_address_valid declared? The latest linus's tree does not have it, nor does your patchset? > > Signed-off-by: KarimAllah Ahmed > --- > arch/x86/kvm/vmx/nested.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index ccb3b63..77aad46 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -4203,7 +4203,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu) > * Note - IA32_VMX_BASIC[48] will never be 1 for the nested case; > * which replaces physical address width with 32 > */ > - if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) > + if (!page_address_valid(vcpu, vmptr)) > return nested_vmx_failInvalid(vcpu); > > if (kvm_read_guest(vcpu->kvm, vmptr, &revision, sizeof(revision)) || > @@ -4266,7 +4266,7 @@ static int handle_vmclear(struct kvm_vcpu *vcpu) > if (nested_vmx_get_vmptr(vcpu, &vmptr)) > return 1; > > - if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) > + if (!page_address_valid(vcpu, vmptr)) > return nested_vmx_failValid(vcpu, > VMXERR_VMCLEAR_INVALID_ADDRESS); > > @@ -4473,7 +4473,7 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) > if (nested_vmx_get_vmptr(vcpu, &vmptr)) > return 1; > > - if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) > + if (!page_address_valid(vcpu, vmptr)) > return nested_vmx_failValid(vcpu, > VMXERR_VMPTRLD_INVALID_ADDRESS); > > -- > 2.7.4 >