[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intended behavior/usage of SSBD setting


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 20 Oct 2022 15:25:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=j4huBr3a8iPd0vXhBJDxD2ZXF+mKTdG4nq3yNO8j/UU=; b=fLEqqUlLnQ6KNRiYCXxQN147Fg1zBs9MagdwRv9JhYWABhbJX5xxhFk21EJy8ia4KlYVouYeouY327ohgyjcyDrFXkFxyhTMmy+vYJ+31lTy5SeIdaOY+/oo2lOQmgL/aHG5jHFiSA+SAQjz+EMjsP21l7fT3XauBke6z0OID2pBVKx4npUYBnu/5H4RKOG+r9fy1fxmSVFgNr1SSdPeeK5lncwzgYS/ud4Lg+DT9S9Wlmx2Mo4NYkZzda9rKk3kt5MBkma1tx18DW0k0ET0DFeCGUe1wIJpUxRMSR9zYeok30u/6+1iiq6XmmRztEma7MmybD2Jiny6PzUYX+WFgQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n0yEG32n9cRGUV7w8sAdet4lpkKWEH2SylJWjSUXGrmOeh2na359vTJdPE688QX+9J2Wue2VzBuGgdDkIcrbQNwzSci4CsVNMUMQrvxsg+4q6ZxdyMJ78Elq+GcSG+U/Z+E3Fd5SOgHn2JI1j0wLfndVQMaCQZ7jYU2mP1pxH3zbiGZRn3OyAiXGyMb7vA5zQWRD0BJQ6bi6TF4yGjRjlbub5/nsFQRqlOIrNaOVwc35iCKkakNCFTBNHbePjSp0QbOrYKVDy71bTZG1jzbzdfOPrRNijAbPTwCtkYFekLb3C8BXA0pkzfET0+37aXj5vy/MlF3KxCheu60enuqI+g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 20 Oct 2022 13:25:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.10.2022 14:37, Roger Pau Monné wrote:
> On Thu, Oct 20, 2022 at 01:22:20PM +0200, Jan Beulich wrote:
>> On 20.10.2022 13:01, Roger Pau Monné wrote:
>>> Hello,
>>>
>>> As part of some follow up improvements to my VIRT_SPEC_CTRL series we
>>> have been discussing what the usage of SSBD should be for the
>>> hypervisor itself.  There's currently a `spec-ctrl=ssbd` option [0],
>>> that has an out of date description, as now SSBD is always offered to
>>> guests on AMD hardware, either using SPEC_CTRL or VIRT_SPEC_CTRL.
>>>
>>> It has been pointed out by Andrew that toggling SSBD on AMD using
>>> VIRT_SPEC_CTRL or the non-architectural way (MSR_AMD64_LS_CFG) can
>>> have a high impact on performance, and hence switching it on every
>>> guest <-> hypervisor context switch is likely a very high
>>> performance penalty.
>>>
>>> It's been suggested that it could be more appropriate to run Xen with
>>> the guest SSBD selection on those systems, however that clashes with
>>> the current intent of the `spec-ctrl=ssbd` option.
>>>
>>> I hope I have captured the expressed opinions correctly in the text
>>> above.
>>>
>>> I see two ways to solve this:
>>>
>>>  * Keep the current logic for switching SSBD on guest <-> hypervisor
>>>    context switch, but only use it if `spec-ctrl=ssbd` is set on the
>>>    command line.
>>>
>>>  * Remove the logic for switching SSBD on guest <-> hypervisor context
>>>    switch, ignore setting of `spec-ctrl=ssbd` on those systems and run
>>>    hypervisor code with the guest selection of SSBD.
>>
>> * Give the guest the illusion of controlling the behavior, but run with
>>   SSBD always enabled when "spec-ctrl=ssbd" is in effect.
> 
> Right, I've also thought about this option but forgot to add it to the
> list. That would limit to only allowing enabling ssbd for the
> hypervisor code, but not explicitly disabling it, ie:
> `spec-ctrl=no-ssbd` won't be a valid option.

Well, it would be valid to use to override an earlier "spec-ctrl=ssbd",
to revert back to whatever the behavior is when no option is specified
at all. It wouldn't strictly mean "no SSBD at all".

>> * Give the guest the illusion of controlling the behavior when
>>   "spec-ctrl=ssbd" is in effect, running with the OR of guest and host
>>   settings (switched, if necessary, as vCPU-s are context-switched).
> 
> Right, this could somehow reduce the number of toggling, but would
> still require having code to handle guest <-> hypervisor context
> switches.

Why? When we're running with the OR of both values, there's no need to
switch when exiting or entering guest context. The only time an
adjustment would be needed is when the guest setting changes (because
of the guest altering the setting, or when switching vCPU-s); obviously
never when the host setting is "on".

Actually I now think that the two points I added actually describe the
same mode, just by somewhat different wording.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.