lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Aug 2017 23:42:25 +0800
From:   Dongjiu Geng <gengdongjiu@...wei.com>
To:     <rjw@...ysocki.net>, <lenb@...nel.org>, <tbaicar@...eaurora.org>,
        <will.deacon@....com>, <james.morse@....com>, <bp@...e.de>,
        <prarit@...hat.com>, <andriy.shevchenko@...ux.intel.com>,
        <zjzhang@...eaurora.org>, <linux-acpi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     <gengdongjiu@...wei.com>, <huangshaoyu@...wei.com>,
        <wuquanming@...wei.com>, <wangxiongfeng2@...wei.com>
Subject: [PATCH] acpi: ghes: fix the OSPM acknowledges error flow

In GHESv2, The read_ack_register is used to specify the
location of the read ack register, it is only the physical
address, but not the value. so needs to continue reading
the address to get the right value. Also It needs to write
the ack value to the right physical address.

Signed-off-by: Dongjiu Geng <gengdongjiu@...wei.com>
---
 drivers/acpi/apei/ghes.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index bb83044..44bb65f 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -703,16 +703,25 @@ static void ghes_estatus_cache_add(
 static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
 {
 	int rc;
-	u64 val = 0;
+	u64 ack_paddr;
+	u64 ack_val = 0;
 
-	rc = apei_read(&val, &gv2->read_ack_register);
+	rc = apei_read(&ack_paddr, &gv2->read_ack_register);
 	if (rc)
 		return rc;
 
-	val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
-	val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
+	if (!ack_paddr)
+		return -ENOENT;
+
+	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
+			      sizeof(u64), 1);
 
-	return apei_write(val, &gv2->read_ack_register);
+	ack_val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
+	ack_val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
+
+	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
+				sizeof(u64), 0);
+	return 0;
 }
 
 static void __ghes_panic(struct ghes *ghes)
-- 
2.10.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ