SeaBIOS
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
May 2015
- 17 participants
- 36 discussions
Bits 16-31 of the SMM revision ID are feature bits. We only need to
check that SMBASE relocation is supported, but do not care about other
features. In particular, this allows the SMM I/O instruction restart
feature to be present.
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
src/fw/smm.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/fw/smm.c b/src/fw/smm.c
index dabc677..6cb484e 100644
--- a/src/fw/smm.c
+++ b/src/fw/smm.c
@@ -18,8 +18,14 @@
#include "util.h" // smm_setup
#include "x86.h" // wbinvd
-#define SMM_REV_I32 0x00020000
-#define SMM_REV_I64 0x00020064
+/*
+ * Check SMM state save area format (bits 0-15) and require support
+ * for SMBASE relocation.
+ */
+#define SMM_REV_MASK 0x0002ffff
+
+#define SMM_REV_I32 0x00020000
+#define SMM_REV_I64 0x00020064
struct smm_state {
union {
@@ -62,9 +68,10 @@ handle_smi(u16 cs)
if (smm == (void*)BUILD_SMM_INIT_ADDR) {
// relocate SMBASE to 0xa0000
- if (smm->cpu.i32.smm_rev == SMM_REV_I32) {
+ u32 rev = smm->cpu.i32.smm_rev & SMM_REV_MASK;
+ if (rev == SMM_REV_I32) {
smm->cpu.i32.smm_base = BUILD_SMM_ADDR;
- } else if (smm->cpu.i64.smm_rev == SMM_REV_I64) {
+ } else if (rev == SMM_REV_I64) {
smm->cpu.i64.smm_base = BUILD_SMM_ADDR;
} else {
warn_internalerror();
--
2.3.5
2
3

July 14, 2015
This patch initialises root complex register block BAR in order to
support TCO watchdog emulation features on QEMU.
Signed-off-by: Paulo Alcantara <pcacjr(a)zytor.com>
---
src/fw/dev-q35.h | 3 +++
src/fw/pciinit.c | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/src/fw/dev-q35.h b/src/fw/dev-q35.h
index c6f8bd9..201825d 100644
--- a/src/fw/dev-q35.h
+++ b/src/fw/dev-q35.h
@@ -27,6 +27,9 @@
#define ICH9_LPC_GEN_PMCON_1_SMI_LOCK (1 << 4)
#define ICH9_LPC_PORT_ELCR1 0x4d0
#define ICH9_LPC_PORT_ELCR2 0x4d1
+#define ICH9_LPC_RCBA 0xf0
+#define ICH9_LPC_RCBA_ADDR 0xfed1c000
+#define ICH9_LPC_RCBA_EN 0x1
#define PCI_DEVICE_ID_INTEL_ICH9_SMBUS 0x2930
#define ICH9_SMB_SMB_BASE 0x20
#define ICH9_SMB_HOSTC 0x40
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index ac39d23..defccf3 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -183,6 +183,10 @@ static void mch_isa_bridge_setup(struct pci_device *dev, void *arg)
/* acpi enable, SCI: IRQ9 000b = irq9*/
pci_config_writeb(bdf, ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_ACPI_EN);
+ /* set root complex register block BAR */
+ pci_config_writel(bdf, ICH9_LPC_RCBA,
+ ICH9_LPC_RCBA_ADDR | ICH9_LPC_RCBA_EN);
+
acpi_pm1a_cnt = acpi_pm_base + 0x04;
pmtimer_setup(acpi_pm_base + 0x08);
}
--
2.1.0
5
7
This interface provides some registers within a 32-byte range and can be
acessed through PCI-to-LPC bridge interface (PMBASE + 0x60).
It's commonly used as a watchdog timer to detect system lockups through
SMIs that are generated -- if TCO_EN bit is set -- on every timeout. If
NO_REBOOT bit is not set in GCS (General Control and Status register),
the system will be resetted upon second timeout if TCO_RLD register
wasn't previously written to prevent timeout.
This patch adds support to TCO watchdog logic and few other features
like mapping NMIs to SMIs (NMI2SMI_EN bit), system intruder detection,
etc. are not implemented yet.
Signed-off-by: Paulo Alcantara <pcacjr(a)zytor.com>
---
hw/acpi/Makefile.objs | 1 +
hw/acpi/ich9.c | 36 ++++++++++
hw/acpi/tco.c | 188 +++++++++++++++++++++++++++++++++++++++++++++++++
hw/isa/lpc_ich9.c | 10 +++
include/hw/acpi/ich9.h | 4 ++
include/hw/acpi/tco.h | 139 ++++++++++++++++++++++++++++++++++++
include/hw/i386/ich9.h | 8 +++
7 files changed, 386 insertions(+)
create mode 100644 hw/acpi/tco.c
create mode 100644 include/hw/acpi/tco.h
diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
index b9fefa7..a32b7f8 100644
--- a/hw/acpi/Makefile.objs
+++ b/hw/acpi/Makefile.objs
@@ -1,4 +1,5 @@
common-obj-$(CONFIG_ACPI) += core.o piix4.o ich9.o pcihp.o cpu_hotplug.o
+common-obj-$(CONFIG_ACPI) += tco.o
common-obj-$(CONFIG_ACPI) += memory_hotplug.o
common-obj-$(CONFIG_ACPI) += acpi_interface.o
common-obj-$(CONFIG_ACPI) += bios-linker-loader.o
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 84e5bb8..8c4364b 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -30,6 +30,7 @@
#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "hw/acpi/acpi.h"
+#include "hw/acpi/tco.h"
#include "sysemu/kvm.h"
#include "exec/address-spaces.h"
@@ -92,8 +93,15 @@ static void ich9_smi_writel(void *opaque, hwaddr addr, uint64_t val,
unsigned width)
{
ICH9LPCPMRegs *pm = opaque;
+ TCOIORegs *tr = &pm->tco_regs;
+
switch (addr) {
case 0:
+ /* once TCO_LOCK bit is set, TCO_EN bit cannot be overwritten */
+ if (tr->tco.cnt1 & TCO_LOCK) {
+ val &= ~ICH9_PMIO_SMI_EN_TCO_EN;
+ val |= pm->smi_en & ICH9_PMIO_SMI_EN_TCO_EN;
+ }
pm->smi_en = val;
break;
}
@@ -107,6 +115,29 @@ static const MemoryRegionOps ich9_smi_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
+static uint64_t ich9_tco_readw(void *opaque, hwaddr addr, unsigned width)
+{
+ ICH9LPCPMRegs *pm = opaque;
+ return acpi_pm_tco_ioport_readw(&pm->tco_regs, addr);
+}
+
+static void ich9_tco_writew(void *opaque, hwaddr addr, uint64_t val,
+ unsigned width)
+{
+ ICH9LPCPMRegs *pm = opaque;
+ acpi_pm_tco_ioport_writew(&pm->tco_regs, addr, val);
+}
+
+static const MemoryRegionOps ich9_tco_ops = {
+ .read = ich9_tco_readw,
+ .write = ich9_tco_writew,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
+ .impl.min_access_size = 1,
+ .impl.max_access_size = 2,
+ .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base)
{
ICH9_DEBUG("to 0x%x\n", pm_io_base);
@@ -230,6 +261,11 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
"acpi-smi", 8);
memory_region_add_subregion(&pm->io, ICH9_PMIO_SMI_EN, &pm->io_smi);
+ acpi_pm_tco_init(&pm->tco_regs);
+ memory_region_init_io(&pm->io_tco, OBJECT(lpc_pci), &ich9_tco_ops, pm,
+ "sm-tco", ICH9_PMIO_TCO_LEN);
+ memory_region_add_subregion(&pm->io, ICH9_PMIO_TCO_RLD, &pm->io_tco);
+
pm->irq = sci_irq;
qemu_register_reset(pm_reset, pm);
pm->powerdown_notifier.notify = pm_powerdown_req;
diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c
new file mode 100644
index 0000000..3a44a95
--- /dev/null
+++ b/hw/acpi/tco.c
@@ -0,0 +1,188 @@
+/*
+ * QEMU ICH9 TCO emulation
+ *
+ * Copyright (c) 2015 Paulo Alcantara <pcacjr(a)zytor.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "qemu-common.h"
+#include "sysemu/watchdog.h"
+#include "hw/i386/ich9.h"
+
+#include "hw/acpi/tco.h"
+
+//#define DEBUG
+
+#ifdef DEBUG
+#define TCO_DEBUG(fmt, ...) \
+ do { \
+ fprintf(stderr, "%s "fmt, __func__, ## __VA_ARGS__); \
+ } while (0)
+#else
+#define TCO_DEBUG(fmt, ...) do { } while (0)
+#endif
+
+static QEMUTimer *tco_timer;
+static unsigned int timeouts_no;
+
+static inline void tco_timer_reload(void)
+{
+ int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+
+ timer_del(tco_timer);
+ timer_mod(tco_timer, now + tco_ticks_per_sec());
+}
+
+static inline void tco_timer_stop(void)
+{
+ timer_del(tco_timer);
+}
+
+static void tco_timer_expired(void *opaque)
+{
+ TCOIORegs *tr = opaque;
+ ICH9LPCPMRegs *pm = container_of(tr, ICH9LPCPMRegs, tco_regs);
+ ICH9LPCState *lpc = container_of(pm, ICH9LPCState, pm);
+ uint32_t gcs = pci_get_long(lpc->chip_config + ICH9_LPC_RCBA_GCS);
+
+ tr->tco.rld--;
+ if (tr->tco.rld & TCO_RLD_MASK) {
+ goto out;
+ }
+
+ tr->tco.sts1 |= TCO_TIMEOUT;
+ if (++timeouts_no == 2) {
+ tr->tco.sts1 |= TCO_SECOND_TO_STS;
+ tr->tco.sts1 |= TCO_BOOT_STS;
+ timeouts_no = 0;
+
+ if (!(gcs & ICH9_LPC_RCBA_GCS_NO_REBOOT)) {
+ watchdog_perform_action();
+ tco_timer_stop();
+ return;
+ }
+ }
+ tr->tco.rld = tr->tco.tmr;
+
+ if (pm->smi_en & ICH9_PMIO_SMI_EN_TCO_EN) {
+ ich9_generate_smi();
+ } else {
+ ich9_generate_nmi();
+ }
+
+out:
+ tco_timer_reload();
+}
+
+void acpi_pm_tco_init(TCOIORegs *tr)
+{
+ *tr = TCO_IO_REGS_DEFAULTS_INIT();
+ tco_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tco_timer_expired, tr);
+}
+
+uint32_t acpi_pm_tco_ioport_readw(TCOIORegs *tr, uint32_t addr)
+{
+ switch (addr) {
+ case TCO_RLD:
+ return tr->tco.rld;
+ case TCO_DAT_IN:
+ return tr->tco.din;
+ case TCO_DAT_OUT:
+ return tr->tco.dout;
+ case TCO1_STS:
+ return tr->tco.sts1;
+ case TCO2_STS:
+ return tr->tco.sts2;
+ case TCO1_CNT:
+ return tr->tco.cnt1;
+ case TCO2_CNT:
+ return tr->tco.cnt2;
+ case TCO_MESSAGE1:
+ return tr->tco.msg1;
+ case TCO_MESSAGE2:
+ return tr->tco.msg2;
+ case TCO_WDCNT:
+ return tr->tco.wdcnt;
+ case TCO_TMR:
+ return tr->tco.tmr;
+ case SW_IRQ_GEN:
+ return tr->sw_irq_gen;
+ }
+ return 0;
+}
+
+void acpi_pm_tco_ioport_writew(TCOIORegs *tr, uint32_t addr, uint32_t val)
+{
+ switch (addr) {
+ case TCO_RLD:
+ timeouts_no = 0;
+ if (can_start_tco_timer(tr)) {
+ tr->tco.rld = tr->tco.tmr;
+ tco_timer_reload();
+ } else {
+ tr->tco.rld = val;
+ }
+ break;
+ case TCO_DAT_IN:
+ tr->tco.din = val;
+ tr->tco.sts1 |= SW_TCO_SMI;
+ ich9_generate_smi();
+ break;
+ case TCO_DAT_OUT:
+ tr->tco.dout = val;
+ tr->tco.sts1 |= TCO_INT_STS;
+ /* TODO: cause an interrupt, as selected by the TCO_INT_SEL bits */
+ break;
+ case TCO1_STS:
+ tr->tco.sts1 = val & TCO1_STS_MASK;
+ break;
+ case TCO2_STS:
+ tr->tco.sts2 = val & TCO2_STS_MASK;
+ break;
+ case TCO1_CNT:
+ val &= TCO1_CNT_MASK;
+ /* TCO_LOCK bit cannot be changed once set */
+ tr->tco.cnt1 = (val & ~TCO_LOCK) | (tr->tco.cnt1 & TCO_LOCK);
+ if (can_start_tco_timer(tr)) {
+ tr->tco.rld = tr->tco.tmr;
+ tco_timer_reload();
+ } else {
+ tco_timer_stop();
+ }
+ break;
+ case TCO2_CNT:
+ tr->tco.cnt2 = val;
+ break;
+ case TCO_MESSAGE1:
+ tr->tco.msg1 = val;
+ break;
+ case TCO_MESSAGE2:
+ tr->tco.msg2 = val;
+ break;
+ case TCO_WDCNT:
+ tr->tco.wdcnt = val;
+ break;
+ case TCO_TMR:
+ tr->tco.tmr = val;
+ break;
+ case SW_IRQ_GEN:
+ tr->sw_irq_gen = val;
+ break;
+ }
+}
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index dba7585..7bfb683 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -313,6 +313,16 @@ PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin)
return route;
}
+void ich9_generate_smi(void)
+{
+ cpu_interrupt(first_cpu, CPU_INTERRUPT_SMI);
+}
+
+void ich9_generate_nmi(void)
+{
+ cpu_interrupt(first_cpu, CPU_INTERRUPT_NMI);
+}
+
static int ich9_lpc_sci_irq(ICH9LPCState *lpc)
{
switch (lpc->d.config[ICH9_LPC_ACPI_CTRL] &
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index c2d3dba..31c74af 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -25,6 +25,7 @@
#include "hw/acpi/cpu_hotplug.h"
#include "hw/acpi/memory_hotplug.h"
#include "hw/acpi/acpi_dev_interface.h"
+#include "hw/acpi/tco.h"
typedef struct ICH9LPCPMRegs {
/*
@@ -37,6 +38,7 @@ typedef struct ICH9LPCPMRegs {
MemoryRegion io;
MemoryRegion io_gpe;
MemoryRegion io_smi;
+ MemoryRegion io_tco;
uint32_t smi_en;
uint32_t smi_sts;
@@ -53,6 +55,8 @@ typedef struct ICH9LPCPMRegs {
uint8_t disable_s3;
uint8_t disable_s4;
uint8_t s4_val;
+
+ TCOIORegs tco_regs;
} ICH9LPCPMRegs;
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
diff --git a/include/hw/acpi/tco.h b/include/hw/acpi/tco.h
new file mode 100644
index 0000000..700532c
--- /dev/null
+++ b/include/hw/acpi/tco.h
@@ -0,0 +1,139 @@
+/*
+ * QEMU ICH9 TCO emulation
+ *
+ * Copyright (c) 2015 Paulo Alcantara <pcacjr(a)zytor.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#ifndef HW_ACPI_TCO_H
+#define HW_ACPI_TCO_H
+
+#include "qemu/typedefs.h"
+#include "qemu-common.h"
+
+/* TCO I/O register offsets */
+enum {
+ TCO_RLD = 0x00,
+ TCO_DAT_IN = 0x02,
+ TCO_DAT_OUT = 0x03,
+ TCO1_STS = 0x04,
+ TCO2_STS = 0x06,
+ TCO1_CNT = 0x08,
+ TCO2_CNT = 0x0a,
+ TCO_MESSAGE1 = 0x0c,
+ TCO_MESSAGE2 = 0x0d,
+ TCO_WDCNT = 0x0e,
+ SW_IRQ_GEN = 0x10,
+ TCO_TMR = 0x12,
+};
+
+/* TCO I/O register defaults */
+enum {
+ TCO_RLD_DEFAULT = 0x0000,
+ TCO_DAT_IN_DEFAULT = 0x00,
+ TCO_DAT_OUT_DEFAULT = 0x00,
+ TCO1_STS_DEFAULT = 0x0000,
+ TCO2_STS_DEFAULT = 0x0000,
+ TCO1_CNT_DEFAULT = 0x0000,
+ TCO2_CNT_DEFAULT = 0x0008,
+ TCO_MESSAGE1_DEFAULT = 0x00,
+ TCO_MESSAGE2_DEFAULT = 0x00,
+ TCO_WDCNT_DEFAULT = 0x00,
+ TCO_TMR_DEFAULT = 0x0004,
+ SW_IRQ_GEN_DEFAULT = 0x03,
+};
+
+/* TCO I/O register control/status bits */
+enum {
+ SW_TCO_SMI = (1 << 1),
+ TCO_INT_STS = (1 << 2),
+ TCO_LOCK = (1 << 12),
+ TCO_TMR_HLT = (1 << 11),
+ TCO_TIMEOUT = (1 << 3),
+ TCO_SECOND_TO_STS = (1 << 1),
+ TCO_BOOT_STS = (1 << 2),
+};
+
+/* TCO I/O registers mask bits */
+enum {
+ TCO_RLD_MASK = 0x3ff,
+ TCO1_STS_MASK = 0xe870,
+ TCO2_STS_MASK = 0xfff8,
+ TCO1_CNT_MASK = 0xfeff,
+ TCO_TMR_MASK = 0x3ff,
+};
+
+typedef struct TCOIORegs {
+ struct {
+ uint16_t rld;
+ uint8_t din;
+ uint8_t dout;
+ uint16_t sts1;
+ uint16_t sts2;
+ uint16_t cnt1;
+ uint16_t cnt2;
+ uint8_t msg1;
+ uint8_t msg2;
+ uint8_t wdcnt;
+ uint16_t tmr;
+ } tco;
+ uint8_t sw_irq_gen;
+} TCOIORegs;
+
+#define TCO_IO_REGS_DEFAULTS_INIT() \
+ (TCOIORegs) { \
+ .tco = { \
+ .rld = TCO_RLD_DEFAULT, \
+ .din = TCO_DAT_IN_DEFAULT, \
+ .dout = TCO_DAT_OUT_DEFAULT, \
+ .sts1 = TCO1_STS_DEFAULT, \
+ .sts2 = TCO2_STS_DEFAULT, \
+ .cnt1 = TCO1_CNT_DEFAULT, \
+ .cnt2 = TCO2_CNT_DEFAULT, \
+ .msg1 = TCO_MESSAGE1_DEFAULT, \
+ .msg2 = TCO_MESSAGE2_DEFAULT, \
+ .wdcnt = TCO_WDCNT_DEFAULT, \
+ .tmr = TCO_TMR_DEFAULT, \
+ }, \
+ .sw_irq_gen = SW_IRQ_GEN_DEFAULT \
+ }
+
+/* tco.c */
+void acpi_pm_tco_init(TCOIORegs *tr);
+uint32_t acpi_pm_tco_ioport_readw(TCOIORegs *tr, uint32_t addr);
+void acpi_pm_tco_ioport_writew(TCOIORegs *tr, uint32_t addr, uint32_t val);
+
+/* As per ICH9 spec, the internal timer has an error of ~0.6s on every tick */
+static inline int64_t tco_ticks_per_sec(void)
+{
+ return 600000000LL;
+}
+
+static inline int is_valid_tco_time(uint32_t val)
+{
+ /* values of 0 or 1 will be ignored by ICH */
+ return val > 1;
+}
+
+static inline int can_start_tco_timer(TCOIORegs *tr)
+{
+ return !(tr->tco.cnt1 & TCO_TMR_HLT) && is_valid_tco_time(tr->tco.tmr);
+}
+
+#endif /* HW_ACPI_TCO_H */
diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index f4e522c..f41cca6 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -20,6 +20,9 @@ PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin);
void ich9_lpc_pm_init(PCIDevice *pci_lpc);
I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
+void ich9_generate_smi(void);
+void ich9_generate_nmi(void);
+
#define ICH9_CC_SIZE (16 * 1024) /* 16KB */
#define TYPE_ICH9_LPC_DEVICE "ICH9-LPC"
@@ -156,6 +159,8 @@ Object *ich9_lpc_find(void);
#define ICH9_LPC_RCBA_BA_MASK Q35_MASK(32, 31, 14)
#define ICH9_LPC_RCBA_EN 0x1
#define ICH9_LPC_RCBA_DEFAULT 0x0
+#define ICH9_LPC_RCBA_GCS 0x3410
+#define ICH9_LPC_RCBA_GCS_NO_REBOOT (1 << 5)
#define ICH9_LPC_PIC_NUM_PINS 16
#define ICH9_LPC_IOAPIC_NUM_PINS 24
@@ -180,7 +185,10 @@ Object *ich9_lpc_find(void);
#define ICH9_PMIO_GPE0_LEN 16
#define ICH9_PMIO_SMI_EN 0x30
#define ICH9_PMIO_SMI_EN_APMC_EN (1 << 5)
+#define ICH9_PMIO_SMI_EN_TCO_EN (1 << 13)
#define ICH9_PMIO_SMI_STS 0x34
+#define ICH9_PMIO_TCO_RLD 0x60
+#define ICH9_PMIO_TCO_LEN 32
/* FADT ACPI_ENABLE/ACPI_DISABLE */
#define ICH9_APM_ACPI_ENABLE 0x2
--
2.1.0
7
74
The following set of patches add support for
- the BIOS taking measurements of various parts of the code and data, adding
them to the ACPI log, and extending the PCRs of the TPM with the measurements
- a reworked TPM menu
- a reworked Physical Presence Interface
Regards,
Stefan
Stefan Berger (3):
Add 'measurement' code to the BIOS
Support for TPM Physical Presence Interface
Add a menu for TPM control
src/boot.c | 20 +-
src/cdrom.c | 4 +
src/hw/tpm_drivers.h | 1 +
src/optionroms.c | 2 +
src/tcgbios.c | 1067 +++++++++++++++++++++++++++++++++++++++++++++++++-
src/tcgbios.h | 50 +++
src/util.h | 1 +
7 files changed, 1140 insertions(+), 5 deletions(-)
--
1.9.3
2
15
Dear SeaBIOS folks,
building SeaBIOS commit 67643955 (make SeaBios compatible with Xen
vTPM.) for coreboot with the attached configuration with GCC 5.1.1, (CPP
4.9) the following warnings are printed.
$ gcc-5 --version
gcc-5 (Debian 5.1.1-7) 5.1.1 20150522
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
$ CC=gcc-5 make
Build Kconfig config file
Compile checking out/src/misc.o
In file included from src/misc.c:13:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/stacks.o
Compile checking out/src/output.o
In file included from src/output.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/string.o
Compile checking out/src/block.o
In file included from src/block.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^$ CC=gcc-5 make
Build Kconfig config file
Compile checking out/src/misc.o
In file included from src/misc.c:13:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/stacks.o
Compile checking out/src/output.o
In file included from src/output.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/string.o
Compile checking out/src/block.o
In file included from src/block.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/cdrom.o
In file included from src/cdrom.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/disk.o
In file included from src/disk.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/mouse.o
In file included from src/mouse.c:11:0:
src/hw/usb-hid.h:10:12: warning: inline function
'usb_mouse_command' declared but never defined
inline int usb_mouse_command(int command, u8 *param);
^
src/hw/usb-hid.h:9:12: warning: inline function
'usb_mouse_active' declared but never defined
inline int usb_mouse_active(void);
^
src/hw/usb-hid.h:8:12: warning: inline function
'usb_kbd_command' declared but never defined
inline int usb_kbd_command(int command, u8 *param);
^
src/hw/usb-hid.h:7:12: warning: inline function 'usb_kbd_active'
declared but never defined
inline int usb_kbd_active(void);
^
Compile checking out/src/kbd.o
In file included from src/kbd.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
In file included from src/kbd.c:12:0:
src/hw/usb-hid.h:10:12: warning: inline function
'usb_mouse_command' declared but never defined
inline int usb_mouse_command(int command, u8 *param);
^
src/hw/usb-hid.h:9:12: warning: inline function
'usb_mouse_active' declared but never defined
inline int usb_mouse_active(void);
^
src/hw/usb-hid.h:8:12: warning: inline function
'usb_kbd_command' declared but never defined
inline int usb_kbd_command(int command, u8 *param);
^
src/hw/usb-hid.h:7:12: warning: inline function 'usb_kbd_active'
declared but never defined
inline int usb_kbd_active(void);
^
Compile checking out/src/system.o
In file included from src/system.c:14:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/serial.o
Compile checking out/src/clock.o
In file included from src/clock.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
In file included from src/clock.c:12:0:
src/hw/usb-hid.h:10:12: warning: inline function
'usb_mouse_command' declared but never defined
inline int usb_mouse_command(int command, u8 *param);
^
src/hw/usb-hid.h:9:12: warning: inline function
'usb_mouse_active' declared but never defined
inline int usb_mouse_active(void);
^
src/hw/usb-hid.h:8:12: warning: inline function
'usb_kbd_command' declared but never defined
inline int usb_kbd_command(int command, u8 *param);
^
src/hw/usb-hid.h:7:12: warning: inline function 'usb_kbd_active'
declared but never defined
inline int usb_kbd_active(void);
^
Compile checking out/src/resume.o
In file included from src/resume.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/pnpbios.o
In file included from src/pnpbios.c:11:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/vgahooks.o
In file included from src/vgahooks.c:14:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/pcibios.o
In file included from src/pcibios.c:14:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/apm.o
Compile checking out/src/hw/pci.o
In file included from src/hw/pci.c:13:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/timer.o
Compile checking out/src/hw/rtc.o
Compile checking out/src/hw/dma.o
Compile checking out/src/hw/pic.o
Compile checking out/src/hw/ps2port.o
Compile checking out/src/hw/serialio.o
Compile checking out/src/hw/usb.o
In file included from src/hw/usb.c:15:0:
src/hw/usb-hid.h:10:12: warning: inline function
'usb_mouse_command' declared but never defined
inline int usb_mouse_command(int command, u8 *param);
^
src/hw/usb-hid.h:9:12: warning: inline function
'usb_mouse_active' declared but never defined
inline int usb_mouse_active(void);
^
src/hw/usb-hid.h:8:12: warning: inline function
'usb_kbd_command' declared but never defined
inline int usb_kbd_command(int command, u8 *param);
^
src/hw/usb-hid.h:7:12: warning: inline function 'usb_kbd_active'
declared but never defined
inline int usb_kbd_active(void);
^
In file included from src/hw/usb.c:11:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-uhci.o
In file included from src/hw/usb-uhci.c:14:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-ohci.o
In file included from src/hw/usb-ohci.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-ehci.o
In file included from src/hw/usb-ehci.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-hid.o
In file included from src/biosvar.h:10:0,
from src/hw/usb-hid.c:7:
src/biosvar.h:101:48: warning: 'get_global_offset' is static but
used in inline function 'usb_mouse_active' which is not static
+
get_global_offset()))
^
src/farptr.h:183:28: note: in definition of macro 'GET_VAR'
#define GET_VAR(seg, var) (var)
^
src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
src/biosvar.h:101:48: warning: 'get_global_offset' is static but
used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
src/farptr.h:183:28: note: in definition of macro 'GET_VAR'
#define GET_VAR(seg, var) (var)
^
src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
Compile checking out/src/hw/usb-msc.o
In file included from src/hw/usb-msc.c:14:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-uas.o
In file included from src/hw/usb-uas.c:24:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/blockcmd.o
In file included from src/hw/blockcmd.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/floppy.o
In file included from src/hw/floppy.c:21:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/ata.o
In file included from src/hw/ata.c:21:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/ramdisk.o
In file included from src/hw/ramdisk.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/virtio-ring.o
Compile checking out/src/hw/virtio-pci.o
In file included from src/hw/virtio-pci.c:23:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/virtio-blk.o
In file included from src/hw/virtio-blk.c:19:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/virtio-scsi.o
In file included from src/hw/virtio-scsi.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/lsi-scsi.o
In file included from src/hw/lsi-scsi.c:24:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/esp-scsi.o
In file included from src/hw/esp-scsi.c:24:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/megasas.o
In file included from src/hw/megasas.c:24:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/post.o
In file included from src/post.c:29:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/memmap.o
In file included from src/memmap.c:10:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/malloc.o
In file included from src/malloc.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/romfile.o
In file included from src/romfile.c:11:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/x86.o
Compile checking out/src/optionroms.o
In file included from src/optionroms.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/pmm.o
In file included from src/pmm.c:12:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/font.o
Compile checking out/src/boot.o
In file included from src/boot.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/bootsplash.o
In file included from src/bootsplash.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/jpeg.o
In file included from src/jpeg.c:44:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/bmp.o
In file included from src/bmp.c:10:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/tcgbios.o
In file included from src/tcgbios.c:19:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/sha1.o
In file included from src/sha1.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/ahci.o
In file included from src/hw/ahci.c:18:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/pvscsi.o
In file included from src/hw/pvscsi.c:20:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-xhci.o
In file included from src/hw/usb-xhci.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/usb-hub.o
In file included from src/hw/usb-hub.c:9:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/sdcard.o
In file included from src/hw/sdcard.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/coreboot.o
In file included from src/fw/coreboot.c:18:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/lzmadecode.o
Compile checking out/src/fw/csm.o
Compile checking out/src/fw/biostables.o
In file included from src/fw/biostables.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/paravirt.o
In file included from src/fw/paravirt.c:22:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/shadow.o
In file included from src/fw/shadow.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/pciinit.o
In file included from src/fw/pciinit.c:22:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/smm.o
In file included from src/fw/smm.c:17:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/smp.o
Compile checking out/src/fw/mtrr.o
Compile checking out/src/fw/xen.o
In file included from src/fw/xen.c:13:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compiling IASL out/src/fw/acpi-dsdt.hex
ASL Input: out/src/fw/acpi-dsdt.dsl.i - 474 lines, 19153
bytes, 315 keywords
AML Output: out/src/fw/acpi-dsdt.aml - 4405 bytes, 159 named
objects, 156 executable opcodes
Listing File: out/src/fw/acpi-dsdt.lst - 142995 bytes
Hex Dump: out/src/fw/acpi-dsdt.hex - 41648 bytes
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 245
Optimizations
Compiling IASL out/src/fw/ssdt-proc.hex
ASL Input: out/src/fw/ssdt-proc.dsl.i - 35 lines, 762 bytes,
8 keywords
AML Output: out/src/fw/ssdt-proc.aml - 120 bytes, 6 named
objects, 2 executable opcodes
Listing File: out/src/fw/ssdt-proc.lst - 2642 bytes
Hex Dump: out/src/fw/ssdt-proc.hex - 1446 bytes
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0
Optimizations
Compiling IASL out/src/fw/ssdt-pcihp.hex
ASL Input: out/src/fw/ssdt-pcihp.dsl.i - 36 lines, 758
bytes, 5 keywords
AML Output: out/src/fw/ssdt-pcihp.aml - 87 bytes, 5 named
objects, 0 executable opcodes
Listing File: out/src/fw/ssdt-pcihp.lst - 2337 bytes
Hex Dump: out/src/fw/ssdt-pcihp.hex - 1147 bytes
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0
Optimizations
Compiling IASL out/src/fw/ssdt-misc.hex
ASL Input: out/src/fw/ssdt-misc.dsl.i - 101 lines, 2567
bytes, 35 keywords
AML Output: out/src/fw/ssdt-misc.aml - 354 bytes, 24 named
objects, 11 executable opcodes
Listing File: out/src/fw/ssdt-misc.lst - 7646 bytes
Hex Dump: out/src/fw/ssdt-misc.hex - 3697 bytes
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 2
Optimizations
Compiling IASL out/src/fw/q35-acpi-dsdt.hex
ASL Input: out/src/fw/q35-acpi-dsdt.dsl.i - 514 lines, 28284
bytes, 413 keywords
AML Output: out/src/fw/q35-acpi-dsdt.aml - 7344 bytes, 239
named objects, 174 executable opcodes
Listing File: out/src/fw/q35-acpi-dsdt.lst - 255956 bytes
Hex Dump: out/src/fw/q35-acpi-dsdt.hex - 69177 bytes
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 445
Optimizations
Compile checking out/src/fw/acpi.o
In file included from src/fw/acpi.c:21:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/mptable.o
In file included from src/fw/mptable.c:16:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/pirtable.o
In file included from src/fw/pirtable.c:12:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/smbios.o
In file included from src/fw/smbios.c:15:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/fw/romfile_loader.o
In file included from src/fw/romfile_loader.c:4:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compile checking out/src/hw/tpm_drivers.o
In file included from src/hw/tpm_drivers.c:11:0:
src/string.h:18:13: warning: inline function 'memcpy_far'
declared but never defined
inline void memcpy_far(u16 d_seg, void *d_far
^
src/string.h:15:13: warning: inline function 'memset16_far'
declared but never defined
inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t
len);
^
src/string.h:14:13: warning: inline function 'memset_far'
declared but never defined
inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t
len);
^
Compiling whole program out/ccode32flat.o
In file included from ./src/biosvar.h:10:0,
from ./src/misc.c:8,
from out/ccode32flat.o.tmp.c:1:
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:183:28: note: in definition of macro 'GET_VAR'
#define GET_VAR(seg, var) (var)
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:183:28: note: in definition of macro 'GET_VAR'
#define GET_VAR(seg, var) (var)
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
Compiling whole program out/code32seg.o
In file included from ./src/string.c:9:0,
from out/code32seg.o.tmp.c:1:
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memcpy_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:129:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memset16_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:101:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memset_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:89:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
Compiling whole program out/ccode16.o
In file included from ./src/biosvar.h:10:0,
from ./src/misc.c:8,
from out/ccode16.o.tmp.c:1:
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:28:59: note: in definition of macro 'READ64_SEG'
union u64_u32_u *__r64_ptr = (union u64_u32_u *)&(var);
\
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:25:19: note: in definition of macro 'READ32_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:22:19: note: in definition of macro 'READ16_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:19:19: note: in definition of macro 'READ8_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_mouse_active' which is not
static
+
get_global_offset()))
^
./src/farptr.h:56:12: note: in definition of macro '__GET_VAR'
typeof(var) __val; \
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:388:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(mouse_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:28:59: note: in definition of macro 'READ64_SEG'
union u64_u32_u *__r64_ptr = (union u64_u32_u *)&(var);
\
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:25:19: note: in definition of macro 'READ32_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:22:19: note: in definition of macro 'READ16_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:19:19: note: in definition of macro 'READ8_SEG'
: "m"(var), "m"(__segment_ ## SEG))
^
./src/farptr.h:144:27: note: in expansion of macro '__GET_VAR'
#define GET_VAR(seg, var) __GET_VAR("", seg, (var))
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
./src/biosvar.h:101:48: warning: 'get_global_offset' is static
but used in inline function 'usb_kbd_active' which is not static
+
get_global_offset()))
^
./src/farptr.h:56:12: note: in definition of macro '__GET_VAR'
typeof(var) __val; \
^
./src/biosvar.h:100:5: note: in expansion of macro 'GET_VAR'
GET_VAR(GLOBAL_SEGREG, *(typeof(&(var)))((void*)&(var)
\
^
./src/hw/usb-hid.c:316:12: note: in expansion of macro
'GET_GLOBAL'
return GET_GLOBAL(keyboard_pipe) != NULL;
^
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memcpy_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:129:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memset16_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:101:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
./src/farptr.h:102:5: warning: '__set_seg_ES' is static but used
in inline function 'memset_far' which is not static
__set_seg_##SEG(value)
^
./src/farptr.h:146:29: note: in expansion of macro '__SET_SEG'
#define SET_SEG(SEG, value) __SET_SEG(SEG, (value))
^
./src/string.c:89:5: note: in expansion of macro 'SET_SEG'
SET_SEG(ES, d_seg);
^
Compiling to assembler out/src/asm-offsets.s
Generating offset file out/asm-offsets.h
Compiling (16bit) out/romlayout.o
Building ld scripts
Version: rel-1.8.0-32-g6764395-20150523_153633-my-asrock-e350m1
Fixed space: 0xe05b-0x10000 total: 8101 slack: 8 Percent
slack: 0.1%
16bit size: 20288
32bit segmented size: 0
32bit flat size: 19248
32bit flat init size: 23728
Lowmem size: 2128
f-segment var size: 1104
Linking out/rom16.o
Stripping out/rom16.strip.o
Linking out/rom32seg.o
Stripping out/rom32seg.strip.o
Linking out/rom.o
Prepping out/bios.bin.prep
Total size: 68312 Fixed: 40640 Free: 62760 (used 52.1% of
128KiB rom)
Creating out/bios.bin.elf
Thanks,
Paul
2
3
In anticipation that the first 3 patches of the previous series
are going to be pushed, here are now the remaining 3 patches
with a reworked TPM menu and a reworked Physical Presence
Interface.
Previous series:
http://www.seabios.org/pipermail/seabios/2015-March/008975.html
Stefan Berger (3):
Add 'measurement' code to the BIOS
Support for TPM Physical Presence Interface
Add a menu for TPM control
src/boot.c | 26 +-
src/cdrom.c | 11 +
src/hw/tpm_drivers.h | 1 +
src/optionroms.c | 4 +
src/post.c | 7 +
src/tcgbios.c | 1067 +++++++++++++++++++++++++++++++++++++++++++++++++-
src/tcgbios.h | 58 +++
src/util.h | 1 +
8 files changed, 1165 insertions(+), 10 deletions(-)
--
1.9.3
3
11
Date: Sat, 23 May 2015 16:02:08 +0200
Using the conditional assignment operator `?=` [1] instead of `=` makes
it possible to override the variable `CPP` by using an environment
variable
$ CPP=cpp-5 make
or directly setting it.
$ make CPP=cpp-5
[1] https://www.gnu.org/software/make/manual/make.html#Setting
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 01cadda..63bff49 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ OBJCOPY=$(CROSS_PREFIX)objcopy
OBJDUMP=$(CROSS_PREFIX)objdump
STRIP=$(CROSS_PREFIX)strip
PYTHON=python
-CPP=cpp
+CPP?=cpp
IASL:=iasl
LD32BIT_FLAG:=-melf_i386
--
2.1.4
2
1

June 1, 2015
From 7ecb31e60ca5cde8f7649414a0463ff70fbe2865 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Mon, 18 May 2015 19:07:16 +0200
Subject: [PATCH 2/2] Add multiboot support.
I've been successfully using SeaBIOS as secondary bootloader. In more
details
I have GRUB2-as-payload in flash together with coreboot. SeaBIOS binary
is on
the HDD and loaded by GRUB when needed. This has an unfortunate consequence
that I have to keep vga oprom in flash even if usually I boot without
it. This
patches makes bios.bin.elf multiboot executable with files passed as
modules.
Example:
menuentry "SeaBIOS (mb)" --unrestricted {
root=ahci0,2
multiboot /bios.bin.elf
module /vgabios_x230.rom name=pci8086,0166.rom
}
the parameter name= specifies under which name SeaBIOS will see it.
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
Makefile | 3 +-
scripts/layoutrom.py | 16 +++-
src/Kconfig | 7 ++
src/fw/coreboot.c | 2 +
src/fw/multiboot.c | 114 ++++++++++++++++++++++
src/post.c | 1 +
src/romlayout.S | 3 +-
src/std/multiboot.h | 260
+++++++++++++++++++++++++++++++++++++++++++++++++++
src/util.h | 1 +
9 files changed, 403 insertions(+), 4 deletions(-)
create mode 100644 src/fw/multiboot.c
create mode 100644 src/std/multiboot.h
diff --git a/Makefile b/Makefile
index 3ee61af..f69f1f7 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,8 @@ SRC32FLAT=$(SRCBOTH) post.c memmap.c malloc.c
romfile.c x86.c optionroms.c \
hw/ahci.c hw/pvscsi.c hw/usb-xhci.c hw/usb-hub.c hw/sdcard.c \
fw/coreboot.c fw/lzmadecode.c fw/csm.c fw/biostables.c \
fw/paravirt.c fw/shadow.c fw/pciinit.c fw/smm.c fw/smp.c fw/mtrr.c
fw/xen.c \
- fw/acpi.c fw/mptable.c fw/pirtable.c fw/smbios.c fw/romfile_loader.c
+ fw/acpi.c fw/mptable.c fw/pirtable.c fw/smbios.c fw/romfile_loader.c \
+ fw/multiboot.c
SRC32SEG=string.c output.c pcibios.c apm.c stacks.c hw/pci.c hw/serialio.c
DIRS=src src/hw src/fw vgasrc
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
index dd770fe..b793f33 100755
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -356,7 +356,7 @@ def getRelocs(sections, tosection, type=None):
and (type is None or reloc.type == type))]
# Output the linker scripts for all required sections.
-def writeLinkerScripts(li, out16, out32seg, out32flat):
+def writeLinkerScripts(li, out16, out32seg, out32flat, mb_section):
# Write 16bit linker script
filesections16 = getSectionsFileid(li.sections, '16')
out = outXRefs(filesections16, useseg=1) + """
@@ -399,6 +399,11 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
filesections32flat = getSectionsFileid(li.sections, '32flat')
out = outXRefs([], exportsyms=li.varlowsyms
, forcedelta=li.final_sec32low_start-li.sec32low_start)
+ if mb_section is None:
+ mbstr = ""
+ else:
+ mbstr = "*(%s)" % mb_section
+ sec32all_start -= 12
out += outXRefs(filesections32flat, exportsyms=[li.entrysym]) + """
_reloc_min_align = 0x%x ;
zonefseg_start = 0x%x ;
@@ -415,6 +420,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
.text code32flat_start : {
%s
%s
+%s
code32flat_end = ABSOLUTE(.) ;
} :text
""" % (li.sec32init_align,
@@ -428,6 +434,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
li.sec32init_start,
li.sec32init_end,
sec32all_start,
+ mbstr,
relocstr,
outRelSections(li.sections, 'code32flat_start'))
out = COMMONHEADER + out + COMMONTRAILER + """
@@ -649,6 +656,11 @@ def main():
anchorsections = [entrysym.section] + [
section for section in allsections
if section.name.startswith('.fixedaddr.')]
+ mb_header = symbols['32flat'].get('mb_head')
+ if mb_header is not None:
+ mb_section = mb_header.section.name
+ else:
+ mb_section = None
keepsections = findReachable(anchorsections, checkKeep, symbols)
sections = [section for section in allsections if section in
keepsections]
@@ -685,7 +697,7 @@ def main():
li.entrysym = entrysym
# Write out linker script files.
- writeLinkerScripts(li, out16, out32seg, out32flat)
+ writeLinkerScripts(li, out16, out32seg, out32flat, mb_section)
if __name__ == '__main__':
main()
diff --git a/src/Kconfig b/src/Kconfig
index 45ca59c..385ce49 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -102,6 +102,13 @@ endchoice
default y
help
Support floppy images in coreboot flash.
+ config MULTIBOOT
+ depends on COREBOOT
+ bool "multiboot support"
+ default y
+ help
+ Add multiboot header in bios.bin.raw and accept files supplied
+ as multiboot modules.
config ENTRY_EXTRASTACK
bool "Use internal stack for 16bit interrupt entry points"
default y
diff --git a/src/fw/coreboot.c b/src/fw/coreboot.c
index 8fd8449..ec09535 100644
--- a/src/fw/coreboot.c
+++ b/src/fw/coreboot.c
@@ -546,6 +546,8 @@ cbfs_payload_setup(void)
break;
struct cbfs_romfile_s *cfile;
cfile = container_of(file, struct cbfs_romfile_s, file);
+ if (!cfile->fhdr)
+ continue;
const char *filename = file->name;
char *desc = znprintf(MAXDESCSIZE, "Payload [%s]", &filename[4]);
boot_add_cbfs(cfile->fhdr, desc,
bootprio_find_named_rom(filename, 0));
diff --git a/src/fw/multiboot.c b/src/fw/multiboot.c
new file mode 100644
index 0000000..7537c6a
--- /dev/null
+++ b/src/fw/multiboot.c
@@ -0,0 +1,114 @@
+#include "block.h" // MAXDESCSIZE
+#include "byteorder.h" // be32_to_cpu
+#include "config.h" // CONFIG_*
+#include "hw/pci.h" // pci_probe_devices
+#include "lzmadecode.h" // LzmaDecode
+#include "malloc.h" // free
+#include "memmap.h" // add_e820
+#include "output.h" // dprintf
+#include "paravirt.h" // PlatformRunningOn
+#include "romfile.h" // romfile_findprefix
+#include "stacks.h" // yield
+#include "string.h" // memset
+#include "util.h" // coreboot_preinit
+#include "std/multiboot.h"
+
+struct mbfs_romfile_s {
+ struct romfile_s file;
+ void *data;
+};
+
+static int
+extract_filename(char *dest, char *src, size_t lim)
+{
+ char *ptr;
+ for (ptr = src; *ptr; ptr++) {
+ if (!(ptr == src || ptr[-1] == ' ' || ptr[-1] == '\t'))
+ continue;
+ /* memcmp stops early if it encounters \0 as it doesn't match name=. */
+ if (memcmp(ptr, "name=", 5) == 0) {
+ int i;
+ char *optr = dest;
+ for (i = 0, ptr += 5; *ptr && *ptr != ' ' && i < lim; i++) {
+ *optr++ = *ptr++;
+ }
+ *optr++ = '\0';
+ return 1;
+ }
+ }
+ return 0;
+}
+
+// Copy a file to memory (uncompressing if necessary)
+static int
+mbfs_copyfile(struct romfile_s *file, void *dst, u32 maxlen)
+{
+ if (!CONFIG_COREBOOT_FLASH)
+ return -1;
+
+ struct mbfs_romfile_s *cfile;
+ cfile = container_of(file, struct mbfs_romfile_s, file);
+ u32 size = cfile->file.size;
+ void *src = cfile->data;
+
+ // Not compressed.
+ dprintf(3, "Copying data %d@%p to %d@%p\n", size, src, maxlen, dst);
+ if (size > maxlen) {
+ warn_noalloc();
+ return -1;
+ }
+ iomemcpy(dst, src, size);
+ return size;
+}
+
+u32 __VISIBLE entry_eax, entry_ebx;
+
+void
+multiboot_init(void)
+{
+ struct multiboot_info *mbi;
+ if (!CONFIG_MULTIBOOT)
+ return;
+ dprintf (1, "multiboot: eax=%x, ebx=%x\n", entry_eax, entry_ebx);
+ if (entry_eax != MULTIBOOT_BOOTLOADER_MAGIC)
+ return;
+ mbi = (void *)entry_ebx;
+ dprintf (1, "mbptr=%p\n", mbi);
+ dprintf (1, "flags=0x%x, mods=0x%x, mods_c=%d\n", mbi->flags,
mbi->mods_addr,
+ mbi->mods_count);
+ if (!(mbi->flags & MULTIBOOT_INFO_MODS))
+ return;
+ int i;
+ struct multiboot_mod_list *mod = (void *)mbi->mods_addr;
+ for (i = 0; i < mbi->mods_count; i++) {
+ struct mbfs_romfile_s *cfile;
+ u8 *copy;
+ u32 len;
+ if (!mod[i].cmdline)
+ continue;
+ len = mod[i].mod_end - mod[i].mod_start;
+ cfile = malloc_tmp(sizeof(*cfile));
+ memset(cfile, 0, sizeof(*cfile));
+ dprintf (1, "module %s, size 0x%x\n", (char *)mod[i].cmdline, len);
+ if (!extract_filename(cfile->file.name, (char *)mod[i].cmdline,
+ sizeof(cfile->file.name))) {
+ free (cfile);
+ continue;
+ }
+ dprintf (1, "assigned file name <%s>\n", cfile->file.name);
+ cfile->file.size = len;
+ copy = malloc_tmp (len);
+ memcpy(copy, (void *)mod[i].mod_start, len);
+ cfile->file.copy = mbfs_copyfile;
+ cfile->data = copy;
+ romfile_add(&cfile->file);
+ }
+}
+
+#if CONFIG_MULTIBOOT
+u32 __attribute__((aligned(4))) __VISIBLE mb_head[] = {
+ MULTIBOOT_HEADER_MAGIC,
+ 0,
+ -MULTIBOOT_HEADER_MAGIC
+};
+#endif
diff --git a/src/post.c b/src/post.c
index 9ea5620..8d8d083 100644
--- a/src/post.c
+++ b/src/post.c
@@ -116,6 +116,7 @@ interface_init(void)
// Setup romfile items.
qemu_cfg_init();
coreboot_cbfs_init();
+ multiboot_init();
// Setup ivt/bda/ebda
ivt_init();
diff --git a/src/romlayout.S b/src/romlayout.S
index 93b6874..9855f4f 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -13,7 +13,6 @@
.code16
-
/****************************************************************
* 16bit / 32bit call trampolines
****************************************************************/
@@ -374,6 +373,8 @@ entry_bios32:
entry_elf:
cli
cld
+ movl %eax, entry_eax
+ movl %ebx, entry_ebx
lidtl (BUILD_BIOS_ADDR + pmode_IDT_info)
lgdtl (BUILD_BIOS_ADDR + rombios32_gdt_48)
movl $SEG32_MODE32_DS, %eax
diff --git a/src/std/multiboot.h b/src/std/multiboot.h
new file mode 100644
index 0000000..6c95127
--- /dev/null
+++ b/src/std/multiboot.h
@@ -0,0 +1,260 @@
+/* multiboot.h - Multiboot header file. */
+/* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software
Foundation, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a copy
+ * of this software and associated documentation files (the
"Software"), to
+ * deal in the Software without restriction, including without
limitation the
+ * rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL ANY
+ * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+ */
+
+#ifndef MULTIBOOT_HEADER
+#define MULTIBOOT_HEADER 1
+
+/* How many bytes from the start of the file we search for the header. */
+#define MULTIBOOT_SEARCH 8192
+#define MULTIBOOT_HEADER_ALIGN 4
+
+/* The magic field should contain this. */
+#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
+
+/* This should be in %eax. */
+#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
+
+/* Alignment of multiboot modules. */
+#define MULTIBOOT_MOD_ALIGN 0x00001000
+
+/* Alignment of the multiboot info structure. */
+#define MULTIBOOT_INFO_ALIGN 0x00000004
+
+/* Flags set in the 'flags' member of the multiboot header. */
+
+/* Align all boot modules on i386 page (4KB) boundaries. */
+#define MULTIBOOT_PAGE_ALIGN 0x00000001
+
+/* Must pass memory information to OS. */
+#define MULTIBOOT_MEMORY_INFO 0x00000002
+
+/* Must pass video information to OS. */
+#define MULTIBOOT_VIDEO_MODE 0x00000004
+
+/* This flag indicates the use of the address fields in the header. */
+#define MULTIBOOT_AOUT_KLUDGE 0x00010000
+
+/* Flags to be set in the 'flags' member of the multiboot info
structure. */
+
+/* is there basic lower/upper memory information? */
+#define MULTIBOOT_INFO_MEMORY 0x00000001
+/* is there a boot device set? */
+#define MULTIBOOT_INFO_BOOTDEV 0x00000002
+/* is the command-line defined? */
+#define MULTIBOOT_INFO_CMDLINE 0x00000004
+/* are there modules to do something with? */
+#define MULTIBOOT_INFO_MODS 0x00000008
+
+/* These next two are mutually exclusive */
+
+/* is there a symbol table loaded? */
+#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
+/* is there an ELF section header table? */
+#define MULTIBOOT_INFO_ELF_SHDR 0X00000020
+
+/* is there a full memory map? */
+#define MULTIBOOT_INFO_MEM_MAP 0x00000040
+
+/* Is there drive info? */
+#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
+
+/* Is there a config table? */
+#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
+
+/* Is there a boot loader name? */
+#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
+
+/* Is there a APM table? */
+#define MULTIBOOT_INFO_APM_TABLE 0x00000400
+
+/* Is there video information? */
+#define MULTIBOOT_INFO_VBE_INFO 0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
+
+#ifndef ASM_FILE
+
+typedef unsigned char multiboot_uint8_t;
+typedef unsigned short multiboot_uint16_t;
+typedef unsigned int multiboot_uint32_t;
+typedef unsigned long long multiboot_uint64_t;
+
+struct multiboot_header
+{
+ /* Must be MULTIBOOT_MAGIC - see above. */
+ multiboot_uint32_t magic;
+
+ /* Feature flags. */
+ multiboot_uint32_t flags;
+
+ /* The above fields plus this one must equal 0 mod 2^32. */
+ multiboot_uint32_t checksum;
+
+ /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
+ multiboot_uint32_t header_addr;
+ multiboot_uint32_t load_addr;
+ multiboot_uint32_t load_end_addr;
+ multiboot_uint32_t bss_end_addr;
+ multiboot_uint32_t entry_addr;
+
+ /* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
+ multiboot_uint32_t mode_type;
+ multiboot_uint32_t width;
+ multiboot_uint32_t height;
+ multiboot_uint32_t depth;
+};
+
+/* The symbol table for a.out. */
+struct multiboot_aout_symbol_table
+{
+ multiboot_uint32_t tabsize;
+ multiboot_uint32_t strsize;
+ multiboot_uint32_t addr;
+ multiboot_uint32_t reserved;
+};
+typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
+
+/* The section header table for ELF. */
+struct multiboot_elf_section_header_table
+{
+ multiboot_uint32_t num;
+ multiboot_uint32_t size;
+ multiboot_uint32_t addr;
+ multiboot_uint32_t shndx;
+};
+typedef struct multiboot_elf_section_header_table
multiboot_elf_section_header_table_t;
+
+struct multiboot_info
+{
+ /* Multiboot info version number */
+ multiboot_uint32_t flags;
+
+ /* Available memory from BIOS */
+ multiboot_uint32_t mem_lower;
+ multiboot_uint32_t mem_upper;
+
+ /* "root" partition */
+ multiboot_uint32_t boot_device;
+
+ /* Kernel command line */
+ multiboot_uint32_t cmdline;
+
+ /* Boot-Module list */
+ multiboot_uint32_t mods_count;
+ multiboot_uint32_t mods_addr;
+
+ union
+ {
+ multiboot_aout_symbol_table_t aout_sym;
+ multiboot_elf_section_header_table_t elf_sec;
+ } u;
+
+ /* Memory Mapping buffer */
+ multiboot_uint32_t mmap_length;
+ multiboot_uint32_t mmap_addr;
+
+ /* Drive Info buffer */
+ multiboot_uint32_t drives_length;
+ multiboot_uint32_t drives_addr;
+
+ /* ROM configuration table */
+ multiboot_uint32_t config_table;
+
+ /* Boot Loader Name */
+ multiboot_uint32_t boot_loader_name;
+
+ /* APM table */
+ multiboot_uint32_t apm_table;
+
+ /* Video */
+ multiboot_uint32_t vbe_control_info;
+ multiboot_uint32_t vbe_mode_info;
+ multiboot_uint16_t vbe_mode;
+ multiboot_uint16_t vbe_interface_seg;
+ multiboot_uint16_t vbe_interface_off;
+ multiboot_uint16_t vbe_interface_len;
+
+ multiboot_uint64_t framebuffer_addr;
+ multiboot_uint32_t framebuffer_pitch;
+ multiboot_uint32_t framebuffer_width;
+ multiboot_uint32_t framebuffer_height;
+ multiboot_uint8_t framebuffer_bpp;
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
+#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
+ multiboot_uint8_t framebuffer_type;
+ union
+ {
+ struct
+ {
+ multiboot_uint32_t framebuffer_palette_addr;
+ multiboot_uint16_t framebuffer_palette_num_colors;
+ };
+ struct
+ {
+ multiboot_uint8_t framebuffer_red_field_position;
+ multiboot_uint8_t framebuffer_red_mask_size;
+ multiboot_uint8_t framebuffer_green_field_position;
+ multiboot_uint8_t framebuffer_green_mask_size;
+ multiboot_uint8_t framebuffer_blue_field_position;
+ multiboot_uint8_t framebuffer_blue_mask_size;
+ };
+ };
+};
+typedef struct multiboot_info multiboot_info_t;
+
+struct multiboot_color
+{
+ multiboot_uint8_t red;
+ multiboot_uint8_t green;
+ multiboot_uint8_t blue;
+};
+
+struct multiboot_mmap_entry
+{
+ multiboot_uint32_t size;
+ multiboot_uint64_t addr;
+ multiboot_uint64_t len;
+#define MULTIBOOT_MEMORY_AVAILABLE 1
+#define MULTIBOOT_MEMORY_RESERVED 2
+#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
+#define MULTIBOOT_MEMORY_NVS 4
+#define MULTIBOOT_MEMORY_BADRAM 5
+ multiboot_uint32_t type;
+} __attribute__((packed));
+typedef struct multiboot_mmap_entry multiboot_memory_map_t;
+
+struct multiboot_mod_list
+{
+ /* the memory used goes from bytes 'mod_start' to 'mod_end-1'
inclusive */
+ multiboot_uint32_t mod_start;
+ multiboot_uint32_t mod_end;
+
+ /* Module command line */
+ multiboot_uint32_t cmdline;
+
+ /* padding to take it to 16 bytes (must be zero) */
+ multiboot_uint32_t pad;
+};
+typedef struct multiboot_mod_list multiboot_module_t;
+
+#endif /* ! ASM_FILE */
+
+#endif /* ! MULTIBOOT_HEADER */
diff --git a/src/util.h b/src/util.h
index 09bb8a9..7f75aa2 100644
--- a/src/util.h
+++ b/src/util.h
@@ -89,6 +89,7 @@ void coreboot_platform_setup(void);
void cbfs_payload_setup(void);
void coreboot_preinit(void);
void coreboot_cbfs_init(void);
+void multiboot_init(void);
struct cb_header;
void *find_cb_subtable(struct cb_header *cbh, u32 tag);
struct cb_header *find_cb_table(void);
--
2.1.4
2
3

May 26, 2015
Some hardware TPMs do not support the assertion of physical presence
via the command. Ignore the specific error code TPM_BAD_PARAMETER if
we come across such a device.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/tcgbios.c | 3 ++-
src/tcgbios.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tcgbios.c b/src/tcgbios.c
index 4cda800..04904e3 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -517,7 +517,8 @@ tpm_leave_bios(void)
PhysicalPresence_CMD_ENABLE,
sizeof(PhysicalPresence_CMD_ENABLE),
NULL, 10, &returnCode, TPM_DURATION_TYPE_SHORT);
- if (rc || returnCode)
+ /* some TPMs do not support phys. presence enablement */
+ if (rc || (returnCode && returnCode != TPM_BAD_PARAMETER))
goto err_exit;
rc = build_and_send_cmd(0, TPM_ORD_PhysicalPresence,
diff --git a/src/tcgbios.h b/src/tcgbios.h
index 332d785..72fd771 100644
--- a/src/tcgbios.h
+++ b/src/tcgbios.h
@@ -88,6 +88,7 @@
/* TPM command error codes */
+#define TPM_BAD_PARAMETER 0x3
#define TPM_INVALID_POSTINIT 0x26
#define TPM_BAD_LOCALITY 0x3d
--
1.9.3
1
0

May 22, 2015
On 05/21/2015 09:18 PM, Xu, Quan wrote:
>
>> -----Original Message-----
>> From: Kevin O'Connor [mailto:kevin@koconnor.net]
>> Sent: Friday, May 22, 2015 1:20 AM
>> To: Stefan Berger
>> Cc: Xu, Quan; seabios(a)seabios.org; stefano.stabellini(a)eu.citrix.com;
>> xen-devel(a)lists.xen.org; Daniel De Graaf; wei.liu2(a)citrix.com
>> Subject: Re: [PATCH v10 3/6] Support for BIOS interrupt handler
>>
>> On Thu, Apr 30, 2015 at 11:34:20AM -0400, Stefan Berger wrote:
>>> On 04/30/2015 09:21 AM, Xu, Quan wrote:
>>>> Stefan,
>>>> Sorry to reply so late to you. I try to make it compatible with Xen
>>>> vTPM by below patch Against your serious of
>> patch(https://github.com/KevinOConnor/seabios/tree/tcg-testing ).
>>>> Also I have tested this patch, which is working.
>> [...]
>>> Kevin, I think this should be good to add after 3/6 ?
>> Thanks - I applied the first three tpm patches along with this patch.
>>
>> -Kevin
> Thanks :))
Yes, thanks!
Stefan
>
>
> Quan
>
1
0