* [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
@ 2006-11-09 1:01 Rusty Russell
2006-11-09 1:20 ` Andrew Morton
2006-11-09 7:12 ` Andi Kleen
0 siblings, 2 replies; 11+ messages in thread
From: Rusty Russell @ 2006-11-09 1:01 UTC (permalink / raw)
To: Andrew Morton, Andi Kleen; +Cc: Chris Wright, virtualization
OK, at least two patches got dropped on the way from the mm tree to
Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
Merging into Andi's tree without these patches must have been a
nightmare 8(
Andi then tried to fix it with x86_64-mm-paravirt-compile.patch but then
it didn't boot so he disabled it in x86_64-mm-paravirt-broken.patch
This patch undoes those two patches and rearranges processor.h correctly
so the kernel compiles and boots with CONFIG_PARAVIRT. Andi's
"paravirt-compile" patch also cleans up the spinlock header, which is
good but should probably be patched separately.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc5-mm1/arch/i386/Kconfig working-2.6.19-rc5-mm1-paravirt/arch/i386/Kconfig
--- linux-2.6.19-rc5-mm1/arch/i386/Kconfig 2006-11-09 11:21:58.000000000 +1100
+++ working-2.6.19-rc5-mm1-paravirt/arch/i386/Kconfig 2006-11-09 11:29:27.000000000 +1100
@@ -204,8 +204,6 @@ endchoice
config PARAVIRT
bool "Paravirtualization support (EXPERIMENTAL)"
depends on EXPERIMENTAL
- # doesn't compile right now
- depends on BROKEN
help
Paravirtualization is a way of running multiple instances of
Linux on the same machine, under a hypervisor. This option
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc5-mm1/include/asm-i386/desc.h working-2.6.19-rc5-mm1-paravirt/include/asm-i386/desc.h
--- linux-2.6.19-rc5-mm1/include/asm-i386/desc.h 2006-11-09 11:22:25.000000000 +1100
+++ working-2.6.19-rc5-mm1-paravirt/include/asm-i386/desc.h 2006-11-09 11:33:24.000000000 +1100
@@ -81,6 +81,10 @@ static inline void load_TLS(struct threa
#undef C
}
+#define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+#define write_gdt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+#define write_idt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+
static inline void write_dt_entry(void *dt, int entry, __u32 entry_a, __u32 entry_b)
{
__u32 *lp = (__u32 *)((char *)dt + entry*8);
@@ -88,29 +92,9 @@ static inline void write_dt_entry(void *
*(lp+1) = entry_b;
}
-#define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
-#define write_gdt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
-#define write_idt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
-
#define set_ldt native_set_ldt
#endif /* CONFIG_PARAVIRT */
-static inline void _set_gate(int gate, unsigned int type, void *addr, unsigned short seg)
-{
- __u32 a, b;
- pack_gate(&a, &b, (unsigned long)addr, seg, type, 0);
- write_idt_entry(idt_table, gate, a, b);
-}
-
-static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const void *addr)
-{
- __u32 a, b;
- pack_descriptor(&a, &b, (unsigned long)addr,
- offsetof(struct tss_struct, __cacheline_filler) - 1,
- DESCTYPE_TSS, 0);
- write_gdt_entry(get_cpu_gdt_table(cpu), entry, a, b);
-}
-
static inline fastcall void native_set_ldt(const void *addr,
unsigned int entries)
{
@@ -128,6 +112,23 @@ static inline fastcall void native_set_l
}
}
+static inline void _set_gate(int gate, unsigned int type, void *addr, unsigned short seg)
+{
+ __u32 a, b;
+ pack_gate(&a, &b, (unsigned long)addr, seg, type, 0);
+ write_idt_entry(idt_table, gate, a, b);
+}
+
+static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const void *addr)
+{
+ __u32 a, b;
+ pack_descriptor(&a, &b, (unsigned long)addr,
+ offsetof(struct tss_struct, __cacheline_filler) - 1,
+ DESCTYPE_TSS, 0);
+ write_gdt_entry(get_cpu_gdt_table(cpu), entry, a, b);
+}
+
+
#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
#define LDT_entry_a(info) \
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc5-mm1/include/asm-i386/paravirt.h working-2.6.19-rc5-mm1-paravirt/include/asm-i386/paravirt.h
--- linux-2.6.19-rc5-mm1/include/asm-i386/paravirt.h 2006-11-09 11:22:25.000000000 +1100
+++ working-2.6.19-rc5-mm1-paravirt/include/asm-i386/paravirt.h 2006-11-09 11:29:20.000000000 +1100
@@ -449,20 +449,16 @@ static inline unsigned long __raw_local_
return f;
}
-#define CLI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
- "call *paravirt_ops+%c[irq_disable];" \
- "popl %%edx; popl %%ecx", \
+#define CLI_STRING paravirt_alt("pushl %ecx; pushl %edx;" \
+ "call *paravirt_ops+PARAVIRT_irq_disable;" \
+ "popl %edx; popl %ecx", \
PARAVIRT_IRQ_DISABLE, CLBR_EAX)
-#define STI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;" \
- "call *paravirt_ops+%c[irq_enable];" \
- "popl %%edx; popl %%ecx", \
+#define STI_STRING paravirt_alt("pushl %ecx; pushl %edx;" \
+ "call *paravirt_ops+PARAVIRT_irq_enable;" \
+ "popl %edx; popl %ecx", \
PARAVIRT_IRQ_ENABLE, CLBR_EAX)
#define CLI_STI_CLOBBERS , "%eax"
-#define CLI_STI_INPUT_ARGS \
- , \
- [irq_disable] "i" (offsetof(struct paravirt_ops, irq_disable)), \
- [irq_enable] "i" (offsetof(struct paravirt_ops, irq_enable))
#else /* __ASSEMBLY__ */
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc5-mm1/include/asm-i386/processor.h working-2.6.19-rc5-mm1-paravirt/include/asm-i386/processor.h
--- linux-2.6.19-rc5-mm1/include/asm-i386/processor.h 2006-11-09 11:22:25.000000000 +1100
+++ working-2.6.19-rc5-mm1-paravirt/include/asm-i386/processor.h 2006-11-09 11:48:37.000000000 +1100
@@ -22,13 +22,6 @@
#include <linux/cpumask.h>
#include <linux/init.h>
-#ifdef CONFIG_PARAVIRT
-#include <asm/paravirt.h>
-#else
-#define paravirt_enabled() 0
-#define __cpuid native_cpuid
-#endif
-
/* flag for disabling the tsc */
extern int tsc_disable;
@@ -166,59 +159,6 @@ static inline fastcall void native_cpuid
: "0" (*eax), "2" (*ecx));
}
-/*
- * Generic CPUID function
- * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
- * resulting in stale register contents being returned.
- */
-static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx)
-{
- *eax = op;
- *ecx = 0;
- __cpuid(eax, ebx, ecx, edx);
-}
-
-/* Some CPUID calls want 'count' to be placed in ecx */
-static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
- int *edx)
-{
- *eax = op;
- *ecx = count;
- __cpuid(eax, ebx, ecx, edx);
-}
-
-/*
- * CPUID functions returning a single datum
- */
-static inline unsigned int cpuid_eax(unsigned int op)
-{
- unsigned int eax, ebx, ecx, edx;
-
- cpuid(op, &eax, &ebx, &ecx, &edx);
- return eax;
-}
-static inline unsigned int cpuid_ebx(unsigned int op)
-{
- unsigned int eax, ebx, ecx, edx;
-
- cpuid(op, &eax, &ebx, &ecx, &edx);
- return ebx;
-}
-static inline unsigned int cpuid_ecx(unsigned int op)
-{
- unsigned int eax, ebx, ecx, edx;
-
- cpuid(op, &eax, &ebx, &ecx, &edx);
- return ecx;
-}
-static inline unsigned int cpuid_edx(unsigned int op)
-{
- unsigned int eax, ebx, ecx, edx;
-
- cpuid(op, &eax, &ebx, &ecx, &edx);
- return edx;
-}
-
#define load_cr3(pgdir) write_cr3(__pa(pgdir))
/*
@@ -505,18 +445,6 @@ struct thread_struct {
.io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \
}
-#ifndef CONFIG_PARAVIRT
-static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread)
-{
- tss->esp0 = thread->esp0;
- /* This can only happen when SEP is enabled, no need to test "SEP"arately */
- if (unlikely(tss->ss1 != thread->sysenter_cs)) {
- tss->ss1 = thread->sysenter_cs;
- wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
- }
-}
-#endif
-
#define start_thread(regs, new_eip, new_esp) do { \
__asm__("movl %0,%%fs": :"r" (0)); \
regs->xgs = 0; \
@@ -529,37 +457,6 @@ static inline void load_esp0(struct tss_
regs->esp = new_esp; \
} while (0)
-#ifndef CONFIG_PARAVIRT
-/*
- * These special macros can be used to get or set a debugging register
- */
-#define get_debugreg(var, register) \
- __asm__("movl %%db" #register ", %0" \
- :"=r" (var))
-#define set_debugreg(value, register) \
- __asm__("movl %0,%%db" #register \
- : /* no output */ \
- :"r" (value))
-
-#define set_iopl_mask native_set_iopl_mask
-#endif /* CONFIG_PARAVIRT */
-
-/*
- * Set IOPL bits in EFLAGS from given mask
- */
-static fastcall inline void native_set_iopl_mask(unsigned mask)
-{
- unsigned int reg;
- __asm__ __volatile__ ("pushfl;"
- "popl %0;"
- "andl %1, %0;"
- "orl %2, %0;"
- "pushl %0;"
- "popfl"
- : "=&r" (reg)
- : "i" (~X86_EFLAGS_IOPL), "r" (mask));
-}
-
/* Forward declaration, a strange C thing */
struct task_struct;
struct mm_struct;
@@ -651,6 +548,105 @@ static inline void rep_nop(void)
#define cpu_relax() rep_nop()
+#ifdef CONFIG_PARAVIRT
+#include <asm/paravirt.h>
+#else
+#define paravirt_enabled() 0
+#define __cpuid native_cpuid
+
+static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread)
+{
+ tss->esp0 = thread->esp0;
+ /* This can only happen when SEP is enabled, no need to test "SEP"arately */
+ if (unlikely(tss->ss1 != thread->sysenter_cs)) {
+ tss->ss1 = thread->sysenter_cs;
+ wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
+ }
+}
+
+/*
+ * These special macros can be used to get or set a debugging register
+ */
+#define get_debugreg(var, register) \
+ __asm__("movl %%db" #register ", %0" \
+ :"=r" (var))
+#define set_debugreg(value, register) \
+ __asm__("movl %0,%%db" #register \
+ : /* no output */ \
+ :"r" (value))
+
+#define set_iopl_mask native_set_iopl_mask
+#endif /* CONFIG_PARAVIRT */
+
+/*
+ * Set IOPL bits in EFLAGS from given mask
+ */
+static fastcall inline void native_set_iopl_mask(unsigned mask)
+{
+ unsigned int reg;
+ __asm__ __volatile__ ("pushfl;"
+ "popl %0;"
+ "andl %1, %0;"
+ "orl %2, %0;"
+ "pushl %0;"
+ "popfl"
+ : "=&r" (reg)
+ : "i" (~X86_EFLAGS_IOPL), "r" (mask));
+}
+
+/*
+ * Generic CPUID function
+ * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
+ * resulting in stale register contents being returned.
+ */
+static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx)
+{
+ *eax = op;
+ *ecx = 0;
+ __cpuid(eax, ebx, ecx, edx);
+}
+
+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
+ int *edx)
+{
+ *eax = op;
+ *ecx = count;
+ __cpuid(eax, ebx, ecx, edx);
+}
+
+/*
+ * CPUID functions returning a single datum
+ */
+static inline unsigned int cpuid_eax(unsigned int op)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ cpuid(op, &eax, &ebx, &ecx, &edx);
+ return eax;
+}
+static inline unsigned int cpuid_ebx(unsigned int op)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ cpuid(op, &eax, &ebx, &ecx, &edx);
+ return ebx;
+}
+static inline unsigned int cpuid_ecx(unsigned int op)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ cpuid(op, &eax, &ebx, &ecx, &edx);
+ return ecx;
+}
+static inline unsigned int cpuid_edx(unsigned int op)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ cpuid(op, &eax, &ebx, &ecx, &edx);
+ return edx;
+}
+
/* generic versions from gas */
#define GENERIC_NOP1 ".byte 0x90\n"
#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc5-mm1/include/asm-i386/spinlock.h working-2.6.19-rc5-mm1-paravirt/include/asm-i386/spinlock.h
--- linux-2.6.19-rc5-mm1/include/asm-i386/spinlock.h 2006-11-09 11:22:25.000000000 +1100
+++ working-2.6.19-rc5-mm1-paravirt/include/asm-i386/spinlock.h 2006-11-09 11:29:20.000000000 +1100
@@ -13,7 +13,6 @@
#define CLI_STRING "cli"
#define STI_STRING "sti"
#define CLI_STI_CLOBBERS
-#define CLI_STI_INPUT_ARGS
#endif /* CONFIG_PARAVIRT */
/*
@@ -59,27 +58,26 @@ static inline void __raw_spin_lock_flags
{
asm volatile(
"\n1:\t"
- LOCK_PREFIX " ; decb %[slock]\n\t"
+ LOCK_PREFIX " ; decb %0\n\t"
"jns 5f\n"
"2:\t"
- "testl $0x200, %[flags]\n\t"
+ "testl $0x200, %1\n\t"
"jz 4f\n\t"
STI_STRING "\n"
"3:\t"
"rep;nop\n\t"
- "cmpb $0, %[slock]\n\t"
+ "cmpb $0, %0\n\t"
"jle 3b\n\t"
CLI_STRING "\n\t"
"jmp 1b\n"
"4:\t"
"rep;nop\n\t"
- "cmpb $0, %[slock]\n\t"
+ "cmpb $0, %0\n\t"
"jg 1b\n\t"
"jmp 4b\n"
"5:\n\t"
- : [slock] "+m" (lock->slock)
- : [flags] "r" (flags)
- CLI_STI_INPUT_ARGS
+ : "+m" (lock->slock)
+ : "r" (flags)
: "memory" CLI_STI_CLOBBERS);
}
#endif
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 1:01 [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1 Rusty Russell
@ 2006-11-09 1:20 ` Andrew Morton
2006-11-09 7:31 ` Andi Kleen
2006-11-09 7:12 ` Andi Kleen
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 1:20 UTC (permalink / raw)
To: Rusty Russell; +Cc: Chris Wright, Andi Kleen, virtualization
On Thu, 09 Nov 2006 12:01:42 +1100
Rusty Russell <rusty@rustcorp.com.au> wrote:
> OK, at least two patches got dropped on the way from the mm tree to
> Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
> Merging into Andi's tree without these patches must have been a
> nightmare 8(
>
> Andi then tried to fix it with x86_64-mm-paravirt-compile.patch but then
> it didn't boot so he disabled it in x86_64-mm-paravirt-broken.patch
>
> This patch undoes those two patches and rearranges processor.h correctly
> so the kernel compiles and boots with CONFIG_PARAVIRT. Andi's
> "paravirt-compile" patch also cleans up the spinlock header, which is
> good but should probably be patched separately.
Fun. Andi, I have a mountain of fixes against your tree. Whatever you
do, don't change anything! I'll get it all sent over later today.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 1:01 [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1 Rusty Russell
2006-11-09 1:20 ` Andrew Morton
@ 2006-11-09 7:12 ` Andi Kleen
2006-11-09 7:39 ` Andrew Morton
2006-11-11 4:34 ` Rusty Russell
1 sibling, 2 replies; 11+ messages in thread
From: Andi Kleen @ 2006-11-09 7:12 UTC (permalink / raw)
To: virtualization; +Cc: Andrew Morton, Andi Kleen, Chris Wright
On Thursday 09 November 2006 02:01, Rusty Russell wrote:
> OK, at least two patches got dropped on the way from the mm tree to
> Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
Can you please resend the patchkit with these patches included?
(and any further changes folded in into the respective patches)
Thanks,
-Andi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 1:20 ` Andrew Morton
@ 2006-11-09 7:31 ` Andi Kleen
2006-11-09 7:50 ` Andrew Morton
0 siblings, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-11-09 7:31 UTC (permalink / raw)
To: Andrew Morton; +Cc: Chris Wright, virtualization
On Wed, Nov 08, 2006 at 05:20:14PM -0800, Andrew Morton wrote:
> On Thu, 09 Nov 2006 12:01:42 +1100
> Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> > OK, at least two patches got dropped on the way from the mm tree to
> > Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
> > Merging into Andi's tree without these patches must have been a
> > nightmare 8(
> >
> > Andi then tried to fix it with x86_64-mm-paravirt-compile.patch but then
> > it didn't boot so he disabled it in x86_64-mm-paravirt-broken.patch
> >
> > This patch undoes those two patches and rearranges processor.h correctly
> > so the kernel compiles and boots with CONFIG_PARAVIRT. Andi's
> > "paravirt-compile" patch also cleans up the spinlock header, which is
> > good but should probably be patched separately.
>
> Fun. Andi, I have a mountain of fixes against your tree. Whatever you
> do, don't change anything! I'll get it all sent over later today.
I think for the paravirt ops stuff it would be best to respin it -- e.g.
let Rusty submit a new clean patchkit. That's much better than trying
to add lots of fixup patches.
I'll go through the other patches.
-Andi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 7:12 ` Andi Kleen
@ 2006-11-09 7:39 ` Andrew Morton
2006-11-09 8:09 ` Andrew Morton
2006-11-11 4:34 ` Rusty Russell
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 7:39 UTC (permalink / raw)
To: Andi Kleen; +Cc: Chris Wright, virtualization, Andi Kleen
On Thu, 9 Nov 2006 08:12:37 +0100
Andi Kleen <ak@suse.de> wrote:
> On Thursday 09 November 2006 02:01, Rusty Russell wrote:
> > OK, at least two patches got dropped on the way from the mm tree to
> > Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
>
> Can you please resend the patchkit with these patches included?
>
> (and any further changes folded in into the respective patches)
>
argh.
I'll do it.
I wish you didn't rename patches.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 7:31 ` Andi Kleen
@ 2006-11-09 7:50 ` Andrew Morton
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 7:50 UTC (permalink / raw)
To: Andi Kleen; +Cc: Chris Wright, virtualization
On 9 Nov 2006 08:31:58 +0100
Andi Kleen <ak@muc.de> wrote:
> On Wed, Nov 08, 2006 at 05:20:14PM -0800, Andrew Morton wrote:
> > On Thu, 09 Nov 2006 12:01:42 +1100
> > Rusty Russell <rusty@rustcorp.com.au> wrote:
> >
> > > OK, at least two patches got dropped on the way from the mm tree to
> > > Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
> > > Merging into Andi's tree without these patches must have been a
> > > nightmare 8(
> > >
> > > Andi then tried to fix it with x86_64-mm-paravirt-compile.patch but then
> > > it didn't boot so he disabled it in x86_64-mm-paravirt-broken.patch
> > >
> > > This patch undoes those two patches and rearranges processor.h correctly
> > > so the kernel compiles and boots with CONFIG_PARAVIRT. Andi's
> > > "paravirt-compile" patch also cleans up the spinlock header, which is
> > > good but should probably be patched separately.
> >
> > Fun. Andi, I have a mountain of fixes against your tree. Whatever you
> > do, don't change anything! I'll get it all sent over later today.
>
> I think for the paravirt ops stuff it would be best to respin it -- e.g.
> let Rusty submit a new clean patchkit. That's much better than trying
> to add lots of fixup patches.
That's what I'm doing.
> I'll go through the other patches.
OK. Please drop all the paravirt patches, publish a new tree then let us
know when it's there.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 7:39 ` Andrew Morton
@ 2006-11-09 8:09 ` Andrew Morton
2006-11-09 14:11 ` Andi Kleen
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 8:09 UTC (permalink / raw)
To: Andi Kleen, virtualization, Rusty Russell, Andi Kleen,
Chris Wright
On Wed, 8 Nov 2006 23:39:04 -0800
Andrew Morton <akpm@osdl.org> wrote:
> > Can you please resend the patchkit with these patches included?
> >
> > (and any further changes folded in into the respective patches)
> >
>
> argh.
>
> I'll do it.
OK, all done.
I kept prep-for-paravirt-be-careful-about-touching-bios.patch (below)
separate, because it's dependent on
x86_64-mm-i386-create-e820.c-to-handle-standard-io-mem-resources.patch. It
could be folded into one of the other patches I guess.
So I have:
paravirt-i386-header-and-stubs-for-paravirtualisation.patch
paravirt-i386-patch-inline-replacements-for.patch
paravirt-i386-more-generic-paravirtualization.patch
paravirt-i386-allow-selected-bug-checks-to-be.patch
paravirt-i386-allow-disabling-legacy-power.patch
paravirt-i386-add-apic-accessors-to-paravirt-ops.patch
paravirt-i386-add-mmu-virtualization-to.patch
prep-for-paravirt-be-careful-about-touching-bios.patch
From: Rusty Russell <rusty@rustcorp.com.au>
BIOS ROM areas may not be mapped into the guest address space, so be careful
when touching those addresses to make sure they appear to be mapped.
[akpm@osdl.org: fix unused var warning]
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
arch/i386/kernel/e820.c | 9 ++++++++-
arch/i386/pci/pcbios.c | 11 +++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff -puN arch/i386/kernel/e820.c~prep-for-paravirt-be-careful-about-touching-bios arch/i386/kernel/e820.c
--- a/arch/i386/kernel/e820.c~prep-for-paravirt-be-careful-about-touching-bios
+++ a/arch/i386/kernel/e820.c
@@ -155,7 +155,14 @@ static struct resource standard_io_resou
.flags = IORESOURCE_BUSY | IORESOURCE_IO
} };
-#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
+static int romsignature(const unsigned char *x)
+{
+ unsigned short sig;
+ int ret = 0;
+ if (__get_user(sig, (const unsigned short *)x) == 0)
+ ret = (sig == 0xaa55);
+ return ret;
+}
static int __init romchecksum(unsigned char *rom, unsigned long length)
{
diff -puN arch/i386/pci/pcbios.c~prep-for-paravirt-be-careful-about-touching-bios arch/i386/pci/pcbios.c
--- a/arch/i386/pci/pcbios.c~prep-for-paravirt-be-careful-about-touching-bios
+++ a/arch/i386/pci/pcbios.c
@@ -5,6 +5,7 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/module.h>
+#include <asm/uaccess.h>
#include "pci.h"
#include "pci-functions.h"
@@ -314,6 +315,10 @@ static struct pci_raw_ops * __devinit pc
for (check = (union bios32 *) __va(0xe0000);
check <= (union bios32 *) __va(0xffff0);
++check) {
+ long sig;
+ if (__get_user(sig, &check->fields.signature))
+ continue;
+
if (check->fields.signature != BIOS32_SIGNATURE)
continue;
length = check->fields.length * 16;
@@ -331,11 +336,13 @@ static struct pci_raw_ops * __devinit pc
}
DBG("PCI: BIOS32 Service Directory structure at 0x%p\n", check);
if (check->fields.entry >= 0x100000) {
- printk("PCI: BIOS32 entry (0x%p) in high memory, cannot use.\n", check);
+ printk("PCI: BIOS32 entry (0x%p) in high memory, "
+ "cannot use.\n", check);
return NULL;
} else {
unsigned long bios32_entry = check->fields.entry;
- DBG("PCI: BIOS32 Service Directory entry at 0x%lx\n", bios32_entry);
+ DBG("PCI: BIOS32 Service Directory entry at 0x%lx\n",
+ bios32_entry);
bios32_indirect.address = bios32_entry + PAGE_OFFSET;
if (check_pcibios())
return &pci_bios_access;
_
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 8:09 ` Andrew Morton
@ 2006-11-09 14:11 ` Andi Kleen
2006-11-09 17:13 ` Andrew Morton
0 siblings, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2006-11-09 14:11 UTC (permalink / raw)
To: Andrew Morton; +Cc: Chris Wright, virtualization
On Thu, Nov 09, 2006 at 12:09:39AM -0800, Andrew Morton wrote:
> On Wed, 8 Nov 2006 23:39:04 -0800
> Andrew Morton <akpm@osdl.org> wrote:
>
> > > Can you please resend the patchkit with these patches included?
> > >
> > > (and any further changes folded in into the respective patches)
> > >
> >
> > argh.
> >
> > I'll do it.
>
> OK, all done.
>
> I kept prep-for-paravirt-be-careful-about-touching-bios.patch (below)
> separate, because it's dependent on
> x86_64-mm-i386-create-e820.c-to-handle-standard-io-mem-resources.patch. It
> could be folded into one of the other patches I guess.
>
> So I have:
>
> paravirt-i386-header-and-stubs-for-paravirtualisation.patch
> paravirt-i386-patch-inline-replacements-for.patch
> paravirt-i386-more-generic-paravirtualization.patch
> paravirt-i386-allow-selected-bug-checks-to-be.patch
> paravirt-i386-allow-disabling-legacy-power.patch
> paravirt-i386-add-apic-accessors-to-paravirt-ops.patch
> paravirt-i386-add-mmu-virtualization-to.patch
> prep-for-paravirt-be-careful-about-touching-bios.patch
Thanks. Where can I get them?
-Andi
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 14:11 ` Andi Kleen
@ 2006-11-09 17:13 ` Andrew Morton
2006-11-09 17:14 ` Andrew Morton
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 17:13 UTC (permalink / raw)
To: Andi Kleen; +Cc: Chris Wright, virtualization
On 9 Nov 2006 15:11:09 +0100
Andi Kleen <ak@muc.de> wrote:
> On Thu, Nov 09, 2006 at 12:09:39AM -0800, Andrew Morton wrote:
> > On Wed, 8 Nov 2006 23:39:04 -0800
> > Andrew Morton <akpm@osdl.org> wrote:
> >
> > > > Can you please resend the patchkit with these patches included?
> > > >
> > > > (and any further changes folded in into the respective patches)
> > > >
> > >
> > > argh.
> > >
> > > I'll do it.
> >
> > OK, all done.
> >
> > I kept prep-for-paravirt-be-careful-about-touching-bios.patch (below)
> > separate, because it's dependent on
> > x86_64-mm-i386-create-e820.c-to-handle-standard-io-mem-resources.patch. It
> > could be folded into one of the other patches I guess.
> >
> > So I have:
> >
> > paravirt-i386-header-and-stubs-for-paravirtualisation.patch
> > paravirt-i386-patch-inline-replacements-for.patch
> > paravirt-i386-more-generic-paravirtualization.patch
> > paravirt-i386-allow-selected-bug-checks-to-be.patch
> > paravirt-i386-allow-disabling-legacy-power.patch
> > paravirt-i386-add-apic-accessors-to-paravirt-ops.patch
> > paravirt-i386-add-mmu-virtualization-to.patch
> > prep-for-paravirt-be-careful-about-touching-bios.patch
>
> Thanks. Where can I get them?
>
I'm still waiting for you to drop the paravirt patches and republish the
tree. So I can make sure it all applies and is nice.
I guess that won't be happening, so I'll send them over now.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 17:13 ` Andrew Morton
@ 2006-11-09 17:14 ` Andrew Morton
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Morton @ 2006-11-09 17:14 UTC (permalink / raw)
To: Andi Kleen, Andi Kleen, virtualization, Rusty Russell,
Chris Wright
On Thu, 9 Nov 2006 09:13:03 -0800
Andrew Morton <akpm@osdl.org> wrote:
> so I'll send them over now.
You'll need to drop
header-and-stubs-for.patch
paravirt-patch.patch
paravirt-entry.patch
paravirt-bug-skip.patch
paravirt-no-legacy.patch
paravirt-apic.patch
paravirt-tlb.patch
paravirt-broken.patch
paravirt-compile.patch
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1
2006-11-09 7:12 ` Andi Kleen
2006-11-09 7:39 ` Andrew Morton
@ 2006-11-11 4:34 ` Rusty Russell
1 sibling, 0 replies; 11+ messages in thread
From: Rusty Russell @ 2006-11-11 4:34 UTC (permalink / raw)
To: Andi Kleen; +Cc: Andrew Morton, virtualization, Chris Wright, Andi Kleen
On Thu, 2006-11-09 at 08:12 +0100, Andi Kleen wrote:
> On Thursday 09 November 2006 02:01, Rusty Russell wrote:
> > OK, at least two patches got dropped on the way from the mm tree to
> > Andi's tree: the desc.h cleanup, and the processor.h rearrangement.
>
> Can you please resend the patchkit with these patches included?
>
> (and any further changes folded in into the respective patches)
No, I'm supposed to be on leave for 3 weeks, starting yesterday.
They went into Andrew Morton's tree. They were fine there, and had been
there for a few weeks!
You can either go back and pull them out of the -mm tree before -rc5-mm1
(say -rc4-mm2), or drop all of them and have Andrew can reinstate the
ones he dropped.
The relevant patches from -rc4-mm2 seem to be:
prep-for-paravirt-be-careful-about-touching-bios.patch
Prep for paravirt: Be careful about touching BIOS address space
prep-for-paravirt-be-careful-about-touching-bios-warning-fix.patch
prep-for-paravirt-be-careful-about-touching-bios-warning-fix
prep-for-paravirt-cpu_detect-extraction.patch
Prep for paravirt: cpu_detect extraction
prep-for-paravirt-desch-clearer-parameter-names.patch
Prep for paravirt: desc.h clearer parameter names, some code motion
prep-for-paravirt-desch-clearer-parameter-names-fix.patch
prep-for-paravirt-desch-clearer-parameter-names fix
prep-for-paravirt-rearrange-processorh.patch
Prep for paravirt: rearrange processor.h
paravirtualization-header-and-stubs-for.patch
paravirtualization: header and stubs for paravirtualizing critical operations
paravirtualization-patch-inline-replacements-for.patch
paravirtualization: Patch inline replacements for common paravirt operations.
paravirtualization-patch-inline-replacements-for-fix.patch
paravirtualization-patch-inline-replacements-for (fix)
paravirtualization-more-generic-paravirtualization.patch
paravirtualization: More generic paravirtualization entry point.
paravirtualization-allow-selected-bug-checks-to-be.patch
paravirtualization: Allow selected bug checks to be skipped by paravirt kernels
paravirtualization-allow-disabling-legacy-power.patch
paravirtualization: Allow disabling legacy power management modes with paravirt kernels
paravirtualization-add-apic-accessors-to-paravirt-ops.patch
paravirtualization: Add APIC accessors to paravirt-ops.
paravirtualization-add-apic-accessors-to-paravirt-ops-tidy.patch
paravirtualization: Add APIC accessors to paravirt-ops
paravirtualization-add-mmu-virtualization-to.patch
paravirtualization: Add mmu virtualization to paravirt-ops.
There were then some fixes which went in after that, in rc5-mm1:
paravirtualization-header-and-stubs-for-fix.patch
fix "paravirtualization: header and stubs for paravirtualizing critical operations"
paravirtualization-header-and-stubs-for-headers_check-fix.patch
paravirtualization: header and stubs for paravirtualizing critical operations (headers_check fix)
paravirtualization-patch-inline-replacements-for-fix-2.patch
paravirtualization-patch-inline-replacements-for fix 2
paravirtualization-patch-inline-replacements-for-fix-3.patch
Fix 'arch/i386/kernel/alternative.c:355: warning: unused variable 'i''
paravirtualization-more-generic-paravirtualization-warning-fix.patch
Fix 'arch/i386/kernel/paravirt.c:481: warning: initialization from incompatible pointer type'
Rusty.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-11-11 4:34 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-09 1:01 [PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1 Rusty Russell
2006-11-09 1:20 ` Andrew Morton
2006-11-09 7:31 ` Andi Kleen
2006-11-09 7:50 ` Andrew Morton
2006-11-09 7:12 ` Andi Kleen
2006-11-09 7:39 ` Andrew Morton
2006-11-09 8:09 ` Andrew Morton
2006-11-09 14:11 ` Andi Kleen
2006-11-09 17:13 ` Andrew Morton
2006-11-09 17:14 ` Andrew Morton
2006-11-11 4:34 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).