Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1071809pxb; Wed, 1 Sep 2021 16:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOMBjPnnNkkn63jRWt31Mq/dmJUgqyt6JRV8iGKJMnP1coh8jHFNTGvpXpvppZ3F6v3DBt X-Received: by 2002:a50:9e41:: with SMTP id z59mr510644ede.376.1630540308906; Wed, 01 Sep 2021 16:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630540308; cv=none; d=google.com; s=arc-20160816; b=tiNT98cQYtAFWAbE09ZCwYeZjjrRaLgRfyMuEau3Em3m+LWO1QDCVh5+BCLl/Gec2s cp1WV9mgXoHV/QliIdPxPO4ZXRFSfxM8JNp8qREKNsKcqe9Oh54MSZ+cOlm96IitPXXd tMLhfu2hEfelNrtIqGk6zwxDs5NmqxuRzEshszgYynILZpd8s48KKQz+tZp3kC7IKK2T mOvTkNJyWdSy0g/ynuIfJNsjWbiBTKdrclUdENxj2FGu5LoIEG0crTYSkJ4A/LbMQ65H hQFEEk5K+aGwNUUYvPb75i3jURBhT5+1g6IfutnhXIpbNsPXbjHU4UigK1wg8yX8QjLn Ur0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xnO4j3l8wgJkh+udehwpdOizZik5cmOQlEavHkKD14I=; b=Vw3tqfO4ssCsNTGJMDrpthzm1M9PeKmDcq/7aqONaJ6uMF2IGiJWGrVjVMn/Gv4Isu UszcBH0rnRliHJYxTN6CwY8m2CZXREb9XWoEIvjiubYTdx/xzWVUxVah4PCO4582dQ4T tZ1Qkt5QRzJOxw/SbXhh0YOCjre38DxJEfiWxRDqeDi8bQgKy726o4XpQt+4H586Vn0N YaJkX9akFjyNTgWXcZK4DXeRHfpxt9v7+UJWONwfdj2KxngZKq5NPJ65Tfx3otPrmp78 QWiqWFSlwBEGluWu2HGBxdx51DQyu6JfMZXgicG3eDCINSV3qgEF9jNimB33ubMOqcPV 3RBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cR3xbTcU; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si218450edu.602.2021.09.01.16.51.26; Wed, 01 Sep 2021 16:51:48 -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=@google.com header.s=20161025 header.b=cR3xbTcU; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242148AbhIAX3t (ORCPT + 99 others); Wed, 1 Sep 2021 19:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhIAX3s (ORCPT ); Wed, 1 Sep 2021 19:29:48 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA3E6C061575 for ; Wed, 1 Sep 2021 16:28:50 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id g184so8655pgc.6 for ; Wed, 01 Sep 2021 16:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xnO4j3l8wgJkh+udehwpdOizZik5cmOQlEavHkKD14I=; b=cR3xbTcUYCXq2yoOsmEspRhLaJO0nhRFvKabyIOpQDKuImzIfWfB0ZS6A7fkLsSqvh IqbsElaLQZagzefg295QvN3rHWXa8FNfpUz3Z6sYq+/NvtYmEPcqO4zOs2KYR2cPSLMq poDNPxSc6wtpYpgY+vPI/Oe5oBaROvf1tBc4O2oHsnNacC8dCW/s5K7yEMrlUwrFpEv0 ForMquYnyLQGbyCbEam/KOl3jQUcSjZ8kmsOLacN6udbb9AVFNyz99MKyhUA6llS8dX0 55+YRa4wGvdy6Bo17uEeO5rsxxc9Wbti96oOw/CAeWfiUU/tKfcEO5fcIXoKgkvRV/EH Useg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xnO4j3l8wgJkh+udehwpdOizZik5cmOQlEavHkKD14I=; b=dZu2GW90LIkgelgYfDMWaS/V8DnZ4PL8Jd0mKTLGhDbARNveNVM4ljSQcazyOtjcnu 6SMbxKKCTY8tpPkZsvnLyAs5XO8GC47/b/J8gAAHNG86CUOOJCqyMz+dHzhcy1Ebf75K fRKucJagkusq0gTFoOHjQdsYorNM/N2tNmesUWWjs0WOP9xoe51rz7tie6TYs8UHUwl5 x5ER8j9KsUDRMF2mpWmzc7AzWrtb7q2pJcaz8u3qyXUDopfgWFeAeVulmgZff0xg050o sSiviXE8T5KnTbQfUcIZNtSDdhwxgC8CXbfOBwVnvSBn6DdUAaoArsYC3NuXszpRkMjQ 6Bfg== X-Gm-Message-State: AOAM532PFc/SaqTJpPc2AKarF86AQPKx9nfU+Tklz6WyZu9WM6rrOiVi 36MC/0CXcEWG/gMpyIjDJe9JLAgmD1xO9Q== X-Received: by 2002:a62:7c0d:0:b0:3fe:60d2:bce2 with SMTP id x13-20020a627c0d000000b003fe60d2bce2mr311221pfc.27.1630538930103; Wed, 01 Sep 2021 16:28:50 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id ev12sm45651pjb.57.2021.09.01.16.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 16:28:49 -0700 (PDT) Date: Wed, 1 Sep 2021 23:28:45 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, isaku.yamahata@intel.com, David Matlack , peterx@redhat.com Subject: Re: [PATCH 16/16] KVM: MMU: change tracepoints arguments to kvm_page_fault Message-ID: References: <20210807134936.3083984-1-pbonzini@redhat.com> <20210807134936.3083984-17-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210807134936.3083984-17-pbonzini@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 07, 2021, Paolo Bonzini wrote: > @@ -377,9 +377,9 @@ TRACE_EVENT( > ), > > TP_fast_assign( > - __entry->gfn = addr >> PAGE_SHIFT; > - __entry->pfn = pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(level) - 1)); > - __entry->level = level; > + __entry->gfn = fault->addr >> PAGE_SHIFT; Eww. The existing code also bastardizes addr vs. gpa, but this just looks even more wrong because we have fault->gfn. Maybe do this as a prep patch at the beginning of the series? And then use fault->gfn directly. diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index 7d03e9b7ccfa..b159749300b5 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -725,7 +725,7 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, gpa_t addr, level = kvm_mmu_hugepage_adjust(vcpu, gw->gfn, max_level, &pfn, huge_page_disallowed, &req_level); - trace_kvm_mmu_spte_requested(addr, gw->level, pfn); + trace_kvm_mmu_spte_requested(gw->gfn << PAGE_SHIFT, gw->level, pfn); for (; shadow_walk_okay(&it); shadow_walk_next(&it)) { clear_sp_write_flooding_count(it.sptep); > + __entry->pfn = fault->pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(fault->goal_level) - 1)); Similar thing here, it could use fault->gfn directly. > + __entry->level = fault->goal_level; > ), > > TP_printk("gfn %llx pfn %llx level %d",