From patchwork Fri Apr 21 12:21:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 9692663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D29A60328 for ; Fri, 21 Apr 2017 12:30:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C83A27FA3 for ; Fri, 21 Apr 2017 12:30:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EF0E28602; Fri, 21 Apr 2017 12:30:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A97027FA3 for ; Fri, 21 Apr 2017 12:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qb3CW8pgKrOTOarnAye4vENFzKwaiTlIqNqz7e29hFs=; b=l39aDDhf0jUI/R joze7cAPOGOSr9fVdtW3tCAADJSEcDKLHN7KDZFyrYCPJW3ygrE6H8NqDmudNPQdOVOnei5e5+2aT knLB0GIDBPO1lfTYPjZEvpNowhir+pvo1FJG73voamXK85TZfSiY+wmbyfjcQvKshAV67tVnkwI6O gR1j8NFlJ1/4LgwQudcngxvYHF7sghs60KTDsVi5Kid7VjoSATpXnndVhglSVGc/H03ygEg98AJLw bxdLeeJvOEJLs+ToDMdmF+80I9eCwPjUE+At29oWHzG1AEi+ibtqlqZ0sj6bosZ0AnGyUTcD/xsi0 SfhqprxaSV+oEIpP4R1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d1XhJ-0005Q2-AU; Fri, 21 Apr 2017 12:30:01 +0000 Received: from mail.skyhub.de ([5.9.137.197]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d1XhE-0005Mg-LV for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2017 12:29:59 +0000 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1OjWOfYepMWj; Fri, 21 Apr 2017 14:29:30 +0200 (CEST) Received: from pd.tnic (p2003008C2F2D1C00F590E9D70934FBF7.dip0.t-ipconnect.de [IPv6:2003:8c:2f2d:1c00:f590:e9d7:934:fbf7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 337861EC031C; Fri, 21 Apr 2017 14:29:30 +0200 (CEST) Date: Fri, 21 Apr 2017 14:21:50 +0200 From: Borislav Petkov To: Tyler Baicar Subject: Re: [PATCH V15 03/11] cper: add timestamp print to CPER status printing Message-ID: <20170421122150.76cce2cfrt767glv@pd.tnic> References: <1492556723-9189-1-git-send-email-tbaicar@codeaurora.org> <1492556723-9189-4-git-send-email-tbaicar@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1492556723-9189-4-git-send-email-tbaicar@codeaurora.org> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170421_052956_873610_657E02C5 X-CRM114-Status: GOOD ( 15.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, linux-efi@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, 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, xiexiuqi@huawei.com, tn@semihalf.com, 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, Suzuki.Poulose@arm.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, james.morse@arm.com, hanjun.guo@linaro.org, joe@perches.com, pbonzini@redhat.com, akpm@linux-foundation.org, bristot@redhat.com, christoffer.dall@linaro.org, shiju.jose@huawei.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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? > 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); } }