Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2643139ybf; Mon, 2 Mar 2020 12:50:09 -0800 (PST) X-Google-Smtp-Source: ADFU+vtyi4hquWPjXILE++h3cwI+JrAHLP6ij+v2YWrh3zYZ6EIusloK9hZuH2tQEhFV3I/Smw5T X-Received: by 2002:a9d:1284:: with SMTP id g4mr756187otg.47.1583182209252; Mon, 02 Mar 2020 12:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583182209; cv=none; d=google.com; s=arc-20160816; b=f/yHGpB9QlZqaaxiewVoytUg1W5M/eji+FKnwdmR1unK6q+gfeFLvgGjtM6UzHWTYd 8CopM0FQ+GPl94VbWGfKConmbBMenKvik+rgTC2xFEcyE2Nt00dI8XbQVtYosgFu5PRV 4Il9aAnIn4trPZ7adoBo8ktDe4CQzoB3KlgsJ6cOjoYWDVBat/if+7Ty1RHkwaOGA3TG 746HLeuZn32N4DNI4QM1qsdrv+NLjHB1o8O9nW6/DkFApoYZQTCk3ZLJsVgg8oHjv8+n criamuTI+v98JN9zYAGw81hQUWvSB0REVVbW4urQY8NC5cfy9LqqZ5JdpawbT09aOC9r 0/kg== 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; bh=ghGVT0LHrXPRjMLiJwr0E2sPxut3FbIP3dlAGF1Krvo=; b=m0spi38MXEN81V1QTF5sgYURvpvKU1GLnnyEo1a6PRYt2ETfBO4vwaDYmXbhmS/3VP A3K7KgSn7WnZQXKfrtpnxXNmKk1goafpa/26d2OCIm5FHT1jxgP6wbb4Ncl3PwdE5QEX VEdA3OqKzXcgWJdxt4QzCSWtV9sE6crljoPXg4souP0CaceshWBFoN1D0GbQBC/9nZib aLlT/fEsqGM3max7+cxvHy9s4Bsvhg5gMmlwOi5H3LkWx72dJEGBiRtQIQf9HNOMk8YM BgYnnvojA0glUUjdv8234+wiybpppVkdpphA3vm97BKtwiV7CnRo7qXOwNi5f4WZKfa8 laYg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si3303565oiw.63.2020.03.02.12.49.57; Mon, 02 Mar 2020 12:50:09 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbgCBUsv (ORCPT + 99 others); Mon, 2 Mar 2020 15:48:51 -0500 Received: from goliath.siemens.de ([192.35.17.28]:50115 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbgCBUsu (ORCPT ); Mon, 2 Mar 2020 15:48:50 -0500 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 022KmR6k007017 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Mar 2020 21:48:29 +0100 Received: from [139.25.68.37] ([139.25.68.37]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 022KmQfk011003; Mon, 2 Mar 2020 21:48:26 +0100 Subject: Re: [PATCH 5/6] KVM: x86: Rename "found" variable in kvm_cpuid() to "exact_entry_exists" To: Sean Christopherson Cc: Paolo Bonzini , 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-6-sean.j.christopherson@intel.com> <680d85ee-948c-6968-2d1a-d563d4863140@siemens.com> <20200302203510.GF6244@linux.intel.com> From: Jan Kiszka Message-ID: <42135019-bbb8-40e0-35c7-070365a5ad79@siemens.com> Date: Mon, 2 Mar 2020 21:48:26 +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: <20200302203510.GF6244@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.03.20 21:35, Sean Christopherson wrote: > On Mon, Mar 02, 2020 at 09:20:52PM +0100, Jan Kiszka wrote: >> On 02.03.20 20:57, Sean Christopherson wrote: >>> Rename "found" in kvm_cpuid() to "exact_entry_exists" to better convey >>> that the intent of the tracepoint's "found/not found" output is to trace >>> whether the output values are for the actual requested leaf or for some >>> other (likely unrelated) leaf that was found while processing entries to >>> emulate funky CPU behavior, e.g. the max basic leaf on Intel CPUs when >>> the requested CPUID leaf is out of range. >>> >>> Suggested-by: Jan Kiszka >>> Signed-off-by: Sean Christopherson >>> --- >>> arch/x86/kvm/cpuid.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c >>> index 869526930cf7..b0a4f3c17932 100644 >>> --- a/arch/x86/kvm/cpuid.c >>> +++ b/arch/x86/kvm/cpuid.c >>> @@ -1002,10 +1002,10 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, >>> { >>> const u32 function = *eax, index = *ecx; >>> struct kvm_cpuid_entry2 *entry; >>> - bool found; >>> + bool exact_entry_exists; >>> entry = kvm_find_cpuid_entry(vcpu, function, index); >>> - found = entry; >>> + exact_entry_exists = !!entry; >>> /* >>> * Intel CPUID semantics treats any query for an out-of-range >>> * leaf as if the highest basic leaf (i.e. CPUID.0H:EAX) were >>> @@ -1047,7 +1047,7 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, >>> } >>> } >>> } >>> - trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, found); >>> + trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, exact_entry_exists); >> >> Actually, I think we also what to change output in the tracepoint. > > Oh, I definitely want to change it, but AIUI it's ABI and shouldn't be > changed. Paolo? > This can be discovered via the format string in sysfs and handled by the consumer. But I'm not an expert in the tracing ABI. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux