debuggers.hg

view tools/ioemu/patches/xen-mm @ 10978:1cbf49c018cb

[qemu patches] Update patches for changeset 10939:5980fb28b050.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Fri Aug 04 10:57:13 2006 +0100 (2006-08-04)
parents f3d6a5281617
children ec8dd0528fc6
line source
1 Index: ioemu/hw/pc.c
2 ===================================================================
3 --- ioemu.orig/hw/pc.c 2006-08-04 10:53:02.019794255 +0100
4 +++ ioemu/hw/pc.c 2006-08-04 10:54:56.876531492 +0100
5 @@ -639,7 +639,9 @@
6 }
8 /* allocate RAM */
9 +#ifndef CONFIG_DM /* HVM domain owns memory */
10 cpu_register_physical_memory(0, ram_size, 0);
11 +#endif
13 /* BIOS load */
14 bios_offset = ram_size + vga_ram_size;
15 @@ -671,8 +673,10 @@
16 ret = load_image(buf, phys_ram_base + vga_bios_offset);
18 /* setup basic memory access */
19 +#ifndef CONFIG_DM /* HVM domain owns memory */
20 cpu_register_physical_memory(0xc0000, 0x10000,
21 vga_bios_offset | IO_MEM_ROM);
22 +#endif
24 /* map the last 128KB of the BIOS in ISA space */
25 isa_bios_size = bios_size;
26 Index: ioemu/vl.c
27 ===================================================================
28 --- ioemu.orig/vl.c 2006-08-04 10:53:02.472741926 +0100
29 +++ ioemu/vl.c 2006-08-04 10:55:48.361590787 +0100
30 @@ -159,6 +159,8 @@
31 #define MAX_CPUS 1
32 #endif
34 +int xc_handle;
35 +
36 char domain_name[1024] = { 'H','V', 'M', 'X', 'E', 'N', '-'};
37 extern int domid;
39 @@ -5106,6 +5108,9 @@
40 QEMUMachine *machine;
41 char usb_devices[MAX_VM_USB_PORTS][128];
42 int usb_devices_index;
43 + unsigned long nr_pages;
44 + xen_pfn_t *page_array;
45 + extern void *shared_page;
47 char qemu_dm_logfilename[64];
49 @@ -5342,11 +5347,13 @@
50 ram_size = atol(optarg) * 1024 * 1024;
51 if (ram_size <= 0)
52 help();
53 +#ifndef CONFIG_DM
54 if (ram_size > PHYS_RAM_MAX_SIZE) {
55 fprintf(stderr, "qemu: at most %d MB RAM can be simulated\n",
56 PHYS_RAM_MAX_SIZE / (1024 * 1024));
57 exit(1);
58 }
59 +#endif /* !CONFIG_DM */
60 break;
61 case QEMU_OPTION_l:
62 {
63 @@ -5560,6 +5567,41 @@
64 /* init the memory */
65 phys_ram_size = ram_size + vga_ram_size + bios_size;
67 +#ifdef CONFIG_DM
68 +
69 + nr_pages = ram_size/PAGE_SIZE;
70 + xc_handle = xc_interface_open();
71 +
72 + page_array = (xen_pfn_t *)malloc(nr_pages * sizeof(xen_pfn_t));
73 + if (page_array == NULL) {
74 + fprintf(logfile, "malloc returned error %d\n", errno);
75 + exit(-1);
76 + }
77 +
78 + if (xc_get_pfn_list(xc_handle, domid, page_array, nr_pages) != nr_pages) {
79 + fprintf(logfile, "xc_get_pfn_list returned error %d\n", errno);
80 + exit(-1);
81 + }
82 +
83 + phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
84 + PROT_READ|PROT_WRITE, page_array,
85 + nr_pages - 1);
86 + if (phys_ram_base == 0) {
87 + fprintf(logfile, "xc_map_foreign_batch returned error %d\n", errno);
88 + exit(-1);
89 + }
90 +
91 + shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
92 + PROT_READ|PROT_WRITE,
93 + page_array[nr_pages - 1]);
94 +
95 + fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n", nr_pages - 1,
96 + (uint64_t)(page_array[nr_pages - 1]));
97 +
98 + free(page_array);
99 +
100 +#else /* !CONFIG_DM */
101 +
102 #ifdef CONFIG_SOFTMMU
103 phys_ram_base = qemu_vmalloc(phys_ram_size);
104 if (!phys_ram_base) {
105 @@ -5600,6 +5642,8 @@
106 }
107 #endif
109 +#endif /* !CONFIG_DM */
110 +
111 /* we always create the cdrom drive, even if no disk is there */
112 bdrv_init();
113 if (cdrom_index >= 0) {