Current seabios will try to boot from selected devices first,
if they are all failed, seabios will also try to boot from
un-selected devices.
For example:
@ qemu-kvm -boot order=n,menu=on ...
Guest will boot from network first, if it's failed, guest will try to
boot from other un-selected devices (floppy, cdrom, disk) one by one.
Sometimes, user don't want to boot from some devices. This patch changes
seabios to boot only from selected devices.
If user choose first boot device from menu, then seabios will try all
the devices, even some of them are not selected.
Signed-off-by: Amos Kong <akong(a)redhat.com>
---
Resend for CCing seabios maillist.
---
src/boot.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/boot.c b/src/boot.c
index 3ca7960..ee810ac 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -424,6 +424,10 @@ interactive_bootmenu(void)
maxmenu++;
printf("%d. %s\n", maxmenu
, strtcpy(desc, pos->description, ARRAY_SIZE(desc)));
+ /* If user chooses first boot device from menu, we will treat
+ all the devices as selected. */
+ if (pos->priority == DEFAULT_PRIO)
+ pos->priority = DEFAULT_PRIO - 1;
pos = pos->next;
}
@@ -490,7 +494,10 @@ boot_prep(void)
// Map drives and populate BEV list
struct bootentry_s *pos = BootList;
- while (pos) {
+
+ /* The priority of un-selected device is not changed,
+ we only boot from user selected devices. */
+ while (pos && pos->priority != DEFAULT_PRIO) {
switch (pos->type) {
case IPL_TYPE_BCV:
call_bcv(pos->vector.seg, pos->vector.offset);
@@ -513,10 +520,6 @@ boot_prep(void)
}
pos = pos->next;
}
-
- // If nothing added a floppy/hd boot - add it manually.
- add_bev(IPL_TYPE_FLOPPY, 0);
- add_bev(IPL_TYPE_HARDDISK, 0);
}
--
1.7.1
This patch gets rid of a compile time dprintf warning.
A 'long int' was being passed to a '%d'.
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/post.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/post.c b/src/post.c
index 924b311..b84d19e 100644
--- a/src/post.c
+++ b/src/post.c
@@ -345,7 +345,7 @@ reloc_init(void)
panic("No space for init relocation.\n");
// Copy code and update relocs (init absolute, init relative, and runtime)
- dprintf(1, "Relocating low data from %p to %p (size %d)\n"
+ dprintf(1, "Relocating low data from %p to %p (size %ld)\n"
, datalow_start, final_datalow_start, datalow_end - datalow_start);
updateRelocs(code32flat_start, _reloc_datalow_start, _reloc_datalow_end
, final_datalow_start - datalow_start);
--
1.7.9
Hi,
yum repository with fresh qemu firmware builds is available now:
http://www.kraxel.org/repos/
Provides rpms with seabios, tianocore (efi), coreboot and ipxe binaries.
enjoy,
Gerd
PS: /me will disappear into xmas season shortly, so any issues will
have to wait 'til next year. jenkins should continue to provide
fresh builds when new commits appear in the upstream repos.
Hi Laszlo,
> In the v2->v3 change of what would become commit 37676f83
> <http://www.seabios.org/pipermail/seabios/2012-December/005166.html>,
> the
> defense against an initial "addr > end" condition ("wraparound") was
> erroneously loosened.
>
> Signed-off-by: Laszlo Ersek <lersek at redhat.com>
> ---
> src/smbios.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/smbios.c b/src/smbios.c
> index aaa99bc..23713a2 100644
> --- a/src/smbios.c
> +++ b/src/smbios.c
> @@ -569,8 +569,8 @@ display_uuid(void)
> addr += 2;
> }
>
> - /* parsing finished, UUID not found */
> - if (addr == end)
> + /* parsing finished or skipped entirely, UUID not found */
> + if (addr >= end)
It's a stricter check, but I didn't find it will happen.
> return;
>
> uuid = (u8 *)(addr + offsetof(struct smbios_type_1, uuid));
> --
> 1.7.1
| void
| display_uuid(void)
| {
| u32 addr, end;
| u8 *uuid;
| u8 empty_uuid[16] = { 0 };
|
| if (SMBiosAddr == NULL)
| return;
|
| addr = SMBiosAddr->structure_table_address;
| end = addr + SMBiosAddr->structure_table_length;
structure_table_length is unsigned, end always >= addr here.
| /* the following takes care of any initial wraparound too */
| while (addr < end) {
| const struct smbios_structure_header *hdr;
|
| /* partial structure header */
| if (end - addr < sizeof(struct smbios_structure_header))
| return;
|
| hdr = (struct smbios_structure_header *)addr;
|
| /* partial structure */
| if (end - addr < hdr->length)
| return;
|
| /* any Type 1 structure version will do that has the UUID */
| if (hdr->type == 1 &&
| hdr->length >= offsetof(struct smbios_type_1, uuid) + 16)
| break;
In this point, it just passes the while condition check, and addr
doesn't change.
* addr < end
|
| /* done with formatted area, skip string-set */
| addr += hdr->length;
|
| while (end - addr >= 2 &&
| (*(u8 *)addr != '\0' ||
| *(u8 *)(addr+1) != '\0'))
| ++addr;
|
| /* structure terminator not found */
| if (end - addr < 2)
| return;
We have above check here, it means if it passes this check
end >= addr + 2
|
| addr += 2;
After above sentence, end >= addr, there is only one condition that
while condition check fails:
* addr = end
| }
The above analysis means that we can only get this point by two
conditions:
* 'break' (addr < end)
* not pass while's condition check (addr >= end)
So the 'addr' will never be larger than 'end'.
However, add this stricter check is harmless.
| /* parsing finished, UUID not found */
| if (addr == end)
| return;
--
Amos.
Hi,
> correct, only the number of channels and ranks(dimms) per channel has been
> emulated so far (2 channels of 4 dimms each). So it is still paravirtual memory
> hotplug, not native. Native support still needs to be worked on.
Ok.
>> I think the paravirtual memory hotplug controller should be a PCI device
>> (which we then can add as function to the chipset). Having some fixed
>> magic addresses is bad.
>
> ok, so in your opinion a pci-based hotplug controller sounds better than adding
> acpi ports to piix4 or ich9?
>
> Magic acpi_ich9 ports can be avoided if q35 native support is implemented.
Yes. We should go that route for q35.
> For
> i440fx/piix4 it was discussed and more or less decided we would only support
> a paravirtual way of memory hotplug.
Sure, there is no other way to do it.
It is probably a good idea to model piix4 paravirtual to work simliar to
q35 native.
> In the description. I meant "paravirtual memory bus" to describe a memory bus
> with unlimited number of dimm devices. But the "hotplug control" has always
> been acpi-based so far and not a pci device.
It still can (and should) be acpi-based. It is just that:
(a) Instead of using get_system_io() as parent memory region you use
create a pci device and place the memory region in one of the PCI
bars.
(b) Instead of using OperationRegion($name, SystemIO, $magicaddress)
you use OperationRegion($name, PciBarTarget, ...) to access the
registers.
cheers,
Gerd
Hi,
> - multiple memory buses can be registered. Memory buses of the real hw/chipset
> or a paravirtual memory bus can be added.
IIRC q35 supports memory hotplug natively (picked up in some
discussion). Is that correct?
What does the code emulate? It doesn't look like it emulates q35 memory
hotplug ...
I think the paravirtual memory hotplug controller should be a PCI device
(which we then can add as function to the chipset). Having some fixed
magic addresses is bad.
[ btw: same goes for ACPI PCI hotplug, that is hardly fixable without
breaking compatibility though, for q35 we should be able to do
better ].
cheers,
Gerd