From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH][5/10] 64 bit xend cleanups.
Date: Wed, 29 Jun 2005 22:51:35 -0700 [thread overview]
Message-ID: <20050630055135.GA7394@intel.com> (raw)
64 bit xend cleanups.
Signed-off-by: Xin Li <xin.bi.li@intel.com>
Signed-off-by: Xiofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
diff -r b4f1afa166af -r 18df82c3dcc7 tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c Thu Jun 30 04:11:46 2005
+++ b/tools/libxc/xc_vmx_build.c Thu Jun 30 04:15:49 2005
@@ -92,18 +92,20 @@
}
static int zap_mmio_range(int xc_handle, u32 dom,
- l2_pgentry_t *vl2tab,
+ l2_pgentry_32_t *vl2tab,
unsigned long mmio_range_start,
unsigned long mmio_range_size)
{
unsigned long mmio_addr;
unsigned long mmio_range_end = mmio_range_start + mmio_range_size;
unsigned long vl2e;
- l1_pgentry_t *vl1tab;
+ l1_pgentry_32_t *vl1tab;
mmio_addr = mmio_range_start & PAGE_MASK;
for (; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE) {
vl2e = vl2tab[l2_table_offset(mmio_addr)];
+ if (vl2e == 0)
+ continue;
vl1tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
PROT_READ|PROT_WRITE, vl2e >> PAGE_SHIFT);
if (vl1tab == 0) {
@@ -121,7 +123,7 @@
struct mem_map *mem_mapp)
{
int i;
- l2_pgentry_t *vl2tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
+ l2_pgentry_32_t *vl2tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
PROT_READ|PROT_WRITE,
l2tab >> PAGE_SHIFT);
if (vl2tab == 0)
@@ -149,8 +151,8 @@
unsigned long flags,
struct mem_map * mem_mapp)
{
- l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
- l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
+ l1_pgentry_32_t *vl1tab=NULL, *vl1e=NULL;
+ l2_pgentry_32_t *vl2tab=NULL, *vl2e=NULL;
unsigned long *page_array = NULL;
unsigned long l2tab;
unsigned long l1tab;
@@ -426,8 +428,10 @@
* Pin down l2tab addr as page dir page - causes hypervisor to provide
* correct protection for the page
*/
+#ifdef __i386__
if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) )
goto error_out;
+#endif
/* Send the page update requests down to the hypervisor. */
if ( finish_mmu_updates(xc_handle, mmu) )
@@ -646,7 +650,7 @@
return -1;
}
-static inline int is_loadable_phdr(Elf_Phdr *phdr)
+static inline int is_loadable_phdr(Elf32_Phdr *phdr)
{
return ((phdr->p_type == PT_LOAD) &&
((phdr->p_flags & (PF_W|PF_X)) != 0));
@@ -656,9 +660,9 @@
unsigned long elfsize,
struct domain_setup_info *dsi)
{
- Elf_Ehdr *ehdr = (Elf_Ehdr *)elfbase;
- Elf_Phdr *phdr;
- Elf_Shdr *shdr;
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)elfbase;
+ Elf32_Phdr *phdr;
+ Elf32_Shdr *shdr;
unsigned long kernstart = ~0UL, kernend=0UL;
char *shstrtab;
int h;
@@ -687,13 +691,13 @@
ERROR("ELF image has no section-header strings table (shstrtab).");
return -EINVAL;
}
- shdr = (Elf_Shdr *)(elfbase + ehdr->e_shoff +
+ shdr = (Elf32_Shdr *)(elfbase + ehdr->e_shoff +
(ehdr->e_shstrndx*ehdr->e_shentsize));
shstrtab = elfbase + shdr->sh_offset;
for ( h = 0; h < ehdr->e_phnum; h++ )
{
- phdr = (Elf_Phdr *)(elfbase + ehdr->e_phoff + (h*ehdr->e_phentsize));
+ phdr = (Elf32_Phdr *)(elfbase + ehdr->e_phoff + (h*ehdr->e_phentsize));
if ( !is_loadable_phdr(phdr) )
continue;
if ( phdr->p_paddr < kernstart )
@@ -726,8 +730,8 @@
char *elfbase, int xch, u32 dom, unsigned long *parray,
struct domain_setup_info *dsi)
{
- Elf_Ehdr *ehdr = (Elf_Ehdr *)elfbase;
- Elf_Phdr *phdr;
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)elfbase;
+ Elf32_Phdr *phdr;
int h;
char *va;
@@ -735,7 +739,7 @@
for ( h = 0; h < ehdr->e_phnum; h++ )
{
- phdr = (Elf_Phdr *)(elfbase + ehdr->e_phoff + (h*ehdr->e_phentsize));
+ phdr = (Elf32_Phdr *)(elfbase + ehdr->e_phoff + (h*ehdr->e_phentsize));
if ( !is_loadable_phdr(phdr) )
continue;
diff -r b4f1afa166af -r 18df82c3dcc7 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h Thu Jun 30 04:11:46 2005
+++ b/tools/libxc/xc_private.h Thu Jun 30 04:15:49 2005
@@ -53,6 +53,8 @@
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
+typedef u32 l1_pgentry_32_t;
+typedef u32 l2_pgentry_32_t;
typedef unsigned long l1_pgentry_t;
typedef unsigned long l2_pgentry_t;
#if defined(__x86_64__)
diff -r b4f1afa166af -r 18df82c3dcc7 tools/libxc/linux_boot_params.h
--- a/tools/libxc/linux_boot_params.h Thu Jun 30 04:11:46 2005
+++ b/tools/libxc/linux_boot_params.h Thu Jun 30 04:15:49 2005
@@ -8,9 +8,9 @@
struct mem_map {
int nr_map;
struct entry {
- unsigned long long addr; /* start of memory segment */
- unsigned long long size; /* size of memory segment */
- unsigned long type; /* type of memory segment */
+ u64 addr; /* start of memory segment */
+ u64 size; /* size of memory segment */
+ u32 type; /* type of memory segment */
#define E820_RAM 1
#define E820_RESERVED 2
#define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */
@@ -18,7 +18,7 @@
#define E820_IO 16
#define E820_SHARED 17
- unsigned long caching_attr; /* used by hypervisor */
+ u32 caching_attr; /* used by hypervisor */
#define MEMMAP_UC 0
#define MEMMAP_WC 1
#define MEMMAP_WT 4
@@ -29,15 +29,15 @@
};
struct e820entry {
- unsigned long long addr; /* start of memory segment */
- unsigned long long size; /* size of memory segment */
- unsigned long type; /* type of memory segment */
-};
+ u64 addr; /* start of memory segment */
+ u64 size; /* size of memory segment */
+ u32 type; /* type of memory segment */
+}__attribute__((packed));
struct e820map {
- int nr_map;
+ u32 nr_map;
struct e820entry map[E820MAX];
-};
+}__attribute__((packed));
struct drive_info_struct { __u8 dummy[32]; };
@@ -64,8 +64,8 @@
unsigned short lfb_width; /* 0x12 */
unsigned short lfb_height; /* 0x14 */
unsigned short lfb_depth; /* 0x16 */
- unsigned long lfb_base; /* 0x18 */
- unsigned long lfb_size; /* 0x1c */
+ unsigned int lfb_base; /* 0x18 */
+ unsigned int lfb_size; /* 0x1c */
unsigned short dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */
unsigned short lfb_linelength; /* 0x24 */
unsigned char red_size; /* 0x26 */
reply other threads:[~2005-06-30 5:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050630055135.GA7394@intel.com \
--to=arun.sharma@intel.com \
--cc=Ian.Pratt@cl.cam.ac.uk \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.