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

Re: [PATCH for-4.17 v4 2/2] amd: remove VIRT_SC_MSR_HVM synthetic feature


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Tue, 15 Nov 2022 23:54:07 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=f89u73OvTwvTvcI1Ez66c6lS5QgQuggKCFI6/Nh4TrU=; b=mqaj5bYZeVjcFzzo5N/YarVfvjwfY6h7Zso4F/oi2lFN+QMTsQ9mvJk45Hooy+msz79theiUrWuB0QWFP8pb6+9X3lG+o9Fy6kt42pKCSnZkFO5lQoA2Eu/0lQ8YI1vjA+9r/taJmmRGEUnv5q4BNhVKGYQbE3OTTgRVgn6JiAv0e7H/GHf8FLHbUKv06VLaFDC9xsf/j4fIJdQney87MPs45+jm/NjEF3c1wpAW7WdF/hWU02f+Jtj4ivjzL8c7/paNt4mduWJAEb/e5rylDLG4WzkF4Hz0YNdzcJFVR9Y3YLnSoLyjSK5mjm4Q+UNVC+qmQUZRWNpOlN8hxQ4pFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R7E0rd+qmoQOVCC1srx5183XbLc+hZ4iaY5R/GJ+NnMB8Q2RzFmQaWgVHbV0I8Tf5sxDzLuHzQXT1A5BNtZ0qeaaw1buRO+dAQf0uXNhyLVlUvftzN75yjQpxG11POp4we551pMnGGKb2QOey3YaZzmRr88x3UbEQCDcUANR3ycTA6+gexDmffXYUNsiC7doFa+3CEO0VF4i4XTB9Kiq7WKkAkIGUEJffBLvUYuaQJnAcFJRIF/u5Lt/xUR9aB0rovP4bI0Z8MtvtXYAsVmV7dfoUUWvxvfBl22laDIBJ0k7fIfBTo27T7h4bHZSWZuLtoyt6D8/J0Ycze1SAMuUPg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "Henry.Wang@xxxxxxx" <Henry.Wang@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 15 Nov 2022 23:54:31 +0000
  • Ironport-data: A9a23:FTmhwK7CekOVVkCZJwEQ5QxRtAbGchMFZxGqfqrLsTDasY5as4F+v mMZXT/SPP6KMTT3e4xybY6y9R9QuJGHmoAwSVY4ryFjHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraBYnoqLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+4pwehBtC5gZkPKkS4QeF/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m0 eQXdRwKaR26qqG22bmqdMtGvsAjBZy+VG8fkikIITDxK98DGMqGaYOaoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OkUooj+GF3Nn9I7RmQe18mEqCq 32A1GP+GhwAb/SUyCaf82LqjejK9c/+cNJJRePlpqU26LGV7kw4Mh8GUAa2m+njkF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T7krJ9R7GkmjJl+WiR94WMNSBItLAwcQ 93PK7n+5nL11WLwQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHY+PYG7JqnYiwdr0usZ0w09l5ina5AKpoAgAAGqQCAAHfpgA==
  • Thread-topic: [PATCH for-4.17 v4 2/2] amd: remove VIRT_SC_MSR_HVM synthetic feature

On 15/11/2022 16:44, Jan Beulich wrote:
> On 15.11.2022 17:21, Andrew Cooper wrote:
>> On 15/11/2022 13:26, Roger Pau Monne wrote:
>>> Since the VIRT_SPEC_CTRL.SSBD selection is no longer context switched
>>> on vm{entry,exit} there's no need to use a synthetic feature bit for
>>> it anymore.
>>>
>>> Remove the bit and instead use a global variable.
>>>
>>> No functional change intended.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>
>> This is definitely not appropriate for 4.17, but it's a performance
>> regression in general, hence my firm and repeated objection to this
>> style of patch.
>>
>> General synthetic bits have existed for several decades longer than
>> alternatives.  It has never ever been a rule, or even a recommendation,
>> to aggressively purge the non-alternative bits, because it's a provably
>> bad thing to do.
> There we are again - you state something as bad without really saying
> why it is bad.

You may not agree with the reasoning, but you are lying to yourself, if
no-one else, by claiming that no justification was presented.


> My view is that synthetic bits were wrong to introduce
> when they don't stand a chance of being used in an alternative.

Your view is incompatible with a linear interpretation of history, as
has been pointed repeatedly before by the fact that 1/3 of Xen's
synthetic features full predate the introduction of alternatives.

"I don't like using synthetic bits in this way" is a point of view, but
is not something that counters technical reasoning about the tradeoff in
question.

>
> I agree though that there's no strong need for this to make 4.17. It
> may end up making backports slightly easier, as no such bit existed
> in 4.16.

*This* is a good justification to take the change.

Equally, Roger's subsequent observation that it can actually live in
__initdata.

>> You are attempting a micro-optimisation, that won't produce any
>> improvement at all in centuries, while...
>>
>>> diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
>>> index a332087604..9e3b9094d3 100644
>>> --- a/xen/arch/x86/cpu/amd.c
>>> +++ b/xen/arch/x86/cpu/amd.c
>>> @@ -49,6 +49,7 @@ boolean_param("allow_unsafe", opt_allow_unsafe);
>>>  /* Signal whether the ACPI C1E quirk is required. */
>>>  bool __read_mostly amd_acpi_c1e_quirk;
>>>  bool __ro_after_init amd_legacy_ssbd;
>>> +bool __ro_after_init amd_virt_spec_ctrl;
>> ... actually expending .rodata with something 8 times less efficiently
>> packed, and ...
> ... as long as you're talking of just a single CPU. The break-even is
> at 8 CPUs (8 bits used either way).

And still irrelevant when the size of the per-cpu data area doesn't
change for several centuries in the argued case.

> I think we need to settle on at least halfway firm rules on when to use
> synthetic feature bits and when to use plain global booleans. Without
> that the tastes of the three of us are going to collide again every once
> in a while.

Its very easy.  All other things being equal, synthetic features are the
most efficient option.

In most cases, things aren't all equal, and literally any
technically-credible justification will do.


If a tradeoff doesn't plausibly work within a decade, then it's probably
a waste of time raising, and definitely not a point to legitimately
object with.  Especially as in the past, I've already given you an
alternative course of action where the synthetic features aren't per-cpu...

~Andrew

 


Rackspace

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