Make to round memory to next page
PATCH 1/3 Make to round memory to next page
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.
user/kvmctl.c +3 -1
@@ -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/
A message that is not in the archive (sent off-list or not yet received): 118900650250-git-send-email-aliguori-r/[email protected]
PATCH 2/3 Fix option ROM loading
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.
qemu/hw/pc.c +5 -0
@@ -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/
A message that is not in the archive (sent off-list or not yet received): 11890065032226-git-send-email-aliguori-r/[email protected]
PATCH 1/1 Fix network boot with newer BIOS
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.
qemu/hw/pc.c +3 -0
@@ -214,6 +214,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, int boocase '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 */
qemu/vl.c +0 -1
@@ -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/
A message that is not in the archive (sent off-list or not yet received): 11890065031622-git-send-email-aliguori-r/[email protected]
Re: [PATCH 3/3] Fix network boot with newer BIOS
Sorry, this should be 3/3.
Regards,
Anthony Liguori
Quoted 25 lines · Anthony Liguori
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/[email protected]>qemu/hw/pc.c +3
-0@@ -214,6 +214,9 @@ static void cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, int boocase '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 */ qemu/vl.c +0
-0
qemu/vl.c int main(int argc, char **argv) · line 7526
Quoted 7 lines
qemu/vl.c +0
-1@@ -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/
Avi Kivity
AppliedQuoted 6 lines · Anthony Liguori
In general, the BIOS, VGA BIOS, and option ROMs are not required to be multiple of page sizes. This means that
phys_ram_sizemay not be a multiple of page. Address this at thekvm_create()level to make things simplier for future callers.
Applied all three, thanks.
Signature · 7 lines
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/