Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp665118lqm; Wed, 1 May 2024 11:45:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGYOocIwQoHilw01uYPaCQbPwjjnYR0A7dFmtb/gake8HU4zOHPTmOtkJYJ3vtF9AT2nXlm05P8Sd9FRFfIr/WtCsj/NK/B40UulANUg== X-Google-Smtp-Source: AGHT+IH2X37xwopbtOtc/F8hK50JPSG3iK9vupi8csVKW0rwT3onaBxMHYCjJcMUMr7/aNo3qwBR X-Received: by 2002:a05:6214:e85:b0:6a0:919e:5822 with SMTP id hf5-20020a0562140e8500b006a0919e5822mr1092269qvb.28.1714589139902; Wed, 01 May 2024 11:45:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714589139; cv=pass; d=google.com; s=arc-20160816; b=Wj8bE8PLfsgwsgxLQDbUDEUodQrQhBGV7SKCK1QJADgieW15so6VlDbxJpGcJVQmoK YbqrD7STDHZ46tscTBNhnNsFAMjWWC9A689gUx3KqAAzMtgZ0tY7TA36b0W+D4M2m4Lo B08wHcLQ6RjSATfEvTLvqvYW/zNgPHIObInBwJEX0eDxlmJCRUmjvz86ePhFP/XkN1at YnyDzfR0iQd6hciBC35w54A63xX0CqesO8Cqjc/ImXrMIEQYh6UMdliQ09rjH9xnrUL3 g5HXgnzxP7+/eN5U/wKMj4SOvfdwwssq6T7j03XNKnHSQOQjyeySBIrsXjq5fnHSPFoP 1I8w== 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 :dkim-signature; bh=4bH1nuvxEqAgawnP6q/iapzLLCUAYNh0OeHBy6uBTGA=; fh=CbvfTPO7iaw/usPyHA//0PDyIxpn/kYICSbU/yLcZEw=; b=gtSDdy8L34JflOOsn4/QEcs6p1X7Awfh0bUhyRaRASGl8bADRdaA0tysk+hCK1xM4c nLfr2ULMmhs3C5mGXtIthXqYKuJa2jGxYd8o3Rb08NV1AA772mA+VtQFUR8tJVAQv0aj WDEgyWpevEcOJtBtoXWMLXSQVPl31sCM99xflhWqWJXhw5xBjrz+JLPZSsgcYe16aVys 2Ewe9SnCq6s37fDV/AlYAHJgzSiXJiKOTpFBe94bRTGmMnKAnSECZ4VHZJt0W3HLS+kH QJiX2meJVX0fGewqMwgm9pCbuDuuO50elOBpjUZNbzboIhuruHMd1Md7JtYUk++zrwkE 5A1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SbceQ6NH; 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-165691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165691-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 a8-20020ad45c48000000b006a0d6c1b798si6138205qva.363.2024.05.01.11.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 11:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165691-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=SbceQ6NH; 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-165691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165691-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 87F201C20B22 for ; Wed, 1 May 2024 18:45:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 481DA1607BD; Wed, 1 May 2024 18:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SbceQ6NH" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 2CF7E13956C for ; Wed, 1 May 2024 18:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714589130; cv=none; b=WaF31H50LoF3fZBjcTKxBRIogKW3wwBAH1L8sSoCV60a8QDTNc5B4RcyxYfY2y97/G2AGBoVi2rfhPedNYzoPPRDRmUPVrKCnjXUEIpkcC+UaWgQJ5howbaAzRTLB97N7ABCdHFU6yy/jeL5T6efKAihezKDFSP3+UV/H6ehCi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714589130; c=relaxed/simple; bh=CKht8bznP+UrF9kl+MNPOitTbYsC3SPRd8wkazD2v9c=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I0mq4xgmfkjc5RSvz1ex5Jjo+Q2z1c0+JOSbQ0JeWp0vq3brG//e0sJ1yEB1qagK0s45k4akG7C3xcOgM0WYrB7UF75SjvGQb3JcbLge5SbbqCQTQE6A/MWm8JCJQa3eiECdpFCStGck6pyFztW8D13FcJtoV0bM8lqKYxeQZ0M= 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=SbceQ6NH; arc=none smtp.client-ip=209.85.128.201 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-yw1-f201.google.com with SMTP id 00721157ae682-61b028ae5easo136678897b3.3 for ; Wed, 01 May 2024 11:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714589128; x=1715193928; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=4bH1nuvxEqAgawnP6q/iapzLLCUAYNh0OeHBy6uBTGA=; b=SbceQ6NHANLsrGwRCT5ojuOB5bJgEpMDWI2gQFCk+sD3rpANkACXDBuwvHaNMTbIB9 EVrlZNPxp4i/2B3WWjKHQrpvKF3Qnxb6JhYr0nfq8dbTvNNA4/DGPpcx4cQvRd1kr7Rf fxFzCZREULBmglqMj0H7qamkelvJe9SweONXL9EjixL11hR+pEHLENvVnvYGgJaOQlLy iCtaQqRdNvt4k/8oE25t2ENwfCu12kPTlinA/50Q413k8azsJcw/5S+Xm4yY5anUSDCT 1zLD/cpiCYM7H9pMl4dy+Q1wuc43ZmURxk1QsvblVGHRADys1P5laIXpXHBXgSmKyevS 3A0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714589128; x=1715193928; h=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=4bH1nuvxEqAgawnP6q/iapzLLCUAYNh0OeHBy6uBTGA=; b=RiP1oNJkDHo5cgFP9Cm2dVkwlycsy7nQvyYEXexeF3CVPQ7/5/SBycYdatEwinHZ8L XkxEHfAC1FKjnM77JT3pY8mQB0J75RKlDDIJ0xT93uskAdgszJdbalIeAaUSyvvqKgYf jZt0f8nFdyX98LpEFdlwkQLqFe0tgBigHUlbdb/EqM/Bd0XcEqAHSJZUEW96p+/xROrz vY/MlCPsTAcFhJ8d8Q2wWST5X0laxV+QLDgzHPr3XqowDybtdRG1Z0HJkqKAUa1GBnVq UWA4J2YFoPhMkOC434L6dMeH8c0LyMtCX9zG/rqqm4CC+aBC4X70ob2/pNlVLzbXvT4Y DZNA== X-Forwarded-Encrypted: i=1; AJvYcCXgplbsCX7mcv0Z30OLmeK7gkqL+1pF/zteki754LT9t/UigEDd1eN1PwUsDxq/Gk4KU41/m92IOSRQsRWA+J9r57W/2PZLzuj79Xpi X-Gm-Message-State: AOJu0YyrwWm7gwiBteGUdEY2yv40A8o6JUVixEE+CTq7JTJzp024PGX4 Yqo+UpgFlfutHTrqGkmifRNRZ/DPMR0x5mw09Cy08KBa9yIhZTYhgrQmym2rqvPinDrr5mT90Bx YsQ== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:18d2:b0:de4:c54c:6754 with SMTP id ck18-20020a05690218d200b00de4c54c6754mr1067004ybb.3.1714589128223; Wed, 01 May 2024 11:45:28 -0700 (PDT) Date: Wed, 1 May 2024 11:45:26 -0700 In-Reply-To: <20240219074733.122080-5-weijiang.yang@intel.com> 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-5-weijiang.yang@intel.com> Message-ID: Subject: Re: [PATCH v10 04/27] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set From: Sean Christopherson To: Yang Weijiang Cc: pbonzini@redhat.com, dave.hansen@intel.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, chao.gao@intel.com, rick.p.edgecombe@intel.com, mlevitsk@redhat.com, john.allen@amd.com Content-Type: text/plain; charset="us-ascii" On Sun, Feb 18, 2024, Yang Weijiang wrote: > Define a new XFEATURE_MASK_KERNEL_DYNAMIC mask to specify the features I still don't understand why this is being called DYNAMIC. CET_SS isn't dynamic, as KVM is _always_ allowed to save/restore CET_SS, i.e. whether or not KVM can expose CET_SS to a guest is a static, boot-time decision. Whether or not a guest XSS actually enables CET_SS is "dynamic", but that's true of literally every xfeature in XCR0 and XSS. XFEATURE_MASK_XTILE_DATA is labeled as dynamic because userspace has to explicitly request that XTILE_DATA be enabled, and thus whether or not KVM is allowed to expose XTILE_DATA to the guest is a dynamic, runtime decision. So IMO, the umbrella macro should be XFEATURE_MASK_KERNEL_GUEST_ONLY.