Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp735741rdb; Thu, 30 Nov 2023 17:54:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGACncg9BdonwU+37XEPgjc9miPN0vyz4toCBmDTZjKFe4WR6VLXsNAqOTSMHgfDOLlj0h0 X-Received: by 2002:a17:90b:1b01:b0:285:9d5f:b7c9 with SMTP id nu1-20020a17090b1b0100b002859d5fb7c9mr20251655pjb.23.1701395677518; Thu, 30 Nov 2023 17:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701395677; cv=none; d=google.com; s=arc-20160816; b=Du4y39IdoAoZ20McFH4sF9O11yNpvvzZFJFhs228y/KNzFhblHH1XnImVcoNYaRJGY fpwCb/3F6sHBZdpyzVHRhXh9YAvgY8/sMNiaXvyM8brrr4bWZ55wAldfok7m9b4M6PuM 5M+lr/7b/wOElW1hF0NaxG2guXypjwwVcdafavT6WlXoO/N0zvet54iO51NMm5kxQ6NB zP3vU7Orm7vR4/IR8IsfUK6VzvXQwxIvo0HZ+bB9gNJoLRtAdL8YWId/zrscdsRBsELx iUb+EHapo3oynSrbg24gc1e5HJM22Dq64AJ1VsNO3dOJhJdOfLcW1yixBbtn0o04Te66 h+oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=PKWMAIjcAS8BeI7d93Q2buqUeQzLcxL2KToIl+B67YY=; fh=CbbM7MoeNEaAgjM4oThWEnvBxdtTQ0CP1hXrmmXfwTY=; b=md1wgzbvKQnymTkB1xoeDYCmQHTvfjgWzsTghCVKur7gvA4vrFRpwKMSU8iI1Sbb+k ZinJThazsgXnm/DhEky8ptwH+ZZ85oO4wEnSBmuiBBdrKdh/Id9kJXqVjcsueY/gF38X v+kuHp1KeWfr4DZvOr6fMoIre0x9YIAOGH15PClMsCq2fdfwibIuHsirBOF9DjDQ4c5C HNuOjhHjl1B81oHnelyludBZX37PSuHyKPFEQWzW+816dEh53MmhIzJ53boLEL0q7oJu Z96SYs/oH6yK/iug/kaTpw/2xqtkATk0D+fJ/HX6K5ewUCOlxzgMOnYxxanE+PonbENV DO6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="q/tfciZT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lj12-20020a17090b344c00b0028659d5fb6bsi219437pjb.143.2023.11.30.17.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 17:54:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="q/tfciZT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2815080BBC42; Thu, 30 Nov 2023 17:54:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbjLABy0 (ORCPT + 99 others); Thu, 30 Nov 2023 20:54:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjLAByZ (ORCPT ); Thu, 30 Nov 2023 20:54:25 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE32F2 for ; Thu, 30 Nov 2023 17:54:32 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-6cdf75604d7so791228b3a.1 for ; Thu, 30 Nov 2023 17:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701395671; x=1702000471; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=PKWMAIjcAS8BeI7d93Q2buqUeQzLcxL2KToIl+B67YY=; b=q/tfciZTHghwtQGUrzY9MTa1sD0lbKskkEVZRrTsrMkl+ZJX7awZrhHHgmIENLumUz hLN9Mv+u8xhAlZhPOHivK4uBrBY8cqIyVrcLV+1EPP66YnPBy8zdAmFEbZcfvi2gLE5N d72JySHtLfpQLfAFXa3T9RnUEz3/472AixJyjH3hFWoUTfkk6DbSfmCvKtmykNOGotgq vW/OGcoFOTRIN6AqURqvEkbWswVZuK3cbX16PsfbveklJP0X7o7s0MqpaYlN+26nZdAj KbJM84m9Fhe5C19IX38jWWaaPrP9dJh8+rHYdUZitg9jvVtPcKcuUffBlzrTHQB7cWH7 H/KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701395671; x=1702000471; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PKWMAIjcAS8BeI7d93Q2buqUeQzLcxL2KToIl+B67YY=; b=X+WnfcET1BsvStQYadRKC2hzoGj+q1eRFAA26SggjThSW9nDA2tGr4uGN4hR6y+CFY /ZKvtn8DM0NvuYaXSTSpr+P+/KqpJ7a51CrGgMlK9eWHZGy0CKdf7+MxXD1e95XCQ6Hk DUifTvXmF3S33dG0ue/9bBu8IwY+F9BXP6797/OevlVBy7xpUHx3tuye3TPevO5rWZ16 8V5xbUju6D2AuSZmGPw2e7wvcNKEQG2cFTHyZbh/eoNt+yXealGSCgfdevNbTghNewDp A6WIIXFi8QURmGNW78eqHFgj6QJhn+kMXx6x88jk5JOpSt9pYZZI8UrlOSYlwniPkzb8 ytAA== X-Gm-Message-State: AOJu0YzDLiuK9+WoyA0bNs/YfvAP1voGhRtEW8h1uEVOURFPKTou++La lOVFFTRov6T/dg75ipq4bcuuQ0s3HJg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2d29:b0:6cd:f18e:17d with SMTP id fa41-20020a056a002d2900b006cdf18e017dmr382231pfb.1.1701395671646; Thu, 30 Nov 2023 17:54:31 -0800 (PST) Date: Thu, 30 Nov 2023 17:52:10 -0800 In-Reply-To: <20231024001636.890236-1-jmattson@google.com> Mime-Version: 1.0 References: <20231024001636.890236-1-jmattson@google.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Message-ID: <170137622057.658898.161602473001495929.b4-ty@google.com> Subject: Re: [PATCH 1/2] KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace From: Sean Christopherson To: Sean Christopherson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "'Paolo Bonzini '" , Jim Mattson Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 17:54:36 -0800 (PST) On Mon, 23 Oct 2023 17:16:35 -0700, Jim Mattson wrote: > The low five bits {INTEL_PSFD, IPRED_CTRL, RRSBA_CTRL, DDPD_U, BHI_CTRL} > advertise the availability of specific bits in IA32_SPEC_CTRL. Since KVM > dynamically determines the legal IA32_SPEC_CTRL bits for the underlying > hardware, the hard work has already been done. Just let userspace know > that a guest can use these IA32_SPEC_CTRL bits. > > The sixth bit (MCDT_NO) states that the processor does not exhibit MXCSR > Configuration Dependent Timing (MCDT) behavior. This is an inherent > property of the physical processor that is inherited by the virtual > CPU. Pass that information on to userspace. > > [...] Applied to kvm-x86 misc, with macros to make Jim queasy (but they really do guard against copy+paste errors). [1/2] KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace https://github.com/kvm-x86/linux/commit/eefe5e668209 [2/2] KVM: x86: Use a switch statement and macros in __feature_translate() https://github.com/kvm-x86/linux/commit/80c883db87d9 -- https://github.com/kvm-x86/linux/tree/next