Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AACFBEA4E3A for ; Mon, 2 Mar 2026 16:12:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1244443.1543887 (Exim 4.92) (envelope-from ) id 1vx5ss-0005W8-EX; Mon, 02 Mar 2026 16:12:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1244443.1543887; Mon, 02 Mar 2026 16:12:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vx5ss-0005W1-Bv; Mon, 02 Mar 2026 16:12:38 +0000 Received: by outflank-mailman (input) for mailman id 1244443; Mon, 02 Mar 2026 16:12:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vx5sr-0005Vs-Ft for xen-devel@lists.xenproject.org; Mon, 02 Mar 2026 16:12:37 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a031208f-1652-11f1-b164-2bf370ae4941; Mon, 02 Mar 2026 17:12:35 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-439af00d33cso1529361f8f.1 for ; Mon, 02 Mar 2026 08:12:35 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439b4d06c27sm9976489f8f.17.2026.03.02.08.12.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2026 08:12:34 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a031208f-1652-11f1-b164-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1772467955; x=1773072755; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=h5tijJDKgCHJT9kT5kp84WZqHGBvYnXwSlos1jRzp5w=; b=JVeb7wsawovWd2G+YnQEvHJcEovdhMdkvgGXSfOlzw+kEu/n5qvAaxWJpPUUXHmSdY gHqFhV3MC/HMDnPg3bChXgSKG5yUvU5tIDbq5kOIg1NPDWnpn4xKAIPYeXrWem8Oies6 8eIVZMwzI+34HsIteoHI2k7P3Ie7y9+F/Vk2blwmiWpYcWcECgeKMuUcPh7JI3comYGB anAUsuFI9n7BIRlvQSPWyHU8q/qqlcObKnA8eDZO9gp5LTmWHrlZI6dkMuOwtKdkGUFb xWk/X7ua+bWRfz+iuR8RRjA/76atmHj9x+nkujB4Xa2Cn+KyO7wMGlJhSJvNa9MLOTQK 9tdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772467955; x=1773072755; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h5tijJDKgCHJT9kT5kp84WZqHGBvYnXwSlos1jRzp5w=; b=AL6Q1YtpZvW+5bnPjakzh8r3jInk7cehQnTmZCIxtfLPFqyBb4C8gx/bffC4tGqC2v /avXwKp+gLvbYCS5N/XE5d7W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:ba75:7db7 with SMTP id ffacd0b85a97d-439ba758121mr5007110f8f.7.1772467955072; Mon, 02 Mar 2026 08:12:35 -0800 (PST) Message-ID: <0dbf14bc-1505-4a33-bbf8-53c1ea41c7da@suse.com> Date: Mon, 2 Mar 2026 17:12:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 08/14] x86/traps: Enable FRED when requested To: Andrew Cooper Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Xen-devel References: <20260227231636.3955109-1-andrew.cooper3@citrix.com> <20260227231636.3955109-9-andrew.cooper3@citrix.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20260227231636.3955109-9-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28.02.2026 00:16, Andrew Cooper wrote: > With the shadow stack and exception handling adjustements in place, we can now > activate FRED when appropriate. Note that opt_fred is still disabled by > default until more infrastructure is in place. > > Introduce init_fred() to set up all the MSRs relevant for FRED. FRED uses > MSR_STAR (entries from Ring3 only), and MSR_FRED_SSP_SL0 aliases MSR_PL0_SSP > when CET-SS is active. Otherwise, they're all new MSRs. > > Also introduce init_fred_tss(). At this juncture we need a TSS set up, even > if it is mostly unused. Reinsert the BUILD_BUG_ON() checking the size of the > TSS against 0x67, this time with a more precise comment. > > With init_fred() existing, load_system_tables() and legacy_syscall_init() > should only be used when setting up IDT delivery. Insert ASSERT()s to this > effect, and adjust the various init functions to make this property true. > > The FRED initialisation path still needs to write to all system table > registers at least once, even if only to invalidate them. Per the > documentation, percpu_early_traps_init() is responsible for switching off the > boot GDT, which also needs doing even in FRED mode. > > Finally, set CR4.FRED in traps_init()/percpu_early_traps_init(). > > Xen can now boot in FRED mode and run a PVH dom0. PV guests still need more > work before they can be run under FRED. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich > [*] PVH Dom0 on an Intel PantherLake CPU. What other part is this remark connected to? > @@ -353,7 +440,11 @@ void __init traps_init(void) > */ > void __init bsp_traps_reinit(void) > { > - load_system_tables(); > + if ( opt_fred ) > + init_fred(); > + else > + load_system_tables(); > + > percpu_traps_init(); > } I see now what you meant in reply to comments on an earlier patch. Jan