Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1307058pxt; Sat, 7 Aug 2021 06:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoy95y9S/G3MBy2QrSXYcCeqVDDrLvKUwilhXhr2t53q2IyThuZlQ0hpySEI5o1r5/8gav X-Received: by 2002:a05:6e02:1a02:: with SMTP id s2mr283939ild.225.1628344379374; Sat, 07 Aug 2021 06:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628344379; cv=none; d=google.com; s=arc-20160816; b=wcYtriyvvjfB/0K1NJAIR9gMMC8jQCDhOh/PlsbZosWlSus0eBMeREBzNTUnQIePGt JbeVVbE6u8aU9yIAS8tOjwsmpM+ItJXjSkLa43w4ZgMNr74m5lgyKx59c9lJgvfaxGy5 PyG2nTOSw0LSmWUT2NNOJ1OrwYvVIZ7FpoRw7J/FuC6SGS8AhOOMAW423HtrS2p4iRWf 4vNPbAgTRM9/ewjYh+WdAAPchsJqQmIRna6uLgDlzQe7AhUhIEpPtuXepIpgKSioldMG p+TFsVv9yO/loywKXCf84N2mJVhyLTL8aYv+TMwAO8o/fYZgFDcksc3n1sNUb862/J2g 6Jmw== 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=q3qi03Y0jFofsQ90jeh8m/1CVrLzsZBLAnQr8heLNMs=; b=NaOHimqoFMsWcJbmuWEDxh/5o/zFNQBA3mc1INJgrX0fs4FTYvIgQ7wmY0FZTxz6pr oponr04Az+G8ZFwAoSYQJCPMY5ZE1C0dfeyefTqkmCCKbWmKfSvZNh0CPa7MibD3vPY1 49R8a38/a19/ROrolOFwYxEfVK9qVwvL/psajWZ49rYCdwHhbuFEQWZN1ARhaolE/tl9 uTQ+5cYM5iEJ666qd6kEMukodRBvT+NXztaZrG45Q0RBy38nlFSDYG1im+oJrmGnpO4x qTD0oIvz6x+s2/7x48hscxmgGJ92FRgb0Y7YjAMBZ0qe7e8B/dBN03S0KLjwJ0+ajGJZ SeVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PAysLRds; 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 w11si12407768ill.114.2021.08.07.06.52.47; Sat, 07 Aug 2021 06:52:59 -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=PAysLRds; 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 S232792AbhHGNuq (ORCPT + 99 others); Sat, 7 Aug 2021 09:50:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43310 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232491AbhHGNuS (ORCPT ); Sat, 7 Aug 2021 09:50:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628344200; 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=q3qi03Y0jFofsQ90jeh8m/1CVrLzsZBLAnQr8heLNMs=; b=PAysLRdssNVEil+WRbUMGBXbxJA+OugIXYzVkGQQWfU+timD1kfbVNZVqW5j0xcCKFUOHR yDDWeeQX6QZ2sONG0dvoxv+JUoaypwLB1yKqjvaKW5RIdmZ2hjaHRfg5OH3bcGNB1+6m1q exctAeCrG3qQRVNhlz9IIF8i+vArumQ= 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-12-GfHxDP6nOxiambFegGo9fQ-1; Sat, 07 Aug 2021 09:49:57 -0400 X-MC-Unique: GfHxDP6nOxiambFegGo9fQ-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 2B74E18397A1; Sat, 7 Aug 2021 13:49:56 +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 A320460C13; Sat, 7 Aug 2021 13:49:55 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@intel.com, David Matlack , seanjc@google.com, peterx@redhat.com Subject: [PATCH 16/16] KVM: MMU: change tracepoints arguments to kvm_page_fault Date: Sat, 7 Aug 2021 09:49:36 -0400 Message-Id: <20210807134936.3083984-17-pbonzini@redhat.com> In-Reply-To: <20210807134936.3083984-1-pbonzini@redhat.com> References: <20210807134936.3083984-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 Pass struct kvm_page_fault to tracepoints instead of extracting the arguments from the struct. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/mmu/mmutrace.h | 18 +++++++++--------- arch/x86/kvm/mmu/paging_tmpl.h | 2 +- arch/x86/kvm/mmu/tdp_mmu.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index a41325f452f4..0c0061893ebe 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2950,7 +2950,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) kvm_mmu_hugepage_adjust(vcpu, fault); - trace_kvm_mmu_spte_requested(fault->addr, fault->goal_level, fault->pfn); + trace_kvm_mmu_spte_requested(fault); for_each_shadow_entry(vcpu, fault->addr, it) { /* * We cannot overwrite existing page tables with an NX @@ -3242,7 +3242,7 @@ static int fast_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) } while (true); - trace_fast_page_fault(vcpu, fault->addr, fault->error_code, sptep, spte, ret); + trace_fast_page_fault(vcpu, fault, sptep, spte, ret); walk_shadow_page_lockless_end(vcpu); return ret; diff --git a/arch/x86/kvm/mmu/mmutrace.h b/arch/x86/kvm/mmu/mmutrace.h index 2924a4081a19..0c37fb9d532e 100644 --- a/arch/x86/kvm/mmu/mmutrace.h +++ b/arch/x86/kvm/mmu/mmutrace.h @@ -252,9 +252,9 @@ TRACE_EVENT( TRACE_EVENT( fast_page_fault, - TP_PROTO(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u32 error_code, + TP_PROTO(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault, u64 *sptep, u64 old_spte, int ret), - TP_ARGS(vcpu, cr2_or_gpa, error_code, sptep, old_spte, ret), + TP_ARGS(vcpu, fault, sptep, old_spte, ret), TP_STRUCT__entry( __field(int, vcpu_id) @@ -268,8 +268,8 @@ TRACE_EVENT( TP_fast_assign( __entry->vcpu_id = vcpu->vcpu_id; - __entry->cr2_or_gpa = cr2_or_gpa; - __entry->error_code = error_code; + __entry->cr2_or_gpa = fault->addr; + __entry->error_code = fault->error_code; __entry->sptep = sptep; __entry->old_spte = old_spte; __entry->new_spte = *sptep; @@ -367,8 +367,8 @@ TRACE_EVENT( TRACE_EVENT( kvm_mmu_spte_requested, - TP_PROTO(gpa_t addr, int level, kvm_pfn_t pfn), - TP_ARGS(addr, level, pfn), + TP_PROTO(struct kvm_page_fault *fault), + TP_ARGS(fault), TP_STRUCT__entry( __field(u64, gfn) @@ -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; + __entry->pfn = fault->pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(fault->goal_level) - 1)); + __entry->level = fault->goal_level; ), TP_printk("gfn %llx pfn %llx level %d", diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index 3f82f469abdf..1c182ef61c79 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -719,7 +719,7 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault, kvm_mmu_hugepage_adjust(vcpu, fault); - trace_kvm_mmu_spte_requested(fault->addr, gw->level, fault->pfn); + trace_kvm_mmu_spte_requested(fault); for (; shadow_walk_okay(&it); shadow_walk_next(&it)) { clear_sp_write_flooding_count(it.sptep); diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 803da0334933..7f7de01cf665 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -1004,7 +1004,7 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) kvm_mmu_hugepage_adjust(vcpu, fault); - trace_kvm_mmu_spte_requested(fault->addr, fault->goal_level, fault->pfn); + trace_kvm_mmu_spte_requested(fault); rcu_read_lock(); -- 2.27.0