2022-12-19 23:26:25

by Elliot Berman

[permalink] [raw]
Subject: [PATCH v8 04/28] arm64: smccc: Include alternative-macros.h

Fix build error when CONFIG_ARM64_SVE is selected and
asm/alternative-macros.h wasn't implicitly included by another header.

In file included from arch/arm64/gunyah/gunyah_hypercall.c:6:
arch/arm64/gunyah/gunyah_hypercall.c: In function `gh_hypercall_msgq_send':
./include/linux/arm-smccc.h:387:25: error: expected string literal before `ALTERNATIVE'
387 | #define SMCCC_SVE_CHECK ALTERNATIVE("nop \n", "bl __arm_smccc_sve_check \n", \

Signed-off-by: Elliot Berman <[email protected]>
---
include/linux/arm-smccc.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 220c8c60e021..6a627cdbbdec 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -383,6 +383,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,

/* nVHE hypervisor doesn't have a current thread so needs separate checks */
#if defined(CONFIG_ARM64_SVE) && !defined(__KVM_NVHE_HYPERVISOR__)
+#include <asm/alternative-macros.h>

#define SMCCC_SVE_CHECK ALTERNATIVE("nop \n", "bl __arm_smccc_sve_check \n", \
ARM64_SVE)
--
2.25.1


2023-01-09 21:53:49

by Alex Elder

[permalink] [raw]
Subject: Re: [PATCH v8 04/28] arm64: smccc: Include alternative-macros.h

On 12/19/22 4:58 PM, Elliot Berman wrote:
> Fix build error when CONFIG_ARM64_SVE is selected and
> asm/alternative-macros.h wasn't implicitly included by another header.
>
> In file included from arch/arm64/gunyah/gunyah_hypercall.c:6:
> arch/arm64/gunyah/gunyah_hypercall.c: In function `gh_hypercall_msgq_send':
> ./include/linux/arm-smccc.h:387:25: error: expected string literal before `ALTERNATIVE'
> 387 | #define SMCCC_SVE_CHECK ALTERNATIVE("nop \n", "bl __arm_smccc_sve_check \n", \
>
> Signed-off-by: Elliot Berman <[email protected]>

If this is correct (and I presume it is), I think this patch should
be posted separate from (and before) the rest of the series.

-Alex

> ---
> include/linux/arm-smccc.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> index 220c8c60e021..6a627cdbbdec 100644
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -383,6 +383,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
>
> /* nVHE hypervisor doesn't have a current thread so needs separate checks */
> #if defined(CONFIG_ARM64_SVE) && !defined(__KVM_NVHE_HYPERVISOR__)
> +#include <asm/alternative-macros.h>
>
> #define SMCCC_SVE_CHECK ALTERNATIVE("nop \n", "bl __arm_smccc_sve_check \n", \
> ARM64_SVE)

2023-01-10 23:18:40

by Elliot Berman

[permalink] [raw]
Subject: Re: [PATCH v8 04/28] arm64: smccc: Include alternative-macros.h



On 1/9/2023 1:34 PM, Alex Elder wrote:
> On 12/19/22 4:58 PM, Elliot Berman wrote:
>> Fix build error when CONFIG_ARM64_SVE is selected and
>> asm/alternative-macros.h wasn't implicitly included by another header.
>>
>> In file included from arch/arm64/gunyah/gunyah_hypercall.c:6:
>> arch/arm64/gunyah/gunyah_hypercall.c: In function
>> `gh_hypercall_msgq_send':
>> ./include/linux/arm-smccc.h:387:25: error: expected string literal
>> before `ALTERNATIVE'
>>    387 | #define SMCCC_SVE_CHECK ALTERNATIVE("nop \n",  "bl
>> __arm_smccc_sve_check \n", \
>>
>> Signed-off-by: Elliot Berman <[email protected]>
>
> If this is correct (and I presume it is), I think this patch should
> be posted separate from (and before) the rest of the series.
>

Ack, will send this separately.

>                     -Alex
>
>> ---
>>   include/linux/arm-smccc.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
>> index 220c8c60e021..6a627cdbbdec 100644
>> --- a/include/linux/arm-smccc.h
>> +++ b/include/linux/arm-smccc.h
>> @@ -383,6 +383,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0,
>> unsigned long a1,
>>   /* nVHE hypervisor doesn't have a current thread so needs separate
>> checks */
>>   #if defined(CONFIG_ARM64_SVE) && !defined(__KVM_NVHE_HYPERVISOR__)
>> +#include <asm/alternative-macros.h>
>>   #define SMCCC_SVE_CHECK ALTERNATIVE("nop \n",  "bl
>> __arm_smccc_sve_check \n", \
>>                       ARM64_SVE)
>