ia64/xen-unstable

changeset 17103:3d6e463d08a2

[IA64] Fix qemu memory access on IA64

- Correct a parameter to xc_map_foreign_batch(). skipping vga hole.
- sync_icache() might overrun a page boundary. qemu-dm will die.

This re-enables HVM support after cset
99478ffd81ee8685e6376210a1bd654c3790bf8d in linux-2.6.18-xen.hg

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Fri Feb 22 08:40:32 2008 -0700 (2008-02-22)
parents 8338290757c5
children 07d9e9ca34f0
files tools/ioemu/hw/xen_machine_fv.c tools/ioemu/target-i386-dm/exec-dm.c
line diff
     1.1 --- a/tools/ioemu/hw/xen_machine_fv.c	Fri Feb 22 10:52:27 2008 +0000
     1.2 +++ b/tools/ioemu/hw/xen_machine_fv.c	Fri Feb 22 08:40:32 2008 -0700
     1.3 @@ -246,14 +246,20 @@ static void xen_init_fv(uint64_t ram_siz
     1.4  
     1.5      for (i = 0; i < nr_pages; i++)
     1.6          page_array[i] = i;
     1.7 -	
     1.8 +
     1.9      /* VTI will not use memory between 3G~4G, so we just pass a legal pfn
    1.10         to make QEMU map continuous virtual memory space */
    1.11 -    if (ram_size > MMIO_START) {	
    1.12 +    if (ram_size > MMIO_START) {
    1.13          for (i = 0 ; i < (MEM_G >> XC_PAGE_SHIFT); i++)
    1.14              page_array[(MMIO_START >> XC_PAGE_SHIFT) + i] =
    1.15                  (STORE_PAGE_START >> XC_PAGE_SHIFT); 
    1.16      }
    1.17 +    /* skipping VGA hole, same as above */
    1.18 +    if (ram_size > VGA_IO_START) {
    1.19 +        for (i = 0 ; i < (VGA_IO_SIZE >> XC_PAGE_SHIFT); i++)
    1.20 +            page_array[(VGA_IO_START >> XC_PAGE_SHIFT) + i] =
    1.21 +                (STORE_PAGE_START >> XC_PAGE_SHIFT); 
    1.22 +    }
    1.23  
    1.24      phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
    1.25                                           PROT_READ|PROT_WRITE,
     2.1 --- a/tools/ioemu/target-i386-dm/exec-dm.c	Fri Feb 22 10:52:27 2008 +0000
     2.2 +++ b/tools/ioemu/target-i386-dm/exec-dm.c	Fri Feb 22 08:40:32 2008 -0700
     2.3 @@ -350,12 +350,13 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
     2.4   * So to emulate right behavior that guest OS is assumed, we need to flush
     2.5   * I/D cache here.
     2.6   */
     2.7 -static void sync_icache(unsigned long address, int len)
     2.8 +static void sync_icache(uint8_t *address, int len)
     2.9  {
    2.10 -    int l;
    2.11 +    unsigned long addr = (unsigned long)address;
    2.12 +    unsigned long end = addr + len;
    2.13  
    2.14 -    for(l = 0; l < (len + 32); l += 32)
    2.15 -        __ia64_fc(address + l);
    2.16 +    for (addr &= ~(32UL-1); addr < end; addr += 32UL)
    2.17 +        __ia64_fc(addr);
    2.18  
    2.19      ia64_sync_i();
    2.20      ia64_srlz_i();