Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp424886lqo; Thu, 16 May 2024 09:58:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVqZa7INObTwtIlIloXOYp+yOo49NIyPjCsmn6xSZfPk0KMM/CDgdbSWpSfP5wNIQoR0yvEqnz3phWFyKxmLlLjPoOdCDiSwv0G7pJ9g== X-Google-Smtp-Source: AGHT+IFJl+lYma0lUR7J9HqrG3lGHDhJPlZcMf2jM6gaP9NA6GCHyzuBZ0dMzzPWLbvd0vw1+Y9K X-Received: by 2002:a17:903:283:b0:1e3:e081:e7f5 with SMTP id d9443c01a7336-1ef4404bf29mr211356845ad.66.1715878729727; Thu, 16 May 2024 09:58:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715878729; cv=pass; d=google.com; s=arc-20160816; b=lTy3AJLTCIBLc7qwwHzB++/K3wC/vyHJ50SqJJye+FYprTD2RlNtj8UEBju1yLQo8O pAXdv+uW1UBc55nmVwCQEBzm0OldvlPMe50hCfhX0VrKxSPEEb6Co7R9ipssDcBPUdef iZHW9dMrcYf4ooCnYTHaSdwn6F0CT7sIxMKqfHcSEe7cJkB3zn1/YhALi7hD/Tbdtcdx xsszpCpJyZuThQ2R4Fz8ILW+EabREcyGqUUirqq1j7CXKmyD7Z6KYvUZXvy+Mv1s/jCO Z5iug1KHBCj7YxM4Mi0+HGmigHKKxWuUA0SPVFlPHfwxECeAANTpAnJ8/SnZhX8seOcq TtzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=VYOU9HPjB76w/RXd8VAXD/28+sXZKX4A/bOVr9SyK1c=; fh=DLeKCkvb6LKhrHY6Bh8+/yRZFV5XmONiFpygw7ZYv6Y=; b=q41jbqZDT6jQqUT6QbKjMzKexB8uf2SFiyYin7o/qFgXzqSANYjmOpWbQXBkEJibCd RpQLzFJpH4P3qKZZ7gCnsfAxdIYMPHGnQL93wf8rJ3D1ls8x7rfTSQOE4kAKNoLM1uww G0MwPmR3KhjEf5xwQbDPpVaB65AgCfVNxYmufXt/ztR35a2Ya+K6KQW0ZXUFRlRYvNj8 epAMBKmdJ6IU33zIP/rUxsGjvNJcaFzkUIgjpO/8YhoR+Nlz/3UNYT+9s2KRwqoIOwha CVuaUL3RKWtrS2DZy70fxzXOYpVBSqkZHCtrlIgLtIfnNzq3EAkdv2Uw9r7FAzn9Isq4 3YjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pWeD82FN; 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-181346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bad6198si152371635ad.164.2024.05.16.09.58.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 09:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pWeD82FN; 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-181346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181346-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AF3C6284F6C for ; Thu, 16 May 2024 16:58:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B897214A4E5; Thu, 16 May 2024 16:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pWeD82FN" Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.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 AABE14A3D for ; Thu, 16 May 2024 16:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715878720; cv=none; b=MeyjagNnFq+FCfOMz5dhW2lhclXYHfV+OL4BqJDHDiDT3inlHUDbcsbYakmq7sKh04TXgQqe5QhvE/iII23HxX0wc6Kp68YGzTZvTo1QiTa9dZxXib8zFvcV+ZtHbLCFW6vVT0sEMvj5Pe9zR782Vi4Vot6kLjJy4IjMrvpdsL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715878720; c=relaxed/simple; bh=fU/c6HrGJfHpZI7B1NOeoFi3w5X1FCUEXZajmkpmbl8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=G9lN/BVqMrjSuzMehcD/soq5dk4vPS7dYTUDSPrZgvxt6iEr821LNiHbk1CbSvZpYWPUkRDltWnYj9Mw/5yZXuJ40F7xwsRsgaIHpuyn6d36EiQ+F3vqxnycrr3Qcj1uVp1WKL2MM+L3zkoyJgCXq3KZk0C/LnxeflK59tWUMTI= 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=pWeD82FN; arc=none smtp.client-ip=209.85.215.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-pg1-f202.google.com with SMTP id 41be03b00d2f7-658b03ebe58so1168495a12.3 for ; Thu, 16 May 2024 09:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715878719; x=1716483519; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=VYOU9HPjB76w/RXd8VAXD/28+sXZKX4A/bOVr9SyK1c=; b=pWeD82FN1lLaqosaNPMDybaqG3D36e9YC5ZNK24iw3HYWOKid5WPPrbUj+ctIUbDQV avDIUwEEFTHaRS9FS5PPx7u6pRG86trON9ClTl7BQQYCj85bskavOKMKNyR4hJqd3gYz kIfk/WTdPwNJqd+aaHZu5+eRxMfq31Srh9T7/UGAl3wf9wx2qZFLCbH/CFp6FD6lEV3q yM9UjkJ98eEnJ37o7N+Q19b8qfoGgrLfdKTtaWKu0nYbdKVddxx/T/LPMw8QPUOD8XSn Gzhslbh7P3d5em1kY2tbk7Ap1lu5084tJ2nEYG7GlyR4fTphZzdrDu62EskKQfW7BpJK C8zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715878719; x=1716483519; h=content-transfer-encoding:cc: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=VYOU9HPjB76w/RXd8VAXD/28+sXZKX4A/bOVr9SyK1c=; b=sVgfcdN2qC5ckbXHyMzX3MrAQPk4EtaRX2HkjBS2QhExOKfNrMPNjgYadROHtNZB14 XkJNdxxKWZtYLm7lO1d0iXuRLcL3PXn5ioU2Tu4U6CMusqFX/i97tCOwPsdkSQ+4Umx4 D2BgoLiTD3JbFLeRnXbIRgN1O2q275KDZ0MSX6iYKeA8QNROflYGZycWhhmojdaAwbj/ TNvmd0rKsFD0/AG/rIdgxUhWTNPbQrb3qZvW9k5QenxSceU5hTtijpv8O8NOXk42D2fr zTYpjfiGI8KAgMSd0UZB2VjsmcaIeL4L2tYXAbqKaoL7FuQoA6gxJj26xS18cYihCzYY D/kQ== X-Forwarded-Encrypted: i=1; AJvYcCVHYrDSBiiVN0lfVk9kmzqEHgX2xxFfCRKtJxy7ZhPgDhYNtXk2Ih4W+1LtEjuAtR7OVEOP6cykyBF4p6cAyHM79+s1+GABshoUJb9e X-Gm-Message-State: AOJu0Yx1uJic+2EKbpAPQLNWDGzLp7F7cqilaAcHttVQA2A0VqcQKH5Y QKsCsruUCGcZpTObxi+ssZUABQKMHwAWMRVzwt7SFYGGvu63Xl0XDMg13lJNv549JPauDksAsOe 5rA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:b609:0:b0:619:f921:b6e0 with SMTP id 41be03b00d2f7-6373d2172afmr46520a12.5.1715878718905; Thu, 16 May 2024 09:58:38 -0700 (PDT) Date: Thu, 16 May 2024 09:58:37 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240219074733.122080-1-weijiang.yang@intel.com> <20240219074733.122080-25-weijiang.yang@intel.com> <39b95ac6-f163-4461-93f3-eaa653ab1355@intel.com> Message-ID: Subject: Re: [PATCH v10 24/27] KVM: x86: Enable CET virtualization for VMX and advertise to userspace From: Sean Christopherson To: Dave Hansen Cc: Weijiang Yang , rick.p.edgecombe@intel.com, pbonzini@redhat.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, chao.gao@intel.com, mlevitsk@redhat.com, john.allen@amd.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2024, Dave Hansen wrote: > On 5/16/24 07:39, Sean Christopherson wrote: > >> We synced the issue internally, and got conclusion that KVM should hon= or host > >> IBT config. In this case IBT bit in boot_cpu_data should be honored.= =C2=A0 With > >> this policy, it can avoid CPUID confusion to guest side due to host ib= t=3Doff > >> config. > > What was the reasoning? CPUID confusion is a weak justification, e.g. = it's not > > like the guest has visibility into the host kernel, and raw CPUID will = still show > > IBT support in the host. >=20 > I'm basically arguing for the path of least resistance (at least to start= ). >=20 > We should just do what takes the least amount of code for now that > results in mostly sane behavior, then debate about making it perfect late= r. >=20 > In other words, let's say the place we'd *IDEALLY* end up is that guests > can have any random FPU state which is disconnected from the host. But > the reality, for now, is that the host needs to have XFEATURE_CET_USER > set in order to pass it into the guest and that means keeping > X86_FEATURE_SHSTK set. >=20 > If you want guest XFEATURE_CET_USER, you must have host > X86_FEATURE_SHSTK ... for now. Ah, because fpu__init_system_xstate() will clear XFEATURE_CET_USER via the X86_FEATURE_SHSTK connection in xsave_cpuid_features.=20 Please put something to that effect in the changelog. "this literally won'= t work (without more changes)" is very different than us making a largely arbitrar= y decision.