mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
This patch fix several issue to support >2G 64bit vmx guest in IA-32e
platform, it includes: 1) One fix on xc_vmx_build.c 2) Change ram_size/phys_ram_size in qemu from int to uint64_t 3) One fix on pcnet unsigned short to unsigned long conversion. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Xin Li <xin.b.li@intel.com>
This commit is contained in:
1 parent
814a93dc4c
commit
b5bdea9ad6
7 files changed
+18
-17
No files matched your search
@@ -668,7 +668,7 @@ static __inline__ void atomic_clear_bit(long nr, volatile void *addr)
|
||||
#endif
|
||||
/* memory API */
|
||||
|
||||
extern int phys_ram_size;
|
||||
extern uint64_t phys_ram_size;
|
||||
extern int phys_ram_fd;
|
||||
extern uint8_t *phys_ram_base;
|
||||
extern uint8_t *phys_ram_dirty;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ spinlock_t tb_lock = SPIN_LOCK_UNLOCKED;
|
||||
uint8_t code_gen_buffer[CODE_GEN_BUFFER_SIZE];
|
||||
uint8_t *code_gen_ptr;
|
||||
|
||||
int phys_ram_size;
|
||||
uint64_t phys_ram_size;
|
||||
int phys_ram_fd;
|
||||
uint8_t *phys_ram_base;
|
||||
uint8_t *phys_ram_dirty;
|
||||
|
||||
+2
-2
@@ -119,7 +119,7 @@ static void cmos_init_hd(int type_ofs, int info_ofs, BlockDriverState *hd)
|
||||
}
|
||||
|
||||
/* hd_table must contain 4 block drivers */
|
||||
static void cmos_init(int ram_size, int boot_device, BlockDriverState **hd_table)
|
||||
static void cmos_init(uint64_t ram_size, int boot_device, BlockDriverState **hd_table)
|
||||
{
|
||||
RTCState *s = rtc_state;
|
||||
int val;
|
||||
@@ -375,7 +375,7 @@ static int serial_irq[MAX_SERIAL_PORTS] = { 4, 3, 4, 3 };
|
||||
#define NOBIOS 1
|
||||
|
||||
/* PC hardware initialisation */
|
||||
void pc_init(int ram_size, int vga_ram_size, int boot_device,
|
||||
void pc_init(uint64_t ram_size, int vga_ram_size, int boot_device,
|
||||
DisplayState *ds, const char **fd_filename, int snapshot,
|
||||
const char *kernel_filename, const char *kernel_cmdline,
|
||||
const char *initrd_filename)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
#define CSR_NRBA(S) ((S)->csr[22] | ((S)->csr[23] << 16))
|
||||
#define CSR_BADR(S) ((S)->csr[24] | ((S)->csr[25] << 16))
|
||||
#define CSR_NRDA(S) ((S)->csr[26] | ((S)->csr[27] << 16))
|
||||
#define CSR_CRDA(S) ((S)->csr[28] | ((S)->csr[29] << 16))
|
||||
#define CSR_CRDA(S) ((S)->csr[28] | (((uint32_t)((S)->csr[29])) << 16))
|
||||
#define CSR_BADX(S) ((S)->csr[30] | ((S)->csr[31] << 16))
|
||||
#define CSR_NXDA(S) ((S)->csr[32] | ((S)->csr[33] << 16))
|
||||
#define CSR_CXDA(S) ((S)->csr[34] | ((S)->csr[35] << 16))
|
||||
@@ -102,7 +102,7 @@
|
||||
#define CSR_NXBA(S) ((S)->csr[64] | ((S)->csr[65] << 16))
|
||||
|
||||
#define PHYSADDR(S,A) \
|
||||
(BCR_SSIZE32(S) ? (A) : (A) | ((0xff00 & (uint32_t)(s)->csr[2])<<16))
|
||||
(BCR_SSIZE32(S) ? (A) : (A) | ((0xff00 & (uint32_t)(S)->csr[2])<<16))
|
||||
|
||||
struct pcnet_initblk16 {
|
||||
uint16_t mode;
|
||||
|
||||
+2
-2
@@ -119,7 +119,7 @@ const char* vncconnect; /* do a reverse connect to this host*/
|
||||
const char* keyboard_layout = 0;
|
||||
int64_t ticks_per_sec;
|
||||
int boot_device = 'c';
|
||||
int ram_size;
|
||||
uint64_t ram_size;
|
||||
int domid = -1;
|
||||
static char network_script[1024];
|
||||
int pit_min_timer_count = 0;
|
||||
@@ -2906,7 +2906,7 @@ int main(int argc, char **argv)
|
||||
help();
|
||||
break;
|
||||
case QEMU_OPTION_m:
|
||||
ram_size = atoi(optarg) * 1024 * 1024;
|
||||
ram_size = atol(optarg) * 1024 * 1024;
|
||||
if (ram_size <= 0)
|
||||
help();
|
||||
break;
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ extern int audio_enabled;
|
||||
extern int sb16_enabled;
|
||||
extern int adlib_enabled;
|
||||
extern int gus_enabled;
|
||||
extern int ram_size;
|
||||
extern uint64_t ram_size;
|
||||
extern int bios_size;
|
||||
extern int rtc_utc;
|
||||
extern int cirrus_vga_enabled;
|
||||
@@ -649,7 +649,7 @@ int pit_get_gate(PITState *pit, int channel);
|
||||
int pit_get_out(PITState *pit, int channel, int64_t current_time);
|
||||
|
||||
/* pc.c */
|
||||
void pc_init(int ram_size, int vga_ram_size, int boot_device,
|
||||
void pc_init(uint64_t ram_size, int vga_ram_size, int boot_device,
|
||||
DisplayState *ds, const char **fd_filename, int snapshot,
|
||||
const char *kernel_filename, const char *kernel_cmdline,
|
||||
const char *initrd_filename);
|
||||
|
||||
@@ -288,11 +288,11 @@ static int setup_guest(int xc_handle,
|
||||
l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
|
||||
unsigned long *page_array = NULL;
|
||||
#ifdef __x86_64__
|
||||
l3_pgentry_t *vl3tab=NULL, *vl3e=NULL;
|
||||
l3_pgentry_t *vl3tab=NULL;
|
||||
unsigned long l3tab;
|
||||
#endif
|
||||
unsigned long l2tab;
|
||||
unsigned long l1tab;
|
||||
unsigned long l2tab = 0;
|
||||
unsigned long l1tab = 0;
|
||||
unsigned long count, i;
|
||||
shared_info_t *shared_info;
|
||||
void *e820_page;
|
||||
@@ -323,7 +323,7 @@ static int setup_guest(int xc_handle,
|
||||
}
|
||||
|
||||
/* memsize is in megabytes */
|
||||
v_end = memsize << 20;
|
||||
v_end = (unsigned long)memsize << 20;
|
||||
|
||||
#ifdef __i386__
|
||||
nr_pt_pages = 1 + ((memsize + 3) >> 2);
|
||||
@@ -435,15 +435,16 @@ static int setup_guest(int xc_handle,
|
||||
goto error_out;
|
||||
memset(vl2tab, 0, PAGE_SIZE);
|
||||
munmap(vl2tab, PAGE_SIZE);
|
||||
vl2tab = NULL;
|
||||
vl3tab[i] = l2tab | L3_PROT;
|
||||
}
|
||||
|
||||
vl3e = &vl3tab[l3_table_offset(0)];
|
||||
for ( count = 0; count < (v_end >> PAGE_SHIFT); count++ )
|
||||
{
|
||||
if (!(count & (1 << (L3_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT)))){
|
||||
if ( !(count & ((1 << (L3_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT)) - 1)) )
|
||||
{
|
||||
l2tab = vl3tab[count >> (L3_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT)]
|
||||
& PAGE_MASK;
|
||||
& PAGE_MASK;
|
||||
|
||||
if (vl2tab != NULL)
|
||||
munmap(vl2tab, PAGE_SIZE);
|
||||
|
||||