From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Baicar, Tyler" Subject: Re: [PATCH V15 03/11] cper: add timestamp print to CPER status printing Date: Fri, 21 Apr 2017 10:04:35 -0600 Message-ID: <35cc4ae0-e8fa-fd3a-5d7f-243ed2e82ea0@codeaurora.org> References: <1492556723-9189-1-git-send-email-tbaicar@codeaurora.org> <1492556723-9189-4-git-send-email-tbaicar@codeaurora.org> <20170421122150.76cce2cfrt767glv@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170421122150.76cce2cfrt767glv@pd.tnic> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Borislav Petkov Cc: linux-efi@vger.kernel.org, kvm@vger.kernel.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com, will.deacon@arm.com, robert.moore@intel.com, paul.gortmaker@windriver.com, lv.zheng@intel.com, kvmarm@lists.cs.columbia.edu, fu.wei@linaro.org, rafael@kernel.org, zjzhang@codeaurora.org, linux@armlinux.org.uk, gengdongjiu@huawei.com, linux-acpi@vger.kernel.org, eun.taik.lee@samsung.com, shijie.huang@arm.com, labbott@redhat.com, lenb@kernel.org, harba@codeaurora.org, john.garry@huawei.com, marc.zyngier@arm.com, punit.agrawal@arm.com, rostedt@goodmis.org, nkaje@codeaurora.org, sandeepa.s.prabhu@gmail.com, linux-arm-kernel@lists.infradead.org, devel@acpica.org, tony.luck@intel.com, rjw@rjwysocki.net, rruigrok@codeaurora.org, linux-kernel@vger.kernel.org, astone@redhat.com, hanjun.guo@linaro.org, joe@perches.com, pbonzini@redhat.com, akpm@linux-foundation.org, bristot@redhat.com List-Id: linux-acpi@vger.kernel.org On 4/21/2017 6:21 AM, Borislav Petkov wrote: > On Tue, Apr 18, 2017 at 05:05:15PM -0600, Tyler Baicar wrote: >> The ACPI 6.1 spec added a timestamp to the HEST generic data > HEST? > > I see the timestamp in > > Table 18-343 Generic Error Data Entry > > where those things are "One or more Generic Error Data Entry structures > may be recorded in the Generic Error Data Entries field of the Generic > Error Status Block structure." > > And those are part of the "18.3.2.7 Generic Hardware Error Source", > i.e., GHES. So why do you say "HEST" above? Ah yes, this should be GHES no HEST. There are too many acronyms involved here :) > >> structure. Print the timestamp out when printing out the error >> status information. >> >> Signed-off-by: Tyler Baicar >> CC: Jonathan (Zhixiong) Zhang >> Reviewed-by: James Morse >> Reviewed-by: Ard Biesheuvel > Remove those Reviewed-by:s > >> --- >> drivers/firmware/efi/cper.c | 28 ++++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c >> index 8328a6f..46585f9 100644 >> --- a/drivers/firmware/efi/cper.c >> +++ b/drivers/firmware/efi/cper.c >> @@ -32,6 +32,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> #include >> >> #define INDENT_SP " " >> @@ -387,6 +389,29 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, >> pfx, pcie->bridge.secondary_status, pcie->bridge.control); >> } >> >> +static void cper_estatus_timestamp(const char *pfx, > cper_print_tstamp() > >> + struct acpi_hest_generic_data_v300 *gdata) >> +{ >> + __u8 hour, min, sec, day, mon, year, century, *timestamp; >> + >> + if (gdata->validation_bits & ACPI_HEST_GEN_VALID_TIMESTAMP) { >> + timestamp = (__u8 *)&(gdata->time_stamp); >> + sec = bcd2bin(timestamp[0]); >> + min = bcd2bin(timestamp[1]); >> + hour = bcd2bin(timestamp[2]); >> + day = bcd2bin(timestamp[4]); >> + mon = bcd2bin(timestamp[5]); >> + year = bcd2bin(timestamp[6]); >> + century = bcd2bin(timestamp[7]); >> + >> + if (*(timestamp + 3) & 0x1) >> + printk("%stimestamp is precise\n", pfx); >> + >> + printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, >> + century, year, mon, day, hour, min, sec); > Yeah, about the precise tstamp, you can do something like this: > > --- > diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c > index 46585f92b741..a649884e2264 100644 > --- a/drivers/firmware/efi/cper.c > +++ b/drivers/firmware/efi/cper.c > @@ -404,10 +404,8 @@ static void cper_estatus_timestamp(const char *pfx, > year = bcd2bin(timestamp[6]); > century = bcd2bin(timestamp[7]); > > - if (*(timestamp + 3) & 0x1) > - printk("%stimestamp is precise\n", pfx); > - > - printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + printk("%s%ststamp: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + (timestamp[3] & 0x1 ? "precise " : ""), > century, year, mon, day, hour, min, sec); > } > } This is basically what I already had in v14...you asked to move it into a different if-statement? https://lkml.org/lkml/2017/4/12/397 Thanks, Tyler -- 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423806AbdDUSmp (ORCPT ); Fri, 21 Apr 2017 14:42:45 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58806 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1041602AbdDUSmg (ORCPT ); Fri, 21 Apr 2017 14:42:36 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A9BB36119E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org Subject: Re: [PATCH V15 03/11] cper: add timestamp print to CPER status printing To: Borislav Petkov Cc: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, nkaje@codeaurora.org, zjzhang@codeaurora.org, mark.rutland@arm.com, james.morse@arm.com, akpm@linux-foundation.org, eun.taik.lee@samsung.com, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com, rruigrok@codeaurora.org, paul.gortmaker@windriver.com, tn@semihalf.com, fu.wei@linaro.org, rostedt@goodmis.org, bristot@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org, Suzuki.Poulose@arm.com, punit.agrawal@arm.com, astone@redhat.com, harba@codeaurora.org, hanjun.guo@linaro.org, john.garry@huawei.com, shiju.jose@huawei.com, joe@perches.com, rafael@kernel.org, tony.luck@intel.com, gengdongjiu@huawei.com, xiexiuqi@huawei.com References: <1492556723-9189-1-git-send-email-tbaicar@codeaurora.org> <1492556723-9189-4-git-send-email-tbaicar@codeaurora.org> <20170421122150.76cce2cfrt767glv@pd.tnic> From: "Baicar, Tyler" Message-ID: <35cc4ae0-e8fa-fd3a-5d7f-243ed2e82ea0@codeaurora.org> Date: Fri, 21 Apr 2017 10:04:35 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <20170421122150.76cce2cfrt767glv@pd.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/21/2017 6:21 AM, Borislav Petkov wrote: > On Tue, Apr 18, 2017 at 05:05:15PM -0600, Tyler Baicar wrote: >> The ACPI 6.1 spec added a timestamp to the HEST generic data > HEST? > > I see the timestamp in > > Table 18-343 Generic Error Data Entry > > where those things are "One or more Generic Error Data Entry structures > may be recorded in the Generic Error Data Entries field of the Generic > Error Status Block structure." > > And those are part of the "18.3.2.7 Generic Hardware Error Source", > i.e., GHES. So why do you say "HEST" above? Ah yes, this should be GHES no HEST. There are too many acronyms involved here :) > >> structure. Print the timestamp out when printing out the error >> status information. >> >> Signed-off-by: Tyler Baicar >> CC: Jonathan (Zhixiong) Zhang >> Reviewed-by: James Morse >> Reviewed-by: Ard Biesheuvel > Remove those Reviewed-by:s > >> --- >> drivers/firmware/efi/cper.c | 28 ++++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c >> index 8328a6f..46585f9 100644 >> --- a/drivers/firmware/efi/cper.c >> +++ b/drivers/firmware/efi/cper.c >> @@ -32,6 +32,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> #include >> >> #define INDENT_SP " " >> @@ -387,6 +389,29 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, >> pfx, pcie->bridge.secondary_status, pcie->bridge.control); >> } >> >> +static void cper_estatus_timestamp(const char *pfx, > cper_print_tstamp() > >> + struct acpi_hest_generic_data_v300 *gdata) >> +{ >> + __u8 hour, min, sec, day, mon, year, century, *timestamp; >> + >> + if (gdata->validation_bits & ACPI_HEST_GEN_VALID_TIMESTAMP) { >> + timestamp = (__u8 *)&(gdata->time_stamp); >> + sec = bcd2bin(timestamp[0]); >> + min = bcd2bin(timestamp[1]); >> + hour = bcd2bin(timestamp[2]); >> + day = bcd2bin(timestamp[4]); >> + mon = bcd2bin(timestamp[5]); >> + year = bcd2bin(timestamp[6]); >> + century = bcd2bin(timestamp[7]); >> + >> + if (*(timestamp + 3) & 0x1) >> + printk("%stimestamp is precise\n", pfx); >> + >> + printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, >> + century, year, mon, day, hour, min, sec); > Yeah, about the precise tstamp, you can do something like this: > > --- > diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c > index 46585f92b741..a649884e2264 100644 > --- a/drivers/firmware/efi/cper.c > +++ b/drivers/firmware/efi/cper.c > @@ -404,10 +404,8 @@ static void cper_estatus_timestamp(const char *pfx, > year = bcd2bin(timestamp[6]); > century = bcd2bin(timestamp[7]); > > - if (*(timestamp + 3) & 0x1) > - printk("%stimestamp is precise\n", pfx); > - > - printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + printk("%s%ststamp: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + (timestamp[3] & 0x1 ? "precise " : ""), > century, year, mon, day, hour, min, sec); > } > } This is basically what I already had in v14...you asked to move it into a different if-statement? https://lkml.org/lkml/2017/4/12/397 Thanks, Tyler -- 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: tbaicar@codeaurora.org (Baicar, Tyler) Date: Fri, 21 Apr 2017 10:04:35 -0600 Subject: [PATCH V15 03/11] cper: add timestamp print to CPER status printing In-Reply-To: <20170421122150.76cce2cfrt767glv@pd.tnic> References: <1492556723-9189-1-git-send-email-tbaicar@codeaurora.org> <1492556723-9189-4-git-send-email-tbaicar@codeaurora.org> <20170421122150.76cce2cfrt767glv@pd.tnic> Message-ID: <35cc4ae0-e8fa-fd3a-5d7f-243ed2e82ea0@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 4/21/2017 6:21 AM, Borislav Petkov wrote: > On Tue, Apr 18, 2017 at 05:05:15PM -0600, Tyler Baicar wrote: >> The ACPI 6.1 spec added a timestamp to the HEST generic data > HEST? > > I see the timestamp in > > Table 18-343 Generic Error Data Entry > > where those things are "One or more Generic Error Data Entry structures > may be recorded in the Generic Error Data Entries field of the Generic > Error Status Block structure." > > And those are part of the "18.3.2.7 Generic Hardware Error Source", > i.e., GHES. So why do you say "HEST" above? Ah yes, this should be GHES no HEST. There are too many acronyms involved here :) > >> structure. Print the timestamp out when printing out the error >> status information. >> >> Signed-off-by: Tyler Baicar >> CC: Jonathan (Zhixiong) Zhang >> Reviewed-by: James Morse >> Reviewed-by: Ard Biesheuvel > Remove those Reviewed-by:s > >> --- >> drivers/firmware/efi/cper.c | 28 ++++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c >> index 8328a6f..46585f9 100644 >> --- a/drivers/firmware/efi/cper.c >> +++ b/drivers/firmware/efi/cper.c >> @@ -32,6 +32,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> #include >> >> #define INDENT_SP " " >> @@ -387,6 +389,29 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, >> pfx, pcie->bridge.secondary_status, pcie->bridge.control); >> } >> >> +static void cper_estatus_timestamp(const char *pfx, > cper_print_tstamp() > >> + struct acpi_hest_generic_data_v300 *gdata) >> +{ >> + __u8 hour, min, sec, day, mon, year, century, *timestamp; >> + >> + if (gdata->validation_bits & ACPI_HEST_GEN_VALID_TIMESTAMP) { >> + timestamp = (__u8 *)&(gdata->time_stamp); >> + sec = bcd2bin(timestamp[0]); >> + min = bcd2bin(timestamp[1]); >> + hour = bcd2bin(timestamp[2]); >> + day = bcd2bin(timestamp[4]); >> + mon = bcd2bin(timestamp[5]); >> + year = bcd2bin(timestamp[6]); >> + century = bcd2bin(timestamp[7]); >> + >> + if (*(timestamp + 3) & 0x1) >> + printk("%stimestamp is precise\n", pfx); >> + >> + printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, >> + century, year, mon, day, hour, min, sec); > Yeah, about the precise tstamp, you can do something like this: > > --- > diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c > index 46585f92b741..a649884e2264 100644 > --- a/drivers/firmware/efi/cper.c > +++ b/drivers/firmware/efi/cper.c > @@ -404,10 +404,8 @@ static void cper_estatus_timestamp(const char *pfx, > year = bcd2bin(timestamp[6]); > century = bcd2bin(timestamp[7]); > > - if (*(timestamp + 3) & 0x1) > - printk("%stimestamp is precise\n", pfx); > - > - printk("%stime: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + printk("%s%ststamp: %02d%02d-%02d-%02d %02d:%02d:%02d\n", pfx, > + (timestamp[3] & 0x1 ? "precise " : ""), > century, year, mon, day, hour, min, sec); > } > } This is basically what I already had in v14...you asked to move it into a different if-statement? https://lkml.org/lkml/2017/4/12/397 Thanks, Tyler -- 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.