Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31811632rwd; Fri, 7 Jul 2023 04:59:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlG73A31RcnTgTGHrvwEwAOT8Z50xjr8l31bNfZQWthYr3NBsO7cuJkwlHr0ELCcyq6mW8aS X-Received: by 2002:a17:903:2310:b0:1b8:af5e:853c with SMTP id d16-20020a170903231000b001b8af5e853cmr7971859plh.26.1688731178693; Fri, 07 Jul 2023 04:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688731178; cv=none; d=google.com; s=arc-20160816; b=wMVKNPUCF9RqbfGrJ+dbQeNtr4Ma+w/1wOD/oXbRBodNZ0egTUcJyj5sO9QPabOzuH IWA12AJtOKYiaK6HBX6b5rxJeqqX0oEiuU9DfsSyyad6u371hteeahwBnqG9ymugBagQ bSTxS8jOnJKzFYlQcZauY522qkcgu4ViqCDEb0D6DX0CSbWDNRm/mk//Q0Uavi3oe1aQ KEA5XSbYh/Z1id/Z7v0sFeAzP5Au7VbcU+0rIfdpd8MD8VI+6yeb8BLsIIsi251SYglk zRdQkj53qpqk3W3/xpddt/3ym2at5H0hVuOW9Srtu70NsDiB9o8TVoH/mWdn6rWIhG1e JPYA== 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=r4V2ufLUCNsoI97ffmWSoc6qtnrBHBX8sx3vLJWt3JA=; fh=Fun9p3fpJZbWxEvv+49Fvco6V2LY1wdwvhIhfizsvJ4=; b=dn8cKD4e9s+17Sbtyc4iy3Dtc4gHP9Q8RPu9saufxIyUlFchaBIUtSunBhTUuyyEvK 0JM4RPGWDlXSHh6mj3yJKYYC9hJ8jgG9BmLuLJ92kBST4fC6MeESzDm4Voc9oq4h5bwv YKvpJGsRxQkcj7KiPbkyf4cBlVRy/nZuS2GBEkhoj+pcE6reSbpTAfPHRZl8c1gQH98t QMwIG6QBeet/trSgCYDQiPa1Goy1D3nTSJtG4MAGiM+QIc/IIFbSjwB9PNLqx4gTUBAF BUMAOBLebFjhGUUWsidmC8xsE93i6FHtnfSzkdNmBHkti2zlMF6h7hmLIRnrul62SeYh T3tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=GB83ByNC; 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 bi10-20020a170902bf0a00b001b55070e154si3452766plb.96.2023.07.07.04.59.25; Fri, 07 Jul 2023 04:59:38 -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=GB83ByNC; 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 S232033AbjGGLl3 (ORCPT + 99 others); Fri, 7 Jul 2023 07:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbjGGLl2 (ORCPT ); Fri, 7 Jul 2023 07:41:28 -0400 Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10D19171D; Fri, 7 Jul 2023 04:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1688730087; x=1720266087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r4V2ufLUCNsoI97ffmWSoc6qtnrBHBX8sx3vLJWt3JA=; b=GB83ByNCMyP5NdmRVx7WBD1l+HhFavzivCwKE3g3aogx0iHvzktwQTu8 MYXzBPNl5NOV3sp8rr89+tDNPEfxN9cplbdmvPrM8Pq1M8zZWhyZe2gj3 CG6zxpLbXyIBKCMPvjYtyvlbrABgS2vdZ1r80e6ajLwhOzXxPzA7tfG8B 0=; X-IronPort-AV: E=Sophos;i="6.01,187,1684800000"; d="scan'208";a="570858371" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-a893d89c.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2023 11:41:24 +0000 Received: from EX19MTAUWA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2b-m6i4x-a893d89c.us-west-2.amazon.com (Postfix) with ESMTPS id 10D9C40D4E; Fri, 7 Jul 2023 11:41:23 +0000 (UTC) Received: from EX19D002ANA003.ant.amazon.com (10.37.240.141) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 7 Jul 2023 11:41:22 +0000 Received: from b0f1d8753182.ant.amazon.com (10.95.106.196) 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; Fri, 7 Jul 2023 11:41:17 +0000 From: Takahiro Itazuri To: Sean Christopherson , Eric Northup , Eric Northup , Jon Cargille , Paolo Bonzini , Jim Mattson CC: , , , Takahiro Itazuri , Takahiro Itazuri Subject: Re: [PATCH 1/1] KVM: pass through CPUID(0x80000006) Date: Fri, 7 Jul 2023 12:41:07 +0100 Message-ID: <20230707114107.73019-1-itazur@amazon.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20200415023726.GD12547@linux.intel.com> References: <20200415023726.GD12547@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.95.106.196] X-ClientProxiedBy: EX19D044UWA001.ant.amazon.com (10.13.139.100) To EX19D002ANA003.ant.amazon.com (10.37.240.141) X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=ham 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 Please forgive me if this is an absurd question. Date: Tue, 14 Apr 2020 19:37:26 -0700 From: Sean Christopherson > Return the host's L2 cache and TLB information for CPUID.0x80000006 > instead of zeroing out the entry as part of KVM_GET_SUPPORTED_CPUID. > This allows a userspace VMM to feed KVM_GET_SUPPORTED_CPUID's output > directly into KVM_SET_CPUID2 (without breaking the guest). I noticed that CPUID 0x80000005 also returns cache information (L1 Cache and TLB Information) when looking at AMD APM, while it is marked reserved on Intel SDM. What do you think about passing through CPUID 0x80000005 to guests? To be honest, I'm not sure if it is harmless from security and performance perspectives in the first place. Regard security aspect, I'm a bit concerned that it could help malicious guests to know something to allow cache side channel attacks. However, CPUID 0x80000006 has already passed through L2 Cache and TLB and L3 Cache Information. If passing through CPUID 0x80000006 is really fine, I'm guessing it is the case with CPUID 0x80000005 as well. In terms of performance, as far as I know, some softwares utilizes cache information to achieve better performance. To simply put, by letting guests know cache information, they may gain some benefits. Having said that, if I understand correctly, guests can be scheduled on CPUs that do not belong to the same group of CPUs that they run last time, unless guests are pinned to a specific set of host physical CPUs. In such cases, guests may not benefit from using cache information. If I'm missing something or say something wrong, I'd appreciate it if you could correct me. If it sounds no problem, I'd like to send a patch for it. Best regards, Takahiro Itazuri