aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-06-04 12:24:19 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-06-04 12:24:19 +0000
commit6f6c1d7919a71b9445c4cfb006ea0fbd6815693b (patch)
treebe0d45b3c91298bcbda9d9bd39161754faaa57f8 /xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel
parentd28379e0ef8536bde8f961147aa6d7842409f7dd (diff)
downloadxen-6f6c1d7919a71b9445c4cfb006ea0fbd6815693b.tar.gz
xen-6f6c1d7919a71b9445c4cfb006ea0fbd6815693b.tar.bz2
xen-6f6c1d7919a71b9445c4cfb006ea0fbd6815693b.zip
bitkeeper revision 1.251 (3edde4f3E2DAGrzTEG2ZDkYKtez4fQ)
setup.c, head.S: Fix IOPL handling in Xenolinux.
Diffstat (limited to 'xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel')
-rw-r--r--xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S5
-rw-r--r--xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S
index a89fd8eda4..6278ececb3 100644
--- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S
+++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/head.S
@@ -50,8 +50,11 @@ startup_32:
jmp SYMBOL_NAME(start_kernel)
+# Stack is 8kB. We leave 100 bytes trailer for fake 'pt_regs'.
+# This is needed so that iopl checks of the saved eflags register
+# work correctly, for example.
ENTRY(stack_start)
- .long SYMBOL_NAME(init_task_union)+8192, __KERNEL_DS
+ .long SYMBOL_NAME(init_task_union)+8192-100, __KERNEL_DS
.org 0x1000
ENTRY(empty_zero_page)
diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
index cc53983f34..21db2e8f01 100644
--- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
+++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c
@@ -143,6 +143,7 @@ static void __init parse_mem_cmdline (char ** cmdline_p)
void __init setup_arch(char **cmdline_p)
{
+ struct pt_regs *regs = ((struct pt_regs *)current->thread.esp0) - 1;
unsigned long start_pfn, max_pfn, max_low_pfn;
unsigned long bootmap_size;
unsigned long i;
@@ -301,10 +302,15 @@ void __init setup_arch(char **cmdline_p)
paging_init();
- if ( start_info.flags & SIF_PRIVILEGED )
+ /* Set privilege level gubbins. */
+ regs->eflags &= ~(3<<12);
+ if ( start_info.flags & SIF_PRIVILEGED ) {
/* We are privileged guest os - should have IO privileges. */
if( HYPERVISOR_set_priv_levels(1, 1) )
panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
+ regs->eflags |= 1<<12;
+ }
+ current->thread.hypercall_pl = 1;
if(start_info.flags & SIF_CONSOLE)
{