| I am confused about traps in XEN. 
   1. I found that there are two traps.c files in xen 
source.      One is in mini-os directory and the other is in 
xen directory. As far as I know, when the domain is scheduled, it will issue a 
hypercall to register its trap_table. In that case, traps from that domain can 
be handled without xen intervention. So it makes sence that we have it in 
mini-os directory, but why is there another one in xen directory? Also, the 
trap_table is also defined in entry.S which is used by xen. All exception 
handlers are not only in traps.c of mini-os, but also in somewhere in xen 
source, although they are doing different things.   2. For some privileged instructions which are not 
replaced by hypercalls will generate "General protection fault (GPF)" which is a 
kind of traps. However, it is handled by xen's traps handler but not os's trap 
handler. Why is it that case? I thought cpu should use the handler registered by 
the os but not xen's trap handler. I found that OS has that handler too 
(do_general_protection). What it does is to shutdown the domain(not sure). And 
xen has that handler also. My question is how does cpu pick which trap handler 
would be used? If os registers its own handler, why does the cpu use xen's 
handler in GPF case?   Any information is very appreciated. Thanks in 
advance.   Regards, - JC 
 Stay up to date on your PC, the Web, and your mobile phone with Windows Live Click here
 |