[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/4] xen/arm: Add sb instruction support
- To: Julien Grall <julien@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 13 Jun 2022 09:21:35 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=HSP+kWOvCT2oPppvmrxVsk7nj8Q3bIMzMKru9D1AXAU=; b=IiNUn1WLnkuL7arK36EkfhQou3g2Z6sbS5Y9gTXTVqWxhBG5s126Qw/uv+JTs1v6Z8LueL6GrnVTyfXWYSm4lt2cUw4OL/Hpt/mQa4i/yY9MUbH8gsb/+nrbYFib7HyLAtxZIj8c9MBi7wk5qsqarhyy61E+Bjgi8XSNeRikFSmdj+NaLYVp6Fu+g753jAkuZH9aI1Wjy74cmDtxJHcHYzNOusy1gCEsHhI0Moz7Z6VUDA8rH7zuaeHShkGFFdyZIVMPio2Yubw3DCNq0e55qn5p7WE6ElQ1eDgoRucfzGFY6t4a2Ozv36JFzJd5ZZ3PEMgYaJqcBK5LDYEbJ9zhqQ==
- 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=HSP+kWOvCT2oPppvmrxVsk7nj8Q3bIMzMKru9D1AXAU=; b=AJ+uPkXxM/s7czpzwOu60bmKRqghpNn+5YS8ECe5GsKnTS8MhPv9e7sj11NrCyAKnhJerLb8oLdb21ii5QzPIi4+JBu0TEVUDjz/+Aumg3dpc3NRgn/iY6QPpn1BOgvsfjK6xRuo0ToS9jvkHTCujVgHFqRXn5DKDFRLL1tfOWLCCx5jaXbLx93K4HPEupfEpo7d4NZMvaaHgQdsjOy11UpyumzEffofEUE8Y10iax53VIUIjcST30VZRwv11Wi81roy6JBdLUPsszmNnAQC6nudDGPsU2cAMekaLXRbLJ3z/XNGfJLvrfcgYk8Mm/AYGxmvqQrNUuEGIrbyomoLdQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=U6Nn1Kh72CbT3ihVGJKs+OE0bLsQwInt8jlJu8BCud2uGmkJnHJN/E8xv4KzKfnxFfo4VRaFMYIJb4pBV+XlQQ14MNCquSJYm+0ioaktkCOdu1RofmeqVzuQySQFgbGwxARvw0yUmD0W0V7Gpk8YENDlGq4lf276yD26xAv8kXEWMKOgs31uHyG4kqzXISBgZW/UJXPZeKUrAH71R/MEAgoYu0nnc11ZaoLmdzvb4Q1I+LWzyZUUQwvdwIUExb33Tz8jpCrp2lqCmNNAoFC5WrDqo9hgFKl3SfosFown+oTykw3OoqeYOJNzgIHbXw1zQMhDdZ9xHNLyLWzGR5ygbQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bUEJt2STraIB/UD/OsElEcfYfng6/lDuZ/RuZdABkdDkwCWLoqwGUiDY9+JvqSYm8hSW9kwRfy2aHImKcGzhoteT8X2x386bFlacGsLyOaMJctSf2zYgCaH/ZPlFBpNh0pYKvDfjLj8X1ZfMv1Tq/LuiJrhQJ9Ep4HafYNLV7YpVSh1qBL0Y5DXasS61/ir2KNkylAz1WWF7LS9YxS02rGmiFvkJg/epQH+VB0pvlfbpzv5lca9wnJthpzj6ivf++oYzzDESqwrcDl7+7gtucLPYGdfmSFQvYZLvwAreNmMCQXrGiSUjwBYGZX5kXjB+xmTAO3Y6++E0hpayKf+SNw==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 13 Jun 2022 09:21:58 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYdNtJOQ4Z/Aud7ESpo3y4E38gSK1JA+qAgAQgUgA=
- Thread-topic: [PATCH v2 2/4] xen/arm: Add sb instruction support
Hi Julien,
> On 10 Jun 2022, at 19:20, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Bertrand,
>
> On 31/05/2022 11:43, Bertrand Marquis wrote:
>> diff --git a/xen/arch/arm/include/asm/cpufeature.h
>> b/xen/arch/arm/include/asm/cpufeature.h
>> index f7368766c0..9649a7afee 100644
>> --- a/xen/arch/arm/include/asm/cpufeature.h
>> +++ b/xen/arch/arm/include/asm/cpufeature.h
>> @@ -67,8 +67,9 @@
>> #define ARM_WORKAROUND_BHB_LOOP_24 13
>> #define ARM_WORKAROUND_BHB_LOOP_32 14
>> #define ARM_WORKAROUND_BHB_SMCC_3 15
>> +#define ARM64_HAS_SB 16
>
> The feature is for both 32-bit and 64-bit. So I would prefer if it is called
> ARM_HAS_SB.
Right make sense.
>
>> -#define ARM_NCAPS 16
>> +#define ARM_NCAPS 17
>> #ifndef __ASSEMBLY__
>> @@ -78,6 +79,9 @@
>> extern DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
>> +void check_local_cpu_features(void);
>> +void enable_cpu_features(void);
>> +
>> static inline bool cpus_have_cap(unsigned int num)
>> {
>> if ( num >= ARM_NCAPS )
>> diff --git a/xen/arch/arm/include/asm/macros.h
>> b/xen/arch/arm/include/asm/macros.h
>> index 1aa373760f..33e863d982 100644
>> --- a/xen/arch/arm/include/asm/macros.h
>> +++ b/xen/arch/arm/include/asm/macros.h
>> @@ -5,14 +5,7 @@
>> # error "This file should only be included in assembly file"
>> #endif
>> - /*
>> - * Speculative barrier
>> - * XXX: Add support for the 'sb' instruction
>> - */
>> - .macro sb
>> - dsb nsh
>> - isb
>> - .endm
>
> Looking at the patch bcab2ac84931 "xen/arm64: Place a speculation barrier
> following an ret instruction", the macro was defined before including
> <asm/arm*/macros.h> so 'sb' could be used in macros defined by the headers.
>
> I can't remember whether I chose the order because I had a failure on some
> compilers. However, I couldn't find anything in the assembler documentation
> suggesting that a macro A could use B before it is used.
>
> So I would rather avoid to move the macro if there are no strong argument for
> it.
Sure I will put it back where it was.
Cheers
Bertrand
|