Re: [SeaBIOS] Stance on TPM?
by Peter Stuge
Fred . wrote:
> What is SeaBIOS stance on Trusted Platform Module (TPM) ?
I guess that there is no stance until you or someone else sends
patches that we can discuss.
//Peter
7 years, 3 months
[PATCH] Use cpu_to_be32() (and related) instead of htonl (and related).
by Kevin O'Connor
Unify the syntax for byte swab calls.
This also fixes a bug in coreboot due to the lack of a be64_to_cpu()
call.
Signed-off-by: Kevin O'Connor <kevin(a)koconnor.net>
---
src/ata.c | 3 ++-
src/blockcmd.c | 17 +++++++-------
src/byteorder.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/coreboot.c | 31 +++++++++++++-------------
src/paravirt.c | 9 ++++----
src/util.h | 30 -------------------------
vgasrc/vgafb.c | 3 ++-
7 files changed, 103 insertions(+), 59 deletions(-)
create mode 100644 src/byteorder.h
diff --git a/src/ata.c b/src/ata.c
index 7ff5f86..f604b37 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -8,6 +8,7 @@
#include "types.h" // u8
#include "ioport.h" // inb
#include "util.h" // dprintf
+#include "byteorder.h" // be16_to_cpu
#include "cmos.h" // inb_cmos
#include "pic.h" // enable_hwirq
#include "biosvar.h" // GET_GLOBAL
@@ -696,7 +697,7 @@ ata_extract_model(char *model, u32 size, u16 *buffer)
// Read model name
int i;
for (i=0; i<size/2; i++)
- *(u16*)&model[i*2] = ntohs(buffer[27+i]);
+ *(u16*)&model[i*2] = be16_to_cpu(buffer[27+i]);
model[size] = 0x00;
nullTrailingSpace(model);
return model;
diff --git a/src/blockcmd.c b/src/blockcmd.c
index 97c72a6..77c690f 100644
--- a/src/blockcmd.c
+++ b/src/blockcmd.c
@@ -6,7 +6,8 @@
// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "biosvar.h" // GET_GLOBAL
-#include "util.h" // htonl
+#include "util.h" // dprintf
+#include "byteorder.h" // be32_to_cpu
#include "disk.h" // struct disk_op_s
#include "blockcmd.h" // struct cdb_request_sense
#include "ata.h" // atapi_cmd_data
@@ -144,12 +145,12 @@ scsi_init_drive(struct drive_s *drive, const char *s, int prio)
// READ CAPACITY returns the address of the last block.
// We do not bother with READ CAPACITY(16) because BIOS does not support
// 64-bit LBA anyway.
- drive->blksize = ntohl(capdata.blksize);
+ drive->blksize = be32_to_cpu(capdata.blksize);
if (drive->blksize != DISK_SECTOR_SIZE) {
dprintf(1, "%s: unsupported block size %d\n", s, drive->blksize);
return -1;
}
- drive->sectors = (u64)ntohl(capdata.sectors) + 1;
+ drive->sectors = (u64)be32_to_cpu(capdata.sectors) + 1;
dprintf(1, "%s blksize=%d sectors=%d\n"
, s, drive->blksize, (unsigned)drive->sectors);
@@ -243,7 +244,7 @@ cdb_mode_sense_geom(struct disk_op_s *op, struct cdbres_mode_sense_geom *data)
cmd.command = CDB_CMD_MODE_SENSE;
cmd.flags = 8; /* DBD */
cmd.page = MODE_PAGE_HD_GEOMETRY;
- cmd.count = htons(sizeof(*data));
+ cmd.count = cpu_to_be16(sizeof(*data));
op->count = 1;
op->buf_fl = data;
return cdb_cmd_data(op, &cmd, sizeof(*data));
@@ -256,8 +257,8 @@ cdb_read(struct disk_op_s *op)
struct cdb_rwdata_10 cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.command = CDB_CMD_READ_10;
- cmd.lba = htonl(op->lba);
- cmd.count = htons(op->count);
+ cmd.lba = cpu_to_be32(op->lba);
+ cmd.count = cpu_to_be16(op->count);
return cdb_cmd_data(op, &cmd, GET_GLOBAL(op->drive_g->blksize));
}
@@ -268,7 +269,7 @@ cdb_write(struct disk_op_s *op)
struct cdb_rwdata_10 cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.command = CDB_CMD_WRITE_10;
- cmd.lba = htonl(op->lba);
- cmd.count = htons(op->count);
+ cmd.lba = cpu_to_be32(op->lba);
+ cmd.count = cpu_to_be16(op->count);
return cdb_cmd_data(op, &cmd, GET_GLOBAL(op->drive_g->blksize));
}
diff --git a/src/byteorder.h b/src/byteorder.h
new file mode 100644
index 0000000..94e3a3b
--- /dev/null
+++ b/src/byteorder.h
@@ -0,0 +1,69 @@
+#ifndef __BYTEORDER_H
+#define __BYTEORDER_H
+
+static inline u16 __swab16_constant(u16 val) {
+ return (val<<8) | (val>>8);
+}
+static inline u32 __swab32_constant(u32 val) {
+ return (val<<24) | ((val&0xff00)<<8) | ((val&0xff0000)>>8) | (val>>24);
+}
+static inline u64 __swab64_constant(u64 val) {
+ return ((u64)__swab32_constant(val) << 32) | __swab32_constant(val>>32);
+}
+static inline u32 __swab32(u32 val) {
+ asm("bswapl %0" : "+r"(val));
+ return val;
+}
+static inline u64 __swab64(u64 val) {
+ union u64_u32_u i, o;
+ i.val = val;
+ o.hi = __swab32(i.lo);
+ o.lo = __swab32(i.hi);
+ return o.val;
+}
+
+#define swab16(x) __swab16_constant(x)
+#define swab32(x) (__builtin_constant_p((u32)(x)) \
+ ? __swab32_constant(x) : __swab32(x))
+#define swab64(x) (__builtin_constant_p((u64)(x)) \
+ ? __swab64_constant(x) : __swab64(x))
+
+static inline u16 cpu_to_le16(u16 x) {
+ return x;
+}
+static inline u32 cpu_to_le32(u32 x) {
+ return x;
+}
+static inline u64 cpu_to_le64(u64 x) {
+ return x;
+}
+static inline u16 le16_to_cpu(u16 x) {
+ return x;
+}
+static inline u32 le32_to_cpu(u32 x) {
+ return x;
+}
+static inline u32 le64_to_cpu(u64 x) {
+ return x;
+}
+
+static inline u16 cpu_to_be16(u16 x) {
+ return swab16(x);
+}
+static inline u32 cpu_to_be32(u32 x) {
+ return swab32(x);
+}
+static inline u64 cpu_to_be64(u64 x) {
+ return swab64(x);
+}
+static inline u16 be16_to_cpu(u16 x) {
+ return swab16(x);
+}
+static inline u32 be32_to_cpu(u32 x) {
+ return swab32(x);
+}
+static inline u32 be64_to_cpu(u64 x) {
+ return swab64(x);
+}
+
+#endif // byteorder.h
diff --git a/src/coreboot.c b/src/coreboot.c
index 55590ce..e4767f1 100644
--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -6,6 +6,7 @@
#include "memmap.h" // add_e820
#include "util.h" // dprintf
+#include "byteorder.h" // be32_to_cpu
#include "lzmadecode.h" // LzmaDecode
#include "smbios.h" // smbios_init
#include "boot.h" // boot_add_cbfs
@@ -329,17 +330,17 @@ coreboot_cbfs_setup(void)
return;
struct cbfs_header *hdr = *(void **)CBFS_HEADPTR_ADDR;
- if (hdr->magic != htonl(CBFS_HEADER_MAGIC)) {
+ if (hdr->magic != cpu_to_be32(CBFS_HEADER_MAGIC)) {
dprintf(1, "Unable to find CBFS (ptr=%p; got %x not %x)\n"
- , hdr, hdr->magic, htonl(CBFS_HEADER_MAGIC));
+ , hdr, hdr->magic, cpu_to_be32(CBFS_HEADER_MAGIC));
return;
}
dprintf(1, "Found CBFS header at %p\n", hdr);
- struct cbfs_file *cfile = (void *)(0 - ntohl(hdr->romsize)
- + ntohl(hdr->offset));
+ struct cbfs_file *cfile = (void *)(0 - be32_to_cpu(hdr->romsize)
+ + be32_to_cpu(hdr->offset));
for (;;) {
- if (cfile < (struct cbfs_file *)(0xFFFFFFFF - ntohl(hdr->romsize)))
+ if (cfile < (struct cbfs_file *)(0xFFFFFFFF - be32_to_cpu(hdr->romsize)))
break;
u64 magic = cfile->magic;
if (magic != CBFS_FILE_MAGIC)
@@ -352,10 +353,10 @@ coreboot_cbfs_setup(void)
memset(file, 0, sizeof(*file));
strtcpy(file->name, cfile->filename, sizeof(file->name));
dprintf(3, "Found CBFS file: %s\n", file->name);
- file->size = file->rawsize = ntohl(cfile->len);
+ file->size = file->rawsize = be32_to_cpu(cfile->len);
file->id = (u32)cfile;
file->copy = cbfs_copyfile;
- file->data = (void*)cfile + ntohl(cfile->offset);
+ file->data = (void*)cfile + be32_to_cpu(cfile->offset);
int len = strlen(file->name);
if (len > 5 && strcmp(&file->name[len-5], ".lzma") == 0) {
// Using compression.
@@ -365,7 +366,7 @@ coreboot_cbfs_setup(void)
}
romfile_add(file);
- cfile = (void*)ALIGN((u32)file->data + file->size, ntohl(hdr->align));
+ cfile = (void*)ALIGN((u32)file->data + file->size, be32_to_cpu(hdr->align));
}
}
@@ -394,13 +395,13 @@ cbfs_run_payload(struct cbfs_file *file)
if (!CONFIG_COREBOOT || !CONFIG_COREBOOT_FLASH || !file)
return;
dprintf(1, "Run %s\n", file->filename);
- struct cbfs_payload *pay = (void*)file + ntohl(file->offset);
+ struct cbfs_payload *pay = (void*)file + be32_to_cpu(file->offset);
struct cbfs_payload_segment *seg = pay->segments;
for (;;) {
- void *src = (void*)pay + ntohl(seg->offset);
- void *dest = (void*)ntohl((u32)seg->load_addr);
- u32 src_len = ntohl(seg->len);
- u32 dest_len = ntohl(seg->mem_len);
+ void *src = (void*)pay + be32_to_cpu(seg->offset);
+ void *dest = (void*)(u32)be64_to_cpu(seg->load_addr);
+ u32 src_len = be32_to_cpu(seg->len);
+ u32 dest_len = be32_to_cpu(seg->mem_len);
switch (seg->type) {
case PAYLOAD_SEGMENT_BSS:
dprintf(3, "BSS segment %d@%p\n", dest_len, dest);
@@ -415,12 +416,12 @@ cbfs_run_payload(struct cbfs_file *file)
default:
dprintf(3, "Segment %x %d@%p -> %d@%p\n"
, seg->type, src_len, src, dest_len, dest);
- if (seg->compression == htonl(CBFS_COMPRESS_NONE)) {
+ if (seg->compression == cpu_to_be32(CBFS_COMPRESS_NONE)) {
if (src_len > dest_len)
src_len = dest_len;
memcpy(dest, src, src_len);
} else if (CONFIG_LZMA
- && seg->compression == htonl(CBFS_COMPRESS_LZMA)) {
+ && seg->compression == cpu_to_be32(CBFS_COMPRESS_LZMA)) {
int ret = ulzma(dest, dest_len, src, src_len);
if (ret < 0)
return;
diff --git a/src/paravirt.c b/src/paravirt.c
index 2a98d53..4b5c441 100644
--- a/src/paravirt.c
+++ b/src/paravirt.c
@@ -8,7 +8,8 @@
// This file may be distributed under the terms of the GNU LGPLv3 license.
#include "config.h" // CONFIG_COREBOOT
-#include "util.h" // ntoh[ls]
+#include "util.h" // dprintf
+#include "byteorder.h" // be32_to_cpu
#include "ioport.h" // outw
#include "paravirt.h" // qemu_cfg_port_probe
#include "smbios.h" // struct smbios_structure_header
@@ -327,7 +328,7 @@ void qemu_cfg_romfile_setup(void)
u32 count;
qemu_cfg_read_entry(&count, QEMU_CFG_FILE_DIR, sizeof(count));
- count = ntohl(count);
+ count = be32_to_cpu(count);
u32 e;
for (e = 0; e < count; e++) {
struct QemuCfgFile qfile;
@@ -339,8 +340,8 @@ void qemu_cfg_romfile_setup(void)
}
memset(file, 0, sizeof(*file));
strtcpy(file->name, qfile.name, sizeof(file->name));
- file->size = ntohl(qfile.size);
- file->id = ntohs(qfile.select);
+ file->size = be32_to_cpu(qfile.size);
+ file->id = be16_to_cpu(qfile.select);
file->copy = qemu_cfg_read_file;
romfile_add(file);
dprintf(3, "Found fw_cfg file: %s (size=%d)\n", file->name, file->size);
diff --git a/src/util.h b/src/util.h
index 89e928c..062eea3 100644
--- a/src/util.h
+++ b/src/util.h
@@ -104,36 +104,6 @@ static inline u32 __fls(u32 word)
return word;
}
-static inline u16 __htons_constant(u16 val) {
- return (val<<8) | (val>>8);
-}
-static inline u32 __htonl_constant(u32 val) {
- return (val<<24) | ((val&0xff00)<<8) | ((val&0xff0000)>>8) | (val>>24);
-}
-static inline u32 __htonl(u32 val) {
- asm("bswapl %0" : "+r"(val));
- return val;
-}
-#define htonl(x) (__builtin_constant_p((u32)(x)) ? __htonl_constant(x) : __htonl(x))
-#define ntohl(x) htonl(x)
-#define htons(x) __htons_constant(x)
-#define ntohs(x) htons(x)
-
-static inline u16 cpu_to_le16(u16 x)
-{
- return x;
-}
-
-static inline u32 cpu_to_le32(u32 x)
-{
- return x;
-}
-
-static inline u32 le32_to_cpu(u32 x)
-{
- return x;
-}
-
static inline u32 getesp(void) {
u32 esp;
asm("movl %%esp, %0" : "=rm"(esp));
diff --git a/vgasrc/vgafb.c b/vgasrc/vgafb.c
index 233f3d5..3b2f367 100644
--- a/vgasrc/vgafb.c
+++ b/vgasrc/vgafb.c
@@ -8,6 +8,7 @@
#include "vgabios.h" // vgafb_scroll
#include "biosvar.h" // GET_BDA
#include "util.h" // memset_far
+#include "byteorder.h" // cpu_to_be16
#include "stdvga.h" // stdvga_planar4_plane
@@ -272,7 +273,7 @@ write_gfx_char_cga(struct vgamode_s *vmode_g
for (j = 0; j < 8; j++)
if (fontline & (1<<j))
pixels |= (ca.attr & 0x03) << (j*2);
- pixels = htons(pixels);
+ pixels = cpu_to_be16(pixels);
if (ca.attr & 0x80)
pixels ^= GET_FARVAR(SEG_GRAPH, *(u16*)dest_far);
SET_FARVAR(SEG_CTEXT, *(u16*)dest_far, pixels);
--
1.7.11.2
7 years, 3 months
Re: [SeaBIOS] How much RAM is required?
by Markus Armbruster
"Fred ." <eldmannen(a)gmail.com> writes:
> On Thu, Aug 9, 2012 at 10:15 AM, Markus Armbruster <armbru(a)redhat.com> wrote:
>> "Kevin O'Connor" <kevin(a)koconnor.net> writes:
>>
>>> On Wed, Aug 08, 2012 at 01:50:13PM +0200, Markus Armbruster wrote:
>>>> Watch this:
>>>>
>>>> $ qemu-system-x86_64 -nodefaults -vnc :0 -monitor stdio -m 16k
>>>> QEMU 1.1.50 monitor - type 'help' for more information
>>>> (qemu) qemu: fatal: Trying to execute code outside RAM or ROM at
>>>> 0x0000000000004000
>>>>
>>>> Admittedly a silly thing to try. I don't really expect SeaBIOS to work
>>>> with 16KiB of RAM. But I'm curious: how much does it require?
>>>
>>> SeaBIOS requires a minimum of 1Meg of ram. I didn't even know one
>>> could request less than 1meg of ram from QEMU.
>>
>> I'll cook up a QEMU patch to give it at least that much.
> But QEMU may use other firmware/payload than SeaBIOS which might
> require less than 1 MB of RAM.
Good point.
Could SeaBIOS fail more cleanly when it detects insufficient RAM?
7 years, 3 months
[PATCH v2] add acpi pmtimer support
by Gerd Hoffmann
This patch makes seabios use the acpi pmtimer instead of tsc for
timekeeping. The pmtimer has a fixed frequency and doesn't need
calibration, thus it doesn't suffer from calibration errors due to a
loaded host machine.
[ v2: add CONFIG_PMTIMER ]
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/Kconfig | 6 ++++++
src/clock.c | 31 +++++++++++++++++++++++++++++++
src/pciinit.c | 5 +++++
src/util.h | 1 +
4 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig
index 6de3e71..b5dd63b 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -222,6 +222,12 @@ menu "Hardware support"
default y
help
Initialize the Memory Type Range Registers (on emulators).
+ config PMTIMER
+ depends on !COREBOOT
+ bool "Use ACPI timer"
+ default y
+ help
+ Use the ACPI timer instead of the TSC for timekeeping (on qemu).
endmenu
menu "BIOS interfaces"
diff --git a/src/clock.c b/src/clock.c
index 69e9f17..b4abf37 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -129,11 +129,42 @@ emulate_tsc(void)
return ret;
}
+u16 pmtimer_ioport VAR16VISIBLE;
+u32 pmtimer_wraps VARLOW;
+u32 pmtimer_last VARLOW;
+
+void pmtimer_init(u16 ioport, u32 khz)
+{
+ if (!CONFIG_PMTIMER)
+ return;
+ dprintf(1, "Using pmtimer, ioport 0x%x, freq %d kHz\n", ioport, khz);
+ SET_GLOBAL(pmtimer_ioport, ioport);
+ SET_GLOBAL(cpu_khz, khz);
+}
+
+static u64 pmtimer_get(void)
+{
+ u16 ioport = GET_GLOBAL(pmtimer_ioport);
+ u32 wraps = GET_LOW(pmtimer_wraps);
+ u32 pmtimer = inl(ioport);
+
+ if (pmtimer < GET_LOW(pmtimer_last)) {
+ wraps++;
+ SET_LOW(pmtimer_wraps, wraps);
+ }
+ SET_LOW(pmtimer_last, pmtimer);
+
+ dprintf(9, "pmtimer: %u:%u\n", wraps, pmtimer);
+ return (u64)wraps << 24 | pmtimer;
+}
+
static u64
get_tsc(void)
{
if (unlikely(GET_GLOBAL(no_tsc)))
return emulate_tsc();
+ if (CONFIG_PMTIMER && GET_GLOBAL(pmtimer_ioport))
+ return pmtimer_get();
return rdtscll();
}
diff --git a/src/pciinit.c b/src/pciinit.c
index 68f302a..31115ee 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -180,6 +180,9 @@ static const struct pci_device_id pci_class_tbl[] = {
PCI_DEVICE_END,
};
+/* PM Timer ticks per second (HZ) */
+#define PM_TIMER_FREQUENCY 3579545
+
/* PIIX4 Power Management device (for ACPI) */
static void piix4_pm_init(struct pci_device *pci, void *arg)
{
@@ -191,6 +194,8 @@ static void piix4_pm_init(struct pci_device *pci, void *arg)
pci_config_writeb(bdf, 0x80, 0x01); /* enable PM io space */
pci_config_writel(bdf, 0x90, PORT_SMB_BASE | 1);
pci_config_writeb(bdf, 0xd2, 0x09); /* enable SMBus io space */
+
+ pmtimer_init(PORT_ACPI_PM_BASE + 0x08, PM_TIMER_FREQUENCY / 1000);
}
static const struct pci_device_id pci_device_tbl[] = {
diff --git a/src/util.h b/src/util.h
index 89e928c..1603a57 100644
--- a/src/util.h
+++ b/src/util.h
@@ -312,6 +312,7 @@ void lpt_setup(void);
// clock.c
#define PIT_TICK_RATE 1193180 // Underlying HZ of PIT
#define PIT_TICK_INTERVAL 65536 // Default interval for 18.2Hz timer
+void pmtimer_init(u16 ioport, u32 khz);
int check_tsc(u64 end);
void timer_setup(void);
void ndelay(u32 count);
--
1.7.1
7 years, 3 months
Bootorder file question regarding USB hubs/devices
by Dave Frodin
Previously (before fetching the latest seabios/master) our bootorder file looked like this
/pci@i0cf8/usb@12,2/*@4
/pci@i0cf8/usb@12,2/*@5
/pci@i0cf8/usb@12,2/*@3
/pci@i0cf8/usb@12,2/*@2
/pci@i0cf8/usb@12,2/*@1
/pci@i0cf8/usb@12,2/*@0
Now it looks like this. This also includes devices plugged into hubs on two of the ports.
(Thank you to whoever got hubs working)
/pci@i0cf8/usb@12,2/storage@5/*@0/*@0,0
/pci@i0cf8/usb@12,2/storage@4/*@0/*@0,0
/pci@i0cf8/usb@12,2/storage@3/*@0/*@0,0
/pci@i0cf8/usb@12,2/storage@2/*@0/*@0,0
/pci@i0cf8/usb@12,2/storage@1/*@0/*@0,0
/pci@i0cf8/usb@12,2/storage@0/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@4/storage@1/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@4/storage@2/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@4/storage@3/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@4/storage@4/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@1/storage@1/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@1/storage@2/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@1/storage@3/*@0/*@0,0
/pci@i0cf8/usb@12,2/hub@1/storage@4/*@0/*@0,0
Is there an easier/generic way to condense this down?
Is there any kind of wildcard support when it comes to adding any USB device?
Thanks in advance,
Dave
7 years, 3 months
[PATCH] acpi: LNKS is not needed
by Paolo Bonzini
LNKS is a bit strange in that it reuses the same PIIX register as LNKA,
but has a different interrupt. This means that the _CRS it returns will
not be one of the possible resources from _PRS. This shows up in the
Linux boot logs as
ACPI: PCI Interrupt Link [LNKS] (IRQs 9) *0
Instead of that, we can simply use a hardwired interrupt index.
Cc: Gleb Natapov <gnatapov(a)redhat.com>
Cc: Laszlo Ersek <lersek(a)redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
src/acpi-dsdt.dsl | 16 ++++------------
1 file modificato, 4 inserzioni(+), 12 rimozioni(-)
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 083e2be..66ca853 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -86,7 +86,10 @@ DefinitionBlock (
#define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
prt_slot0(0x0000),
/* Device 1 is power mgmt device, and can only use irq 9 */
- prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
+ Package() { 0x1ffff, 0, 0, 9 },
+ Package() { 0x1ffff, 1, LNKB, 0 },
+ Package() { 0x1ffff, 2, LNKC, 0 },
+ Package() { 0x1ffff, 3, LNKD, 0 }
prt_slot2(0x0002),
prt_slot3(0x0003),
prt_slot0(0x0004),
@@ -653,17 +656,6 @@ DefinitionBlock (
Method (_CRS, 0, NotSerialized) { Return (IQCR(PRQ3)) }
Method (_SRS, 1, NotSerialized) { SETIRQ(PRQ3, Arg0) }
}
- Device(LNKS) {
- Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
- Name(_UID, 5)
- Name(_PRS, ResourceTemplate() {
- Interrupt (, Level, ActiveHigh, Shared)
- { 9 }
- })
- Method (_STA, 0, NotSerialized) { Return (IQST(PRQ0)) }
- Method (_DIS, 0, NotSerialized) { DISIRQ(PRQ0) }
- Method (_CRS, 0, NotSerialized) { Return (IQCR(PRQ0)) }
- }
}
/****************************************************************
--
1.7.11.2
7 years, 3 months
[PATCH v2 0/6] Build PCI hotplug SSDT from a single template
by Paolo Bonzini
More than 1kb of data is taken by the 32 copies of the PCI hotplug SSDT
methods. We can build them from a single template like we do for CPUs.
This series does exactly this. Patches 1 prepares for the change, by
moving other pieces of ssdt-pcihd.dsl out of the way. Patch 2 is also
a simple rename and patch 3 fixes a bug in acpi_extract. Patches 4 to
6 finally do the movement.
v1->v2: document computation of length (patch 1, Igor)
build PCNT dynamically (Kevin)
Paolo Bonzini (6):
acpi: move s3/s4/s5 to build_ssdt
acpi: rename Processor SSDT constants
acpi_extract: fix off-by-one
acpi_extract: detect DeviceOp
acpi: build PCNT dynamically
acpi: build PCI hotplug devices from a single template
Makefile | 2 +-
src/acpi.c | 218 +++++++++++++++++++++++++++----------------------
src/ssdt-pcihp.dsl | 124 +++-------------------------
src/ssdt-susp.dsl | 41 ++++++++++
tools/acpi_extract.py | 30 ++++++-
5 files changed, 203 insertions(+), 212 deletions(-)
create mode 100644 src/ssdt-susp.dsl
--
1.7.10.4
7 years, 3 months
[PATCH] Makefile: delete output on error
by Michael S. Tsirkin
I had a disk full condition and a partial hex file
got generated. Following make failed trying to use it.
We can make build a bit more robust by instructing
make to remove output files on error.
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 33b3e69..e5e2735 100644
--- a/Makefile
+++ b/Makefile
@@ -75,6 +75,7 @@ all: $(target-y)
# Make definitions
.PHONY : all clean distclean FORCE
+.DELETE_ON_ERROR:
vpath %.c src vgasrc
vpath %.S src vgasrc
--
MST
7 years, 3 months
[PATCH] apic_id_is_present: fix undefined behavior
by Eduardo Habkost
This patch addresses some feedback sent by Laszlo[1] on the
non-contiguous APIC ID patches I have sent recently.
- (1 << 31) is undefined for 32-bit signed ints
- Use !! on the returned value, so the function return value
can be an int without a unsigned -> signed conversion
[] http://article.gmane.org/gmane.comp.emulators.qemu/162163
Cc: Laszlo Ersek <lersek(a)redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
src/smp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/smp.c b/src/smp.c
index 3c36f8c..4975412 100644
--- a/src/smp.c
+++ b/src/smp.c
@@ -77,7 +77,7 @@ ASM16(
int apic_id_is_present(u8 apic_id)
{
- return FoundAPICIDs[apic_id/32] & (1 << (apic_id % 32));
+ return !!(FoundAPICIDs[apic_id/32] & (1ul << (apic_id % 32)));
}
// find and initialize the CPUs by launching a SIPI to them
--
1.7.11.4
7 years, 3 months
[PATCH 6/4] Make use of geodevga_set_mode()
by Christian Gmeiner
Make use of geodevga_set_mode().
---
vgasrc/vgahw.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h
index 044cd32..43cfaee 100644
--- a/vgasrc/vgahw.h
+++ b/vgasrc/vgahw.h
@@ -22,6 +22,8 @@ static inline int vgahw_set_mode(struct vgamode_s
*vmode_g, int flags) {
return clext_set_mode(vmode_g, flags);
if (CONFIG_VGA_BOCHS)
return bochsvga_set_mode(vmode_g, flags);
+ if (CONFIG_VGA_GEODELX)
+ return geodevga_set_mode(vmode_g, flags);
return stdvga_set_mode(vmode_g, flags);
}
--
1.7.11.rc2.5.g68f532f
7 years, 3 months