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

Re: [PATCH 1/3] x86: allow Kconfig control over psABI level


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jul 2023 15:35:00 +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=RzwQTFjZ57qzFp07BpNhwxBISUTlC0GUMABmg8ADWpw=; b=F+U8ClBTF2tckBpKQ9h9ZAiLHJ5Wfk14qWHuUEVacHq68SuQlUC0pcEGk5i2vU7uUsw3SOZ+k34mTxVqckaR3UDub/imjlQPCX0Ya7ayOyd3TfcZH6sw/Ky4iM5FPzsgq/FgKrpMrinv1xFFlSfJhMVfB++pGHg6jnVHch28+AP1Oa3DqQFDwr8N3uCxgJdsAYbAM2J7tFoMIBWAGA41rH9kJk9VDjioUqhOhisgvxyV2n9z5P68ItSKt7oym2P8S+Do5v4vvyiU81H0nACBz3W6nYurYWLuP6xQ4Clf2nPZO3SWRO3nwJhzVcGBTdWIFotcaozmu0J5GbtScYT+CQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G1pacMSTvMgMte4W+JS7eBFFO0ozcvCD8c0BzYO1BXk8D/kHP1XGMgUeLZrscfHv4Y80n0Y7P7shTrt77BWQEUYsRlsD8oCAuvZWPaUSb0+q4nx/KtaZML2zRgvXRl5Y7N2sgcYzoDbnauRCFjRHL5lEAKjqu4lG/DV6RI/U66zLht5kLC2g/kUi8UcHb6A84WVkLFCQeGzaaDjQw2FAKhDNKwfVyzekWAk1Or5JyG6Bw+5UsScQ+t5/Uw7iRP6/4i2EKe18kUnSHUjAQJ787dFnH49kHNxw4fVHpyKPfHeqA+R/B4fxkxjd7Ije6jlpHSwHqavG3/SMguTKx3D0pg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 17 Jul 2023 13:35:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.07.2023 14:23, Jason Andryuk wrote:
> On Wed, Jul 12, 2023 at 8:34 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>
>> Newer hardware offers more efficient and/or flexible and/or capable
>> instructions, some of which we can make good use of in the hypervisor
>> as well. Allow a basic way (no alternatives patching) of enabling their
>> use. Of course this means that hypervisors thus built won't work
>> anymore on older, less capable hardware.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>

Thanks.

> With two comments.
> 
>> ---
>> TBD: Should we, just like for NX, add an early check in assembly code,
>>      to have a "clean" failure rather than a random crash?
> 
> That is less confusing than a random crash.

Of course. My thinking behind not doing this right away was that people
aren't supposed to use such a hypervisor on incapable hardware. So we
would likely add code for something which ought to never happen. Still
for v2 I guess I'll add such code (then of course invalidating your R-b
again); in the worst case it should be easy to rip out again from the
patch.

>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -118,6 +118,36 @@ config HVM
>>
>>           If unsure, say Y.
>>
>> +choice
>> +       prompt "base psABI level"
>> +       default X86_64_BASELINE
>> +       help
>> +         The psABI defines 4 levels of ISA extension sets as a coarse 
>> granular
>> +         way of identifying advanced functionality that would be uniformly
>> +         available in respectively newer hardware.  While v4 is not really 
>> of
>> +         interest for Xen, the others can be selected here, making the
>> +         resulting Xen no longer work on older hardware.  This option won't
>> +         have any effect if the toolchain doesn't support the distinction.
>> +
>> +         If unsure, stick to the default.
>> +
>> +config X86_64_BASELINE
>> +       bool "baseline"
>> +
>> +config X86_64_V2
>> +       bool "v2"
>> +       help
>> +         This enables POPCNT and CX16, besides other extensions which are of
>> +         no interest here.
>> +
>> +config X86_64_V3
>> +       bool "v3"
>> +       help
>> +         This enables BMI, BMI2, LZCNT, and MOVBE, besides other extensions
>> +         which are of no interest here.
> 
> Would it make sense to try and specify models?  According to this:
> https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
> 
> x86-64-v2
> (circa 2009: Nehalem and Jaguar)
> Atom Silvermont (2013)
> VIA Nano and Eden "C" (2015)
> 
> x86-64-v3
> (circa 2015: Haswell and Excavator)
> Atom Gracemont (2021)

I'm not sure how useful this would be without supplying a reasonably
complete list of models. I don't think we can expect people to be aware
of the sequence of model names, without which specifying just the first
respective models isn't very useful.

Jan



 


Rackspace

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