diff --git a/tboot-gcc7.patch b/tboot-gcc7.patch new file mode 100644 index 0000000..b59936f --- /dev/null +++ b/tboot-gcc7.patch @@ -0,0 +1,86 @@ +Index: tboot-1.9.5/tboot/common/tboot.c +=================================================================== +--- tboot-1.9.5.orig/tboot/common/tboot.c ++++ tboot-1.9.5/tboot/common/tboot.c +@@ -501,11 +501,13 @@ static void shutdown_system(uint32_t shu + /* write our S3 resume vector to ACPI resume addr */ + set_s3_resume_vector(&_tboot_shared.acpi_sinfo, TBOOT_S3_WAKEUP_ADDR); + /* fall through for rest of Sx handling */ ++ /* FALLTHROUGH */ + case TB_SHUTDOWN_S4: + case TB_SHUTDOWN_S5: + machine_sleep(&_tboot_shared.acpi_sinfo); + /* if machine_sleep() fails, fall through to reset */ + ++ /* FALLTHROUGH */ + case TB_SHUTDOWN_REBOOT: + if ( txt_is_powercycle_required() ) { + /* powercycle by writing 0x0a+0x0e to port 0xcf9 */ +@@ -524,6 +526,7 @@ static void shutdown_system(uint32_t shu + outb(0xcf9, 0x06); + } + ++ /* FALLTHROUGH */ + case TB_SHUTDOWN_HALT: + default: + while ( true ) +Index: tboot-1.9.5/tboot/common/vsprintf.c +=================================================================== +--- tboot-1.9.5.orig/tboot/common/vsprintf.c ++++ tboot-1.9.5/tboot/common/vsprintf.c +@@ -404,6 +404,7 @@ handle_width: + case 'p': + mods.flag |= PREFIX; /* print prefix 0x for %p */ + mods.flag_long = LONG; ++ /* FALLTHROUGH */ + case 'x': + mods.base = 16; + buf_pos = write_number_to_buffer(buf, size, buf_pos, mods); +Index: tboot-1.9.5/tboot/common/tpm.c +=================================================================== +--- tboot-1.9.5.orig/tboot/common/tpm.c ++++ tboot-1.9.5/tboot/common/tpm.c +@@ -117,14 +117,14 @@ static bool tpm_send_cmd_ready_status_cr + #endif + + if ( reg_ctrl_sts.tpmidle== 1) { +- reg_ctrl_request._raw[0] = 0; ++ memset(®_ctrl_request,0,sizeof(reg_ctrl_request)); + reg_ctrl_request.cmdReady = 1; + write_tpm_reg(locality, TPM_CRB_CTRL_REQ, ®_ctrl_request); + + return true; + } + +- reg_ctrl_request._raw[0] = 0; ++ memset(®_ctrl_request,0,sizeof(reg_ctrl_request)); + reg_ctrl_request.goIdle = 1; + write_tpm_reg(locality, TPM_CRB_CTRL_REQ, ®_ctrl_request); + +@@ -158,7 +158,7 @@ static bool tpm_send_cmd_ready_status_cr + printk(TBOOT_INFO"2. reg_ctrl_sts.tpmsts: 0x%x\n", reg_ctrl_sts.tpmsts); + #endif + +- reg_ctrl_request._raw[0] = 0; ++ memset(®_ctrl_request,0,sizeof(reg_ctrl_request)); + reg_ctrl_request.cmdReady = 1; + write_tpm_reg(locality, TPM_CRB_CTRL_REQ, ®_ctrl_request); + +@@ -724,7 +724,7 @@ bool tpm_relinquish_locality_crb(uint32_ + if ( reg_loc_state.loc_assigned == 0 ) return true; + + /* make inactive by writing a 1 */ +- reg_loc_ctrl._raw[0] = 0; ++ memset(®_loc_ctrl,0,sizeof(reg_loc_ctrl)); + reg_loc_ctrl.relinquish = 1; + write_tpm_reg(locality, TPM_REG_LOC_CTRL, ®_loc_ctrl); + +@@ -778,7 +778,7 @@ bool tpm_request_locality_crb(uint32_t l + tpm_reg_loc_state_t reg_loc_state; + tpm_reg_loc_ctrl_t reg_loc_ctrl; + /* request access to the TPM from locality N */ +- reg_loc_ctrl._raw[0] = 0; ++ memset(®_loc_ctrl,0,sizeof(reg_loc_ctrl)); + reg_loc_ctrl.requestAccess = 1; + write_tpm_reg(locality, TPM_REG_LOC_CTRL, ®_loc_ctrl); + diff --git a/tboot.changes b/tboot.changes index 98c0d1d..ddf0378 100644 --- a/tboot.changes +++ b/tboot.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Jun 4 08:43:14 UTC 2017 - meissner@suse.com + +- tboot-gcc7.patch: fix some gcc7 warnings that lead to errors. (bsc#1041264) + ------------------------------------------------------------------- Sun Apr 30 05:29:57 UTC 2017 - bwiedemann@suse.com @@ -82,7 +87,7 @@ Fri May 8 12:08:52 UTC 2015 - meissner@suse.com * Fixed bug for wrong assumption on the way how GRUB2 load modules * Fixed MB2 tags mess issue caused by moving shorter module cmdline to head * Fixed compile issue when debug=y - +- fixes a boot issue on Skylake (bsc#964408) - refreshed tboot-grub2-fix-xen-submenu-name.patch ------------------------------------------------------------------- diff --git a/tboot.spec b/tboot.spec index fa96cc5..3563ee9 100644 --- a/tboot.spec +++ b/tboot.spec @@ -30,6 +30,7 @@ Patch3: tboot-grub2-fix-menu-in-xen-host-server.patch Patch4: tboot-grub2-fix-xen-submenu-name.patch # PATCH-FIX-UPSTREAM -- https://sourceforge.net/p/tboot/code/merge-requests/1/ Patch5: reproducible.patch +Patch6: tboot-gcc7.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: openssl-devel BuildRequires: trousers-devel @@ -46,6 +47,7 @@ verified launch of an OS kernel/VMM. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build export CFLAGS="%{optflags}"