This commit is contained in:
awilliam@xenbuild.aw committed 2006-02-18 13:17:24 -07:00
commit 8a5f45ddf8
23 files changed
+235 -238

No files matched your search

@@ -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!"
@@ -243,6 +246,12 @@ reserve_memory (void)
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) {
rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
@@ -106,8 +106,10 @@ int bind_virq_to_irqhandler(
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 @@ int bind_virq_to_irqhandler(
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 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
{
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 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
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 @@ void unbind_from_irqhandler(unsigned int irq, void *dev_id)
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 @@ void unbind_from_irqhandler(unsigned int irq, void *dev_id)
evtchns[evtchn].handler = NULL;
evtchns[evtchn].opened = 0;
out:
spin_unlock(&irq_mapping_update_lock);
}
+21 -16
View File
@@ -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
+1 -1
View File
@@ -169,7 +169,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
* 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
+3 -2
View File
@@ -5,14 +5,15 @@ needs to be changed, move it to ../linux-xen and follow
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
+6 -6
View File
@@ -317,7 +317,7 @@ int vmx_alloc_contig_pages(struct domain *d)
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 @@ int vmx_alloc_contig_pages(struct domain *d)
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 @@ int vmx_alloc_contig_pages(struct domain *d)
/* 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 @@ int vmx_alloc_contig_pages(struct domain *d)
/* 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;
+29 -90
View File
@@ -251,9 +251,12 @@ int arch_domain_create(struct domain *d)
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 @@ printk("map_new_domain0_page: start=%p,end=%p!\n",dom0_start,dom0_start+dom0_siz
}
/* 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 @@ struct page * map_new_domain_page(struct domain *d, unsigned long mpaddr)
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 @@ extern unsigned long vhpt_paddr, vhpt_pend;
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 @@ void map_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physa
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 @@ void map_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physa
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 @@ void map_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long fl
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 @@ void map_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long fl
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 @@ tryagain:
}
/* 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 @@ void loaddomainelfimage(struct domain *d, unsigned long image_start)
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 @@ int construct_dom0(struct domain *d,
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 @@ int construct_dom0(struct domain *d,
(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 @@ int construct_dom0(struct domain *d,
/* 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 @@ int construct_dom0(struct domain *d,
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 @@ if (d == dom0)
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();
+43 -9
View File
@@ -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 @@ extern unsigned long translate_domain_mpaddr(unsigned long);
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 @@ ia64_hypercall (struct pt_regs *regs)
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 @@ ia64_hypercall (struct pt_regs *regs)
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;
}
+3 -3
View File
@@ -1336,7 +1336,7 @@ ENTRY(hyper_ssm_dt)
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 @@ ENTRY(hyper_rsm_dt)
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 @@ ENTRY(hyper_set_rr)
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
+4 -4
View File
@@ -81,7 +81,7 @@ unsigned long vcpu_verbose = 0;
**************************************************************************/
#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 @@ vcpu_get_gr(VCPU *vcpu, unsigned reg)
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 @@ vcpu_get_gr_nat(VCPU *vcpu, unsigned reg, UINT64 *val)
// 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 @@ vcpu_set_gr(VCPU *vcpu, unsigned reg, UINT64 value, int nat)
// 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;
+1 -1
View File
@@ -59,7 +59,7 @@ xen_do_IRQ(ia64_vector vector)
/*
* 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);
}
+24 -11
View File
@@ -168,7 +168,11 @@ void __free_pages(struct page *page, unsigned int order)
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 @@ unsigned long context_switch_count = 0;
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 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
}
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 (!i--) { printk("+",id); i = 1000000; }
}
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);
-36
View File
@@ -31,9 +31,6 @@ struct vcpu *idle_vcpu[NR_CPUS];
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 sort_main_extable()\n");
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 @@ printk("About to call domain_create()\n");
/* 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 @@ printk("About to call init_trace_bufs()\n");
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();
-6
View File
@@ -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 @@ void sort_main_extable(void);
// 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")
+6 -11
View File
@@ -15,8 +15,8 @@ extern void domain_relinquish_resources(struct domain *);
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 @@ struct arch_domain {
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 @@ struct arch_vcpu {
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 */
+1 -1
View File
@@ -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)) \
)
@@ -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
@@ -639,6 +639,19 @@ ia64_get_ivr (void)
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)
{
+28 -28
View File
@@ -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
+1 -1
View File
@@ -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 @@ break.h -> linux/include/asm-ia64/break.h
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
@@ -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
+23 -1
View File
@@ -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__ */
+3 -3
View File
@@ -34,9 +34,9 @@ struct privop_addr_count {
#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 */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.