Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp435960ybh; Sat, 7 Mar 2020 01:50:38 -0800 (PST) X-Google-Smtp-Source: ADFU+vsD7smL/rBxKh6xFOb9uwZz1DoX7uoyVG5ZpadnMnWOcmjCXwYwsdwgKV6kAIRzWQNVuarx X-Received: by 2002:aca:5303:: with SMTP id h3mr5309498oib.74.1583574638767; Sat, 07 Mar 2020 01:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583574638; cv=none; d=google.com; s=arc-20160816; b=lI6TQYsm6ffOGGF5wfEfq760bMAK2a0r8Mi1i+4Uv37fu0K2PwbFi8JkDRIN+yk0Ex AjiUqtIaX0n0uXh2oPeJV9Kjv2spUuJ356i/Uw+f1X/KdAaIpeHPAD6JIC/Ch12ihK3n Yp+etpEetqFdaOdRb7Mjbg8/490F0zaEqMeVsiPmoVQ49wgvK8Yq3/7+76emOyE3AZE8 nOC8+8z2HGdxy4HfzfdQW1y0w17H8sItVRKmf2r3ks+wE0tDeqAfwfHWjhA0u3RDp05z Agv167kBpVNmnJz1T2K7KWT1O+4NbXyOH0alrQk6GHnYaUW/sJOIWvHoc01JNZk7x2G7 UILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ftggWOkjRRCSjiop0sb8f7nrRSLTY/N2BuXl0fida/s=; b=b7HMxw8eQhLZpUNR2Xzq94Ec3BhuPK7dakirRXrKHxqtmY/qjKVGT+IRv/FWNf/sCt GVhlgl8YqgIWp/5T5yy6iq9ulUdF2MThbn3LBnJEn/MHl2f8PQ2Az1eh+jYpTTkIU145 CbaCmiHkBDa/B7xoH2iCJbNdjhqUZRhNZ2eN4/21lTt4qekv2IPj7F5qiNvIXP4U2KPG KcZTBPFT/Wq3nnwQX6Tcax+Zv8QoJ5/JL0xc1UavK2TILHVzHDz+YvXpOkIGO61PE9Mh 8HxRogLNqv06Eq456e4VIAHA0scNrT2/XgzFhYKMRJXJGmocxQks0MXa0aM2qqdY5M6S HfSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=FoT6pFGP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si1107700oiy.28.2020.03.07.01.50.27; Sat, 07 Mar 2020 01:50:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=FoT6pFGP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbgCGJs7 (ORCPT + 99 others); Sat, 7 Mar 2020 04:48:59 -0500 Received: from mout.web.de ([212.227.15.3]:45965 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbgCGJs6 (ORCPT ); Sat, 7 Mar 2020 04:48:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1583574507; bh=NfYTLzzJkZUdCjUySaSerm1xfcOdkle+o2cN/pwHHvI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=FoT6pFGPuFPu/Ab0sk/+Q8WlnXmAVnZh0PBMbIQLtTLz2gFPmlpRdewGU69GMZZeG 1RDW2n/JAek1ORfQToPEDI4624K7T4kBdXPoSw502OG4r5ALU8sQNcDROGand65+wb qYDMT66X0hnDX8QSOUrZd4FdGIy5KM65iOE9oU/k= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.10] ([95.157.55.156]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MCqmp-1j0rHc0RZz-009jrJ; Sat, 07 Mar 2020 10:48:27 +0100 Subject: Re: [PATCH 6/6] KVM: x86: Add requested index to the CPUID tracepoint To: Sean Christopherson , Paolo Bonzini Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li References: <20200302195736.24777-1-sean.j.christopherson@intel.com> <20200302195736.24777-7-sean.j.christopherson@intel.com> From: Jan Kiszka Message-ID: <00827dc7-3338-ce1a-923a-784284cb26db@web.de> Date: Sat, 7 Mar 2020 10:48:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200302195736.24777-7-sean.j.christopherson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:l1aUPNuFvYp9CoUQMSZJV7f6WzEVM9scmarRJ+A48HNxbxkcGoW b33bxhIDH7cGv+BPRBUj0bkevbMX622nbNj79UZpUOZKAg6kb+YE7+/BoTChoh8pKlXfKWS noh+Y+JaL7fRHvLv9Vq4ToClCGX3IJbN1+AzuSqjg/54G1h9xM//qE4BOVBEYHhX/B5mI0q yCZ3yqzsTKx4YzGdTHwlg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wxVnwk6qj7E=:vxZjq4j7XV57YYVd4YaPlQ WO1mR12AXAlyxAfonBYpuPnieU8mMSggPKPLCIC5u4WRMG+/K/i+ocK3J8vklu58888xuESNd FnMpt6kh8xELgdtRoQeABwat7u30oYc5YYExLBsQkTiUFFiIrXyzIMTfy20P+F36T1h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2VEDuO8dTzDZOirNN+R/PSHbryaVwgczYc diJVkPoBlDlzD9YCe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.03.20 20:57, Sean Christopherson wrote: > Output the requested index when tracing CPUID emulation; it's basically > mandatory for leafs where the index is meaningful, and is helpful for > verifying KVM correctness even when the index isn't meaningful, e.g. the > trace for a Linux guest's hypervisor_cpuid_base() probing appears to > be broken (returns all zeroes) at first glance, but is correct because > the index is non-zero, i.e. the output values correspond to random index > in the maximum basic leaf. > > Suggested-by: Xiaoyao Li > Cc: Jan Kiszka > Signed-off-by: Sean Christopherson > --- > arch/x86/kvm/cpuid.c | 3 ++- > arch/x86/kvm/trace.h | 13 ++++++++----- > 2 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index b0a4f3c17932..a3c9f6bf43f3 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -1047,7 +1047,8 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u3= 2 *ebx, > } > } > } > - trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, exact_entry_exists); > + trace_kvm_cpuid(function, index, *eax, *ebx, *ecx, *edx, > + exact_entry_exists); > } > EXPORT_SYMBOL_GPL(kvm_cpuid); > > diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h > index f194dd058470..aa372d0119f0 100644 > --- a/arch/x86/kvm/trace.h > +++ b/arch/x86/kvm/trace.h > @@ -151,12 +151,14 @@ TRACE_EVENT(kvm_fast_mmio, > * Tracepoint for cpuid. > */ > TRACE_EVENT(kvm_cpuid, > - TP_PROTO(unsigned int function, unsigned long rax, unsigned long rbx, > - unsigned long rcx, unsigned long rdx, bool found), > - TP_ARGS(function, rax, rbx, rcx, rdx, found), > + TP_PROTO(unsigned int function, unsigned int index, unsigned long rax, > + unsigned long rbx, unsigned long rcx, unsigned long rdx, > + bool found), > + TP_ARGS(function, index, rax, rbx, rcx, rdx, found), > > TP_STRUCT__entry( > __field( unsigned int, function ) > + __field( unsigned int, index ) > __field( unsigned long, rax ) > __field( unsigned long, rbx ) > __field( unsigned long, rcx ) > @@ -166,6 +168,7 @@ TRACE_EVENT(kvm_cpuid, > > TP_fast_assign( > __entry->function =3D function; > + __entry->index =3D index; > __entry->rax =3D rax; > __entry->rbx =3D rbx; > __entry->rcx =3D rcx; > @@ -173,8 +176,8 @@ TRACE_EVENT(kvm_cpuid, > __entry->found =3D found; > ), > > - TP_printk("func %x rax %lx rbx %lx rcx %lx rdx %lx, cpuid entry %s", > - __entry->function, __entry->rax, > + TP_printk("func %x idx %x rax %lx rbx %lx rcx %lx rdx %lx, cpuid entry= %s", > + __entry->function, __entry->index, __entry->rax, > __entry->rbx, __entry->rcx, __entry->rdx, > __entry->found ? "found" : "not found") > ); > What happened to this patch in your v2 round? Jan