Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1708931 > unrolled thread

[PATCH] acpi: apei: fix the wrongly parse generic error status block

Started byDongjiu Geng <gengdongjiu@huawei.com>
First post2017-08-10 19:50 +0200
Last post2017-08-10 23:40 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] acpi: apei: fix the wrongly parse generic error status block Dongjiu Geng <gengdongjiu@huawei.com> - 2017-08-10 19:50 +0200
    Re: [PATCH] acpi: apei: fix the wrongly parse generic error status  block "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-08-10 19:50 +0200
      Re: [PATCH] acpi: apei: fix the wrongly parse generic error status  block gengdongjiu <gengdongjiu@huawei.com> - 2017-08-10 23:40 +0200
        Re: [PATCH] acpi: apei: fix the wrongly parse generic error status  block "Baicar, Tyler" <tbaicar@codeaurora.org> - 2017-08-11 15:30 +0200
      Re: [PATCH] acpi: apei: fix the wrongly parse generic error status  block gengdongjiu <gengdongjiu@huawei.com> - 2017-08-10 23:40 +0200

#1708931 — [PATCH] acpi: apei: fix the wrongly parse generic error status block

FromDongjiu Geng <gengdongjiu@huawei.com>
Date2017-08-10 19:50 +0200
Subject[PATCH] acpi: apei: fix the wrongly parse generic error status block
Message-ID<ucZKO-jX-33@gated-at.bofh.it>
The revision 0x300 generic error data entry is different with the old
version. when ghes_do_proc traverses to get the data entry, it does not
consider this difference. so when error status block has revision 0x300
data entry, it will have issue.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
 drivers/acpi/apei/apei-internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
index 6e9f14c0a71b..6491f1c4a96e 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void);
 
 #define apei_estatus_for_each_section(estatus, section)			\
 	for (section = (struct acpi_hest_generic_data *)(estatus + 1);	\
-	     (void *)section - (void *)estatus < estatus->data_length;	\
-	     section = (void *)(section+1) + section->error_data_length)
+	     (void *)section - (void *)(estatus + 1) < estatus->data_length; \
+	     section = acpi_hest_get_next(section))
 
 static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
 {
-- 
2.14.0

[toc] | [next] | [standalone]


#1708932 — Re: [PATCH] acpi: apei: fix the wrongly parse generic error status block

From"Baicar, Tyler" <tbaicar@codeaurora.org>
Date2017-08-10 19:50 +0200
SubjectRe: [PATCH] acpi: apei: fix the wrongly parse generic error status block
Message-ID<ucZKO-jX-31@gated-at.bofh.it>
In reply to#1708931
Hello,

I have already posted a patch fixing this. Please see:

https://lkml.org/lkml/2017/8/3/824

This makes the loop identical to the CPER code which prints the estatus 
blocks to the kernel logs.

Thanks,

Tyler


On 8/10/2017 12:06 PM, Dongjiu Geng wrote:
> The revision 0x300 generic error data entry is different with the old
> version. when ghes_do_proc traverses to get the data entry, it does not
> consider this difference. so when error status block has revision 0x300
> data entry, it will have issue.
>
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> ---
>   drivers/acpi/apei/apei-internal.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
> index 6e9f14c0a71b..6491f1c4a96e 100644
> --- a/drivers/acpi/apei/apei-internal.h
> +++ b/drivers/acpi/apei/apei-internal.h
> @@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void);
>   
>   #define apei_estatus_for_each_section(estatus, section)			\
>   	for (section = (struct acpi_hest_generic_data *)(estatus + 1);	\
> -	     (void *)section - (void *)estatus < estatus->data_length;	\
> -	     section = (void *)(section+1) + section->error_data_length)
> +	     (void *)section - (void *)(estatus + 1) < estatus->data_length; \
> +	     section = acpi_hest_get_next(section))
>   
>   static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
>   {

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

[toc] | [prev] | [next] | [standalone]


#1709033 — Re: [PATCH] acpi: apei: fix the wrongly parse generic error status block

Fromgengdongjiu <gengdongjiu@huawei.com>
Date2017-08-10 23:40 +0200
SubjectRe: [PATCH] acpi: apei: fix the wrongly parse generic error status block
Message-ID<ud3ln-31s-1@gated-at.bofh.it>
In reply to#1708932
may be directly remove the macro apei_estatus_for_each_section is not better, if other place code also
needs to iterate through the GHES estatus blocks, it will be repeated written again.


On 2017/8/11 5:31, gengdongjiu wrote:
> Hello,
> 
>    sorry, I do not see that. Just know I have reviewed your modification, may be my change can be simpleness and reserve the macro of apei_estatus_for_each_section
> can be used by other place to avoid duplicated code, such as prints the estatus blocks.
> 
> On 2017/8/11 1:48, Baicar, Tyler wrote:
>> Hello,
>>
>> I have already posted a patch fixing this. Please see:
>>
>> https://lkml.org/lkml/2017/8/3/824
>>
>> This makes the loop identical to the CPER code which prints the estatus blocks to the kernel logs.
>>
>> Thanks,
>>
>> Tyler
>>
>>
>> On 8/10/2017 12:06 PM, Dongjiu Geng wrote:
>>> The revision 0x300 generic error data entry is different with the old
>>> version. when ghes_do_proc traverses to get the data entry, it does not
>>> consider this difference. so when error status block has revision 0x300
>>> data entry, it will have issue.
>>>
>>> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
>>> ---
>>>   drivers/acpi/apei/apei-internal.h | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
>>> index 6e9f14c0a71b..6491f1c4a96e 100644
>>> --- a/drivers/acpi/apei/apei-internal.h
>>> +++ b/drivers/acpi/apei/apei-internal.h
>>> @@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void);
>>>     #define apei_estatus_for_each_section(estatus, section)            \
>>>       for (section = (struct acpi_hest_generic_data *)(estatus + 1);    \
>>> -         (void *)section - (void *)estatus < estatus->data_length;    \
>>> -         section = (void *)(section+1) + section->error_data_length)
>>> +         (void *)section - (void *)(estatus + 1) < estatus->data_length; \
>>> +         section = acpi_hest_get_next(section))
>>>     static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
>>>   {
>>

[toc] | [prev] | [next] | [standalone]


#1709612 — Re: [PATCH] acpi: apei: fix the wrongly parse generic error status block

From"Baicar, Tyler" <tbaicar@codeaurora.org>
Date2017-08-11 15:30 +0200
SubjectRe: [PATCH] acpi: apei: fix the wrongly parse generic error status block
Message-ID<udiaJ-43p-3@gated-at.bofh.it>
In reply to#1709033
I removed the apei_estatus_for_each_section because it was only being 
used in this one spot even though several other parts of the code do the 
same iteration (it is done several times in the CPER code). I made this 
iteration match the CPER iterations because the CPER iterations are 
verifying that the structures are all valid and lengths are correct. If 
those checks are being done this way, it makes the most sense to mimic 
that iteration here when calling into EDAC and triggering trace events.

Thanks,

Tyler


On 8/10/2017 3:37 PM, gengdongjiu wrote:
> may be directly remove the macro apei_estatus_for_each_section is not better, if other place code also
> needs to iterate through the GHES estatus blocks, it will be repeated written again.
>
>
> On 2017/8/11 5:31, gengdongjiu wrote:
>> Hello,
>>
>>     sorry, I do not see that. Just know I have reviewed your modification, may be my change can be simpleness and reserve the macro of apei_estatus_for_each_section
>> can be used by other place to avoid duplicated code, such as prints the estatus blocks.
>>
>> On 2017/8/11 1:48, Baicar, Tyler wrote:
>>> Hello,
>>>
>>> I have already posted a patch fixing this. Please see:
>>>
>>> https://lkml.org/lkml/2017/8/3/824
>>>
>>> This makes the loop identical to the CPER code which prints the estatus blocks to the kernel logs.
>>>
>>> Thanks,
>>>
>>> Tyler
>>>
>>>
>>> On 8/10/2017 12:06 PM, Dongjiu Geng wrote:
>>>> The revision 0x300 generic error data entry is different with the old
>>>> version. when ghes_do_proc traverses to get the data entry, it does not
>>>> consider this difference. so when error status block has revision 0x300
>>>> data entry, it will have issue.
>>>>
>>>> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
>>>> ---
>>>>    drivers/acpi/apei/apei-internal.h | 4 ++--
>>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
>>>> index 6e9f14c0a71b..6491f1c4a96e 100644
>>>> --- a/drivers/acpi/apei/apei-internal.h
>>>> +++ b/drivers/acpi/apei/apei-internal.h
>>>> @@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void);
>>>>      #define apei_estatus_for_each_section(estatus, section)            \
>>>>        for (section = (struct acpi_hest_generic_data *)(estatus + 1);    \
>>>> -         (void *)section - (void *)estatus < estatus->data_length;    \
>>>> -         section = (void *)(section+1) + section->error_data_length)
>>>> +         (void *)section - (void *)(estatus + 1) < estatus->data_length; \
>>>> +         section = acpi_hest_get_next(section))
>>>>      static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
>>>>    {

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

[toc] | [prev] | [next] | [standalone]


#1709034 — Re: [PATCH] acpi: apei: fix the wrongly parse generic error status block

Fromgengdongjiu <gengdongjiu@huawei.com>
Date2017-08-10 23:40 +0200
SubjectRe: [PATCH] acpi: apei: fix the wrongly parse generic error status block
Message-ID<ud3ln-31s-3@gated-at.bofh.it>
In reply to#1708932
Hello,

   sorry, I do not see that. Just know I have reviewed your modification, may be my change can be simpleness and reserve the macro of apei_estatus_for_each_section
can be used by other place to avoid duplicated code, such as prints the estatus blocks.

On 2017/8/11 1:48, Baicar, Tyler wrote:
> Hello,
> 
> I have already posted a patch fixing this. Please see:
> 
> https://lkml.org/lkml/2017/8/3/824
> 
> This makes the loop identical to the CPER code which prints the estatus blocks to the kernel logs.
> 
> Thanks,
> 
> Tyler
> 
> 
> On 8/10/2017 12:06 PM, Dongjiu Geng wrote:
>> The revision 0x300 generic error data entry is different with the old
>> version. when ghes_do_proc traverses to get the data entry, it does not
>> consider this difference. so when error status block has revision 0x300
>> data entry, it will have issue.
>>
>> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
>> ---
>>   drivers/acpi/apei/apei-internal.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
>> index 6e9f14c0a71b..6491f1c4a96e 100644
>> --- a/drivers/acpi/apei/apei-internal.h
>> +++ b/drivers/acpi/apei/apei-internal.h
>> @@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void);
>>     #define apei_estatus_for_each_section(estatus, section)            \
>>       for (section = (struct acpi_hest_generic_data *)(estatus + 1);    \
>> -         (void *)section - (void *)estatus < estatus->data_length;    \
>> -         section = (void *)(section+1) + section->error_data_length)
>> +         (void *)section - (void *)(estatus + 1) < estatus->data_length; \
>> +         section = acpi_hest_get_next(section))
>>     static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus)
>>   {
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web