Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6901892pxv; Fri, 30 Jul 2021 05:27:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhowFyJzdn1RdkcU4zreP//6LachfR9BdiCG5vu65cDDLG1lTRFG8IGz8nL2/+4pPfLFSd X-Received: by 2002:a05:6e02:b43:: with SMTP id f3mr1845221ilu.94.1627648067749; Fri, 30 Jul 2021 05:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627648067; cv=none; d=google.com; s=arc-20160816; b=0W/ZTzRkHaz32sgZHdxxwAvp/sNrx2TDGqO6dYoI5n8XVTbE4yW+H45es7O05lfXno m1A3Q9oAjx4nn4bbArzKwv2+7i1+QllxSxApwSV8jmd2kxbouDsTDQ71xnF7HwHQLuTY E3J16f9qUHW83tWisiKy1Zc066k6iS2iGVRd+krauMEr90OwFwLcr3pZVEJkQcgyvsxQ JI7BEBlgnLvF784mPdL1SD60DAGSAfhKpyrhuYmGEuqeoD0e2aLDrokFTvQW14oOtAMd z92biQ9wwWC/AsGOTed1LGDMWLHDRpLrLkZ6VslG1u4d6JZ3FtXfmLY45xniHp4xG6f8 WVoQ== 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=CBrkosEHBpunXjv6llkfAXVgsSQKtiHD9fz58o111/Q=; b=Zoba4kI9A48KecpqhGmGc6uoHkMhgxmU1bYI81g30AYNhrHDAg6lPuqBc0A+F5Dair 53+iOPIhgh4IM2Dmz9y4zC0Ic/GuAf3tRY6W7k6z05pYKY6mHgHQ7dYrg1xdQE0pliEd /tXZLT8L0vjZnDev0qNVGT661hnH9DY3VlQM1F1QdSLZSsSJo5FYzsY8ya04mvUfwQmV emBVzvV46vvow3uHXT8ENJ0tonW/CIq1vD6Lo3AJC4GkNV0HJRKcgBVOw4HqY9U1OgP+ WplbkBWgsN4gugo1oA46qu9BgLFIzObQghg/56Veyk3EolCk/ZyZMkZIp3aEClRGjC3H 4ANQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JHCWr6nW; 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 d2si1527695iow.58.2021.07.30.05.27.35; Fri, 30 Jul 2021 05:27:47 -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=JHCWr6nW; 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 S238779AbhG3M0t (ORCPT + 99 others); Fri, 30 Jul 2021 08:26:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38625 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238833AbhG3M0t (ORCPT ); Fri, 30 Jul 2021 08:26:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627648004; 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=CBrkosEHBpunXjv6llkfAXVgsSQKtiHD9fz58o111/Q=; b=JHCWr6nW/K+gl1wRPvBdd6DGCiwgiQwZeMPOmOyvhJqYngTy/wJlgcs/wbyi8/vTnB/dgW M15pmMmTCJKAF6lRdzndow1qIL3OPOS+3ChJ5VhlyCBXb0SQOe0KWLFXUR5uifXUBxYqo6 pY6y4JDsBQQg61NZoPYKzczN/NTaKmw= 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-554-yi_BwJUSOlSp_6jkkaOJew-1; Fri, 30 Jul 2021 08:26:41 -0400 X-MC-Unique: yi_BwJUSOlSp_6jkkaOJew-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5793EC1A0; Fri, 30 Jul 2021 12:26:39 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.194.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC6B5687D5; Fri, 30 Jul 2021 12:26:34 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Siddharth Chandrasekaran , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] KVM: x86: Introduce trace_kvm_hv_hypercall_done() Date: Fri, 30 Jul 2021 14:26:23 +0200 Message-Id: <20210730122625.112848-3-vkuznets@redhat.com> In-Reply-To: <20210730122625.112848-1-vkuznets@redhat.com> References: <20210730122625.112848-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hypercall failures are unusual with potentially far going consequences so it would be useful to see their results when tracing. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 1 + arch/x86/kvm/trace.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index cb7e045905a5..2945b93dbadd 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -2016,6 +2016,7 @@ static void kvm_hv_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result) static int kvm_hv_hypercall_complete(struct kvm_vcpu *vcpu, u64 result) { + trace_kvm_hv_hypercall_done(result); kvm_hv_hypercall_set_result(vcpu, result); ++vcpu->stat.hypercalls; return kvm_skip_emulated_instruction(vcpu); diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index b484141ea15b..03ebe368333e 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -92,6 +92,21 @@ TRACE_EVENT(kvm_hv_hypercall, __entry->outgpa) ); +TRACE_EVENT(kvm_hv_hypercall_done, + TP_PROTO(u64 result), + TP_ARGS(result), + + TP_STRUCT__entry( + __field(__u64, result) + ), + + TP_fast_assign( + __entry->result = result; + ), + + TP_printk("result 0x%llx", __entry->result) +); + /* * Tracepoint for Xen hypercall. */ -- 2.31.1