* [PATCH 1/3] Make to round memory to next page
@ 2007-09-05 15:35 Anthony Liguori
[not found] ` <118900650250-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2007-09-05 15:35 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Anthony Liguori, Avi Kivity
In general, the BIOS, VGA BIOS, and option ROMs are not required to be multiple
of page sizes. This means that phys_ram_size may not be a multiple of page.
Address this at the kvm_create() level to make things simplier for future
callers.
Signed-off-by: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
diff --git a/user/kvmctl.c b/user/kvmctl.c
index 846aac9..035ff43 100644
--- a/user/kvmctl.c
+++ b/user/kvmctl.c
@@ -40,6 +40,7 @@
static int kvm_abi = EXPECTED_KVM_API_VERSION;
#define PAGE_SIZE 4096ul
+#define PAGE_MASK (~(PAGE_SIZE - 1))
/* FIXME: share this number with kvm */
/* FIXME: or dynamically alloc/realloc regions */
@@ -232,11 +233,12 @@ int kvm_create_vcpu(kvm_context_t kvm, int slot)
return 0;
}
-int kvm_create(kvm_context_t kvm, unsigned long memory, void **vm_mem)
+int kvm_create(kvm_context_t kvm, unsigned long phys_mem_bytes, void **vm_mem)
{
unsigned long dosmem = 0xa0000;
unsigned long exmem = 0xc0000;
unsigned long pcimem = 0xf0000000;
+ unsigned long memory = (phys_mem_bytes + PAGE_SIZE - 1) & PAGE_MASK;
int fd = kvm->fd;
int zfd;
int r;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <118900650250-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* [PATCH 2/3] Fix option ROM loading [not found] ` <118900650250-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2007-09-05 15:35 ` Anthony Liguori [not found] ` <11890065032226-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 2007-09-09 11:32 ` [PATCH 1/3] Make to round memory to next page Avi Kivity 1 sibling, 1 reply; 5+ messages in thread From: Anthony Liguori @ 2007-09-05 15:35 UTC (permalink / raw) To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Anthony Liguori, Avi Kivity Make sure to copy the option ROMs into physical memory so they're visible to KVM guests. With the older BIOS, this allows -boot n to work although the CVS BIOS does not work. Signed-off-by: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index a5c08bc..f2917ca 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -585,6 +585,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, int boot_device, } cpu_register_physical_memory(0xd0000 + option_rom_offset, size, offset | IO_MEM_ROM); + + if (kvm_allowed) + memcpy(phys_ram_base + 0xd0000 + option_rom_offset, + phys_ram_base + offset, size); + option_rom_offset += size + 2047; option_rom_offset -= (option_rom_offset % 2048); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <11890065032226-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* [PATCH] Fix network boot with newer BIOS [not found] ` <11890065032226-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2007-09-05 15:35 ` Anthony Liguori [not found] ` <11890065031622-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Anthony Liguori @ 2007-09-05 15:35 UTC (permalink / raw) To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Anthony Liguori, Avi Kivity This patch is in QEMU CVS and allows network boot to work with newer BIOSes. It was originally written by Bernhard Kauer and committed (and modified) by Thiemo Seufer. Signed-off-by: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index f2917ca..d3b8786 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -214,6 +214,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, int boo case 'd': rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */ break; + case 'n': + rtc_set_memory(s, 0x3d, 0x04); /* Expansion ROM boot */ + break; } /* floppy type */ diff --git a/qemu/vl.c b/qemu/vl.c index fcc899b..d67b12f 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -7521,7 +7521,6 @@ int main(int argc, char **argv) fprintf(stderr, "No valid PXE rom found for network device\n"); exit(1); } - boot_device = 'c'; /* to prevent confusion by the BIOS */ } #endif ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <11890065031622-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 3/3] Fix network boot with newer BIOS [not found] ` <11890065031622-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2007-09-05 15:36 ` Anthony Liguori 0 siblings, 0 replies; 5+ messages in thread From: Anthony Liguori @ 2007-09-05 15:36 UTC (permalink / raw) To: kvm-devel Sorry, this should be 3/3. Regards, Anthony Liguori On Wed, 2007-09-05 at 10:35 -0500, Anthony Liguori wrote: > This patch is in QEMU CVS and allows network boot to work with newer BIOSes. > It was originally written by Bernhard Kauer and committed (and modified) by > Thiemo Seufer. > > Signed-off-by: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> > > diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c > index f2917ca..d3b8786 100644 > --- a/qemu/hw/pc.c > +++ b/qemu/hw/pc.c > @@ -214,6 +214,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, int boo > case 'd': > rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */ > break; > + case 'n': > + rtc_set_memory(s, 0x3d, 0x04); /* Expansion ROM boot */ > + break; > } > > /* floppy type */ > diff --git a/qemu/vl.c b/qemu/vl.c > index fcc899b..d67b12f 100644 > --- a/qemu/vl.c > +++ b/qemu/vl.c > @@ -7521,7 +7521,6 @@ int main(int argc, char **argv) > fprintf(stderr, "No valid PXE rom found for network device\n"); > exit(1); > } > - boot_device = 'c'; /* to prevent confusion by the BIOS */ > } > #endif > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Make to round memory to next page [not found] ` <118900650250-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 2007-09-05 15:35 ` [PATCH 2/3] Fix option ROM loading Anthony Liguori @ 2007-09-09 11:32 ` Avi Kivity 1 sibling, 0 replies; 5+ messages in thread From: Avi Kivity @ 2007-09-09 11:32 UTC (permalink / raw) To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Anthony Liguori wrote: > In general, the BIOS, VGA BIOS, and option ROMs are not required to be multiple > of page sizes. This means that phys_ram_size may not be a multiple of page. > Address this at the kvm_create() level to make things simplier for future > callers. > > Applied all three, thanks. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-09 11:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-05 15:35 [PATCH 1/3] Make to round memory to next page Anthony Liguori
[not found] ` <118900650250-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-05 15:35 ` [PATCH 2/3] Fix option ROM loading Anthony Liguori
[not found] ` <11890065032226-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-05 15:35 ` [PATCH] Fix network boot with newer BIOS Anthony Liguori
[not found] ` <11890065031622-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-05 15:36 ` [PATCH 3/3] " Anthony Liguori
2007-09-09 11:32 ` [PATCH 1/3] Make to round memory to next page Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox