Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2031491pxb; Fri, 24 Sep 2021 18:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJUIv6Gw7NfgEud5m8J2q7+YG/8uggnmzjZOfcYNwV9rEqwuzQl0MidMd1TcBN6N6MF0GL X-Received: by 2002:a5d:8b43:: with SMTP id c3mr11431485iot.30.1632533486918; Fri, 24 Sep 2021 18:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632533486; cv=none; d=google.com; s=arc-20160816; b=bTN1SO4X4FNB5ltgJmBEzjvs4TB6AlaGR/GYVWSvccWAyeLBas/msmPq4HBDpn2kUZ hLX83m5JXgEPjleWJhcXHlBHIuB/DCOJJrYVFh6vKQ9qFLMDO6OJ1zLGgoD6iLQIoxuC EjHW3rVbd26wqwsYkzEj8lc7tzPnEtp+l8/ZkKw/bMbDN+HzZsLmvMRTy8AJbnpZNM6z OHyNsiGmAxTIFBn6jyEjVi6SUD/uf2vP8axTTkUaaehd7qgMWQHeFgN60Fn00G6kUcwU wLz0TrX4IJTcs9OJ5lYELjSxT0aFSmO50suT7r9AZfntRy7ejNqS/Ot6ygjin/AhcHPC NbAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pHxiD8QxANCttvyiT7gVT3Bljga6UHkvpi20YNkEKP4=; b=B3eMl+gPy8TLZpXx8RCtxArJQMkzzFPOpAL8Kq7iNTqD6b98921Fe3v98slMMDdevH 3f8Fiwvv6Pt88qFnTW7IM1iv1aFHeKN5b/dDy1sYzszx3D8Y0yrcnTN1zKSKHWQYq0XC LK4Xpsd66EELIB8kOKHezr7Vn0zGjSQI9dQueCXXehugJa9uKx9sZElTt5bEPhGH4b41 sdVEgaHUi7m/WP2ZsNHL9tLt+tCjYEDfzjWLX2MxMIrvREkTGXg1gQQk5151w52cqPbS EA56yXCWzI8O7sZTFlUSar7rHvTZHktb2As1VSoBIe2BRDOj54kBtwqBa8sk3+A9g5Ql HTPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EYgHYGig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si1986532iow.40.2021.09.24.18.31.16; Fri, 24 Sep 2021 18:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EYgHYGig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347429AbhIXQde (ORCPT + 99 others); Fri, 24 Sep 2021 12:33:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32226 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbhIXQda (ORCPT ); Fri, 24 Sep 2021 12:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632501116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pHxiD8QxANCttvyiT7gVT3Bljga6UHkvpi20YNkEKP4=; b=EYgHYGigjxdjJFKv3JCVvWdrzA2QQ6FmUEhog59iqwdBvviN9KA8FNMhqOUa21kDAHO8LG gYMPZNjyC+cSyHorYSWrJNB9RZw+K716XoQ6QQDFnha7E5I7UrAQb4lJ26l2Qwd3DpxoWt 4Rtri+IUqBDfqENyYQMx70e63fa1LLU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-I4_du0zSN2qiT9pba9O2yg-1; Fri, 24 Sep 2021 12:31:55 -0400 X-MC-Unique: I4_du0zSN2qiT9pba9O2yg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 19FCC801E72; Fri, 24 Sep 2021 16:31:54 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB98660E1C; Fri, 24 Sep 2021 16:31:53 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: dmatlack@google.com, seanjc@google.com Subject: [PATCH v3 01/31] KVM: MMU: pass unadulterated gpa to direct_page_fault Date: Fri, 24 Sep 2021 12:31:22 -0400 Message-Id: <20210924163152.289027-2-pbonzini@redhat.com> In-Reply-To: <20210924163152.289027-1-pbonzini@redhat.com> References: <20210924163152.289027-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not bother removing the low bits of the gpa. This masking dates back to the very first commit of KVM but it is unnecessary, as exemplified by the other call in kvm_tdp_page_fault. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 7ef9c001d1b6..376e90f4f413 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4018,7 +4018,7 @@ static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, pgprintk("%s: gva %lx error %x\n", __func__, gpa, error_code); /* This path builds a PAE pagetable, we can map 2mb pages at maximum. */ - return direct_page_fault(vcpu, gpa & PAGE_MASK, error_code, prefault, + return direct_page_fault(vcpu, gpa, error_code, prefault, PG_LEVEL_2M, false); } -- 2.27.0