Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1106991lqo; Fri, 17 May 2024 10:49:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvVxK/slDwOSs4y5cxsL9u9b7I1IHPJuUEH5juSjQgPPcdCKW9Q8haZEKWlqFOXKQ/rPRWkt4bGcTuv8bU8MkT7o9GdHZtCana4AAxgQ== X-Google-Smtp-Source: AGHT+IHhjd0NrTDSoC0F/AdH1iadG8pqxaTq8n6njTGrSGwwdxNqg1yoP9+Hc7HZU+1zceMLIGNi X-Received: by 2002:ac8:5d4f:0:b0:43a:f441:75ab with SMTP id d75a77b69052e-43dfdb2715cmr230231891cf.22.1715968177605; Fri, 17 May 2024 10:49:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715968177; cv=pass; d=google.com; s=arc-20160816; b=qBBXXxKGKJAJW8S409yGYMJniq9cIY/6JoQuxgtLYOonO61FrmuMnCUc4rk4dEusWy 1Nk3Wq2w/Um1C7HF6I9V0b2VuY+nzecJsedtU/PC5dzS2U3JFOl+JPd6srFnbSwnJ3JR 1dPiaLg/FK8JRzoYZ1J8GhAoLO3AwUQSwYR53bu3fqgshni1Z94BTUXMObOx+Rp9tOsj C0v4e7YY6ImxNzK66ABGsA6YjKM4D+Qhs9amf02LM9Y+a5a/SdvKhYooteSNIIYvTfRx pVA1xds8HcujLV/0CgRm/1Ng0dX2Ag6hIcjGfYNxgiiGqtpKtlbqluhtIa5Q+f1w3Jhb ZggA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=W9vbUGR+ZudSgxxnkuWHpd6w+0NtOufsj8EL4oL6crU=; fh=rnw2W5CQRdeZeq9C7Jkt1i8+QhPUSlcUnKlHfnKeqV8=; b=pAudgRtPUU5c9JdNBJqX6nM6eOWawSvysDz+QxQ3yRcrc5yWd1jjNUMsPGtu+PRQBW Y7K0TYQySP+t+DJ8o8ChSU/82K3cBg6gLzavXxYeyyeMgFvcwN6lDevuwL5OZpFZc1Re zNUoUm7TUi9B4WGe0mmooX6FJtyfXvxKd9FlfrsoEqantfvj74ZMxCuoEBLdVOrl9pvn nfD9rH1xwDma0+OsoioX54UKzdIGZ2n1bkLoWTV5uRvKzrIb9tApbieSACFzNFIQfW5/ QNeSbI4FBTm1hec7SOcsI+NgPUr3FO9gzKpoxWADSxkwKMHU0tUMPNPgWpBl/aZQmFXl ZV4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kXhKVBRP; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e09bb9c78si152239311cf.470.2024.05.17.10.49.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 10:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kXhKVBRP; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5219D1C2165B for ; Fri, 17 May 2024 17:49:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69069154C19; Fri, 17 May 2024 17:40:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kXhKVBRP" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249A115445D for ; Fri, 17 May 2024 17:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967644; cv=none; b=Co3M3Sp+iVd/5LzjK2IwkU1VymxlIQq8h5BWtcpCxhT4kOYe710ZngmfknF+gKxSTdIhEysLz3Cl96dzOgLQxpE5x3gpQkRf1LwHOuwV+ub8lbIvWDnmZnG6rzLIhRaskOOGooNPaqMhr9Ir5nLGyOpvulB+eeMqE3bzzsPqaBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967644; c=relaxed/simple; bh=kg0XQmVXTF7zWpc7zfBmMEfoHYByvyMTPJF15P3dX+s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=TMuFZ/AptBmmFnnA98YT8cBWcLwZeR8W283RZlxVACiXwz8DNz7NT40TtFMcmfyO+Dr/eB+qeiNuOYUPsNTX/s41a8uu87fI+iwf1Eug2DWQZgWUhLdwXpnvSO75ouRZB8sxPHihZL9n2WlnUr8Ha7NGQnS2o87V8N0UjIzJEWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kXhKVBRP; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1e2bbb6049eso85153865ad.0 for ; Fri, 17 May 2024 10:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715967642; x=1716572442; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=W9vbUGR+ZudSgxxnkuWHpd6w+0NtOufsj8EL4oL6crU=; b=kXhKVBRP+2U0il4E/5Lx/qkjPjFmGzDdVa0o6WT/g3Sfa1CA1sJJGNTxTBZsztHSo7 ep/Qqzqc5bup1GstNZE4NO8ScePXa2ISon2zKO7zo4KknXr1rTdU6fXYQXmKEU3gImn3 cuBJPi6Sg0SSC+/aoBnx0F+IdR9pCkM/oJOBw2xIIgHnguc7dO4L3rVMOcmFgFrDa0hb xnwhfYbONU/EG4BOk507fBwdsf3z6dVKCPqh3N8SeovqnmkAUTYpl1BA8/heprGxf0DX 8ZkLDrxObspS/YT7/lc6XILj+6HlHz/IgZFJvpuDO2MuHUUlagKV4c05ENcPFV9x705x O7YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715967642; x=1716572442; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W9vbUGR+ZudSgxxnkuWHpd6w+0NtOufsj8EL4oL6crU=; b=Te/Q9KiZkSgSD40RwF/MnPYvgCr64KRS8/eJr4YsT/t3L0DS+DJozkrznTykx6/6iJ U6KN3blJFORpXurzRblBDVFbY+sukHQ7IVd89k9az75GIYcKyUeYIGmgeipF7PHl+jQM C4keQ72QmvA86TlxLvN77JZ2PNb8VAQzQtOyjlZNN6y9KVRCFl5ctgQgol3oxn8u8xrI 4yx4Nsa9YtsVjc5pNB2T69CPgq9KaCZ+12HPKs3YI+jTfV4zqDh9/IGZWdXFCZk1gliD 2shU+mgFMtrzd1zlQ2+5hOxkLI92DIbaw7k0rysLL1nAnLKs7eIXOP5C4xWzgS+liXog UMbA== X-Forwarded-Encrypted: i=1; AJvYcCX4xSZOeO+J7b/I0ucFfMLUKf9VamArS0Enh17VLogqaL+XGNITosvDvhMXHoSbbb83hfGaHu4YPVShJhr0qo+MjoWOpFmpvxF1RYce X-Gm-Message-State: AOJu0YyxtwDMhh4oJq30qF6w+zlRsmlZH8Z+wxps7TEIjDjuBWMMmmu0 NbkmhmXDoy9REm5Xxd3tT2pzsvniEZW9puV4ghIPt3myCw8xbR8m/SGhJ3Lcu6PWL8IW+C89Fyx npQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:f550:b0:1e4:3269:8c32 with SMTP id d9443c01a7336-1ef433d9969mr1683465ad.0.1715967642396; Fri, 17 May 2024 10:40:42 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 17 May 2024 10:39:08 -0700 In-Reply-To: <20240517173926.965351-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240517173926.965351-1-seanjc@google.com> X-Mailer: git-send-email 2.45.0.215.g3402c0e53f-goog Message-ID: <20240517173926.965351-32-seanjc@google.com> Subject: [PATCH v2 31/49] KVM: x86: Move kvm_find_cpuid_entry{,_index}() up near cpuid_entry2_find() From: Sean Christopherson To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Hou Wenlong , Kechen Lu , Oliver Upton , Maxim Levitsky , Binbin Wu , Yang Weijiang , Robert Hoo Content-Type: text/plain; charset="UTF-8" Move kvm_find_cpuid_entry{,_index}() "up" in cpuid.c so that they are colocated with cpuid_entry2_find(), e.g. to make it easier to see the effective guts of the helpers without having to bounce around cpuid.c. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/cpuid.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 0526f25a7c80..d7390ade1c29 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -175,6 +175,20 @@ static struct kvm_cpuid_entry2 *cpuid_entry2_find(struct kvm_vcpu *vcpu, return NULL; } +struct kvm_cpuid_entry2 *kvm_find_cpuid_entry_index(struct kvm_vcpu *vcpu, + u32 function, u32 index) +{ + return cpuid_entry2_find(vcpu, function, index); +} +EXPORT_SYMBOL_GPL(kvm_find_cpuid_entry_index); + +struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu, + u32 function) +{ + return cpuid_entry2_find(vcpu, function, KVM_CPUID_INDEX_NOT_SIGNIFICANT); +} +EXPORT_SYMBOL_GPL(kvm_find_cpuid_entry); + static int kvm_check_cpuid(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; @@ -1511,20 +1525,6 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid, return r; } -struct kvm_cpuid_entry2 *kvm_find_cpuid_entry_index(struct kvm_vcpu *vcpu, - u32 function, u32 index) -{ - return cpuid_entry2_find(vcpu, function, index); -} -EXPORT_SYMBOL_GPL(kvm_find_cpuid_entry_index); - -struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu, - u32 function) -{ - return cpuid_entry2_find(vcpu, function, KVM_CPUID_INDEX_NOT_SIGNIFICANT); -} -EXPORT_SYMBOL_GPL(kvm_find_cpuid_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 requested. AMD CPUID semantics -- 2.45.0.215.g3402c0e53f-goog