From patchwork Sat Dec 2 09:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 172786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1676656vqy; Sat, 2 Dec 2023 01:58:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvw0M99guBXdXS9DdtF7Gnw/nsTuXnRPHo8GTRzNtKhDqb0JG1Vso+c3DID39VK8qFg43C X-Received: by 2002:a05:6a20:da8b:b0:18a:6639:e331 with SMTP id iy11-20020a056a20da8b00b0018a6639e331mr1095111pzb.13.1701511111728; Sat, 02 Dec 2023 01:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701511111; cv=none; d=google.com; s=arc-20160816; b=w+2wUR2YrnPyfkTTwv1a2dVgL9hQSAMmRRQsZsbIFskF5TW9U1c4ayfETJe9w42CDq 8ug7NKkolApFQIBkcfLwQPnQdF4vwJUHtFbwWgcn76nZVFu95GW7gLeD8eEOkBDo/3x6 lr7xfG6kPVm7peK+2M8wi9VxMzIdjTP6CfIUu7yrWAH35aD4EcWGJXrMtNIPuw9g85gR EMvrbjYAQm3gsjHz6FtyPlKaQkwQH86Hd9FBhWIrT8y6HV9uckPPM1LamdLKIr+ts8Ot tLbmcHkbK13tTRA49nKS08vHhEScP9b8uQpZY7Sbw0TCjJqlu3v/jIHP2rm2akJ6WeXC sEZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=fpmbroBdZEGfkrrsi+4q0Hvzc1XZ2y0Oje6F+znB+1U=; fh=+WI4m5k3dRLR+dR3neThuZkNBTzIm/a8HgtddERL9fA=; b=zb+t/i4YFMCo4e2uCRMZXvh/UDJMhPfawkQc+FWjqf5cLjatBvxnW0qzOR2Ssvqy3G OlAGTbBIeOlZ4Jh5ppU2Sn7lWJajTedGLoER2zEgAqewxr+3xio0Ts2DhUh4y5t5+rq1 2dPv9H4SDSe8ByxLH6Bqksw5p/Kg8It9nAhV0QnSYndDB/c63RGV6sJ8uJdlqjX/1M/4 wQu9Fcs+pIwzuBKZUQjiXt4oWxsEFgyiKuVmmhBP8RYs3qMVRvfO9rhyyKM6IxpHr+/z aDNijzqnMW1GQMI9JZKPxV4Zy2N8ACFiZx3KfTCZEP14cB8tPUi8IdeFjZ0rLpEE3xAt 2DeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0FBx8eH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q5-20020a056a00150500b006cd8db94631si4771689pfu.365.2023.12.02.01.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 01:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0FBx8eH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C36C380FCBEA; Sat, 2 Dec 2023 01:58:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbjLBJ6S (ORCPT + 99 others); Sat, 2 Dec 2023 04:58:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjLBJ6R (ORCPT ); Sat, 2 Dec 2023 04:58:17 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4791E3; Sat, 2 Dec 2023 01:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701511103; x=1733047103; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=/sZNp1HTRIQfF9DKgY191Av3Iz3lMdrk+plprrEgK+w=; b=g0FBx8eHz1PxIow3zhCSsV9sgvMBKfNWPsderNGvX4z2P4Osbh2W+86+ Htv6ql1KBx9jl8Bi/Y2IJdgudgZhVqQHc4g69C89XHmAdHZ9UTfsX7Ix0 xgxE+xv43w+Ttt1ScmAWkCTMZVPdSiTckVk13M5xqwoUqx9nUXuFvyWWY cvY6tmWpIB6SsisubCuda4vyfFdCZh8I+m37+tMkNmPq/cVP1+X8r2OjV dtjIe02uxLQvkzruxukuwcLaGxFIY8mO3f+u/FkoMCbv+J6kNzhLHv5u4 j83luoNNQojQ+DjMFhHNf9pDH2hIab80iYrCqJz/hNdVDwFOXWizKyQx2 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="393322323" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="393322323" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 01:58:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="804337625" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="804337625" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 01:58:19 -0800 From: Yan Zhao To: iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alex.williamson@redhat.com, jgg@nvidia.com, pbonzini@redhat.com, seanjc@google.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, yi.l.liu@intel.com, Yan Zhao Subject: [RFC PATCH 28/42] KVM: x86/mmu: change "vcpu" to "kvm" in page_fault_handle_page_track() Date: Sat, 2 Dec 2023 17:29:20 +0800 Message-Id: <20231202092920.15167-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231202091211.13376-1-yan.y.zhao@intel.com> References: <20231202091211.13376-1-yan.y.zhao@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 02 Dec 2023 01:58:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784163715705458622 X-GMAIL-MSGID: 1784163715705458622 page_fault_handle_page_track() only uses param "vcpu" to refer to "vcpu->kvm", change it to "kvm" directly. No functional changes expected. Signed-off-by: Yan Zhao --- arch/x86/kvm/mmu/mmu.c | 8 ++++---- arch/x86/kvm/mmu/paging_tmpl.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index b461bab51255e..73437c1b1943e 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4186,7 +4186,7 @@ static int handle_mmio_page_fault(struct kvm_vcpu *vcpu, u64 addr, bool direct) return RET_PF_RETRY; } -static bool page_fault_handle_page_track(struct kvm_vcpu *vcpu, +static bool page_fault_handle_page_track(struct kvm *kvm, struct kvm_page_fault *fault) { if (unlikely(fault->rsvd)) @@ -4199,7 +4199,7 @@ static bool page_fault_handle_page_track(struct kvm_vcpu *vcpu, * guest is writing the page which is write tracked which can * not be fixed by page fault handler. */ - if (kvm_gfn_is_write_tracked(vcpu->kvm, fault->slot, fault->gfn)) + if (kvm_gfn_is_write_tracked(kvm, fault->slot, fault->gfn)) return true; return false; @@ -4378,7 +4378,7 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault if (WARN_ON_ONCE(kvm_mmu_is_dummy_root(vcpu->arch.mmu->common.root.hpa))) return RET_PF_RETRY; - if (page_fault_handle_page_track(vcpu, fault)) + if (page_fault_handle_page_track(vcpu->kvm, fault)) return RET_PF_EMULATE; r = fast_page_fault(vcpu, fault); @@ -4458,7 +4458,7 @@ static int kvm_tdp_mmu_page_fault(struct kvm_vcpu *vcpu, { int r; - if (page_fault_handle_page_track(vcpu, fault)) + if (page_fault_handle_page_track(vcpu->kvm, fault)) return RET_PF_EMULATE; r = fast_page_fault(vcpu, fault); diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index 13c6390824a3e..f685b036f6637 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -803,7 +803,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault fault->max_level = walker.level; fault->slot = kvm_vcpu_gfn_to_memslot(vcpu, fault->gfn); - if (page_fault_handle_page_track(vcpu, fault)) { + if (page_fault_handle_page_track(vcpu->kvm, fault)) { shadow_page_table_clear_flood(vcpu, fault->addr); return RET_PF_EMULATE; }