Skip to contentSkip to conversation

ACPI / APEI: Suppress message if HEST not present

PATCH Superseded Punit Agrawal 2 participants 4 messages Aug 16, 2017 – Aug 29, 2017

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI / APEI: Suppress message if HEST not present

According to the ACPI specification, firmware is not required to provide the Hardware Error Source Table (HEST). When HEST is not present, the following superfluous message is printed to the kernel boot log -

[    3.460067] GHES: HEST is not enabled!

Extend hest_disable variable to track whether the firmware provides this table and if it is not present skip any log output. The existing behaviour is preserved in all other cases.

---
 drivers/acpi/apei/ghes.c |  4 ++--
 drivers/acpi/apei/hest.c | 13 +++++++------
 include/acpi/apei.h      |  8 +++++++-
 3 files changed, 16 insertions(+), 9 deletions(-)
drivers/acpi/apei/ghes.c +2 -2
index d661d452b238..f8685bcbeff2 100644
@@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
 {
 	int rc;
 
-	if (acpi_disabled)
+	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
 		return -ENODEV;
 
-	if (hest_disable) {
+	if (hest_disable == HEST_DISABLED) {
 		pr_info(GHES_PFX "HEST is not enabled!\n");
 		return -EINVAL;
 	}
drivers/acpi/apei/hest.c +7 -6
index 456b488eb1df..9cb74115a43d 100644
@@ -37,7 +37,7 @@
 
 #define HEST_PFX "HEST: "
 
-bool hest_disable;
+int hest_disable;
 EXPORT_SYMBOL_GPL(hest_disable);
 
 /* HEST table parsing */
@@ -213,7 +213,7 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
 
 static int __init setup_hest_disable(char *str)
 {
-	hest_disable = 1;
+	hest_disable = HEST_DISABLED;
 	return 0;
 }
 
@@ -232,9 +232,10 @@ void __init acpi_hest_init(void)
 
 	status = acpi_get_table(ACPI_SIG_HEST, 0,
 				(struct acpi_table_header **)&hest_tab);
-	if (status == AE_NOT_FOUND)
-		goto err;
-	else if (ACPI_FAILURE(status)) {
+	if (status == AE_NOT_FOUND) {
+		hest_disable = HEST_NOT_FOUND;
+		return;
+	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		pr_err(HEST_PFX "Failed to get table, %s\n", msg);
 		rc = -EINVAL;
@@ -257,5 +258,5 @@ void __init acpi_hest_init(void)
 	pr_info(HEST_PFX "Table parsing has been initialized.\n");
 	return;
 err:
-	hest_disable = 1;
+	hest_disable = HEST_DISABLED;
 }
include/acpi/apei.h +7 -1
index 76284bb560a6..c46694abea28 100644
@@ -16,7 +16,13 @@
 
 #ifdef __KERNEL__
 
-extern bool hest_disable;
+enum hest_status {
+	HEST_ENABLED,
+	HEST_DISABLED,
+	HEST_NOT_FOUND,
+};
+
+extern int hest_disable;
 extern int erst_disable;
 #ifdef CONFIG_ACPI_APEI_GHES
 extern bool ghes_disable;
Signature · 1 line
2.13.2
#1 lore raw
Quoted 89 lines · Punit Agrawal

According to the ACPI specification, firmware is not required to provide the Hardware Error Source Table (HEST). When HEST is not present, the following superfluous message is printed to the kernel boot log -

[    3.460067] GHES: HEST is not enabled!

Extend hest_disable variable to track whether the firmware provides this table and if it is not present skip any log output. The existing behaviour is preserved in all other cases.

---
 drivers/acpi/apei/ghes.c |  4 ++--
 drivers/acpi/apei/hest.c | 13 +++++++------
 include/acpi/apei.h      |  8 +++++++-
 3 files changed, 16 insertions(+), 9 deletions(-)
drivers/acpi/apei/ghes.c +2 -2
index d661d452b238..f8685bcbeff2 100644
@@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
 {
 	int rc;
 
-	if (acpi_disabled)
+	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
 		return -ENODEV;
 
-	if (hest_disable) {
+	if (hest_disable == HEST_DISABLED) {
 		pr_info(GHES_PFX "HEST is not enabled!\n");
 		return -EINVAL;
 	}
drivers/acpi/apei/hest.c +7 -6
index 456b488eb1df..9cb74115a43d 100644
@@ -37,7 +37,7 @@
 
 #define HEST_PFX "HEST: "
 
-bool hest_disable;
+int hest_disable;
 EXPORT_SYMBOL_GPL(hest_disable);
 
 /* HEST table parsing */
@@ -213,7 +213,7 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
 
 static int __init setup_hest_disable(char *str)
 {
-	hest_disable = 1;
+	hest_disable = HEST_DISABLED;
 	return 0;
 }
 
@@ -232,9 +232,10 @@ void __init acpi_hest_init(void)
 
 	status = acpi_get_table(ACPI_SIG_HEST, 0,
 				(struct acpi_table_header **)&hest_tab);
-	if (status == AE_NOT_FOUND)
-		goto err;
-	else if (ACPI_FAILURE(status)) {
+	if (status == AE_NOT_FOUND) {
+		hest_disable = HEST_NOT_FOUND;
+		return;
+	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		pr_err(HEST_PFX "Failed to get table, %s\n", msg);
 		rc = -EINVAL;
@@ -257,5 +258,5 @@ void __init acpi_hest_init(void)
 	pr_info(HEST_PFX "Table parsing has been initialized.\n");
 	return;
 err:
-	hest_disable = 1;
+	hest_disable = HEST_DISABLED;
 }
include/acpi/apei.h +0 -1
index 76284bb560a6..c46694abea28 100644
@@ -16,7 +16,13 @@
 
 #ifdef __KERNEL__
 
-extern bool hest_disable;

include/acpi/apei.h line 28

Quoted 10 lines
include/acpi/apei.h +7 -0
+enum hest_status {
+	HEST_ENABLED,
+	HEST_DISABLED,
+	HEST_NOT_FOUND,
+};
+
+extern int hest_disable;
 extern int erst_disable;
 #ifdef CONFIG_ACPI_APEI_GHES
 extern bool ghes_disable;

Ping!

Looks like this one has slipped through the cracks? Any objections Boris?

Thanks,
Punit

#2 lore raw
In reply to Punit Agrawal
Quoted 27 lines · Punit Agrawal

According to the ACPI specification, firmware is not required to provide the Hardware Error Source Table (HEST). When HEST is not present, the following superfluous message is printed to the kernel boot log -

[    3.460067] GHES: HEST is not enabled!

Extend hest_disable variable to track whether the firmware provides this table and if it is not present skip any log output. The existing behaviour is preserved in all other cases.

---
 drivers/acpi/apei/ghes.c |  4 ++--
 drivers/acpi/apei/hest.c | 13 +++++++------
 include/acpi/apei.h      |  8 +++++++-
 3 files changed, 16 insertions(+), 9 deletions(-)
drivers/acpi/apei/ghes.c +0 -0
index d661d452b238..f8685bcbeff2 100644
@@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
 {
 	int rc;

drivers/acpi/apei/ghes.c static int __init ghes_init(void) · line 1271

Quoted 10 lines
drivers/acpi/apei/ghes.c +2 -2
 
-	if (acpi_disabled)
+	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
 		return -ENODEV;
 
-	if (hest_disable) {
+	if (hest_disable == HEST_DISABLED) {
 		pr_info(GHES_PFX "HEST is not enabled!\n");
 		return -EINVAL;
 	}

Yap, looks good.

Just a minor nitpick: I'd additionally group the hest_disable checking in one switch-case, so that the code flow is obvious at a quick glance:

        if (acpi_disabled)
                return -ENODEV;

        switch (hest_disable) {
        case HEST_NOT_FOUND:
                return -ENODEV;
        case HEST_DISABLED:
                pr_info(GHES_PFX "HEST is not enabled!\n");
                return -EINVAL;
        default:
                break;
        }

Thx.

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#3 lore raw
Quoted 44 lines · Borislav Petkov
Quoted 27 lines · Punit Agrawal

According to the ACPI specification, firmware is not required to provide the Hardware Error Source Table (HEST). When HEST is not present, the following superfluous message is printed to the kernel boot log -

[    3.460067] GHES: HEST is not enabled!

Extend hest_disable variable to track whether the firmware provides this table and if it is not present skip any log output. The existing behaviour is preserved in all other cases.

---
 drivers/acpi/apei/ghes.c |  4 ++--
 drivers/acpi/apei/hest.c | 13 +++++++------
 include/acpi/apei.h      |  8 +++++++-
 3 files changed, 16 insertions(+), 9 deletions(-)
drivers/acpi/apei/ghes.c +0 -0
index d661d452b238..f8685bcbeff2 100644
@@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
 {
 	int rc;

drivers/acpi/apei/ghes.c static int __init ghes_init(void) · line 1271

Quoted 10 lines
drivers/acpi/apei/ghes.c +2 -2
 
-	if (acpi_disabled)
+	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
 		return -ENODEV;
 
-	if (hest_disable) {
+	if (hest_disable == HEST_DISABLED) {
 		pr_info(GHES_PFX "HEST is not enabled!\n");
 		return -EINVAL;
 	}

Yap, looks good.

Just a minor nitpick: I'd additionally group the hest_disable checking in one switch-case, so that the code flow is obvious at a quick glance:

Quoted 12 lines
        if (acpi_disabled)
                return -ENODEV;

        switch (hest_disable) {
        case HEST_NOT_FOUND:
                return -ENODEV;
        case HEST_DISABLED:
                pr_info(GHES_PFX "HEST is not enabled!\n");
                return -EINVAL;
        default:
                break;
        }

I've picked this change and will send out an update shortly.

Thanks,
Punit