Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp241715rwp; Wed, 12 Jul 2023 12:31:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlElJSO9ka/OdYmAsAHi3CxszENY7jtBGuvItBL+nQ9vwrgV0HuaJ60uMeHtHFbzWd8YI+my X-Received: by 2002:a17:902:da89:b0:1b8:a6be:ea82 with SMTP id j9-20020a170902da8900b001b8a6beea82mr3911546plx.26.1689190317697; Wed, 12 Jul 2023 12:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689190317; cv=none; d=google.com; s=arc-20160816; b=aF+WIk8PdonuluuugPUSJHG0E14J+6yO8LzYuWAvBV0yb4ilChKaspozR0H8fErMsP zr4c7qZR23n5SsjzPd7BYyeAoR1CVaR7J/GR86tV698pkdy2HzpU6k9CF6sVQKA1WKcm 2kC3I4aM9HYQJs/QFbos2ggFQRDW2w71sWVE9xgus7lJVnEqAfLAxZhrnNU5ws8XVIxg LXNYv4zPbPqjfNMjObxN6uoKs3KclT0fsY3cUP0Cj498gHjtAGDqcRB19j6SykB4m1WI mxjW7e2Us9gRSA9xGpFWfAKnllzPvKRKPFhDf2Rmv3J9897IWwsNJb3GY7PY8RMK7LoR QKiQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=NUM+SsTWU9wvHoPzLXfvOsVyQM5ZYPYAOL7pyHpyzkM=; fh=pMpK2taBDm9u7dWvZYNcc2zA+pSPurs4zZ9d//CB5ds=; b=xzlCFMpl3L622PaxIh5P/iPPmnPzySqxZZzJqEXcGi9WfexVw15ObKjafstYH1/6Ga 1TTXRGYAcqDoQL/lTjlGoTrVA5Pzdd7HHFozFdRLhRFqAM/4FtcoKLDTsnsC4UeinE+H NppbKJ70tCAyBh/TP8zF4/MjN/VJuw0ca8WBNp93yivrpD2+2hLki2Vr1xQf3PPBfmWM bCXouqlP+udlzWU0mZ0Vvx0gVWD5v6G/r3hswspyl3x1UUue1guZcbOB9jiPv9RJTcEm 2Lc+M+tKdf339CKHIG+uipysWXWQDxmdX3GmKWrx+FsF+HUyWgq9Gc644C2froobrkgy Y6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=NqvxwxwU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020a170902ec8d00b001b973681493si3965393plg.16.2023.07.12.12.31.45; Wed, 12 Jul 2023 12:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=NqvxwxwU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233002AbjGLScE (ORCPT + 99 others); Wed, 12 Jul 2023 14:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232948AbjGLSb4 (ORCPT ); Wed, 12 Jul 2023 14:31:56 -0400 Received: from smtp-fw-52004.amazon.com (smtp-fw-52004.amazon.com [52.119.213.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05827DC; Wed, 12 Jul 2023 11:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1689186715; x=1720722715; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NUM+SsTWU9wvHoPzLXfvOsVyQM5ZYPYAOL7pyHpyzkM=; b=NqvxwxwUkq6h6SY59/00ZVcvTXfK0G6ZUHrVhoTaClKEWhWtmjO0hrNj eVX8lmFhSzzl0urPd+frxxxUxlQXiJiA1iz/85fE/eQaZwuidJ1pOp4w2 HLWZZxcPTFbK2uTy6jV8ly7qnoYWo287Am+PGV5Y2dg6t3XEm8BKEM4VS c=; X-IronPort-AV: E=Sophos;i="6.01,200,1684800000"; d="scan'208";a="142361311" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-bbc6e425.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-52004.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 18:31:53 +0000 Received: from EX19MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-m6i4x-bbc6e425.us-east-1.amazon.com (Postfix) with ESMTPS id 423CB806BF; Wed, 12 Jul 2023 18:31:52 +0000 (UTC) Received: from EX19D002ANA003.ant.amazon.com (10.37.240.141) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 12 Jul 2023 18:31:51 +0000 Received: from b0f1d8753182.ant.amazon.com (10.106.83.21) by EX19D002ANA003.ant.amazon.com (10.37.240.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 12 Jul 2023 18:31:47 +0000 From: Takahiro Itazuri To: Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H . Peter Anvin" , , CC: Takahiro Itazuri , Takahiro Itazuri Subject: [PATCH] KVM: pass through CPUID 0x80000005 Date: Wed, 12 Jul 2023 19:31:36 +0100 Message-ID: <20230712183136.85561-1-itazur@amazon.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.106.83.21] X-ClientProxiedBy: EX19D033UWA002.ant.amazon.com (10.13.139.10) To EX19D002ANA003.ant.amazon.com (10.37.240.141) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass CPUID 0x80000005 (L1 cache and TLB info). CPUID 0x80000006 (L2 cache and TLB and L3 cache info) has been returned since commit 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)"). Enumerating both 0x80000005 and 0x80000006 with KVM_GET_SUPPORTED_CPUID would be better than reporting either, and 0x80000005 could be helpful for VMM to pass it to KVM_SET_CPUID{,2} for the same reason with 0x80000006.. Signed-off-by: Takahiro Itazuri --- Discussion was made a bit on https://lore.kernel.org/all/20230712170258.75355-1-itazur@amazon.com/. If there is any reason that leaf 0x80000005 should not be enumerated or dropping leaf 0x80000006 is preferred, please feel free to share your thoughts. --- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 0c9660a07b23..54a5b256c484 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -1152,6 +1152,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) cpuid_entry_override(entry, CPUID_8000_0001_EDX); cpuid_entry_override(entry, CPUID_8000_0001_ECX); break; + case 0x80000005: + /* Pass host L1 cache and TLB info. */ + break; case 0x80000006: /* Drop reserved bits, pass host L2 cache and TLB info. */ entry->edx &= ~GENMASK(17, 16); -- 2.38.0