From mboxrd@z Thu Jan 1 00:00:00 1970 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 660F3C04FFF for ; Thu, 18 Apr 2024 10:44:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.708206.1106865 (Exim 4.92) (envelope-from ) id 1rxPFm-0007dZ-55; Thu, 18 Apr 2024 10:44:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 708206.1106865; Thu, 18 Apr 2024 10:44:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rxPFm-0007dS-2U; Thu, 18 Apr 2024 10:44:30 +0000 Received: by outflank-mailman (input) for mailman id 708206; Thu, 18 Apr 2024 10:44:29 +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 1rxPFk-0007dM-Uy for xen-devel@lists.xenproject.org; Thu, 18 Apr 2024 10:44:28 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a1205026-fd70-11ee-b909-491648fe20b8; Thu, 18 Apr 2024 12:44:27 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-418dc00a31aso4910425e9.0 for ; Thu, 18 Apr 2024 03:44:27 -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 e2-20020adfc842000000b00346cc85c821sm1508135wrh.89.2024.04.18.03.44.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 03:44:27 -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" X-Inumbo-ID: a1205026-fd70-11ee-b909-491648fe20b8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1713437067; x=1714041867; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WyTMC05f8zIiysE3K7QC8zs3oYC74Bt+N2EiLX734UE=; b=WLIADQ9a4LvAoKYgAm8OEyDpzHlyBMnV/bYiIxD+OC3yPgdVS2M6wZMYsTnug1B5q8 DNkAX0jJpnGlA1akOgsnegzHrgS4LdkTJbYnJebhrP0jBopiOTUCkSUJ+EB+oj2kV9d8 VYAGmZUgvax0dWp+rrBgjAxu72nCfKSETviXSnVHcQr4BKJHm2+9qlm3tgqy9RjopDcU 6OeqfF1nfaAQ0436QzZ3FxxQXDrkgWgWOyw9X4vQm130j9FJxAFrxgBaqlA9aCkqHinl wuQjDsx6BzQkmCtBJMkUYFPKWJ9Rno9DW/MwZN7DrcjZ6X29C6ERCFukxsF2h2GuB4a2 M/vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713437067; x=1714041867; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WyTMC05f8zIiysE3K7QC8zs3oYC74Bt+N2EiLX734UE=; b=RUdZvM/HSm8RWioKKe0aoz2pAjj3+v/GiKJghp0qpRC9uo+bofN9BKPSxFCLFHu7ZX wsUh1lPL68zGxH/5FX6rPupV99Du/e5kAu+Zgzq5fhT/GNHCbsF+O1U4FihuWCk1AikD kozrSwjsISuoKE1NBDinsL03X3nvCihLySu+/hLKA0nzKu4yuuIoVrKTh7STXcLhct9c P4bC+b3Oh39ws0JlbPY1UqT1aeV8aqOmIcBve+fCtrEJ/8obB3CLWT8U/2hyR5QHTSMm 8+/ZwuT/RRmsU8mhXw3jelxmh7M1UI8cYkaBKKf0HsMY1TPujorasKKse574yPmWnnic KPaw== X-Forwarded-Encrypted: i=1; AJvYcCWbxcOmmEizgCSLti7+uO7/9QRl8ELLVwezilg0UOmnQYS9az3JVSUz0K0AR3zitiLwoRHfpu1GJqMSFs2+GcUt1E9ly7SbsR13jbDW8yw= X-Gm-Message-State: AOJu0Yx5Kxpdu1/nnvh7XhyJoqiI6SuQDQLzqPl62ekcsXIk8609vCDE L/9Y1EyvwOZsSTrmFAZynt1+1bHT9A59g0sVbl78Yysf2r+BIZFxOTFLYAPT1Q== X-Google-Smtp-Source: AGHT+IGQ7Xyqwg5jmRj54XHXG0RKOP25un7IysIq/xeFBvWgfTEhLaBrzar70uHu2hD3Lxy/YLF+zQ== X-Received: by 2002:a05:600c:3d9b:b0:418:a620:15a1 with SMTP id bi27-20020a05600c3d9b00b00418a62015a1mr1754121wmb.30.1713437067246; Thu, 18 Apr 2024 03:44:27 -0700 (PDT) Message-ID: Date: Thu, 18 Apr 2024 12:44:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/spec: fix reporting of BHB clearing usage from guest entry points Content-Language: en-US To: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org References: <20240415141737.88236-1-roger.pau@citrix.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6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I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20240415141737.88236-1-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15.04.2024 16:17, Roger Pau Monne wrote: > --- a/xen/arch/x86/spec_ctrl.c > +++ b/xen/arch/x86/spec_ctrl.c > @@ -643,7 +643,7 @@ static void __init print_details(enum ind_thunk thunk) > opt_eager_fpu ? " EAGER_FPU" : "", > opt_verw_hvm ? " VERW" : "", > boot_cpu_has(X86_FEATURE_IBPB_ENTRY_HVM) ? " IBPB-entry" : "", > - cpu_has_bhb_seq ? " BHB-entry" : ""); > + opt_bhb_entry_hvm ? " BHB-entry" : ""); > > #endif > #ifdef CONFIG_PV > @@ -658,7 +658,7 @@ static void __init print_details(enum ind_thunk thunk) > opt_eager_fpu ? " EAGER_FPU" : "", > opt_verw_pv ? " VERW" : "", > boot_cpu_has(X86_FEATURE_IBPB_ENTRY_PV) ? " IBPB-entry" : "", > - cpu_has_bhb_seq ? " BHB-entry" : ""); > + opt_bhb_entry_pv ? " BHB-entry" : ""); > > printk(" XPTI (64-bit PV only): Dom0 %s, DomU %s (with%s PCID)\n", > opt_xpti_hwdom ? "enabled" : "disabled", For one the surrounding if() conditions need similar adjustment. But then I wonder whether the further uses of cpu_has_bhb_seq don't need switching, too (when determining whether to force X86_SPEC_NO_LFENCE_ENTRY_*). At which point the question is why cpu_has_bhb_seq exists in the first place: It in particular does not affect the default calculation of opt_bhb_entry_*, afaics. Jan