summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2017-10-30 17:20:18 +0100
committerMartin Roth <martinroth@google.com>2017-11-04 00:33:26 +0000
commit0781cbe1d33e62a26a234962bc271209cc22c931 (patch)
tree99aca77e0aab82cd3c869f333a6ff33fd63f391d /src
parent7bd4715a7016b3228df877d625cf26a3694cfebe (diff)
downloadcoreboot-0781cbe1d33e62a26a234962bc271209cc22c931.tar.xz
sb and soc: Enforce correct offset of member "chromeos" in global_nvs_t
The padding has recently been broken in commit 90ebf96df5 ("soc/intel/skylake: Add GNVS variables and include SGX ASL") and fixed again in commit af88398887 ("soc/intel/skylake: Fix broken GNVS offset for chromeos"). Avoid this bug in the future. Change-Id: I1bf3027bba239c8747ad26a3130a7e047d3b8c94 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/22229 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/stoneyridge/include/soc/nvs.h2
-rw-r--r--src/soc/intel/apollolake/include/soc/nvs.h2
-rw-r--r--src/soc/intel/baytrail/include/soc/nvs.h4
-rw-r--r--src/soc/intel/braswell/include/soc/nvs.h8
-rw-r--r--src/soc/intel/broadwell/include/soc/nvs.h6
-rw-r--r--src/soc/intel/cannonlake/include/soc/nvs.h2
-rw-r--r--src/soc/intel/skylake/include/soc/nvs.h6
-rw-r--r--src/southbridge/intel/bd82x6x/nvs.h7
-rw-r--r--src/southbridge/intel/fsp_bd82x6x/nvs.h5
-rw-r--r--src/southbridge/intel/fsp_i89xx/nvs.h5
-rw-r--r--src/southbridge/intel/ibexpeak/nvs.h5
-rw-r--r--src/southbridge/intel/lynxpoint/nvs.h5
12 files changed, 43 insertions, 14 deletions
diff --git a/src/soc/amd/stoneyridge/include/soc/nvs.h b/src/soc/amd/stoneyridge/include/soc/nvs.h
index 20396bf560..623c554057 100644
--- a/src/soc/amd/stoneyridge/include/soc/nvs.h
+++ b/src/soc/amd/stoneyridge/include/soc/nvs.h
@@ -24,6 +24,7 @@
#ifndef __SOC_STONEYRIDGE_NVS_H__
#define __SOC_STONEYRIDGE_NVS_H__
+#include <commonlib/helpers.h>
#include <compiler.h>
#include <stdint.h>
#include <vendorcode/google/chromeos/gnvs.h>
@@ -48,5 +49,6 @@ typedef struct global_nvs_t {
/* ChromeOS specific (0x100 - 0xfff) */
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#endif /* __SOC_STONEYRIDGE_NVS_H__ */
diff --git a/src/soc/intel/apollolake/include/soc/nvs.h b/src/soc/intel/apollolake/include/soc/nvs.h
index 2c9a4b5a54..c7be979553 100644
--- a/src/soc/intel/apollolake/include/soc/nvs.h
+++ b/src/soc/intel/apollolake/include/soc/nvs.h
@@ -24,6 +24,7 @@
#ifndef _SOC_APOLLOLAKE_NVS_H_
#define _SOC_APOLLOLAKE_NVS_H_
+#include <commonlib/helpers.h>
#include <compiler.h>
#include <vendorcode/google/chromeos/gnvs.h>
@@ -52,5 +53,6 @@ typedef struct global_nvs_t {
/* ChromeOS specific (0x100 - 0xfff) */
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#endif /* _SOC_APOLLOLAKE_NVS_H_ */
diff --git a/src/soc/intel/baytrail/include/soc/nvs.h b/src/soc/intel/baytrail/include/soc/nvs.h
index 8e6819d3b2..fdc4e10e6c 100644
--- a/src/soc/intel/baytrail/include/soc/nvs.h
+++ b/src/soc/intel/baytrail/include/soc/nvs.h
@@ -17,11 +17,12 @@
#ifndef _BAYTRAIL_NVS_H_
#define _BAYTRAIL_NVS_H_
+#include <commonlib/helpers.h>
#include <compiler.h>
#include <vendorcode/google/chromeos/gnvs.h>
#include <soc/device_nvs.h>
-typedef struct {
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -66,6 +67,7 @@ typedef struct {
/* Baytrail LPSS (0x1000) */
device_nvs_t dev;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
void acpi_create_gnvs(global_nvs_t *gnvs);
#ifdef __SMM__
diff --git a/src/soc/intel/braswell/include/soc/nvs.h b/src/soc/intel/braswell/include/soc/nvs.h
index 80b0759d76..9b921c54a7 100644
--- a/src/soc/intel/braswell/include/soc/nvs.h
+++ b/src/soc/intel/braswell/include/soc/nvs.h
@@ -18,12 +18,13 @@
#ifndef _SOC_NVS_H_
#define _SOC_NVS_H_
-#include <rules.h>
+#include <commonlib/helpers.h>
#include <compiler.h>
-#include <vendorcode/google/chromeos/gnvs.h>
+#include <rules.h>
#include <soc/device_nvs.h>
+#include <vendorcode/google/chromeos/gnvs.h>
-typedef struct {
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -70,6 +71,7 @@ typedef struct {
/* LPSS (0x1000) */
device_nvs_t dev;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
void acpi_create_gnvs(global_nvs_t *gnvs);
#if ENV_SMM
diff --git a/src/soc/intel/broadwell/include/soc/nvs.h b/src/soc/intel/broadwell/include/soc/nvs.h
index a7d6d7c9fc..b40ffc4d20 100644
--- a/src/soc/intel/broadwell/include/soc/nvs.h
+++ b/src/soc/intel/broadwell/include/soc/nvs.h
@@ -17,11 +17,12 @@
#ifndef _BROADWELL_NVS_H_
#define _BROADWELL_NVS_H_
+#include <commonlib/helpers.h>
#include <compiler.h>
-#include <vendorcode/google/chromeos/gnvs.h>
#include <soc/device_nvs.h>
+#include <vendorcode/google/chromeos/gnvs.h>
-typedef struct {
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -58,6 +59,7 @@ typedef struct {
/* Device specific (0x1000) */
device_nvs_t dev;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
void acpi_create_gnvs(global_nvs_t *gnvs);
#ifdef __SMM__
diff --git a/src/soc/intel/cannonlake/include/soc/nvs.h b/src/soc/intel/cannonlake/include/soc/nvs.h
index aa5093d4ef..6c64f3ac2c 100644
--- a/src/soc/intel/cannonlake/include/soc/nvs.h
+++ b/src/soc/intel/cannonlake/include/soc/nvs.h
@@ -18,6 +18,7 @@
#ifndef _SOC_NVS_H_
#define _SOC_NVS_H_
+#include <commonlib/helpers.h>
#include <compiler.h>
#include <vendorcode/google/chromeos/gnvs.h>
@@ -45,6 +46,7 @@ typedef struct global_nvs_t {
/* ChromeOS specific (0x100 - 0xfff) */
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#endif
diff --git a/src/soc/intel/skylake/include/soc/nvs.h b/src/soc/intel/skylake/include/soc/nvs.h
index 68ac947b32..da6b2af110 100644
--- a/src/soc/intel/skylake/include/soc/nvs.h
+++ b/src/soc/intel/skylake/include/soc/nvs.h
@@ -18,11 +18,12 @@
#ifndef _SOC_NVS_H_
#define _SOC_NVS_H_
-#include <rules.h>
+#include <commonlib/helpers.h>
#include <compiler.h>
+#include <rules.h>
#include <vendorcode/google/chromeos/gnvs.h>
-typedef struct {
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -66,6 +67,7 @@ typedef struct {
/* ChromeOS specific (0x100 - 0xfff) */
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#if ENV_SMM
/* Used in SMM to find the ACPI GNVS address */
diff --git a/src/southbridge/intel/bd82x6x/nvs.h b/src/southbridge/intel/bd82x6x/nvs.h
index 51fc7bb1f4..207f763cee 100644
--- a/src/southbridge/intel/bd82x6x/nvs.h
+++ b/src/southbridge/intel/bd82x6x/nvs.h
@@ -14,10 +14,12 @@
* GNU General Public License for more details.
*/
-#include <stdint.h>
+#include <commonlib/helpers.h>
#include <compiler.h>
+#include <stdint.h>
#include "vendorcode/google/chromeos/gnvs.h"
-typedef struct {
+
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -152,6 +154,7 @@ typedef struct {
/* ChromeOS specific (starts at 0x100)*/
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#ifdef __SMM__
/* Used in SMM to find the ACPI GNVS address */
diff --git a/src/southbridge/intel/fsp_bd82x6x/nvs.h b/src/southbridge/intel/fsp_bd82x6x/nvs.h
index fc843194a7..a0e063c393 100644
--- a/src/southbridge/intel/fsp_bd82x6x/nvs.h
+++ b/src/southbridge/intel/fsp_bd82x6x/nvs.h
@@ -14,9 +14,11 @@
* GNU General Public License for more details.
*/
+#include <commonlib/helpers.h>
#include <compiler.h>
#include "vendorcode/google/chromeos/gnvs.h"
-typedef struct {
+
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -148,6 +150,7 @@ typedef struct {
/* ChromeOS specific (starts at 0x100)*/
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#ifdef __SMM__
/* Used in SMM to find the ACPI GNVS address */
diff --git a/src/southbridge/intel/fsp_i89xx/nvs.h b/src/southbridge/intel/fsp_i89xx/nvs.h
index fc843194a7..a0e063c393 100644
--- a/src/southbridge/intel/fsp_i89xx/nvs.h
+++ b/src/southbridge/intel/fsp_i89xx/nvs.h
@@ -14,9 +14,11 @@
* GNU General Public License for more details.
*/
+#include <commonlib/helpers.h>
#include <compiler.h>
#include "vendorcode/google/chromeos/gnvs.h"
-typedef struct {
+
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -148,6 +150,7 @@ typedef struct {
/* ChromeOS specific (starts at 0x100)*/
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#ifdef __SMM__
/* Used in SMM to find the ACPI GNVS address */
diff --git a/src/southbridge/intel/ibexpeak/nvs.h b/src/southbridge/intel/ibexpeak/nvs.h
index 6cd8ec3c4f..870391183f 100644
--- a/src/southbridge/intel/ibexpeak/nvs.h
+++ b/src/southbridge/intel/ibexpeak/nvs.h
@@ -14,9 +14,11 @@
* GNU General Public License for more details.
*/
+#include <commonlib/helpers.h>
#include <compiler.h>
#include "vendorcode/google/chromeos/gnvs.h"
-typedef struct {
+
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -150,6 +152,7 @@ typedef struct {
/* ChromeOS specific (starts at 0x100)*/
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#ifdef __SMM__
/* Used in SMM to find the ACPI GNVS address */
diff --git a/src/southbridge/intel/lynxpoint/nvs.h b/src/southbridge/intel/lynxpoint/nvs.h
index 667a6dba1b..e7d4a8b2d8 100644
--- a/src/southbridge/intel/lynxpoint/nvs.h
+++ b/src/southbridge/intel/lynxpoint/nvs.h
@@ -14,9 +14,11 @@
* GNU General Public License for more details.
*/
+#include <commonlib/helpers.h>
#include <compiler.h>
#include "vendorcode/google/chromeos/gnvs.h"
-typedef struct {
+
+typedef struct global_nvs_t {
/* Miscellaneous */
u16 osys; /* 0x00 - Operating System */
u8 smif; /* 0x02 - SMI function call ("TRAP") */
@@ -126,6 +128,7 @@ typedef struct {
/* ChromeOS specific (starts at 0x100)*/
chromeos_acpi_t chromeos;
} __packed global_nvs_t;
+check_member(global_nvs_t, chromeos, 0x100);
#ifdef __SMM__
/* Used in SMM to find the ACPI GNVS address */