Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp320650lqg; Thu, 11 Apr 2024 04:15:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQwb6S3PhL5nqXOmsu4YFpnmg+DyEvFyNGPQJUAdZ86T9uMBuoHOL2a9wfUpXZ2dQ58l+dL018wAqshCKylf9PYK0+LxqkXDAlqWHupQ== X-Google-Smtp-Source: AGHT+IGHTwHvmcIAfjD316vFftJ6vX+/UByKe9AAXSOo072h+ueYNl3E69MK2Z2QgDlZseqP3lqJ X-Received: by 2002:a05:6358:6e8e:b0:186:16ef:444 with SMTP id q14-20020a0563586e8e00b0018616ef0444mr5994429rwm.17.1712834107826; Thu, 11 Apr 2024 04:15:07 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s9-20020a63e809000000b005f3ffb190fdsi1063743pgh.557.2024.04.11.04.15.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 04:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W2H4cyVc; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-140322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 75D29282F56 for ; Thu, 11 Apr 2024 11:15:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CAF91487C3; Thu, 11 Apr 2024 11:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="W2H4cyVc" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20C671474BA; Thu, 11 Apr 2024 11:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.10 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834096; cv=fail; b=TqrLy3G881wnmidPAXs6gx3tpt3GbZ1Ee4jle6kJlNcum9avrrq2377UySzgCfTF5qWvUvz7xYZzP58/3ASZsz7YrjN1Adx8U39lbdvSDO77OGJTOsquovPy9cu7GmAYR7RxA2m70x2yPqnnW2P99EJSiNTfGnhQUbb9nt0Ef10= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712834096; c=relaxed/simple; bh=5SYU2lPlxme330IzEHo24yOwv0zZDpj9yPhSy9h4I34=; h=Date:From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=Gz9CDwF3Y8WI9N/kvsNGvVvKRBYdk4JvS7f2tNpPiEnt6xuTfh7J/5iSrnt7vVUyaCay1wfbf/bimGwRyUCbSzCb5YWkMHrm+4XzJZ4YkattpQodTTzkMYEh9NeMu2UkrVg1X4Gfc0WV5bQdgCmtMiE1q1fFMSTSjqdbNVHDKKY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=W2H4cyVc; arc=fail smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712834095; x=1744370095; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=5SYU2lPlxme330IzEHo24yOwv0zZDpj9yPhSy9h4I34=; b=W2H4cyVcBFoTi3I5ipVgQOAwmUySSGj3rJ/IJpKJdNp6y6SlMoBgGyd5 Pnll0UpjYG44sIBOllL4Ywh+zEHg9B01RNcaNdtPnGEstQ+r2rt/2Wudo lOWBDLLzypIQDWq5I7lmbZolBcSw2yP9N+h1FXrhCzW3qBw+vsfsMuIGg 5rcHwUAJvY4uqx09ZXaZLuFqpdeMBgmZMrboy14MVuYMBB8/x7dRv79Kf 2OHpti7CHD6cF/T+IbnAviM2qWnj0jqflzXwMoFke2izR3SknC566XhqU XX8RglANXjrymjcq/kX55yQ+WO7WyAlLCJAiqEMkRb3aDmPFxyAnbkdio A==; X-CSE-ConnectionGUID: 4L+m6Ld1RN6eGBhA1cNh0A== X-CSE-MsgGUID: +0GCMQd9Rc2odu5chsqliQ== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="19628234" X-IronPort-AV: E=Sophos;i="6.07,193,1708416000"; d="scan'208";a="19628234" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 04:14:54 -0700 X-CSE-ConnectionGUID: Tqq97iAqStih+LmkcaLLxQ== X-CSE-MsgGUID: MyyTExhLTjeTVhnnYm/Olw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,193,1708416000"; d="scan'208";a="58289714" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 11 Apr 2024 04:14:53 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 11 Apr 2024 04:14:53 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 11 Apr 2024 04:14:52 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 11 Apr 2024 04:14:52 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 11 Apr 2024 04:14:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PoDepLymW+17uNuV6HW4SDbmhqv0wWwcuxZIrJ1dKVeztal0DC44mdXe4+3hWsMzYH4o8/v+B+MKnmywcRA+5gJo+RdYd0sbS+/Eqg7USYazmY1CWaLlQxH2xeirsbufUobqJqw81EVmav3wlnrYiHQNuRh2PhWS6FOrelHKqz2RL9zLSiKmig+pxT/HB55EtECc1NMbmu2ox8gtBgP7zmxS5GBMHsnmOwUOv/Ywa/6+JisdxZBLY+DkzIFlJ2sbiMa68Ud27MJ85ruUQqwbbyNsY7EeEbN+mtCcywz+5YGMvzd3INpwonbU7+wh/3xnOhYpjhhOXoioBleLEt42gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5SYU2lPlxme330IzEHo24yOwv0zZDpj9yPhSy9h4I34=; b=V8v1QJXR7b7CBUeWc2hcyClS4UQFGOcdL13JGlI8ZryksG31yOHZ1Y4WWszqEG59W/gfVwj9TnoRqsHARRaSkyI+hwEYTyOGE4kYaLezkUAqmqZJmGjqj1TbDBlPgUOPZFA2lBgJhuujgpH/gcaZ7AOY21p4WEPuo3o4V/CRPT7EPnw10U6woKjHaPCRzYAhAEbeLFIfroIywYqAelVJREugSD5IouWHXJulYFp80BUmIBES1MwHzmfqD6yt/MsXln4LaJNKURJWkfNg58Rxl9bkKMgko6TuaoSC+4MU4v25RLenTKsGk1GaLeo5EGf9nltoDu0jHNsMVFnYAwsmkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CH3PR11MB8660.namprd11.prod.outlook.com (2603:10b6:610:1ce::13) by SJ0PR11MB4831.namprd11.prod.outlook.com (2603:10b6:a03:2d2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26; Thu, 11 Apr 2024 11:14:50 +0000 Received: from CH3PR11MB8660.namprd11.prod.outlook.com ([fe80::5135:2255:52ba:c64e]) by CH3PR11MB8660.namprd11.prod.outlook.com ([fe80::5135:2255:52ba:c64e%4]) with mapi id 15.20.7452.019; Thu, 11 Apr 2024 11:14:50 +0000 Date: Thu, 11 Apr 2024 19:14:38 +0800 From: Chao Gao To: Andrew Cooper CC: Alexandre Chartre , , , , , , , , , , , , , , , , Subject: Re: [PATCH] KVM: x86: Set BHI_NO in guest when host is not affected by BHI Message-ID: References: <20240411072445.522731-1-alexandre.chartre@oracle.com> <7f1faa48-6252-4409-aefc-2ed2f38fb1c3@citrix.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SG2PR02CA0134.apcprd02.prod.outlook.com (2603:1096:4:188::14) To CH3PR11MB8660.namprd11.prod.outlook.com (2603:10b6:610:1ce::13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR11MB8660:EE_|SJ0PR11MB4831:EE_ X-MS-Office365-Filtering-Correlation-Id: b0a33589-6438-4bc9-5574-08dc5a189ad7 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X4fFuAw01jnQ1lKl3jOX1KUAbshvxPmivEQaRJd6HoQ7gVyUO81R92lE9OA59Ox1fSVhCVyFpsZIWOFohVq52271+QN4aaNqwaX4lsZSyl6wXjRn7A+oHwO+F+4lFbyYglOr9mD8ZK7QV4a5pXkvkNdkmHvJmnwBcKJt0SE8xRtnL+b3GbqpPGu2bgXhAJ/IMkVV7+GbxXoaC0J799cHUUmHMIRrItWNF7C8ndGH7NO1Ra9UtszxS6V0uQennhdw3bKoU2wm/IxuPu3GJGthU+vzMCXEetIqyMkm8bbdNyC5r/TdvY3FSPLGYPWsHSohONzJIZFLM15xcvEx/EwWV86iDDjKlYNIRUZBNdOCcoZZrzGSW7zBRXESHL7joaygWiJz2IgxddGwuPzJBF4KjwI5FM2CvNKS3hSD0jySvLxPItVbI88BSux3Ofx+SGwiJIHd1+ii1pxt0quHm7+ACdUPVGVcVGzns5K5mAk3n9BOWMkiKJ9K1WUmDSSgzgjw+8KjTvJQl2tNacVtU0nghrqI3dck5mxtIBGbKmjkYUvHS1ha4iH9G8LgkbczUDsRTV38a2wBrEbyBX6f20TBwuSMKl8zRDZH8Dt0baJGLy2DoSDyhHdT+pkTK3RT6taCfk3NWRR84/qaZ7S1Io17rjXEIq9caALJqHqcDwHhUZ4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR11MB8660.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nwhO6nD2CLPrnPSqHgjjwPqdEqMufP68NChFvx0DmFssattNYl7YqWRiewwJ?= =?us-ascii?Q?DeFgZtRWAfNn7Uqd90XQF/SHQqhiV4Q655KzIQz7/Wq+VYXESX9vnbpWRvyt?= =?us-ascii?Q?ZVcNzyL/EqEjvJplFkWIEKBqCw1/lN4D8HDcf4Y3DfS58nd2+eMGb29eohPE?= =?us-ascii?Q?727DjiD5GZVI61GZwtVttA/H/MpsRFSc1+hvZD9Bgja2iV9h9n4kkOB+IUVO?= =?us-ascii?Q?D0LbDf0fLvIAXdcDLVgmYhWinu48r+aK10SgckB1yyGBHxmfuFOGqS8wb9Q7?= =?us-ascii?Q?IIGQUfW3CKNVsfosBV9ksG8qBnxZEe3U5+ddoYbTR0QJh65zCh72UpFdZ6NQ?= =?us-ascii?Q?NStseqKRKqrVm3yfyrAY9/P0IKsJc10m+k0Pii3JqZL65nudtGtzkPUcFwui?= =?us-ascii?Q?S8Fob/wa1dXIeNT6F2TNiCL4WzOsjkKzcmdXCIZopNh6J5v6aFOgbmDTOwT1?= =?us-ascii?Q?xKaOF+akTe0r5XLUI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?= =?us-ascii?Q?s9ywbM9htPT+IiLljKFA5CCptbWPx6K2bZxAlcxQzAweCtgwu6VhGE6eWsvC?= =?us-ascii?Q?9qvsoeRJhEZQoVZHsDP0V7ABYRjDHqrHMC+kE75Pqq2oiqgv27lBireBlgkb?= =?us-ascii?Q?kwzIL/9vMjjdewneR47mlAVUHmSsSGvDDm5PWcsgpGi4Q3+QyJhaRGHp3xQU?= =?us-ascii?Q?l4Y3m/Lvzdg6Ru/G7WLehPggepP+jD9/TaVug68r?= X-MS-Exchange-CrossTenant-Network-Message-Id: b0a33589-6438-4bc9-5574-08dc5a189ad7 X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB8660.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2024 11:14:50.4289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jQpbx0vee8TPZ5kxtp2Y3JEIat+PdXGYsYp5v+1XOUzbqtXrNj3VKC4oE2AKC0uUDWE5I8tMmhSgcskTLlQw9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4831 X-OriginatorOrg: intel.com >> The problem is that we can end up with a guest running extra BHI >> mitigations >> while this is not needed. Could we inform the guest that eIBRS is not >> available >> on the system so a Linux guest doesn't run with extra BHI mitigations? > >Well, that's why Intel specified some MSRs at 0x5000xxxx. Yes. But note that there is a subtle difference. Those MSRs are used for guest to communicate in-used software mitigations to the host. Such information is stable across migration. Here we need the host to communicate that eIBRS isn't available to the guest. this isn't stable as the guest may be migrated from a host without eIBRS to one with it. > >Except I don't know anyone currently interested in implementing them, >and I'm still not sure if they work correctly for some of the more >complicated migration cases. Looks you have the same opinion on the Intel-defined virtual MSRs as Sean. If we all agree the issue here and the effectivenss problem of the short BHB-clearing sequence need to be resolved and don't think the Intel-defined virtual MSRs can handle all cases correctly, we have to define a better interface through community collaboration as Sean suggested.