From nobody Wed May 15 18:50:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1713190694; cv=none; d=zohomail.com; s=zohoarc; b=SHoD7Ahfu3Pf2qZOyTKnptHmuKfLBkm+DHpU8ZdsiU3ObDCAl+pOpJcEFCVnvze4rCcgEkO2m7AHiu6Ppqi1lIoTpEajZTICnNdPrbVkAt3aucIf0Ly09/+0wqZqqP8yQn2ybStZRtfUBVtFbvFqJGaW97Ig1q2T6Ve9yFT3o50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713190694; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=27tQGw34RL0SwJjgwMX6PjGL+Bogfqv+9M2xZQMRSJU=; b=bYAek84rTTqPpA9YchXZ2Vl+CKm5D8P/EqLTShcat77RWqSzqWXjh9AmamTLvwfICWs0O2sSeQ/0+uyam6cv2nga3T3WcnzKCoqKcZ2CKe4HmlMj4BUCC1MmubT5pPtU7qwqyM75xrqd5GCK7feEA1xYFn99pzLIf5PJMBKCW1U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1713190694202338.0763047930061; Mon, 15 Apr 2024 07:18:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.706293.1103386 (Exim 4.92) (envelope-from ) id 1rwN9b-00029X-Uw; Mon, 15 Apr 2024 14:17:51 +0000 Received: by outflank-mailman (output) from mailman id 706293.1103386; Mon, 15 Apr 2024 14:17:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rwN9b-00029Q-RM; Mon, 15 Apr 2024 14:17:51 +0000 Received: by outflank-mailman (input) for mailman id 706293; Mon, 15 Apr 2024 14:17:50 +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 1rwN9a-00027e-4N for xen-devel@lists.xenproject.org; Mon, 15 Apr 2024 14:17:50 +0000 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [2607:f8b0:4864:20::833]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id efff5675-fb32-11ee-b908-491648fe20b8; Mon, 15 Apr 2024 16:17:49 +0200 (CEST) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4347bcc2b47so14500851cf.3 for ; Mon, 15 Apr 2024 07:17:49 -0700 (PDT) Received: from localhost ([85.31.135.62]) by smtp.gmail.com with ESMTPSA id t7-20020ac87607000000b00435163abba5sm5987974qtq.94.2024.04.15.07.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 07:17:48 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: efff5675-fb32-11ee-b908-491648fe20b8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1713190668; x=1713795468; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=27tQGw34RL0SwJjgwMX6PjGL+Bogfqv+9M2xZQMRSJU=; b=acKU7aR+y/0IrvFYqO4shA2VXEEcVdffe9YWUvnp0sa+L4FCrSRI3c7EO5qf0U2tXv jWZkL1K7dX7jIlqldSdbN4ygod4qhq46PegbTXW1Dfrc6mbxYy3af/sP+82dzRcX0ac5 Y9xZtQ3xVek/zL2QVSHmNcQa2HmGBnvEbQsZc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713190668; x=1713795468; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=27tQGw34RL0SwJjgwMX6PjGL+Bogfqv+9M2xZQMRSJU=; b=IU2rZVJeVgk1feLtcJHdYhTeefo4r+btd/8noSpi/l3BhusPFFFD/tquocKpORio1I 6lityRYKhyrXxEsZBJgPe2aW+AzgEE9mao6V9YtghZksMMR19crdIaUIW87WV2c9VX3A X0Tw6EH6rbMSSJwqoV1OyboGHErIxCRSdPUnwtICUiO0LRDWYUJC3b/j+gBwNYgcYKCq bQAf/2UrEM9wBlc/xft8+G+qXn1KY1Ragef5JZit3JC77A5E9jZdQhPqQfHl/8vhsVe5 2OBghcJB0AU7Bo85TjRsVR/3VxP/uVv6Ip49EDafHmqV/zvw0xN/u8wr0HrqQzeKGZ7x Fl8g== X-Forwarded-Encrypted: i=1; AJvYcCXFqQ/jyQsNk8+endTAvlWmhuiDHARrSyhDkMY6MGIRp2cFls4XRAzbyPtAZHW5Q9ujgCg3vI4RgIH0kJGxKa4m1ftt4As1Z3Sqa1F0RKs= X-Gm-Message-State: AOJu0YxHM+8/Tk7Cjf5Jbvjxsn+wnX7X54BC5xL5FfSJzNPXpcIF2vWN QIeA/iGTk/s2OYjaUO0KcvXkfRjeBVk5RfteaVf5zIV/vCwyQP1E7lT81Ztsykk= X-Google-Smtp-Source: AGHT+IExIkpO8kzAKUopeuw/fxAsXnN6jFxRvMorbLUkIdPcl29k5cz4C35p1tyOdyh7wSmjFnCF3A== X-Received: by 2002:a05:622a:1a81:b0:437:1ec3:3b6c with SMTP id s1-20020a05622a1a8100b004371ec33b6cmr1249107qtc.30.1713190668355; Mon, 15 Apr 2024 07:17:48 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.or, xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH] x86/spec: fix reporting of BHB clearing usage from guest entry points Date: Mon, 15 Apr 2024 16:17:37 +0200 Message-ID: <20240415141737.88236-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1713190694677100001 Reporting whether the BHB clearing on entry is done for the different domai= ns types based on cpu_has_bhb_seq is incorrect, as that variable signals wheth= er there's a BHB clearing sequence selected, but that alone doesn't imply that such sequence is used from the PV and/or HVM entry points. Instead use opt_bhb_entry_{pv,hvm} which do signal whether BHB clearing is performed on entry from PV/HVM. Fixes: 689ad48ce9cf ('x86/spec-ctrl: Wire up the Native-BHI software sequen= ces') Signed-off-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/spec_ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index dd01e30844a1..29f5248d01d1 100644 --- 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" : = ""); =20 #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" : = ""); =20 printk(" XPTI (64-bit PV only): Dom0 %s, DomU %s (with%s PCID)\n", opt_xpti_hwdom ? "enabled" : "disabled", --=20 2.44.0