mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1236.31.1 (4235d7e6zfwsw0_e5xhU8KHoDsP69Q)
config.h, xenmisc.c, xenasm.S, process.c, domain.c: cleanup
This commit is contained in:
1 parent
ddf9e77213
commit
da4b35d537
6 files changed
+39
-51
No files matched your search
@@ -20,6 +20,7 @@ cl349@freefall.cl.cam.ac.uk
|
||||
cl349@labyrinth.cl.cam.ac.uk
|
||||
cwc22@centipede.cl.cam.ac.uk
|
||||
cwc22@donkeykong.cl.cam.ac.uk
|
||||
djm@djmnc4000.(none)
|
||||
djm@kirby.fc.hp.com
|
||||
gm281@boulderdash.cl.cam.ac.uk
|
||||
gm281@tetrapod.cl.cam.ac.uk
|
||||
|
||||
@@ -670,6 +670,7 @@ void dummy(void)
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void switch_to(struct exec_domain *prev, struct exec_domain *next)
|
||||
{
|
||||
struct exec_domain *last;
|
||||
@@ -677,6 +678,7 @@ void switch_to(struct exec_domain *prev, struct exec_domain *next)
|
||||
__switch_to(prev,next,last);
|
||||
//set_current(next);
|
||||
}
|
||||
#endif
|
||||
|
||||
void domain_pend_keyboard_interrupt(int irq)
|
||||
{
|
||||
|
||||
+7
-27
@@ -143,15 +143,13 @@ void reflect_interruption(unsigned long ifa, unsigned long isr, unsigned long it
|
||||
}
|
||||
if (!PSCB(ed,interrupt_collection_enabled)) {
|
||||
if (!(PSCB(ed,ipsr) & IA64_PSR_DT)) {
|
||||
printf("psr.dt off, trying to deliver nested dtlb!\n");
|
||||
while(1);
|
||||
panic_domain(regs,"psr.dt off, trying to deliver nested dtlb!\n");
|
||||
}
|
||||
vector &= ~0xf;
|
||||
if (vector != IA64_DATA_TLB_VECTOR &&
|
||||
vector != IA64_DATA_TLB_VECTOR) {
|
||||
printf("psr.ic off, delivering fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
|
||||
panic_domain(regs,"psr.ic off, delivering fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
|
||||
vector,regs->cr_iip,isr,PSCB(ed,iip));
|
||||
while(1);
|
||||
|
||||
}
|
||||
//printf("Delivering NESTED DATA TLB fault\n");
|
||||
@@ -243,9 +241,6 @@ void xen_handle_domain_access(unsigned long address, unsigned long isr, struct p
|
||||
unsigned long lookup_domain_mpa(struct domain *,unsigned long);
|
||||
unsigned long match_dtlb(struct exec_domain *,unsigned long, unsigned long *, unsigned long *);
|
||||
IA64FAULT fault;
|
||||
#ifndef USER_ACCESS
|
||||
extern void __get_domain_bundle(void);
|
||||
#endif
|
||||
|
||||
// NEED TO HANDLE THREE CASES:
|
||||
// 1) domain is in metaphysical mode
|
||||
@@ -268,13 +263,6 @@ void xen_handle_domain_access(unsigned long address, unsigned long isr, struct p
|
||||
vcpu_itc_no_srlz(ed,2,address,pteval,-1UL,PAGE_SHIFT);
|
||||
return;
|
||||
}
|
||||
#ifndef USER_ACCESS
|
||||
if (*(unsigned long *)__get_domain_bundle != iip) {
|
||||
printf("Bad user space access @%p ",address);
|
||||
printf("iip=%p, ipsr=%p, b0=%p\n",iip,psr,regs->b0);
|
||||
while(1);
|
||||
}
|
||||
#endif
|
||||
if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
|
||||
|
||||
// if we are fortunate enough to have it in the 1-entry TLB...
|
||||
@@ -285,13 +273,6 @@ if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
|
||||
// look in the TRs
|
||||
fault = vcpu_tpa(ed,address,&mpaddr);
|
||||
if (fault != IA64_NO_FAULT) {
|
||||
#ifndef USER_ACCESS
|
||||
// this is hardcoded to handle __get_domain_bundle only
|
||||
regs->r8 = 0; regs->r9 = 0;
|
||||
regs->cr_iip += 0x20;
|
||||
//regs->cr_iip |= (2UL << IA64_PSR_RI_BIT);
|
||||
return;
|
||||
#else /* USER_ACCESS */
|
||||
static int uacnt = 0;
|
||||
// can't translate it, just fail (poor man's exception)
|
||||
// which results in retrying execution
|
||||
@@ -303,12 +284,10 @@ if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
|
||||
else {
|
||||
// should never happen. If it does, region 0 addr may
|
||||
// indicate a bad xen pointer
|
||||
printk("*** xen_handle_domain_access: exception table"
|
||||
panic_domain(regs,"*** xen_handle_domain_access: exception table"
|
||||
" lookup failed, iip=%p, addr=%p, spinning...\n",
|
||||
iip,address);
|
||||
while(1);
|
||||
}
|
||||
#endif /* USER_ACCESS */
|
||||
}
|
||||
if (d == dom0) {
|
||||
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
|
||||
@@ -375,7 +354,9 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
|
||||
}
|
||||
vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
|
||||
if (handle_lazy_cover(current, isr, regs)) return;
|
||||
if (!(address>>61)) { printf("ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc()); while(1); }
|
||||
if (!(address>>61)) {
|
||||
panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc());
|
||||
}
|
||||
if ((isr & IA64_ISR_SP)
|
||||
|| ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH))
|
||||
{
|
||||
@@ -835,8 +816,7 @@ ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long i
|
||||
unsigned long itir = vcpu_get_itir_on_fault(ed,ifa);
|
||||
|
||||
if (!(psr & IA64_PSR_CPL)) {
|
||||
printf("ia64_handle_reflection: reflecting with priv=0!!\n");
|
||||
while(1);
|
||||
panic_domain(regs,"ia64_handle_reflection: reflecting with priv=0!!\n");
|
||||
}
|
||||
// FIXME: no need to pass itir in to this routine as we need to
|
||||
// compute the virtual itir anyway (based on domain's RR.ps)
|
||||
|
||||
@@ -261,24 +261,6 @@ GLOBAL_ENTRY(ia64_prepare_handle_reflection)
|
||||
br.cond.sptk.many rp // goes to ia64_leave_kernel
|
||||
END(ia64_prepare_handle_reflection)
|
||||
|
||||
#ifndef USER_ACCESS
|
||||
// REMOVE: replaced with get_user
|
||||
// NOTE: instruction spacing must be explicit for recovery on miss
|
||||
GLOBAL_ENTRY(__get_domain_bundle)
|
||||
ld8 r8=[r32],8
|
||||
nop 0
|
||||
nop 0
|
||||
;;
|
||||
ld8 r9=[r32]
|
||||
nop 0
|
||||
nop 0
|
||||
;;
|
||||
br.ret.sptk.many rp
|
||||
nop 0
|
||||
nop 0
|
||||
;;
|
||||
END(__get_domain_bundle)
|
||||
#else
|
||||
GLOBAL_ENTRY(__get_domain_bundle)
|
||||
EX(.failure_in_get_bundle,ld8 r8=[r32],8)
|
||||
;;
|
||||
@@ -294,7 +276,6 @@ GLOBAL_ENTRY(__get_domain_bundle)
|
||||
br.ret.sptk.many rp
|
||||
;;
|
||||
END(__get_domain_bundle)
|
||||
#endif
|
||||
|
||||
GLOBAL_ENTRY(dorfirfi)
|
||||
#define SI_CR_IIP_OFFSET 0x10
|
||||
|
||||
+27
-3
@@ -203,7 +203,7 @@ char * __devinit pcibios_setup(char *str)
|
||||
|
||||
void show_registers(struct pt_regs *regs)
|
||||
{
|
||||
dummy();
|
||||
printf("*** ADD REGISTER DUMP HERE FOR DEBUGGING\n");
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
@@ -240,12 +240,36 @@ void *module_text_address(unsigned long addr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void cs10foo(void) {}
|
||||
void cs01foo(void) {}
|
||||
|
||||
// context_switch
|
||||
void context_switch(struct exec_domain *prev, struct exec_domain *next)
|
||||
{
|
||||
switch_to(prev,next);
|
||||
printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
||||
printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
|
||||
prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
|
||||
printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
|
||||
if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
|
||||
if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
|
||||
switch_to(prev,next,prev);
|
||||
clear_bit(EDF_RUNNING, &prev->ed_flags);
|
||||
//if (!is_idle_task(next->domain) )
|
||||
//send_guest_virq(next, VIRQ_TIMER);
|
||||
schedule_tail(next);
|
||||
load_region_regs(current);
|
||||
}
|
||||
|
||||
void panic_domain(struct pt_regs *regs, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[128];
|
||||
struct exec_domain *ed = current;
|
||||
static volatile int test = 1; // so can continue easily in debug
|
||||
|
||||
printf("$$$$$ PANIC in domain %d:",ed->domain->id);
|
||||
va_start(args, fmt);
|
||||
(void)vsnprintf(buf, sizeof(buf), fmt, args);
|
||||
va_end(args);
|
||||
if (regs) show_registers(regs);
|
||||
while(test);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// control flags for turning on/off features under test
|
||||
#undef CLONE_DOMAIN0
|
||||
//#define CLONE_DOMAIN0 1
|
||||
//#undef CLONE_DOMAIN0
|
||||
#define CLONE_DOMAIN0 1
|
||||
//#undef CLONE_DOMAIN0
|
||||
#define USER_ACCESS
|
||||
|
||||
|
||||