2018-07-26 12:58:37

by Dongjiu Geng

[permalink] [raw]
Subject: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea()

In order to remove the additional check before calling the
ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA.

Signed-off-by: Dongjiu Geng <[email protected]>
---

This cleanup is ever mentioned by Mark Rutland in [1]

[1]:
https://lkml.org/lkml/2018/5/31/289
---
arch/arm64/mm/fault.c | 7 +------
include/acpi/ghes.h | 4 ++++
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index b8eecc7..9ffe01d 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)

int handle_guest_sea(phys_addr_t addr, unsigned int esr)
{
- int ret = -ENOENT;
-
- if (IS_ENABLED(CONFIG_ACPI_APEI_SEA))
- ret = ghes_notify_sea();
-
- return ret;
+ return ghes_notify_sea();
}

asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 1624e2b..82cb4eb 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
(void *)section - (void *)(estatus + 1) < estatus->data_length; \
section = acpi_hest_get_next(section))

+#ifdef CONFIG_ACPI_APEI_SEA
int ghes_notify_sea(void);
+#else
+static inline int ghes_notify_sea(void) { return -ENOENT; }
+#endif

#endif /* GHES_H */
--
1.9.1



2018-07-27 10:07:57

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea()

On Thu, Jul 26, 2018 at 05:01:47PM -0400, Dongjiu Geng wrote:
> In order to remove the additional check before calling the
> ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA.
>
> Signed-off-by: Dongjiu Geng <[email protected]>
> ---

Acked-by: Will Deacon <[email protected]>

Will

> This cleanup is ever mentioned by Mark Rutland in [1]
>
> [1]:
> https://lkml.org/lkml/2018/5/31/289
> ---
> arch/arm64/mm/fault.c | 7 +------
> include/acpi/ghes.h | 4 ++++
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index b8eecc7..9ffe01d 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
>
> int handle_guest_sea(phys_addr_t addr, unsigned int esr)
> {
> - int ret = -ENOENT;
> -
> - if (IS_ENABLED(CONFIG_ACPI_APEI_SEA))
> - ret = ghes_notify_sea();
> -
> - return ret;
> + return ghes_notify_sea();
> }
>
> asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> index 1624e2b..82cb4eb 100644
> --- a/include/acpi/ghes.h
> +++ b/include/acpi/ghes.h
> @@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
> (void *)section - (void *)(estatus + 1) < estatus->data_length; \
> section = acpi_hest_get_next(section))
>
> +#ifdef CONFIG_ACPI_APEI_SEA
> int ghes_notify_sea(void);
> +#else
> +static inline int ghes_notify_sea(void) { return -ENOENT; }
> +#endif
>
> #endif /* GHES_H */
> --
> 1.9.1
>

2018-08-05 02:36:54

by gengdongjiu

[permalink] [raw]
Subject: Re: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea()

2018-07-27 18:06 GMT+08:00 Will Deacon <[email protected]>:
> On Thu, Jul 26, 2018 at 05:01:47PM -0400, Dongjiu Geng wrote:
>> In order to remove the additional check before calling the
>> ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA.
>>
>> Signed-off-by: Dongjiu Geng <[email protected]>
>> ---
>
> Acked-by: Will Deacon <[email protected]>

Will,
This patch will be applied, right? thanks

>
> Will
>
>> This cleanup is ever mentioned by Mark Rutland in [1]
>>
>> [1]:
>> https://lkml.org/lkml/2018/5/31/289
>> ---
>> arch/arm64/mm/fault.c | 7 +------
>> include/acpi/ghes.h | 4 ++++
>> 2 files changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index b8eecc7..9ffe01d 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
>>
>> int handle_guest_sea(phys_addr_t addr, unsigned int esr)
>> {
>> - int ret = -ENOENT;
>> -
>> - if (IS_ENABLED(CONFIG_ACPI_APEI_SEA))
>> - ret = ghes_notify_sea();
>> -
>> - return ret;
>> + return ghes_notify_sea();
>> }
>>
>> asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
>> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
>> index 1624e2b..82cb4eb 100644
>> --- a/include/acpi/ghes.h
>> +++ b/include/acpi/ghes.h
>> @@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
>> (void *)section - (void *)(estatus + 1) < estatus->data_length; \
>> section = acpi_hest_get_next(section))
>>
>> +#ifdef CONFIG_ACPI_APEI_SEA
>> int ghes_notify_sea(void);
>> +#else
>> +static inline int ghes_notify_sea(void) { return -ENOENT; }
>> +#endif
>>
>> #endif /* GHES_H */
>> --
>> 1.9.1
>>

2018-08-06 14:27:33

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea()

On Sun, Aug 05, 2018 at 10:35:03AM +0800, gengdongjiu wrote:
> 2018-07-27 18:06 GMT+08:00 Will Deacon <[email protected]>:
> > On Thu, Jul 26, 2018 at 05:01:47PM -0400, Dongjiu Geng wrote:
> >> In order to remove the additional check before calling the
> >> ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA.
> >>
> >> Signed-off-by: Dongjiu Geng <[email protected]>
> >> ---
> >
> > Acked-by: Will Deacon <[email protected]>
>
> Will,
> This patch will be applied, right? thanks

I haven't queued it in the arm64 tree, since it touches include/acpi/ghes.h
and you don't have an ack from the acpi folks. I acked it so that you could
route it via the acpi tree without me holding you up.

Will

> >> This cleanup is ever mentioned by Mark Rutland in [1]
> >>
> >> [1]:
> >> https://lkml.org/lkml/2018/5/31/289
> >> ---
> >> arch/arm64/mm/fault.c | 7 +------
> >> include/acpi/ghes.h | 4 ++++
> >> 2 files changed, 5 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> >> index b8eecc7..9ffe01d 100644
> >> --- a/arch/arm64/mm/fault.c
> >> +++ b/arch/arm64/mm/fault.c
> >> @@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
> >>
> >> int handle_guest_sea(phys_addr_t addr, unsigned int esr)
> >> {
> >> - int ret = -ENOENT;
> >> -
> >> - if (IS_ENABLED(CONFIG_ACPI_APEI_SEA))
> >> - ret = ghes_notify_sea();
> >> -
> >> - return ret;
> >> + return ghes_notify_sea();
> >> }
> >>
> >> asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
> >> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> >> index 1624e2b..82cb4eb 100644
> >> --- a/include/acpi/ghes.h
> >> +++ b/include/acpi/ghes.h
> >> @@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata)
> >> (void *)section - (void *)(estatus + 1) < estatus->data_length; \
> >> section = acpi_hest_get_next(section))
> >>
> >> +#ifdef CONFIG_ACPI_APEI_SEA
> >> int ghes_notify_sea(void);
> >> +#else
> >> +static inline int ghes_notify_sea(void) { return -ENOENT; }
> >> +#endif
> >>
> >> #endif /* GHES_H */
> >> --
> >> 1.9.1
> >>

2018-08-07 06:52:16

by Dongjiu Geng

[permalink] [raw]
Subject: Re: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea()



On 2018/8/6 22:26, Will Deacon wrote:
>> Will,
>> This patch will be applied, right? thanks
> I haven't queued it in the arm64 tree, since it touches include/acpi/ghes.h
> and you don't have an ack from the acpi folks. I acked it so that you could
> route it via the acpi tree without me holding you up.

Thanks the explanation.
yes, this patch touches the "include/acpi/ghes.h", I will repost this patch to let acpi
folks review it.


>
> Will
>
>>>> This cleanup is ever mentioned by Mark Rutland in [1]