# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID ded14681ae84eea28c43fa5b651d751262aa25c3
# Parent 864dcee1f899c52e022fadcfab9929dcdbcb1ac4
# Parent dcbe36ee21718d5f423c6415ed79ce6a8d0ab4f9
merge
diff -r 864dcee1f899 -r ded14681ae84
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Sat Feb 18 10:56:51 2006
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Sat Feb 18 20:17:24 2006
@@ -61,6 +61,9 @@
#include <asm/system.h>
#include <asm/unistd.h>
#include <asm/system.h>
+#ifdef CONFIG_XEN
+#include <asm/hypervisor.h>
+#endif
#if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
# error "struct cpuinfo_ia64 too big!"
@@ -242,6 +245,12 @@
rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
rsvd_region[n].end = (unsigned long) ia64_imva(_end);
n++;
+
+#ifdef CONFIG_XEN
+ rsvd_region[n].start = (unsigned long)
(HYPERVISOR_shared_info->arch.start_info_pfn << PAGE_SHIFT);
+ rsvd_region[n].end = rsvd_region[n].start + PAGE_SIZE;
+ n++;
+#endif
#ifdef CONFIG_BLK_DEV_INITRD
if (ia64_boot_param->initrd_start) {
diff -r 864dcee1f899 -r ded14681ae84
linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Sat Feb 18
10:56:51 2006
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Sat Feb 18
20:17:24 2006
@@ -106,8 +106,10 @@
BUG_ON(HYPERVISOR_event_channel_op(&op) != 0 );
evtchn = op.u.bind_virq.port;
- if (!unbound_irq(evtchn))
- return -EINVAL;
+ if (!unbound_irq(evtchn)) {
+ evtchn = -EINVAL;
+ goto out;
+ }
evtchns[evtchn].handler = handler;
evtchns[evtchn].dev_id = dev_id;
@@ -115,6 +117,7 @@
irq_info[evtchn] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
unmask_evtchn(evtchn);
+out:
spin_unlock(&irq_mapping_update_lock);
return evtchn;
}
@@ -125,8 +128,10 @@
{
spin_lock(&irq_mapping_update_lock);
- if (!unbound_irq(evtchn))
- return -EINVAL;
+ if (!unbound_irq(evtchn)) {
+ evtchn = -EINVAL;
+ goto out;
+ }
evtchns[evtchn].handler = handler;
evtchns[evtchn].dev_id = dev_id;
@@ -134,6 +139,7 @@
irq_info[evtchn] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
unmask_evtchn(evtchn);
+out:
spin_unlock(&irq_mapping_update_lock);
return evtchn;
}
@@ -158,7 +164,7 @@
spin_lock(&irq_mapping_update_lock);
if (unbound_irq(irq))
- return;
+ goto out;
op.cmd = EVTCHNOP_close;
op.u.close.port = evtchn;
@@ -179,6 +185,7 @@
evtchns[evtchn].handler = NULL;
evtchns[evtchn].opened = 0;
+out:
spin_unlock(&irq_mapping_update_lock);
}
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/linux-xen/README.origin
--- a/xen/arch/ia64/linux-xen/README.origin Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/linux-xen/README.origin Sat Feb 18 20:17:24 2006
@@ -5,19 +5,24 @@
# (e.g. with #ifdef XEN or XEN in a comment) so that they can be
# easily updated to future versions of the corresponding Linux files.
-efi.c -> linux/arch/ia64/kernel/efi.c
-entry.h -> linux/arch/ia64/kernel/entry.h
-entry.S -> linux/arch/ia64/kernel/entry.S
-hpsim_ssc.h -> linux/arch/ia64/hp/sim/hpsim_ssc.h
-irq_ia64.c -> linux/arch/ia64/kernel/irq_ia64.c
-minstate.h -> linux/arch/ia64/kernel/minstate.h
-mm_contig.c -> linux/arch/ia64/mm/contig.c
-pal.S -> linux/arch/ia64/kernel/pal.S
-sal.c -> linux/arch/ia64/kernel/sal.c
-setup.c -> linux/arch/ia64/kernel/setup.c
-smp.c -> linux/arch/ia64/kernel/smp.c
-smpboot.c -> linux/arch/ia64/kernel/smpboot.c
-sort.c -> linux/lib/sort.c
-time.c -> linux/arch/ia64/kernel/time.c
-tlb.c -> linux/arch/ia64/mm/tlb.c
-unaligned.c -> linux/arch/ia64/kernel/unaligned.c
+efi.c -> linux/arch/ia64/kernel/efi.c
+entry.h -> linux/arch/ia64/kernel/entry.h
+entry.S -> linux/arch/ia64/kernel/entry.S
+head.S -> linux/arch/ia64/kernel/head.S
+hpsim_ssc.h -> linux/arch/ia64/hp/sim/hpsim_ssc.h
+irq_ia64.c -> linux/arch/ia64/kernel/irq_ia64.c
+minstate.h -> linux/arch/ia64/kernel/minstate.h
+mm_contig.c -> linux/arch/ia64/mm/contig.c
+pal.S -> linux/arch/ia64/kernel/pal.S
+process-linux-xen.c -> linux/arch/ia64/kernel/process.c
+sal.c -> linux/arch/ia64/kernel/sal.c
+setup.c -> linux/arch/ia64/kernel/setup.c
+smp.c -> linux/arch/ia64/kernel/smp.c
+smpboot.c -> linux/arch/ia64/kernel/smpboot.c
+sort.c -> linux/lib/sort.c
+time.c -> linux/arch/ia64/kernel/time.c
+tlb.c -> linux/arch/ia64/mm/tlb.c
+unaligned.c -> linux/arch/ia64/kernel/unaligned.c
+unwind.c -> linux/arch/ia64/kernel/unwind.c
+unwind_decoder.c -> linux/arch/ia64/kernel/unwind_decoder.c
+unwind_i.h -> linux/arch/ia64/kernel/unwind_i.h
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/linux-xen/irq_ia64.c
--- a/xen/arch/ia64/linux-xen/irq_ia64.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/linux-xen/irq_ia64.c Sat Feb 18 20:17:24 2006
@@ -169,7 +169,7 @@
* handler needs to be able to wait for further keyboard interrupts,
which can't
* come through until ia64_eoi() has been done.
*/
- xen_irq_exit(regs);
+ irq_exit();
}
#ifdef CONFIG_HOTPLUG_CPU
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/linux/README.origin
--- a/xen/arch/ia64/linux/README.origin Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/linux/README.origin Sat Feb 18 20:17:24 2006
@@ -5,14 +5,15 @@
the instructions in the README there.
cmdline.c -> linux/lib/cmdline.c
-efi_stub.S -> linux/arch/ia64/efi_stub.S
+efi_stub.S -> linux/arch/ia64/kernel/efi_stub.S
extable.c -> linux/arch/ia64/mm/extable.c
hpsim.S -> linux/arch/ia64/hp/sim/hpsim.S
ia64_ksyms.c -> linux/arch/ia64/kernel/ia64_ksyms.c
+irq_lsapic.c -> linux/arch/ia64/kernel/irq_lsapic.c
linuxextable.c -> linux/kernel/extable.c
machvec.c -> linux/arch/ia64/kernel/machvec.c
patch.c -> linux/arch/ia64/kernel/patch.c
-pcdp.h -> drivers/firmware/pcdp.h
+pcdp.h -> linux/drivers/firmware/pcdp.h
bitop.c -> linux/arch/ia64/lib/bitop.c
clear_page.S -> linux/arch/ia64/lib/clear_page.S
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/vmx/vmx_init.c
--- a/xen/arch/ia64/vmx/vmx_init.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/vmx/vmx_init.c Sat Feb 18 20:17:24 2006
@@ -317,7 +317,7 @@
for (j = io_ranges[i].start;
j < io_ranges[i].start + io_ranges[i].size;
j += PAGE_SIZE)
- map_domain_page(d, j, io_ranges[i].type);
+ assign_domain_page(d, j, io_ranges[i].type);
}
conf_nr = VMX_CONFIG_PAGES(d);
@@ -334,14 +334,14 @@
for (i = 0;
i < (end < MMIO_START ? end : MMIO_START);
i += PAGE_SIZE, pgnr++)
- map_domain_page(d, i, pgnr << PAGE_SHIFT);
+ assign_domain_page(d, i, pgnr << PAGE_SHIFT);
/* Map normal memory beyond 4G */
if (unlikely(end > MMIO_START)) {
start = 4 * MEM_G;
end = start + (end - 3 * MEM_G);
for (i = start; i < end; i += PAGE_SIZE, pgnr++)
- map_domain_page(d, i, pgnr << PAGE_SHIFT);
+ assign_domain_page(d, i, pgnr << PAGE_SHIFT);
}
d->arch.max_pfn = end >> PAGE_SHIFT;
@@ -356,7 +356,7 @@
/* Map guest firmware */
pgnr = page_to_mfn(page);
for (i = GFW_START; i < GFW_START + GFW_SIZE; i += PAGE_SIZE, pgnr++)
- map_domain_page(d, i, pgnr << PAGE_SHIFT);
+ assign_domain_page(d, i, pgnr << PAGE_SHIFT);
if (unlikely((page = alloc_domheap_pages(d, 1, 0)) == NULL)) {
printk("Could not allocate order=1 pages for vmx contig alloc\n");
@@ -365,9 +365,9 @@
/* Map for shared I/O page and xenstore */
pgnr = page_to_mfn(page);
- map_domain_page(d, IO_PAGE_START, pgnr << PAGE_SHIFT);
+ assign_domain_page(d, IO_PAGE_START, pgnr << PAGE_SHIFT);
pgnr++;
- map_domain_page(d, STORE_PAGE_START, pgnr << PAGE_SHIFT);
+ assign_domain_page(d, STORE_PAGE_START, pgnr << PAGE_SHIFT);
set_bit(ARCH_VMX_CONTIG_MEM, &v->arch.arch_vmx.flags);
return 0;
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/domain.c Sat Feb 18 20:17:24 2006
@@ -251,9 +251,12 @@
return 0;
fail_nomem:
- free_xenheap_page(d->shared_info);
- xfree(d->arch.mm);
- pgd_free(d->arch.mm->pgd);
+ if (d->arch.mm->pgd != NULL)
+ pgd_free(d->arch.mm->pgd);
+ if (d->arch.mm != NULL)
+ xfree(d->arch.mm);
+ if (d->shared_info != NULL)
+ free_xenheap_page(d->shared_info);
return -ENOMEM;
}
@@ -389,7 +392,7 @@
}
/* allocate new page for domain and map it to the specified metaphysical addr
*/
-struct page * map_new_domain_page(struct domain *d, unsigned long mpaddr)
+struct page * assign_new_domain_page(struct domain *d, unsigned long mpaddr)
{
struct mm_struct *mm = d->arch.mm;
struct page *p = (struct page *)0;
@@ -400,7 +403,7 @@
extern unsigned long vhpt_paddr, vhpt_pend;
if (!mm->pgd) {
- printk("map_new_domain_page: domain pgd must exist!\n");
+ printk("assign_new_domain_page: domain pgd must exist!\n");
return(p);
}
pgd = pgd_offset(mm,mpaddr);
@@ -428,21 +431,21 @@
if (p) memset(__va(page_to_maddr(p)),0,PAGE_SIZE);
}
if (unlikely(!p)) {
-printf("map_new_domain_page: Can't alloc!!!! Aaaargh!\n");
+printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
return(p);
}
if (unlikely(page_to_maddr(p) > vhpt_paddr && page_to_maddr(p) < vhpt_pend)) {
- printf("map_new_domain_page: reassigned vhpt page %p!!\n",page_to_maddr(p));
+ printf("assign_new_domain_page: reassigned vhpt page
%p!!\n",page_to_maddr(p));
}
set_pte(pte, pfn_pte(page_to_maddr(p) >> PAGE_SHIFT,
__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
}
- else printk("map_new_domain_page: mpaddr %lx already mapped!\n",mpaddr);
+ else printk("assign_new_domain_page: mpaddr %lx already
mapped!\n",mpaddr);
return p;
}
/* map a physical address to the specified metaphysical addr */
-void map_domain_page(struct domain *d, unsigned long mpaddr, unsigned long
physaddr)
+void assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long
physaddr)
{
struct mm_struct *mm = d->arch.mm;
pgd_t *pgd;
@@ -451,7 +454,7 @@
pte_t *pte;
if (!mm->pgd) {
- printk("map_domain_page: domain pgd must exist!\n");
+ printk("assign_domain_page: domain pgd must exist!\n");
return;
}
pgd = pgd_offset(mm,mpaddr);
@@ -472,11 +475,11 @@
set_pte(pte, pfn_pte(physaddr >> PAGE_SHIFT,
__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
}
- else printk("map_domain_page: mpaddr %lx already mapped!\n",mpaddr);
+ else printk("assign_domain_page: mpaddr %lx already mapped!\n",mpaddr);
}
#if 0
/* map a physical address with specified I/O flag */
-void map_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long
flags)
+void assign_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned
long flags)
{
struct mm_struct *mm = d->arch.mm;
pgd_t *pgd;
@@ -486,7 +489,7 @@
pte_t io_pte;
if (!mm->pgd) {
- printk("map_domain_page: domain pgd must exist!\n");
+ printk("assign_domain_page: domain pgd must exist!\n");
return;
}
ASSERT(flags & GPFN_IO_MASK);
@@ -509,7 +512,7 @@
pte_val(io_pte) = flags;
set_pte(pte, io_pte);
}
- else printk("map_domain_page: mpaddr %lx already mapped!\n",mpaddr);
+ else printk("assign_domain_page: mpaddr %lx already mapped!\n",mpaddr);
}
#endif
void mpafoo(unsigned long mpaddr)
@@ -557,7 +560,7 @@
}
/* if lookup fails and mpaddr is "legal", "create" the page */
if ((mpaddr >> PAGE_SHIFT) < d->max_pages) {
- if (map_new_domain_page(d,mpaddr)) goto tryagain;
+ if (assign_new_domain_page(d,mpaddr)) goto tryagain;
}
printk("lookup_domain_mpa: bad mpa %p (> %p\n",
mpaddr,d->max_pages<<PAGE_SHIFT);
@@ -655,15 +658,9 @@
else
#endif
while (memsz > 0) {
-#ifdef DOMU_AUTO_RESTART
- pteval = lookup_domain_mpa(d,dom_mpaddr);
- if (pteval) dom_imva = __va(pteval & _PFN_MASK);
- else { printf("loaddomainelfimage: BAD!\n"); while(1); }
-#else
- p = map_new_domain_page(d,dom_mpaddr);
+ p = assign_new_domain_page(d,dom_mpaddr);
if (unlikely(!p)) BUG();
dom_imva = __va(page_to_maddr(p));
-#endif
if (filesz > 0) {
if (filesz >= PAGE_SIZE)
copy_memory(dom_imva,elfaddr,PAGE_SIZE);
@@ -788,16 +785,15 @@
unsigned long pkern_entry;
unsigned long pkern_end;
unsigned long pinitrd_start = 0;
+ unsigned long pstart_info;
unsigned long ret, progress = 0;
//printf("construct_dom0: starting\n");
-#ifndef CLONE_DOMAIN0
/* Sanity! */
BUG_ON(d != dom0);
BUG_ON(d->vcpu[0] == NULL);
BUG_ON(test_bit(_VCPUF_initialised, &v->vcpu_flags));
-#endif
memset(&dsi, 0, sizeof(struct domain_setup_info));
@@ -847,13 +843,18 @@
(PAGE_ALIGN(initrd_len) + 4*1024*1024);
memcpy(__va(pinitrd_start),initrd_start,initrd_len);
+ pstart_info = PAGE_ALIGN(pinitrd_start + initrd_len);
+ } else {
+ pstart_info = PAGE_ALIGN(pkern_end);
}
printk("METAPHYSICAL MEMORY ARRANGEMENT:\n"
" Kernel image: %lx->%lx\n"
" Entry address: %lx\n"
- " Init. ramdisk: %lx len %lx\n",
- pkern_start, pkern_end, pkern_entry, pinitrd_start, initrd_len);
+ " Init. ramdisk: %lx len %lx\n"
+ " Start info.: %lx->%lx\n",
+ pkern_start, pkern_end, pkern_entry, pinitrd_start, initrd_len,
+ pstart_info, pstart_info + PAGE_SIZE);
if ( (pkern_end - pkern_start) > (d->max_pages * PAGE_SIZE) )
{
@@ -908,9 +909,9 @@
/* Set up start info area. */
- si = (start_info_t *)alloc_xenheap_page();
+ d->shared_info->arch.start_info_pfn = pstart_info >> PAGE_SHIFT;
+ si = __va(pstart_info);
memset(si, 0, PAGE_SIZE);
- d->shared_info->arch.start_info_pfn = __pa(si) >> PAGE_SHIFT;
sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION);
si->nr_pages = d->tot_pages;
@@ -962,9 +963,6 @@
sync_split_caches();
// FIXME: Hack for keyboard input
-#ifdef CLONE_DOMAIN0
-if (d == dom0)
-#endif
serial_input_init();
if (d == dom0) {
VCPU(v, delivery_mask[0]) = -1L;
@@ -977,65 +975,6 @@
return 0;
}
-// FIXME: When dom0 can construct domains, this goes away (or is rewritten)
-int construct_domU(struct domain *d,
- unsigned long image_start, unsigned long image_len,
- unsigned long initrd_start, unsigned long initrd_len,
- char *cmdline)
-{
- int i, rc;
- struct vcpu *v = d->vcpu[0];
- unsigned long pkern_entry;
-
-#ifndef DOMU_AUTO_RESTART
- BUG_ON(test_bit(_VCPUF_initialised, &v->vcpu_flags));
-#endif
-
- printk("*** LOADING DOMAIN %d ***\n",d->domain_id);
-
- d->max_pages = dom0_size/PAGE_SIZE; // FIXME: use dom0 size
- // FIXME: use domain0 command line
- rc = parsedomainelfimage(image_start, image_len, &pkern_entry);
- printk("parsedomainelfimage returns %d\n",rc);
- if ( rc != 0 ) return rc;
-
- /* Mask all upcalls... */
- for ( i = 0; i < MAX_VIRT_CPUS; i++ )
- d->shared_info->vcpu_info[i].evtchn_upcall_mask = 1;
-
- /* Copy the OS image. */
- printk("calling loaddomainelfimage(%p,%p)\n",d,image_start);
- loaddomainelfimage(d,image_start);
- printk("loaddomainelfimage returns\n");
-
- set_bit(_VCPUF_initialised, &v->vcpu_flags);
-
- printk("calling new_thread, entry=%p\n",pkern_entry);
-#ifdef DOMU_AUTO_RESTART
- v->domain->arch.image_start = image_start;
- v->domain->arch.image_len = image_len;
- v->domain->arch.entry = pkern_entry;
-#endif
- new_thread(v, pkern_entry, 0, 0);
- printk("new_thread returns\n");
- sync_split_caches();
- __set_bit(0x30, VCPU(v, delivery_mask));
-
- return 0;
-}
-
-#ifdef DOMU_AUTO_RESTART
-void reconstruct_domU(struct vcpu *v)
-{
- /* re-copy the OS image to reset data values to original */
- printk("reconstruct_domU: restarting domain %d...\n",
- v->domain->domain_id);
- loaddomainelfimage(v->domain,v->domain->arch.image_start);
- new_thread(v, v->domain->arch.entry, 0, 0);
- sync_split_caches();
-}
-#endif
-
void machine_restart(char * __unused)
{
if (platform_is_hp_ski()) dummy();
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/hypercall.c Sat Feb 18 20:17:24 2006
@@ -9,6 +9,7 @@
#include <xen/config.h>
#include <xen/sched.h>
#include <xen/hypercall.h>
+#include <xen/multicall.h>
#include <linux/efi.h> /* FOR EFI_UNIMPLEMENTED */
#include <asm/sal.h> /* FOR struct ia64_sal_retval */
@@ -23,10 +24,46 @@
unsigned long idle_when_pending = 0;
unsigned long pal_halt_light_count = 0;
+hypercall_t ia64_hypercall_table[] =
+ {
+ (hypercall_t)do_ni_hypercall, /* do_set_trap_table */
/* 0 */
+ (hypercall_t)do_ni_hypercall, /* do_mmu_update */
+ (hypercall_t)do_ni_hypercall, /* do_set_gdt */
+ (hypercall_t)do_ni_hypercall, /* do_stack_switch */
+ (hypercall_t)do_ni_hypercall, /* do_set_callbacks */
+ (hypercall_t)do_ni_hypercall, /* do_fpu_taskswitch */
/* 5 */
+ (hypercall_t)do_ni_hypercall, /* do_sched_op */
+ (hypercall_t)do_dom0_op,
+ (hypercall_t)do_ni_hypercall, /* do_set_debugreg */
+ (hypercall_t)do_ni_hypercall, /* do_get_debugreg */
+ (hypercall_t)do_ni_hypercall, /* do_update_descriptor */
/* 10 */
+ (hypercall_t)do_ni_hypercall, /* do_ni_hypercall */
+ (hypercall_t)do_memory_op,
+ (hypercall_t)do_multicall,
+ (hypercall_t)do_ni_hypercall, /* do_update_va_mapping */
+ (hypercall_t)do_ni_hypercall, /* do_set_timer_op */
/* 15 */
+ (hypercall_t)do_event_channel_op,
+ (hypercall_t)do_xen_version,
+ (hypercall_t)do_console_io,
+ (hypercall_t)do_ni_hypercall, /* do_physdev_op */
+ (hypercall_t)do_grant_table_op,
/* 20 */
+ (hypercall_t)do_ni_hypercall, /* do_vm_assist */
+ (hypercall_t)do_ni_hypercall, /*
do_update_va_mapping_otherdomain */
+ (hypercall_t)do_ni_hypercall, /* (x86 only) */
+ (hypercall_t)do_ni_hypercall, /* do_vcpu_op */
+ (hypercall_t)do_ni_hypercall, /* (x86_64 only) */
/* 25 */
+ (hypercall_t)do_ni_hypercall, /* do_mmuext_op */
+ (hypercall_t)do_ni_hypercall, /* do_acm_op */
+ (hypercall_t)do_ni_hypercall, /* do_nmi_op */
+ (hypercall_t)do_ni_hypercall, /* */
+ (hypercall_t)do_ni_hypercall, /* */
/* 30 */
+ (hypercall_t)do_ni_hypercall /* */
+ };
+
int
ia64_hypercall (struct pt_regs *regs)
{
- struct vcpu *v = (struct domain *) current;
+ struct vcpu *v = current;
struct sal_ret_values x;
unsigned long *tv, *tc;
int pi;
@@ -94,15 +131,8 @@
printf("(by dom0)\n ");
(*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
}
-#ifdef DOMU_AUTO_RESTART
- else {
- reconstruct_domU(current);
- return 0; // don't increment ip!
- }
-#else
printf("(not supported for non-0 domain)\n");
regs->r8 = EFI_UNSUPPORTED;
-#endif
break;
case FW_HYPERCALL_EFI_GET_TIME:
tv = vcpu_get_gr(v,32);
@@ -181,9 +211,13 @@
regs->r8 = do_xen_version(regs->r14, regs->r15);
break;
+ case __HYPERVISOR_multicall:
+ regs->r8 = do_multicall(regs->r14, regs->r15);
+ break;
+
default:
printf("unknown hypercall %x\n", regs->r2);
- regs->r8 = (unsigned long)-1;
+ regs->r8 = do_ni_hypercall();
}
return 1;
}
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/hyperprivop.S Sat Feb 18 20:17:24 2006
@@ -1336,7 +1336,7 @@
movl r22=THIS_CPU(cpu_kr)+IA64_KR_CURRENT_OFFSET;;
ld8 r22=[r22];;
adds r22=IA64_VCPU_META_SAVED_RR0_OFFSET,r22;;
- ld4 r23=[r22];;
+ ld8 r23=[r22];;
mov rr[r0]=r23;;
srlz.i;;
st4 [r20]=r0 ;;
@@ -1372,7 +1372,7 @@
movl r22=THIS_CPU(cpu_kr)+IA64_KR_CURRENT_OFFSET;;
ld8 r22=[r22];;
adds r22=IA64_VCPU_META_RR0_OFFSET,r22;;
- ld4 r23=[r22];;
+ ld8 r23=[r22];;
mov rr[r0]=r23;;
srlz.i;;
adds r21=1,r0 ;;
@@ -1733,7 +1733,7 @@
dep r23=r28,r23,16,8;;
dep r23=r29,r23,8,8
cmp.eq p6,p0=r25,r0;; // if rr0, save for metaphysical
-(p6) st4 [r24]=r23
+(p6) st8 [r24]=r23
mov rr[r8]=r23;;
// done, mosey on back
1: mov r24=cr.ipsr
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/vcpu.c Sat Feb 18 20:17:24 2006
@@ -81,7 +81,7 @@
**************************************************************************/
#ifdef XEN
UINT64
-vcpu_get_gr(VCPU *vcpu, unsigned reg)
+vcpu_get_gr(VCPU *vcpu, unsigned long reg)
{
REGS *regs = vcpu_regs(vcpu);
UINT64 val;
@@ -90,7 +90,7 @@
return val;
}
IA64FAULT
-vcpu_get_gr_nat(VCPU *vcpu, unsigned reg, UINT64 *val)
+vcpu_get_gr_nat(VCPU *vcpu, unsigned long reg, UINT64 *val)
{
REGS *regs = vcpu_regs(vcpu);
int nat;
@@ -104,7 +104,7 @@
// IA64_ILLOP_FAULT if the register would cause an Illegal Operation fault
// IA64_NO_FAULT otherwise
IA64FAULT
-vcpu_set_gr(VCPU *vcpu, unsigned reg, UINT64 value, int nat)
+vcpu_set_gr(VCPU *vcpu, unsigned long reg, UINT64 value, int nat)
{
REGS *regs = vcpu_regs(vcpu);
if (!reg) return IA64_ILLOP_FAULT;
@@ -118,7 +118,7 @@
// IA64_ILLOP_FAULT if the register would cause an Illegal Operation fault
// IA64_NO_FAULT otherwise
IA64FAULT
-vcpu_set_gr(VCPU *vcpu, unsigned reg, UINT64 value)
+vcpu_set_gr(VCPU *vcpu, unsigned long reg, UINT64 value)
{
REGS *regs = vcpu_regs(vcpu);
long sof = (regs->cr_ifs) & 0x7f;
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/xenirq.c
--- a/xen/arch/ia64/xen/xenirq.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/xenirq.c Sat Feb 18 20:17:24 2006
@@ -59,7 +59,7 @@
/*
* Exit an interrupt context. Process softirqs if needed and possible:
*/
-void xen_irq_exit(struct pt_regs *regs)
+void irq_exit(void)
{
sub_preempt_count(IRQ_EXIT_OFFSET);
}
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/xenmisc.c Sat Feb 18 20:17:24 2006
@@ -168,7 +168,11 @@
void *pgtable_quicklist_alloc(void)
{
- return alloc_xenheap_pages(0);
+ void *p;
+ p = alloc_xenheap_pages(0);
+ if (p)
+ clear_page(p);
+ return p;
}
void pgtable_quicklist_free(void *pgtable_entry)
@@ -291,6 +295,7 @@
void context_switch(struct vcpu *prev, struct vcpu *next)
{
uint64_t spsr;
+ uint64_t pta;
local_irq_save(spsr);
if(VMX_DOMAIN(prev)){
@@ -298,9 +303,9 @@
}
context_switch_count++;
switch_to(prev,next,prev);
- if(VMX_DOMAIN(current)){
- vtm_domain_in(current);
- }
+// if(VMX_DOMAIN(current)){
+// vtm_domain_in(current);
+// }
// leave this debug for now: it acts as a heartbeat when more than
// one domain is active
@@ -313,18 +318,26 @@
}
if (VMX_DOMAIN(current)){
+ vtm_domain_in(current);
vmx_load_all_rr(current);
}else{
- extern char ia64_ivt;
- ia64_set_iva(&ia64_ivt);
- ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
- VHPT_ENABLED);
+ extern char ia64_ivt;
+ ia64_set_iva(&ia64_ivt);
if (!is_idle_domain(current->domain)) {
+ ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
+ VHPT_ENABLED);
load_region_regs(current);
vcpu_load_kernel_regs(current);
- if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
- }
- if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+ if (vcpu_timer_expired(current))
+ vcpu_pend_timer(current);
+ }else {
+ /* When switching to idle domain, only need to disable vhpt
+ * walker. Then all accesses happen within idle context will
+ * be handled by TR mapping and identity mapping.
+ */
+ pta = ia64_get_pta();
+ ia64_set_pta(pta & ~VHPT_ENABLED);
+ }
}
local_irq_restore(spsr);
diff -r 864dcee1f899 -r ded14681ae84 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c Sat Feb 18 10:56:51 2006
+++ b/xen/arch/ia64/xen/xensetup.c Sat Feb 18 20:17:24 2006
@@ -31,9 +31,6 @@
cpumask_t cpu_present_map;
-#ifdef CLONE_DOMAIN0
-struct domain *clones[CLONE_DOMAIN0];
-#endif
extern unsigned long domain0_ready;
int find_max_pfn (unsigned long, unsigned long, void *);
@@ -342,16 +339,6 @@
printk("About to call domain_create()\n");
dom0 = domain_create(0, 0);
-#ifdef CLONE_DOMAIN0
- {
- int i;
- for (i = 0; i < CLONE_DOMAIN0; i++) {
- clones[i] = domain_create(i+1, 0);
- if ( clones[i] == NULL )
- panic("Error creating domain0 clone %d\n",i);
- }
- }
-#endif
if ( dom0 == NULL )
panic("Error creating domain 0\n");
@@ -376,22 +363,6 @@
/* PIN domain0 on CPU 0. */
dom0->vcpu[0]->cpu_affinity = cpumask_of_cpu(0);
-#ifdef CLONE_DOMAIN0
- {
- int i;
- dom0_memory_start = __va(ia64_boot_param->domain_start);
- dom0_memory_size = ia64_boot_param->domain_size;
-
- for (i = 0; i < CLONE_DOMAIN0; i++) {
- printk("CONSTRUCTING DOMAIN0 CLONE #%d\n",i+1);
- if ( construct_domU(clones[i], dom0_memory_start, dom0_memory_size,
- dom0_initrd_start,dom0_initrd_size,
- 0) != 0)
- panic("Could not set up DOM0 clone %d\n",i);
- }
- }
-#endif
-
/* The stash space for the initial kernel image can now be freed up. */
init_domheap_pages(ia64_boot_param->domain_start,
ia64_boot_param->domain_size);
@@ -412,13 +383,6 @@
console_endboot(cmdline && strstr(cmdline, "tty0"));
#endif
-#ifdef CLONE_DOMAIN0
- {
- int i;
- for (i = 0; i < CLONE_DOMAIN0; i++)
- domain_unpause_by_systemcontroller(clones[i]);
- }
-#endif
domain0_ready = 1;
local_irq_enable();
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/config.h Sat Feb 18 20:17:24 2006
@@ -3,11 +3,8 @@
#undef USE_PAL_EMULATOR
// control flags for turning on/off features under test
-#undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 1
#undef DOMU_BUILD_STAGING
#define VHPT_GLOBAL
-#define DOMU_AUTO_RESTART
#undef DEBUG_PFMON
@@ -215,9 +212,6 @@
// see include/asm-ia64/mm.h, handle remaining page_info uses until gone
#define page_info page
-// see common/memory.c
-#define set_gpfn_from_mfn(x,y) do { } while (0)
-
// see common/keyhandler.c
#define nop() asm volatile ("nop 0")
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/domain.h Sat Feb 18 20:17:24 2006
@@ -15,8 +15,8 @@
struct arch_domain {
struct mm_struct *active_mm;
struct mm_struct *mm;
- int metaphysical_rr0;
- int metaphysical_rr4;
+ unsigned long metaphysical_rr0;
+ unsigned long metaphysical_rr4;
int starting_rid; /* first RID assigned to domain */
int ending_rid; /* one beyond highest RID assigned to domain */
int rid_bits; /* number of virtual rid bits (default: 18) */
@@ -32,11 +32,6 @@
u64 xen_vastart;
u64 xen_vaend;
u64 shared_info_va;
-#ifdef DOMU_AUTO_RESTART
- u64 image_start;
- u64 image_len;
- u64 entry;
-#endif
unsigned long initrd_start;
unsigned long initrd_len;
char *cmdline;
@@ -66,10 +61,10 @@
unsigned long xen_timer_interval;
#endif
mapped_regs_t *privregs; /* save the state of vcpu */
- int metaphysical_rr0; // from arch_domain (so is pinned)
- int metaphysical_rr4; // from arch_domain (so is pinned)
- int metaphysical_saved_rr0; // from arch_domain (so is
pinned)
- int metaphysical_saved_rr4; // from arch_domain (so is
pinned)
+ unsigned long metaphysical_rr0; // from arch_domain (so is
pinned)
+ unsigned long metaphysical_rr4; // from arch_domain (so is
pinned)
+ unsigned long metaphysical_saved_rr0; // from arch_domain (so is
pinned)
+ unsigned long metaphysical_saved_rr4; // from arch_domain (so is
pinned)
int breakimm; // from arch_domain (so is pinned)
int starting_rid; /* first RID assigned to domain */
int ending_rid; /* one beyond highest RID assigned to domain */
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/grant_table.h
--- a/xen/include/asm-ia64/grant_table.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/grant_table.h Sat Feb 18 20:17:24 2006
@@ -17,7 +17,7 @@
#define gnttab_shared_gmfn(d, t, i) \
( ((d) == dom0) ? \
((virt_to_maddr((t)->shared) >> PAGE_SHIFT) + (i)) : \
- (map_domain_page((d), 1UL<<40, virt_to_maddr((t)->shared)), \
+ (assign_domain_page((d), 1UL<<40, virt_to_maddr((t)->shared)), \
1UL << (40 - PAGE_SHIFT)) \
)
diff -r 864dcee1f899 -r ded14681ae84
xen/include/asm-ia64/linux-xen/asm/README.origin
--- a/xen/include/asm-ia64/linux-xen/asm/README.origin Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/linux-xen/asm/README.origin Sat Feb 18 20:17:24 2006
@@ -5,6 +5,7 @@
# (e.g. with #ifdef XEN or XEN in a comment) so that they can be
# easily updated to future versions of the corresponding Linux files.
+cache.h -> linux/include/asm-ia64/cache.h
gcc_intrin.h -> linux/include/asm-ia64/gcc_intrin.h
ia64regs.h -> linux/include/asm-ia64/ia64regs.h
io.h -> linux/include/asm-ia64/io.h
diff -r 864dcee1f899 -r ded14681ae84
xen/include/asm-ia64/linux-xen/asm/processor.h
--- a/xen/include/asm-ia64/linux-xen/asm/processor.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/linux-xen/asm/processor.h Sat Feb 18 20:17:24 2006
@@ -639,6 +639,19 @@
return r;
}
+#ifdef XEN
+/* Get the page table address and control bits. */
+static inline __u64
+ia64_get_pta (void)
+{
+ __u64 r;
+ ia64_srlz_d();
+ r = ia64_getreg(_IA64_REG_CR_PTA);
+ ia64_srlz_d();
+ return r;
+}
+#endif
+
static inline void
ia64_set_dbr (__u64 regnum, __u64 value)
{
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/linux/README.origin
--- a/xen/include/asm-ia64/linux/README.origin Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/linux/README.origin Sat Feb 18 20:17:24 2006
@@ -4,31 +4,31 @@
# needs to be changed, move it to ../linux-xen and follow
# the instructions in the README there.
-bcd.h ->linux/include/linux/bcd.h
-bitmap.h ->linux/include/linux/bitmap.h
-bitops.h ->linux/include/linux/bitops.h
-dma-mapping.h ->linux/include/linux/dma-mapping.h
-efi.h ->linux/include/linux/efi.h
-err.h ->linux/include/linux/err.h
-initrd.h ->linux/include/linux/initrd.h
-jiffies.h ->linux/include/linux/jiffies.h
-kmalloc_sizes.h ->linux/include/linux/kmalloc_sizes.h
-linkage.h ->linux/include/linux/linkage.h
-mmzone.h ->linux/include/linux/mmzone.h
-notifier.h ->linux/include/linux/notifier.h
-numa.h ->linux/include/linux/numa.h
-page-flags.h ->linux/include/linux/page-flags.h
-percpu.h ->linux/include/linux/percpu.h
-preempt.h ->linux/include/linux/preempt.h
-rbtree.h ->linux/include/linux/rbtree.h
-rwsem.h ->linux/include/linux/rwsem.h
-seqlock.h ->linux/include/linux/seqlock.h
-slab.h ->linux/include/linux/slab.h
-sort.h ->linux/include/linux/sort.h
-stddef.h ->linux/include/linux/stddef.h
-thread_info.h ->linux/include/linux/thread_info.h
-threads.h ->linux/include/linux/threads.h
-time.h ->linux/include/linux/time.h
-timex.h ->linux/include/linux/timex.h
-topology.h ->linux/include/linux/topology.h
-wait.h ->linux/include/linux/wait.h
+bcd.h -> linux/include/linux/bcd.h
+bitmap.h -> linux/include/linux/bitmap.h
+bitops.h -> linux/include/linux/bitops.h
+dma-mapping.h -> linux/include/linux/dma-mapping.h
+efi.h -> linux/include/linux/efi.h
+err.h -> linux/include/linux/err.h
+initrd.h -> linux/include/linux/initrd.h
+jiffies.h -> linux/include/linux/jiffies.h
+kmalloc_sizes.h -> linux/include/linux/kmalloc_sizes.h
+linkage.h -> linux/include/linux/linkage.h
+mmzone.h -> linux/include/linux/mmzone.h
+notifier.h -> linux/include/linux/notifier.h
+numa.h -> linux/include/linux/numa.h
+page-flags.h -> linux/include/linux/page-flags.h
+percpu.h -> linux/include/linux/percpu.h
+preempt.h -> linux/include/linux/preempt.h
+rbtree.h -> linux/include/linux/rbtree.h
+rwsem.h -> linux/include/linux/rwsem.h
+seqlock.h -> linux/include/linux/seqlock.h
+slab.h -> linux/include/linux/slab.h
+sort.h -> linux/include/linux/sort.h
+stddef.h -> linux/include/linux/stddef.h
+thread_info.h -> linux/include/linux/thread_info.h
+threads.h -> linux/include/linux/threads.h
+time.h -> linux/include/linux/time.h
+timex.h -> linux/include/linux/timex.h
+topology.h -> linux/include/linux/topology.h
+wait.h -> linux/include/linux/wait.h
diff -r 864dcee1f899 -r ded14681ae84
xen/include/asm-ia64/linux/asm/README.origin
--- a/xen/include/asm-ia64/linux/asm/README.origin Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/linux/asm/README.origin Sat Feb 18 20:17:24 2006
@@ -4,6 +4,7 @@
# needs to be changed, move it to ../linux-xen and follow
# the instructions in the README there.
+acpi.h -> linux/include/asm-ia64/acpi.h
asmmacro.h -> linux/include/asm-ia64/asmmacro.h
atomic.h -> linux/include/asm-ia64/atomic.h
bitops.h -> linux/include/asm-ia64/bitops.h
@@ -11,7 +12,6 @@
bug.h -> linux/include/asm-ia64/bug.h
byteorder.h -> linux/include/asm-ia64/byteorder.h
cacheflush.h -> linux/include/asm-ia64/cacheflush.h
-cache.h -> linux/include/asm-ia64/cache.h
checksum.h -> linux/include/asm-ia64/checksum.h
current.h -> linux/include/asm-ia64/current.h
delay.h -> linux/include/asm-ia64/delay.h
diff -r 864dcee1f899 -r ded14681ae84
xen/include/asm-ia64/linux/byteorder/README.origin
--- a/xen/include/asm-ia64/linux/byteorder/README.origin Sat Feb 18
10:56:51 2006
+++ b/xen/include/asm-ia64/linux/byteorder/README.origin Sat Feb 18
20:17:24 2006
@@ -4,6 +4,6 @@
# needs to be changed, move it to ../linux-xen and follow
# the instructions in the README there.
-generic.h -> linux/include/byteorder/generic.h
-little_endian.h -> linux/include/byteorder/little_endian.h
-swab.h -> linux/include/byteorder/swab.h
+generic.h -> linux/include/linux/byteorder/generic.h
+little_endian.h -> linux/include/linux/byteorder/little_endian.h
+swab.h -> linux/include/linux/byteorder/swab.h
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/multicall.h
--- a/xen/include/asm-ia64/multicall.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/multicall.h Sat Feb 18 20:17:24 2006
@@ -1,5 +1,27 @@
#ifndef __ASM_IA64_MULTICALL_H__
#define __ASM_IA64_MULTICALL_H__
-#define do_multicall_call(_call) BUG()
+#include <public/xen.h>
+
+typedef unsigned long (*hypercall_t)(
+ unsigned long arg0,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5);
+
+extern hypercall_t ia64_hypercall_table[];
+
+static inline void do_multicall_call(multicall_entry_t *call)
+{
+ call->result = (*ia64_hypercall_table[call->op])(
+ call->args[0],
+ call->args[1],
+ call->args[2],
+ call->args[3],
+ call->args[4],
+ call->args[5]);
+}
+
#endif /* __ASM_IA64_MULTICALL_H__ */
diff -r 864dcee1f899 -r ded14681ae84 xen/include/asm-ia64/vcpu.h
--- a/xen/include/asm-ia64/vcpu.h Sat Feb 18 10:56:51 2006
+++ b/xen/include/asm-ia64/vcpu.h Sat Feb 18 20:17:24 2006
@@ -34,9 +34,9 @@
#endif
/* general registers */
-extern UINT64 vcpu_get_gr(VCPU *vcpu, unsigned reg);
-extern IA64FAULT vcpu_get_gr_nat(VCPU *vcpu, unsigned reg, UINT64 *val);
-extern IA64FAULT vcpu_set_gr(VCPU *vcpu, unsigned reg, UINT64 value, int nat);
+extern UINT64 vcpu_get_gr(VCPU *vcpu, unsigned long reg);
+extern IA64FAULT vcpu_get_gr_nat(VCPU *vcpu, unsigned long reg, UINT64 *val);
+extern IA64FAULT vcpu_set_gr(VCPU *vcpu, unsigned long reg, UINT64 value, int
nat);
/* application registers */
extern IA64FAULT vcpu_set_ar(VCPU *vcpu, UINT64 reg, UINT64 val);
/* psr */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|