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 EBA04C43458 for ; Mon, 6 Jul 2026 07:07:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1355060.1609855 (Exim 4.92) (envelope-from ) id 1wgdPv-0007jM-4p; Mon, 06 Jul 2026 07:06:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1355060.1609855; Mon, 06 Jul 2026 07:06:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wgdPv-0007jF-2B; Mon, 06 Jul 2026 07:06:59 +0000 Received: by outflank-mailman (input) for mailman id 1355060; Mon, 06 Jul 2026 07:06:58 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wgdPu-0007j9-CT for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 07:06:58 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wgdPs-002EKk-Tv for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:06:56 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4b540c-e002-0a2a0a5209dd-0a2a45029d48-10 for ; Mon, 06 Jul 2026 09:06:56 +0200 Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4b5410-5a27-0a2a45020019-d155dd35f19a-3 for ; Mon, 06 Jul 2026 09:06:56 +0200 Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-475881b9a4bso2265699f8f.3 for ; Mon, 06 Jul 2026 00:06:56 -0700 (PDT) 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-47a9b4d850dsm23116278f8f.0.2026.07.06.00.06.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2026 00:06:55 -0700 (PDT) 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783321616; x=1783926416; darn=lists.xenproject.org; h=content-transfer-encoding:content-type: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 :content-type; bh=ixgw4sga4KdnrbZMauOznZXsvGKJMRN7WaUBDWbAfwY=; b=GI0OBi1jg5xYPpgI7ogz1kjHQSOfKuLH56AwW23jJFAz3Tq8GjK2fewLZgpB19U6nj RBF8XIMnMHYoclevsOkv5M/R29RsMwscrfmNqZQbqfXy6dEKC6oP12MS7yED1ByulxBs gCoGdXJsa48kNFF77s/ivB3OANr6WeexO/dyMpB+Bsq+q/fWnFAJshlgnvc+hgoNIeIi sVfrbnNuSm6fMvwToGc4hEx8gYRKobRwqzhNxUyqYpJtfzDe9lwYQuCoFsZxTUpjpVWK k8AZcGE7zbjKuhEW9Sr5N72Dl2G1ia2oZBbBqHKSaTJHaOt1pVrqfJ/ZMy3NgckvM4hr alYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783321616; x=1783926416; h=content-transfer-encoding:content-type: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:content-type; bh=ixgw4sga4KdnrbZMauOznZXsvGKJMRN7WaUBDWbAfwY=; b=Ml9PXB+5VdHMhbV5u3d6IU4/Jiip5t52gqtJ8qte6q+wMylQXBJ5ntjf7zFIyQSJ9W LIQk0gddjq/oBeu8BmWDUbfvkyGSVkMe7hqujipnfuL4lFp/S0yrTlydev1YrqR/zLIO x/Qzc266FfcOT7IlQvTk8iUptKo/SxY1TGi6OpvtdmMmR67SheIXFQvR5h11jBJyHQiT yRAENgpGM75dQltlmsvBxbLZxoGpLSP+XPQ4jpkhu5SaUWsVCvod6VXO3+hSsp3MWv9r vl5t9tvKsAWH9oTWSyaKuYcO7lKXi5QpPH7i5gnYVkasSP15BKD7+Wca7OkuGc+Wt3nz f54g== X-Forwarded-Encrypted: i=1; AHgh+RrKMrvzMdb81Yxic6ZSLNzxPV0hZuudemGn5wNKQ0JIs8rAgtZRQxtgYxMsZl4Bql9zwAcZBuUvXhw=@lists.xenproject.org X-Gm-Message-State: AOJu0Yykfv/xuysDnrZJGwKivBVEhuev9szgFUUcnNT9PV0KNfFGOYpY Dm4fQzRwxEvHQpbV8Qh3LJ7P+iMrEKjUqWxbnzGseqTz2ZLV0MmH2FSTUWXN5fFl4Q== X-Gm-Gg: AfdE7cn3j/EcTLFOPMwNZvIGdt0w+sIYgsH4qYN+2FDJFxC6JEeZclKBDHhiwKQQALc tZoP0kxwWI30FFF9YZgHWYDQJSA9H1Evi9Kn+VCtiXB5uRgvqHrAuLoMEX8/Zvb/KFXxGkTSNjc iacHxRKDD/2VBLNgcGzdhraC8Qzhw2TNIPW6JLkq8VudmxSxsvNPHlHyyCjl+pCU3RZyj/AkQ19 GejfUOHtXnffS02d4LUpePKK0TON19ZvfJdvTexyQnkhPpEdmaI/VRYOieVxy64o4ox2w8QTxV8 fCDgn9dVcDZ3A8NupQWptKFMTCLLIyVLvEnzZy9oM7YOExMbLuVEJdo3jjbTw3ueh28FOMUicz/ cA8TrmDswWNd8GO+vEAgufx+0gelqAX131wLn/AC5sZ8t22UrcM5LhFmXwyv5Zltm/RvOzUk+7N LY+n6e+lm5fhk06RQ1jHf9A1pnzDvT4ebWaCuVJFai4NPIPpoZsLdKgS00l2qR2l5D2AeWkDCi8 8yi X-Received: by 2002:adf:f004:0:b0:473:6e8d:7f3 with SMTP id ffacd0b85a97d-47aab57d2acmr6745984f8f.1.1783321616053; Mon, 06 Jul 2026 00:06:56 -0700 (PDT) Message-ID: <083d91f7-af98-473c-89d2-363e69248b0b@suse.com> Date: Mon, 6 Jul 2026 09:06:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier To: Teddy Astie Cc: Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Marek Marczykowski , Oleksii Kurochko , "xen-devel@lists.xenproject.org" References: <1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@vates.tech> 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/v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ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@vates.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-720697/1783321616-771127C5-BD4AC79B/0/0 X-purgate-type: clean X-purgate-size: 1749 On 03.07.2026 15:37, Teddy Astie wrote: > Le 03/07/2026 à 08:28, Jan Beulich a écrit : >> --- a/xen/arch/x86/include/asm/cpu-policy.h >> +++ b/xen/arch/x86/include/asm/cpu-policy.h >> @@ -30,4 +30,10 @@ void recalculate_cpuid_policy(struct dom >> */ >> void calculate_raw_cpu_policy(void); >> >> +/* >> + * Collect the host CPU policy. Called after collecting enough CPUID output, >> + * and again after all feature overrides have been put in place. >> + */ >> +void calculate_host_cpu_policy(void); >> + >> #endif /* X86_CPU_POLICY_H */ >> > > That looks quite confusing. > > As I understand it, (ideally) host CPU policy (which I suppose, contains > "non synthetic" cpu featureset) is about the CPUID info that Xen is > allowed to see and rely on, while "synthetic CPU capabilities" is more > about Xen decisions. I'm not sure what the long term plans are here. Likely synthetic bits need to remain separate from the policy, yes. Yet I don't see how synthetic bits matter here - x86_cpu_featureset_to_policy() doesn't consume any of the synthetic parts (those covered by X86_NR_SYNTH and X86_NR_BUG). > If "cpu featureset info" and "host cpu policy" can get out of sync, then > recalculating host cpu policy each time we make a modification of the > cpu featureset sounds like a bad idea, and we probably should try to not > end up in this situation in the first place by not having host CPU > policy and featureset competing on what hardware feature Xen should rely on. Well, that'll require a lot of work, as effectively to avoid this the duplication needs to go away. Hence adjusting the policy when the featureset changes is (imo) the least bad option for the time being. Jan