rpms/kernel/FC-4 linux-2.6-acpi-xen.patch, NONE, 1.1 linux-2.6.12-xen-additional.patch, NONE, 1.1 linux-2.6.12-xen.patch, NONE, 1.1 linux-2.6.11-xen.patch, 1.16, NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Aug 15 18:46:04 UTC 2005
- Previous message (by thread): rpms/xen/FC-4 .cvsignore, 1.6, 1.7 sources, 1.17, 1.18 xen-misc-fixes.patch, 1.16, 1.17 xen.spec, 1.43, 1.44 xen-qemu.patch, 1.2, NONE xen-vmxfixes.patch, 1.2, NONE
- Next message (by thread): rpms/xen/FC-4 xen.spec,1.44,1.45
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: riel
Update of /cvs/dist/rpms/kernel/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv6902
Added Files:
linux-2.6-acpi-xen.patch linux-2.6.12-xen-additional.patch
linux-2.6.12-xen.patch
Removed Files:
linux-2.6.11-xen.patch
Log Message:
actually commit the Xen patches
linux-2.6-acpi-xen.patch:
arch/xen/i386/pci/irq.c | 17 +++++++++++------
include/asm-xen/asm-i386/pci.h | 2 +-
2 files changed, 12 insertions(+), 7 deletions(-)
--- NEW FILE linux-2.6-acpi-xen.patch ---
--- linux-2.6.12/arch/xen/i386/pci/irq.c.acpi 2005-08-15 11:03:50.000000000 -0400
+++ linux-2.6.12/arch/xen/i386/pci/irq.c 2005-08-15 11:07:05.000000000 -0400
@@ -56,6 +56,7 @@ struct irq_router_handler {
};
int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
+void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
/*
* Search 0xf0000 -- 0xfffff for the PCI IRQ Routing Table.
@@ -1010,24 +1011,28 @@ static int __init pcibios_irq_init(void)
subsys_initcall(pcibios_irq_init);
-static void pirq_penalize_isa_irq(int irq)
+static void pirq_penalize_isa_irq(int irq, int active)
{
/*
* If any ISAPnP device reports an IRQ in its list of possible
* IRQ's, we try to avoid assigning it to PCI devices.
*/
- if (irq < 16)
- pirq_penalty[irq] += 100;
+ if (irq < 16) {
+ if (active)
+ pirq_penalty[irq] += 1000;
+ else
+ pirq_penalty[irq] += 100;
+ }
}
-void pcibios_penalize_isa_irq(int irq)
+void pcibios_penalize_isa_irq(int irq, int active)
{
#ifdef CONFIG_ACPI_PCI
if (!acpi_noirq)
- acpi_penalize_isa_irq(irq);
+ acpi_penalize_isa_irq(irq, active);
else
#endif
- pirq_penalize_isa_irq(irq);
+ pirq_penalize_isa_irq(irq, active);
}
static int pirq_enable_irq(struct pci_dev *dev)
--- linux-2.6.12/include/asm-xen/asm-i386/pci.h.acpi 2005-08-15 11:07:41.000000000 -0400
+++ linux-2.6.12/include/asm-xen/asm-i386/pci.h 2005-08-15 11:08:33.000000000 -0400
@@ -27,7 +27,7 @@ void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus);
void pcibios_set_master(struct pci_dev *dev);
-void pcibios_penalize_isa_irq(int irq);
+void pcibios_penalize_isa_irq(int irq, int active);
struct irq_routing_table *pcibios_get_irq_routing_table(void);
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
linux-2.6.12-xen-additional.patch:
linux-2.6.10/include/asm-x86_64/hw_irq.h | 3
linux-2.6.10/include/asm-x86_64/irq.h | 5
linux-2.6.10/include/asm-x86_64/posix_types.h | 4
linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c | 1
linux-2.6.11-rcu/kernel/rcupdate.c | 5
linux-2.6.12.new/arch/i386/mm/init.c | 2
linux-2.6.12.new/arch/i386/mm/pageattr.c | 2
linux-2.6.12.new/arch/i386/mm/pgtable.c | 40 +++-
linux-2.6.12.new/include/asm-i386/pgtable-2level-defs.h | 2
linux-2.6.12.new/include/asm-i386/pgtable-3level-defs.h | 2
linux-2.6.12.post/arch/i386/Kconfig | 13 +
linux-2.6.12.post/arch/i386/kernel/Makefile | 1
linux-2.6.12.post/arch/i386/kernel/smpalts.c | 85 ++++++++++
linux-2.6.12.post/arch/i386/kernel/smpboot.c | 10 +
linux-2.6.12.post/arch/i386/kernel/vmlinux.lds.S | 7
linux-2.6.12.post/include/asm-i386/atomic.h | 7
linux-2.6.12.post/include/asm-i386/bitops.h | 19 --
linux-2.6.12.post/include/asm-i386/rwsem.h | 17 +-
linux-2.6.12.post/include/asm-i386/smp_alt.h | 32 +++
linux-2.6.12.post/include/asm-i386/spinlock.h | 41 ++++
linux-2.6.12.post/include/asm-i386/system.h | 58 ++++++
21 files changed, 303 insertions(+), 53 deletions(-)
--- NEW FILE linux-2.6.12-xen-additional.patch ---
diff -ur linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c
--- linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2005-05-27 11:47:48 +01:00
+++ linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2005-05-27 11:48:07 +01:00
@@ -120,6 +120,7 @@
* and moreover root might send raw packets.
* FIXME: Source route IP option packets --RR */
if (hooknum == NF_IP_PRE_ROUTING
+ && skb->ip_summed != CHECKSUM_UNNECESSARY
&& csum_tcpudp_magic(iph->saddr, iph->daddr, udplen, IPPROTO_UDP,
skb->ip_summed == CHECKSUM_HW ? skb->csum
: skb_checksum(skb, iph->ihl*4, udplen, 0))) {
diff -urNpP linux-2.6.12/arch/i386/mm/init.c linux-2.6.12.new/arch/i386/mm/init.c
--- linux-2.6.12/arch/i386/mm/init.c 2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12.new/arch/i386/mm/init.c 2005-07-11 16:28:09.778165582 +0100
@@ -634,7 +634,7 @@ void __init pgtable_cache_init(void)
PTRS_PER_PGD*sizeof(pgd_t),
0,
pgd_ctor,
- PTRS_PER_PMD == 1 ? pgd_dtor : NULL);
+ pgd_dtor);
if (!pgd_cache)
panic("pgtable_cache_init(): Cannot create pgd cache");
}
diff -urNpP linux-2.6.12/arch/i386/mm/pageattr.c linux-2.6.12.new/arch/i386/mm/pageattr.c
--- linux-2.6.12/arch/i386/mm/pageattr.c 2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12.new/arch/i386/mm/pageattr.c 2005-07-11 16:28:09.775165494 +0100
@@ -75,7 +75,7 @@ static void set_pmd_pte(pte_t *kpte, uns
unsigned long flags;
set_pte_atomic(kpte, pte); /* change init_mm */
- if (PTRS_PER_PMD > 1)
+ if (HAVE_SHARED_KERNEL_PMD)
return;
spin_lock_irqsave(&pgd_lock, flags);
diff -urNpP linux-2.6.12/arch/i386/mm/pgtable.c linux-2.6.12.new/arch/i386/mm/pgtable.c
--- linux-2.6.12/arch/i386/mm/pgtable.c 2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12.new/arch/i386/mm/pgtable.c 2005-07-11 16:32:01.478023726 +0100
@@ -199,14 +199,14 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
{
unsigned long flags;
- if (PTRS_PER_PMD == 1)
+ if (!HAVE_SHARED_KERNEL_PMD)
spin_lock_irqsave(&pgd_lock, flags);
memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
swapper_pg_dir + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
- if (PTRS_PER_PMD > 1)
+ if (HAVE_SHARED_KERNEL_PMD)
return;
pgd_list_add(pgd);
@@ -214,11 +214,13 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
}
-/* never called when PTRS_PER_PMD > 1 */
void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)
{
unsigned long flags; /* can be called from interrupt context */
+ if (HAVE_SHARED_KERNEL_PMD)
+ return;
+
spin_lock_irqsave(&pgd_lock, flags);
pgd_list_del(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
@@ -226,12 +228,29 @@ void pgd_dtor(void *pgd, kmem_cache_t *c
pgd_t *pgd_alloc(struct mm_struct *mm)
{
- int i;
+ int i = 0;
pgd_t *pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
if (PTRS_PER_PMD == 1 || !pgd)
return pgd;
+ if (!HAVE_SHARED_KERNEL_PMD) {
+ /* alloc and copy kernel pmd */
+ unsigned long flags;
+ pgd_t *copy_pgd = pgd_offset_k(PAGE_OFFSET);
+ pud_t *copy_pud = pud_offset(copy_pgd, PAGE_OFFSET);
+ pmd_t *copy_pmd = pmd_offset(copy_pud, PAGE_OFFSET);
+ pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
+ if (0 == pmd)
+ goto out_oom;
+
+ spin_lock_irqsave(&pgd_lock, flags);
+ memcpy(pmd, copy_pmd, PAGE_SIZE);
+ spin_unlock_irqrestore(&pgd_lock, flags);
+ set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
+ }
+
+ /* alloc user pmds */
for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
if (!pmd)
@@ -252,9 +271,16 @@ void pgd_free(pgd_t *pgd)
int i;
/* in the PAE case user pgd entries are overwritten before usage */
- if (PTRS_PER_PMD > 1)
- for (i = 0; i < USER_PTRS_PER_PGD; ++i)
- kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+ if (PTRS_PER_PMD > 1) {
+ for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
+ pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
+ kmem_cache_free(pmd_cache, pmd);
+ }
+ if (!HAVE_SHARED_KERNEL_PMD) {
+ pmd_t *pmd = (void *)__va(pgd_val(pgd[USER_PTRS_PER_PGD])-1);
+ kmem_cache_free(pmd_cache, pmd);
+ }
+ }
/* in the non-PAE case, free_pgtables() clears user pgd entries */
kmem_cache_free(pgd_cache, pgd);
}
diff -urNpP linux-2.6.12/include/asm-i386/pgtable-2level-defs.h linux-2.6.12.new/include/asm-i386/pgtable-2level-defs.h
--- linux-2.6.12/include/asm-i386/pgtable-2level-defs.h 2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12.new/include/asm-i386/pgtable-2level-defs.h 2005-07-11 16:28:09.733164251 +0100
@@ -1,6 +1,8 @@
#ifndef _I386_PGTABLE_2LEVEL_DEFS_H
#define _I386_PGTABLE_2LEVEL_DEFS_H
+#define HAVE_SHARED_KERNEL_PMD 0
+
/*
* traditional i386 two-level paging structure:
*/
diff -urNpP linux-2.6.12/include/asm-i386/pgtable-3level-defs.h linux-2.6.12.new/include/asm-i386/pgtable-3level-defs.h
--- linux-2.6.12/include/asm-i386/pgtable-3level-defs.h 2005-06-17 20:48:29.000000000 +0100
+++ linux-2.6.12.new/include/asm-i386/pgtable-3level-defs.h 2005-07-11 16:28:09.755164902 +0100
@@ -1,6 +1,8 @@
#ifndef _I386_PGTABLE_3LEVEL_DEFS_H
#define _I386_PGTABLE_3LEVEL_DEFS_H
+#define HAVE_SHARED_KERNEL_PMD 1
+
/*
* PGDIR_SHIFT determines what a top-level page table entry can map
*/
diff -ur linux-2.6.11/kernel/rcupdate.c linux-2.6.11-rcu/kernel/rcupdate.c
--- linux-2.6.11/kernel/rcupdate.c 2005-05-30 10:51:41 +01:00
+++ linux-2.6.11-rcu/kernel/rcupdate.c 2005-05-30 10:53:53 +01:00
@@ -202,8 +202,11 @@
*/
static void cpu_quiet(int cpu, struct rcu_ctrlblk *rcp, struct rcu_state *rsp)
{
+ cpumask_t mask;
+
cpu_clear(cpu, rsp->cpumask);
- if (cpus_empty(rsp->cpumask)) {
+ cpus_andnot(mask, rsp->cpumask, nohz_cpu_mask);
+ if (cpus_empty(mask)) {
/* batch completed ! */
rcp->completed = rcp->cur;
rcu_start_batch(rcp, rsp, 0);
diff -Naur linux-2.6.12/arch/i386/Kconfig linux-2.6.12.post/arch/i386/Kconfig
--- linux-2.6.12/arch/i386/Kconfig 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/arch/i386/Kconfig 2005-07-25 05:51:21.000000000 -0400
@@ -487,6 +487,19 @@
If you don't know what to do here, say N.
+config SMP_ALTERNATIVES
+ bool "SMP alternatives support (EXPERIMENTAL)"
+ depends on SMP && EXPERIMENTAL
+ help
+ Try to reduce the overhead of running an SMP kernel on a uniprocessor
+ host slightly by replacing certain key instruction sequences
+ according to whether we currently have more than one CPU available.
+ This should provide a noticeable boost to performance when
+ running SMP kernels on UP machines, and have negligible impact
+ when running on an true SMP host.
+
+ If unsure, say N.
+
config NR_CPUS
int "Maximum number of CPUs (2-255)"
range 2 255
diff -Naur linux-2.6.12/arch/i386/kernel/Makefile linux-2.6.12.post/arch/i386/kernel/Makefile
--- linux-2.6.12/arch/i386/kernel/Makefile 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/arch/i386/kernel/Makefile 2005-07-25 05:51:21.000000000 -0400
@@ -33,6 +33,7 @@
obj-$(CONFIG_HPET_TIMER) += time_hpet.o
obj-$(CONFIG_EFI) += efi.o efi_stub.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+obj-$(CONFIG_SMP_ALTERNATIVES) += smpalts.o
EXTRA_AFLAGS := -traditional
diff -Naur linux-2.6.12/arch/i386/kernel/smpalts.c linux-2.6.12.post/arch/i386/kernel/smpalts.c
--- linux-2.6.12/arch/i386/kernel/smpalts.c 1969-12-31 19:00:00.000000000 -0500
+++ linux-2.6.12.post/arch/i386/kernel/smpalts.c 2005-07-25 05:51:21.000000000 -0400
@@ -0,0 +1,85 @@
+#include <linux/kernel.h>
+#include <asm/system.h>
+#include <asm/smp_alt.h>
+#include <asm/processor.h>
+#include <asm/string.h>
+
+struct smp_replacement_record {
+ unsigned char targ_size;
+ unsigned char smp1_size;
+ unsigned char smp2_size;
+ unsigned char up_size;
+ unsigned char feature;
+ unsigned char data[0];
+};
+
+struct smp_alternative_record {
+ void *targ_start;
+ struct smp_replacement_record *repl;
+};
+
+extern struct smp_alternative_record __start_smp_alternatives_table,
+ __stop_smp_alternatives_table;
+extern unsigned long __init_begin, __init_end;
+
+void prepare_for_smp(void)
+{
+ struct smp_alternative_record *r;
+ printk(KERN_INFO "Enabling SMP...\n");
+ for (r = &__start_smp_alternatives_table;
+ r != &__stop_smp_alternatives_table;
+ r++) {
+ BUG_ON(r->repl->targ_size < r->repl->smp1_size);
+ BUG_ON(r->repl->targ_size < r->repl->smp2_size);
+ BUG_ON(r->repl->targ_size < r->repl->up_size);
+ if (system_state == SYSTEM_RUNNING &&
+ r->targ_start >= (void *)&__init_begin &&
+ r->targ_start < (void *)&__init_end)
+ continue;
+ if (r->repl->feature != (unsigned char)-1 &&
+ boot_cpu_has(r->repl->feature)) {
+ memcpy(r->targ_start,
+ r->repl->data + r->repl->smp1_size,
+ r->repl->smp2_size);
+ memset(r->targ_start + r->repl->smp2_size,
+ 0x90,
+ r->repl->targ_size - r->repl->smp2_size);
+ } else {
+ memcpy(r->targ_start,
+ r->repl->data,
+ r->repl->smp1_size);
+ memset(r->targ_start + r->repl->smp1_size,
+ 0x90,
+ r->repl->targ_size - r->repl->smp1_size);
+ }
+ }
+ /* Paranoia */
+ asm volatile ("jmp 1f\n1:");
+ mb();
+}
+
+void unprepare_for_smp(void)
+{
+ struct smp_alternative_record *r;
+ printk(KERN_INFO "Disabling SMP...\n");
+ for (r = &__start_smp_alternatives_table;
+ r != &__stop_smp_alternatives_table;
+ r++) {
+ BUG_ON(r->repl->targ_size < r->repl->smp1_size);
+ BUG_ON(r->repl->targ_size < r->repl->smp2_size);
+ BUG_ON(r->repl->targ_size < r->repl->up_size);
+ if (system_state == SYSTEM_RUNNING &&
+ r->targ_start >= (void *)&__init_begin &&
+ r->targ_start < (void *)&__init_end)
+ continue;
+ memcpy(r->targ_start,
+ r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
+ r->repl->up_size);
+ memset(r->targ_start + r->repl->up_size,
+ 0x90,
+ r->repl->targ_size - r->repl->up_size);
+ }
+ /* Paranoia */
+ asm volatile ("jmp 1f\n1:");
+ mb();
+}
diff -Naur linux-2.6.12/arch/i386/kernel/smpboot.c linux-2.6.12.post/arch/i386/kernel/smpboot.c
--- linux-2.6.12/arch/i386/kernel/smpboot.c 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/arch/i386/kernel/smpboot.c 2005-07-25 05:51:21.000000000 -0400
@@ -1001,6 +1001,11 @@
if (max_cpus <= cpucount+1)
continue;
+#ifdef CONFIG_SMP_ALTERNATIVES
+ if (kicked == 1)
+ prepare_for_smp();
+#endif
+
if (do_boot_cpu(apicid))
printk("CPU #%d not responding - cannot use it.\n",
apicid);
@@ -1130,6 +1135,11 @@
return -EIO;
}
+#ifdef CONFIG_SMP_ALTERNATIVES
+ if (num_online_cpus() == 1)
+ prepare_for_smp();
+#endif
+
local_irq_enable();
/* Unleash the CPU! */
cpu_set(cpu, smp_commenced_mask);
diff -Naur linux-2.6.12/arch/i386/kernel/vmlinux.lds.S linux-2.6.12.post/arch/i386/kernel/vmlinux.lds.S
--- linux-2.6.12/arch/i386/kernel/vmlinux.lds.S 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/arch/i386/kernel/vmlinux.lds.S 2005-07-25 05:51:21.000000000 -0400
@@ -30,6 +30,13 @@
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
+ . = ALIGN(16);
+ __start_smp_alternatives_table = .;
+ __smp_alternatives : { *(__smp_alternatives) }
+ __stop_smp_alternatives_table = .;
+
+ __smp_replacements : { *(__smp_replacements) }
+
RODATA
/* writeable */
diff -Naur linux-2.6.12/include/asm-i386/atomic.h linux-2.6.12.post/include/asm-i386/atomic.h
--- linux-2.6.12/include/asm-i386/atomic.h 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/include/asm-i386/atomic.h 2005-07-25 05:51:21.000000000 -0400
@@ -4,18 +4,13 @@
#include <linux/config.h>
#include <linux/compiler.h>
#include <asm/processor.h>
+#include <asm/smp_alt.h>
/*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc..
*/
-#ifdef CONFIG_SMP
-#define LOCK "lock ; "
-#else
-#define LOCK ""
-#endif
-
/*
* Make sure gcc doesn't try to be clever and move things around
* on us. We need to use _exactly_ the address the user gave us,
diff -Naur linux-2.6.12/include/asm-i386/bitops.h linux-2.6.12.post/include/asm-i386/bitops.h
--- linux-2.6.12/include/asm-i386/bitops.h 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/include/asm-i386/bitops.h 2005-07-25 05:51:21.000000000 -0400
@@ -7,6 +7,7 @@
#include <linux/config.h>
#include <linux/compiler.h>
+#include <asm/smp_alt.h>
/*
* These have to be done with inline assembly: that way the bit-setting
@@ -16,12 +17,6 @@
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
*/
-#ifdef CONFIG_SMP
-#define LOCK_PREFIX "lock ; "
-#else
-#define LOCK_PREFIX ""
-#endif
-
#define ADDR (*(volatile long *) addr)
/**
@@ -41,7 +36,7 @@
*/
static inline void set_bit(int nr, volatile unsigned long * addr)
{
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btsl %1,%0"
:"=m" (ADDR)
:"Ir" (nr));
@@ -76,7 +71,7 @@
*/
static inline void clear_bit(int nr, volatile unsigned long * addr)
{
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btrl %1,%0"
:"=m" (ADDR)
:"Ir" (nr));
@@ -121,7 +116,7 @@
*/
static inline void change_bit(int nr, volatile unsigned long * addr)
{
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btcl %1,%0"
:"=m" (ADDR)
:"Ir" (nr));
@@ -140,7 +135,7 @@
{
int oldbit;
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"Ir" (nr) : "memory");
@@ -180,7 +175,7 @@
{
int oldbit;
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"Ir" (nr) : "memory");
@@ -231,7 +226,7 @@
{
int oldbit;
- __asm__ __volatile__( LOCK_PREFIX
+ __asm__ __volatile__( LOCK
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
:"Ir" (nr) : "memory");
diff -Naur linux-2.6.12/include/asm-i386/rwsem.h linux-2.6.12.post/include/asm-i386/rwsem.h
--- linux-2.6.12/include/asm-i386/rwsem.h 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/include/asm-i386/rwsem.h 2005-07-25 05:51:21.000000000 -0400
@@ -40,6 +40,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
+#include <asm/smp_alt.h>
struct rwsem_waiter;
@@ -99,7 +100,7 @@
{
__asm__ __volatile__(
"# beginning down_read\n\t"
-LOCK_PREFIX " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value */
+LOCK " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value */
" js 2f\n\t" /* jump if we weren't granted the lock */
"1:\n\t"
LOCK_SECTION_START("")
@@ -130,7 +131,7 @@
" movl %1,%2\n\t"
" addl %3,%2\n\t"
" jle 2f\n\t"
-LOCK_PREFIX " cmpxchgl %2,%0\n\t"
+LOCK " cmpxchgl %2,%0\n\t"
" jnz 1b\n\t"
"2:\n\t"
"# ending __down_read_trylock\n\t"
@@ -150,7 +151,7 @@
tmp = RWSEM_ACTIVE_WRITE_BIAS;
__asm__ __volatile__(
"# beginning down_write\n\t"
-LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
+LOCK " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
" testl %%edx,%%edx\n\t" /* was the count 0 before? */
" jnz 2f\n\t" /* jump if we weren't granted the lock */
"1:\n\t"
@@ -188,7 +189,7 @@
__s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
__asm__ __volatile__(
"# beginning __up_read\n\t"
-LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
+LOCK " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old value */
" js 2f\n\t" /* jump if the lock is being waited upon */
"1:\n\t"
LOCK_SECTION_START("")
@@ -214,7 +215,7 @@
__asm__ __volatile__(
"# beginning __up_write\n\t"
" movl %2,%%edx\n\t"
-LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
+LOCK " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 -> 0x00000000 */
" jnz 2f\n\t" /* jump if the lock is being waited upon */
"1:\n\t"
LOCK_SECTION_START("")
@@ -239,7 +240,7 @@
{
__asm__ __volatile__(
"# beginning __downgrade_write\n\t"
-LOCK_PREFIX " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
+LOCK " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001 */
" js 2f\n\t" /* jump if the lock is being waited upon */
"1:\n\t"
LOCK_SECTION_START("")
@@ -263,7 +264,7 @@
static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
{
__asm__ __volatile__(
-LOCK_PREFIX "addl %1,%0"
+LOCK "addl %1,%0"
: "=m"(sem->count)
: "ir"(delta), "m"(sem->count));
}
@@ -276,7 +277,7 @@
int tmp = delta;
__asm__ __volatile__(
-LOCK_PREFIX "xadd %0,(%2)"
+LOCK "xadd %0,(%2)"
: "+r"(tmp), "=m"(sem->count)
: "r"(sem), "m"(sem->count)
: "memory");
diff -Naur linux-2.6.12/include/asm-i386/smp_alt.h linux-2.6.12.post/include/asm-i386/smp_alt.h
--- linux-2.6.12/include/asm-i386/smp_alt.h 1969-12-31 19:00:00.000000000 -0500
+++ linux-2.6.12.post/include/asm-i386/smp_alt.h 2005-07-25 05:51:21.000000000 -0400
@@ -0,0 +1,32 @@
+#ifndef __ASM_SMP_ALT_H__
+#define __ASM_SMP_ALT_H__
+
+#include <linux/config.h>
+
+#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
+#define LOCK \
+ "6677: nop\n" \
+ ".section __smp_alternatives,\"a\"\n" \
+ ".long 6677b\n" \
+ ".long 6678f\n" \
+ ".previous\n" \
+ ".section __smp_replacements,\"a\"\n" \
+ "6678: .byte 1\n" \
+ ".byte 1\n" \
+ ".byte 0\n" \
+ ".byte 1\n" \
+ ".byte -1\n" \
+ "lock\n" \
+ "nop\n" \
+ ".previous\n"
+void prepare_for_smp(void);
+void unprepare_for_smp(void);
+#else
+#define LOCK "lock ; "
+#endif
+#else
+#define LOCK ""
+#endif
+
+#endif /* __ASM_SMP_ALT_H__ */
diff -Naur linux-2.6.12/include/asm-i386/spinlock.h linux-2.6.12.post/include/asm-i386/spinlock.h
--- linux-2.6.12/include/asm-i386/spinlock.h 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/include/asm-i386/spinlock.h 2005-07-25 05:51:21.000000000 -0400
@@ -6,6 +6,7 @@
#include <asm/page.h>
#include <linux/config.h>
#include <linux/compiler.h>
+#include <asm/smp_alt.h>
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
@@ -47,8 +48,9 @@
#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
#define spin_lock_string \
- "\n1:\t" \
- "lock ; decb %0\n\t" \
+ "1:\n" \
+ LOCK \
+ "decb %0\n\t" \
"jns 3f\n" \
"2:\t" \
"rep;nop\n\t" \
@@ -58,8 +60,9 @@
"3:\n\t"
#define spin_lock_string_flags \
- "\n1:\t" \
- "lock ; decb %0\n\t" \
+ "1:\n" \
+ LOCK \
+ "decb %0\n\t" \
"jns 4f\n\t" \
"2:\t" \
"testl $0x200, %1\n\t" \
@@ -121,10 +124,34 @@
static inline int _raw_spin_trylock(spinlock_t *lock)
{
char oldval;
+#ifdef CONFIG_SMP_ALTERNATIVES
__asm__ __volatile__(
- "xchgb %b0,%1"
+ "1:movb %1,%b0\n"
+ "movb $0,%1\n"
+ "2:"
+ ".section __smp_alternatives,\"a\"\n"
+ ".long 1b\n"
+ ".long 3f\n"
+ ".previous\n"
+ ".section __smp_replacements,\"a\"\n"
+ "3: .byte 2b - 1b\n"
+ ".byte 5f-4f\n"
+ ".byte 0\n"
+ ".byte 6f-5f\n"
+ ".byte -1\n"
+ "4: xchgb %b0,%1\n"
+ "5: movb %1,%b0\n"
+ "movb $0,%1\n"
+ "6:\n"
+ ".previous\n"
:"=q" (oldval), "=m" (lock->slock)
:"0" (0) : "memory");
+#else
+ __asm__ __volatile__(
+ "xchgb %b0,%1\n"
+ :"=q" (oldval), "=m" (lock->slock)
+ :"0" (0) : "memory");
+#endif
return oldval > 0;
}
@@ -225,8 +252,8 @@
__build_write_lock(rw, "__write_lock_failed");
}
-#define _raw_read_unlock(rw) asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory")
-#define _raw_write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory")
+#define _raw_read_unlock(rw) asm volatile(LOCK "incl %0" :"=m" ((rw)->lock) : : "memory")
+#define _raw_write_unlock(rw) asm volatile(LOCK "addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory")
static inline int _raw_read_trylock(rwlock_t *lock)
{
diff -Naur linux-2.6.12/include/asm-i386/system.h linux-2.6.12.post/include/asm-i386/system.h
--- linux-2.6.12/include/asm-i386/system.h 2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.post/include/asm-i386/system.h 2005-07-25 05:51:21.000000000 -0400
@@ -5,7 +5,7 @@
#include <linux/kernel.h>
#include <asm/segment.h>
#include <asm/cpufeature.h>
-#include <linux/bitops.h> /* for LOCK_PREFIX */
+#include <asm/smp_alt.h>
#ifdef __KERNEL__
@@ -249,19 +249,19 @@
unsigned long prev;
switch (size) {
case 1:
- __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
+ __asm__ __volatile__(LOCK "cmpxchgb %b1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
- __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
+ __asm__ __volatile__(LOCK "cmpxchgw %w1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
- __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
+ __asm__ __volatile__(LOCK "cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
@@ -425,11 +425,55 @@
#endif
#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
+#define smp_alt_mb(instr) \
+__asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
+ ".section __smp_alternatives,\"a\"\n" \
+ ".long 6667b\n" \
+ ".long 6673f\n" \
+ ".previous\n" \
+ ".section __smp_replacements,\"a\"\n" \
+ "6673:.byte 6668b-6667b\n" \
+ ".byte 6670f-6669f\n" \
+ ".byte 6671f-6670f\n" \
+ ".byte 0\n" \
+ ".byte %c0\n" \
+ "6669:lock;addl $0,0(%%esp)\n" \
+ "6670:" instr "\n" \
+ "6671:\n" \
+ ".previous\n" \
+ : \
+ : "i" (X86_FEATURE_XMM2) \
+ : "memory")
+#define smp_rmb() smp_alt_mb("lfence")
+#define smp_mb() smp_alt_mb("mfence")
+#define set_mb(var, value) do { \
+unsigned long __set_mb_temp; \
+__asm__ __volatile__("6667:movl %1, %0\n6668:\n" \
+ ".section __smp_alternatives,\"a\"\n" \
+ ".long 6667b\n" \
+ ".long 6673f\n" \
+ ".previous\n" \
+ ".section __smp_replacements,\"a\"\n" \
+ "6673: .byte 6668b-6667b\n" \
+ ".byte 6670f-6669f\n" \
+ ".byte 0\n" \
+ ".byte 6671f-6670f\n" \
+ ".byte -1\n" \
+ "6669: xchg %1, %0\n" \
+ "6670:movl %1, %0\n" \
+ "6671:\n" \
+ ".previous\n" \
+ : "=m" (var), "=r" (__set_mb_temp) \
+ : "1" (value) \
+ : "memory"); } while (0)
+#else
+#define smp_rmb() rmb()
+#define smp_mb() mb()
#define set_mb(var, value) do { xchg(&var, value); } while (0)
+#endif
+#define smp_read_barrier_depends() read_barrier_depends()
#else
#define smp_mb() barrier()
#define smp_rmb() barrier()
diff -urN linux-2.6.10-orig/include/asm-x86_64/hw_irq.h linux-2.6.10/include/asm-x86_64/hw_irq.h
--- linux-2.6.10-orig/include/asm-x86_64/hw_irq.h 2005-01-06 00:34:38.000000000 -0500
+++ linux-2.6.10/include/asm-x86_64/hw_irq.h 2005-02-25 17:45:37.181518088 -0500
@@ -48,6 +48,7 @@
*
* Vectors 0xf0-0xf9 are free (reserved for future Linux use).
*/
+#ifndef CONFIG_XEN
#define SPURIOUS_APIC_VECTOR 0xff
#define ERROR_APIC_VECTOR 0xfe
#define INVALIDATE_TLB_VECTOR 0xfd
@@ -57,7 +58,7 @@
#define KDB_VECTOR 0xf9
#define THERMAL_APIC_VECTOR 0xf0
-
+#endif
/*
* Local APIC timer IRQ vector is on a different priority level,
diff -urN linux-2.6.10-orig/include/asm-x86_64/irq.h linux-2.6.10/include/asm-x86_64/irq.h
--- linux-2.6.10-orig/include/asm-x86_64/irq.h 2005-01-06 00:34:38.000000000 -0500
+++ linux-2.6.10/include/asm-x86_64/irq.h 2005-02-25 17:45:37.181518088 -0500
@@ -10,6 +10,9 @@
* <tomsoft at informatik.tu-chemnitz.de>
*/
+#ifdef CONFIG_XEN
+#include "irq_vectors.h"
+#endif
#define TIMER_IRQ 0
/*
@@ -22,6 +25,7 @@
* the usable vector space is 0x20-0xff (224 vectors)
*/
+#ifndef CONFIG_XEN
/*
* The maximum number of vectors supported by x86_64 processors
* is limited to 256. For processors other than x86_64, NR_VECTORS
@@ -38,6 +42,7 @@
#define NR_IRQS 224
#define NR_IRQ_VECTORS 1024
#endif
+#endif
static __inline__ int irq_canonicalize(int irq)
{
diff -urN linux-2.6.10-orig/include/asm-x86_64/posix_types.h linux-2.6.10/include/asm-x86_64/posix_types.h
--- linux-2.6.10-orig/include/asm-x86_64/posix_types.h 2004-10-18 17:55:29.000000000 -0400
+++ linux-2.6.10/include/asm-x86_64/posix_types.h 2005-02-25 17:45:37.183517784 -0500
@@ -6,7 +6,7 @@
* be a little careful about namespace pollution etc. Also, we cannot
* assume GCC is being used.
*/
-
+#ifndef __ASSEMBLY__
typedef unsigned long __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef unsigned long __kernel_nlink_t;
@@ -115,5 +115,5 @@
}
#endif /* defined(__KERNEL__) */
-
+#endif
#endif
linux-2.6.12-xen.patch:
arch/xen/Kconfig | 212 +
arch/xen/Kconfig.debug | 129
arch/xen/Kconfig.drivers | 94
arch/xen/Makefile | 91
arch/xen/boot/Makefile | 8
arch/xen/configs/xen0_defconfig_x86_32 | 1278 +++++++
arch/xen/configs/xen0_defconfig_x86_64 | 1042 ++++++
arch/xen/configs/xenU_defconfig_x86_32 | 565 +++
arch/xen/configs/xenU_defconfig_x86_64 | 921 +++++
arch/xen/configs/xen_defconfig_x86_32 | 2996 ++++++++++++++++++
arch/xen/configs/xen_defconfig_x86_64 | 2644 +++++++++++++++
arch/xen/i386/Kconfig | 955 +++++
arch/xen/i386/Makefile | 108
arch/xen/i386/kernel/Makefile | 101
arch/xen/i386/kernel/acpi/Makefile | 13
arch/xen/i386/kernel/acpi/boot.c | 912 +++++
arch/xen/i386/kernel/apic.c | 83
arch/xen/i386/kernel/cpu/Makefile | 31
arch/xen/i386/kernel/cpu/common.c | 650 +++
arch/xen/i386/kernel/cpu/mtrr/Makefile | 16
arch/xen/i386/kernel/cpu/mtrr/main.c | 165
arch/xen/i386/kernel/entry.S | 753 ++++
arch/xen/i386/kernel/head.S | 198 +
arch/xen/i386/kernel/i386_ksyms.c | 193 +
arch/xen/i386/kernel/io_apic.c | 2609 +++++++++++++++
arch/xen/i386/kernel/ioport.c | 129
arch/xen/i386/kernel/irq.c | 300 +
arch/xen/i386/kernel/ldt.c | 275 +
arch/xen/i386/kernel/microcode.c | 163
arch/xen/i386/kernel/mpparse.c | 1116 ++++++
arch/xen/i386/kernel/pci-dma.c | 282 +
arch/xen/i386/kernel/process.c | 793 ++++
arch/xen/i386/kernel/quirks.c | 49
arch/xen/i386/kernel/setup.c | 1702 ++++++++++
arch/xen/i386/kernel/signal.c | 665 +++
arch/xen/i386/kernel/smp.c | 624 +++
arch/xen/i386/kernel/smpboot.c | 1548 +++++++++
arch/xen/i386/kernel/time.c | 929 +++++
arch/xen/i386/kernel/timers/Makefile | 17
arch/xen/i386/kernel/timers/timer_tsc.c | 379 ++
arch/xen/i386/kernel/traps.c | 1026 ++++++
arch/xen/i386/kernel/vsyscall.S | 15
arch/xen/i386/mach-default/Makefile | 12
arch/xen/i386/mm/Makefile | 24
arch/xen/i386/mm/fault.c | 561 +++
arch/xen/i386/mm/highmem.c | 100
arch/xen/i386/mm/hypervisor.c | 363 ++
arch/xen/i386/mm/init.c | 801 ++++
arch/xen/i386/mm/ioremap.c | 442 ++
arch/xen/i386/mm/pgtable.c | 551 +++
arch/xen/i386/pci/Makefile | 32
arch/xen/i386/pci/irq.c | 1120 ++++++
arch/xen/kernel/Makefile | 18
arch/xen/kernel/ctrl_if.c | 569 +++
arch/xen/kernel/devmem.c | 158
arch/xen/kernel/evtchn.c | 698 ++++
arch/xen/kernel/fixup.c | 87
arch/xen/kernel/gnttab.c | 396 ++
arch/xen/kernel/reboot.c | 269 +
arch/xen/kernel/skbuff.c | 47
arch/xen/kernel/smp.c | 16
arch/xen/kernel/xen_proc.c | 18
arch/xen/x86_64/Kconfig | 476 ++
arch/xen/x86_64/Makefile | 92
arch/xen/x86_64/ia32/Makefile | 62
arch/xen/x86_64/ia32/ia32entry.S | 629 +++
arch/xen/x86_64/ia32/syscall32.c | 149
arch/xen/x86_64/ia32/vsyscall-int80.S | 57
arch/xen/x86_64/kernel/Makefile | 69
arch/xen/x86_64/kernel/acpi/Makefile | 20
arch/xen/x86_64/kernel/apic.c | 200 +
arch/xen/x86_64/kernel/asm-offsets.c | 70
arch/xen/x86_64/kernel/e820.c | 588 +++
arch/xen/x86_64/kernel/early_printk.c | 242 +
arch/xen/x86_64/kernel/entry.S | 1062 ++++++
arch/xen/x86_64/kernel/head.S | 202 +
arch/xen/x86_64/kernel/head64.c | 127
arch/xen/x86_64/kernel/init_task.c | 49
arch/xen/x86_64/kernel/io_apic.c | 1991 +++++++++++
arch/xen/x86_64/kernel/ioport.c | 62
arch/xen/x86_64/kernel/irq.c | 105
arch/xen/x86_64/kernel/ldt.c | 263 +
arch/xen/x86_64/kernel/mpparse.c | 963 +++++
arch/xen/x86_64/kernel/pci-dma.c | 336 ++
arch/xen/x86_64/kernel/pci-nommu.c | 96
arch/xen/x86_64/kernel/process.c | 746 ++++
arch/xen/x86_64/kernel/setup.c | 1421 ++++++++
arch/xen/x86_64/kernel/setup64.c | 339 ++
arch/xen/x86_64/kernel/signal.c | 493 ++
arch/xen/x86_64/kernel/smp.c | 440 ++
arch/xen/x86_64/kernel/smpboot.c | 1035 ++++++
arch/xen/x86_64/kernel/traps.c | 971 +++++
arch/xen/x86_64/kernel/vsyscall.c | 237 +
arch/xen/x86_64/kernel/x8664_ksyms.c | 211 +
arch/xen/x86_64/kernel/xen_entry.S | 38
arch/xen/x86_64/mm/Makefile | 31
arch/xen/x86_64/mm/fault.c | 585 +++
arch/xen/x86_64/mm/init.c | 957 +++++
arch/xen/x86_64/mm/ioremap.c | 466 ++
arch/xen/x86_64/mm/pageattr.c | 254 +
arch/xen/x86_64/pci/Makefile | 38
arch/xen/x86_64/pci/Makefile-BUS | 22
drivers/Makefile | 1
drivers/acpi/tables.c | 8
drivers/char/mem.c | 12
drivers/char/tty_io.c | 23
drivers/xen/Makefile | 14
drivers/xen/balloon/Makefile | 2
drivers/xen/balloon/balloon.c | 438 ++
drivers/xen/blkback/Makefile | 2
drivers/xen/blkback/blkback.c | 757 ++++
drivers/xen/blkback/common.h | 109
drivers/xen/blkback/control.c | 61
drivers/xen/blkback/interface.c | 295 +
drivers/xen/blkback/vbd.c | 295 +
drivers/xen/blkfront/Kconfig | 6
drivers/xen/blkfront/Makefile | 3
drivers/xen/blkfront/blkfront.c | 1491 ++++++++
drivers/xen/blkfront/block.h | 133
drivers/xen/blkfront/vbd.c | 500 +++
drivers/xen/blktap/Makefile | 3
drivers/xen/blktap/blktap.c | 87
drivers/xen/blktap/blktap.h | 253 +
drivers/xen/blktap/blktap_controlmsg.c | 540 +++
drivers/xen/blktap/blktap_datapath.c | 451 ++
drivers/xen/blktap/blktap_userdev.c | 478 ++
drivers/xen/console/Makefile | 2
drivers/xen/console/console.c | 811 ++++
drivers/xen/evtchn/Makefile | 2
drivers/xen/evtchn/evtchn.c | 430 ++
drivers/xen/netback/Makefile | 2
drivers/xen/netback/common.h | 106
drivers/xen/netback/control.c | 58
drivers/xen/netback/interface.c | 381 ++
drivers/xen/netback/loopback.c | 164
drivers/xen/netback/netback.c | 1004 ++++++
drivers/xen/netfront/Kconfig | 6
drivers/xen/netfront/Makefile | 2
drivers/xen/netfront/netfront.c | 1622 +++++++++
drivers/xen/privcmd/Makefile | 2
drivers/xen/privcmd/privcmd.c | 260 +
drivers/xen/usbback/common.h | 85
drivers/xen/usbback/control.c | 61
drivers/xen/usbback/interface.c | 252 +
drivers/xen/usbback/usbback.c | 1066 ++++++
drivers/xen/usbfront/usbfront.c | 1738 ++++++++++
drivers/xen/usbfront/xhci.h | 183 +
drivers/xen/xenbus/Makefile | 10
drivers/xen/xenbus/xenbus_comms.c | 208 +
drivers/xen/xenbus/xenbus_comms.h | 14
drivers/xen/xenbus/xenbus_probe.c | 622 +++
drivers/xen/xenbus/xenbus_xs.c | 481 ++
include/asm-generic/pgtable.h | 12
include/asm-xen/asm-i386/agp.h | 37
include/asm-xen/asm-i386/bug.h | 16
include/asm-xen/asm-i386/desc.h | 146
include/asm-xen/asm-i386/dma-mapping.h | 165
include/asm-xen/asm-i386/fixmap.h | 168 +
include/asm-xen/asm-i386/floppy.h | 147
include/asm-xen/asm-i386/highmem.h | 80
include/asm-xen/asm-i386/hypercall.h | 564 +++
include/asm-xen/asm-i386/io.h | 436 ++
include/asm-xen/asm-i386/mach-xen/irq_vectors.h | 140
include/asm-xen/asm-i386/mach-xen/setup_arch_post.h | 51
include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h | 5
include/asm-xen/asm-i386/mach-xen/smpboot_hooks.h | 55
include/asm-xen/asm-i386/mmu.h | 26
include/asm-xen/asm-i386/mmu_context.h | 108
include/asm-xen/asm-i386/page.h | 235 +
include/asm-xen/asm-i386/param.h | 23
include/asm-xen/asm-i386/pci.h | 117
include/asm-xen/asm-i386/pgalloc.h | 61
include/asm-xen/asm-i386/pgtable-2level-defs.h | 21
include/asm-xen/asm-i386/pgtable-2level.h | 107
include/asm-xen/asm-i386/pgtable-3level-defs.h | 25
include/asm-xen/asm-i386/pgtable-3level.h | 188 +
include/asm-xen/asm-i386/pgtable.h | 491 ++
include/asm-xen/asm-i386/processor.h | 703 ++++
include/asm-xen/asm-i386/ptrace.h | 69
include/asm-xen/asm-i386/segment.h | 99
include/asm-xen/asm-i386/setup.h | 66
include/asm-xen/asm-i386/spinlock.h | 250 +
include/asm-xen/asm-i386/synch_bitops.h | 140
include/asm-xen/asm-i386/system.h | 579 +++
include/asm-xen/asm-i386/tlbflush.h | 102
include/asm-xen/asm-i386/vga.h | 20
include/asm-xen/asm-x86_64/arch_hooks.h | 27
include/asm-xen/asm-x86_64/bootsetup.h | 42
include/asm-xen/asm-x86_64/desc.h | 240 +
include/asm-xen/asm-x86_64/dma-mapping.h | 89
include/asm-xen/asm-x86_64/fixmap.h | 114
include/asm-xen/asm-x86_64/floppy.h | 204 +
include/asm-xen/asm-x86_64/hypercall.h | 505 +++
include/asm-xen/asm-x86_64/io.h | 372 ++
include/asm-xen/asm-x86_64/irq.h | 36
include/asm-xen/asm-x86_64/mach-xen/io_ports.h | 30
include/asm-xen/asm-x86_64/mach-xen/irq_vectors.h | 138
include/asm-xen/asm-x86_64/mach-xen/mach_time.h | 122
include/asm-xen/asm-x86_64/mach-xen/mach_timer.h | 48
include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h | 47
include/asm-xen/asm-x86_64/mach-xen/setup_arch_pre.h | 5
include/asm-xen/asm-x86_64/mach-xen/smpboot_hooks.h | 55
include/asm-xen/asm-x86_64/mmu_context.h | 126
include/asm-xen/asm-x86_64/page.h | 225 +
include/asm-xen/asm-x86_64/param.h | 22
include/asm-xen/asm-x86_64/pci.h | 148
include/asm-xen/asm-x86_64/pda.h | 85
include/asm-xen/asm-x86_64/pgalloc.h | 172 +
include/asm-xen/asm-x86_64/pgtable.h | 544 +++
include/asm-xen/asm-x86_64/processor.h | 472 ++
include/asm-xen/asm-x86_64/ptrace.h | 124
include/asm-xen/asm-x86_64/segment.h | 46
include/asm-xen/asm-x86_64/smp.h | 139
include/asm-xen/asm-x86_64/system.h | 405 ++
include/asm-xen/asm-x86_64/timer.h | 64
include/asm-xen/asm-x86_64/tlbflush.h | 97
include/asm-xen/asm-x86_64/vga.h | 20
include/asm-xen/asm-x86_64/xor.h | 328 +
include/asm-xen/balloon.h | 51
include/asm-xen/ctrl_if.h | 160
include/asm-xen/evtchn.h | 106
include/asm-xen/foreign_page.h | 30
include/asm-xen/gnttab.h | 72
include/asm-xen/hypervisor.h | 197 +
include/asm-xen/linux-public/privcmd.h | 90
include/asm-xen/linux-public/suspend.h | 43
include/asm-xen/queues.h | 81
include/asm-xen/synch_bitops.h | 2
include/asm-xen/xen-public/COPYING | 28
include/asm-xen/xen-public/acm.h | 157
include/asm-xen/xen-public/arch-ia64.h | 219 +
include/asm-xen/xen-public/arch-x86_32.h | 140
include/asm-xen/xen-public/arch-x86_64.h | 198 +
include/asm-xen/xen-public/dom0_ops.h | 414 ++
include/asm-xen/xen-public/event_channel.h | 191 +
include/asm-xen/xen-public/grant_table.h | 275 +
include/asm-xen/xen-public/io/blkif.h | 99
include/asm-xen/xen-public/io/domain_controller.h | 783 ++++
include/asm-xen/xen-public/io/ioreq.h | 70
include/asm-xen/xen-public/io/netif.h | 108
include/asm-xen/xen-public/io/ring.h | 199 +
include/asm-xen/xen-public/io/usbif.h | 66
include/asm-xen/xen-public/io/vmx_vlapic.h | 57
include/asm-xen/xen-public/physdev.h | 70
include/asm-xen/xen-public/policy_ops.h | 70
include/asm-xen/xen-public/sched_ctl.h | 58
include/asm-xen/xen-public/trace.h | 59
include/asm-xen/xen-public/version.h | 31
include/asm-xen/xen-public/vmx_assist.h | 101
include/asm-xen/xen-public/xen.h | 466 ++
include/asm-xen/xen_proc.h | 13
include/asm-xen/xenbus.h | 145
include/linux/gfp.h | 6
include/linux/highmem.h | 2
include/linux/irq.h | 1
include/linux/mm.h | 1
include/linux/skbuff.h | 4
kernel/irq/manage.c | 83
mm/highmem.c | 9
mm/memory.c | 24
mm/mmap.c | 4
mm/page_alloc.c | 6
net/core/dev.c | 40
net/core/skbuff.c | 2
264 files changed, 80325 insertions(+), 38 deletions(-)
--- NEW FILE linux-2.6.12-xen.patch ---
diff -Nurp ref-linux-2.6.12/arch/xen/Kconfig tmp-linux-2.6.12-xen.patch/arch/xen/Kconfig
--- ref-linux-2.6.12/arch/xen/Kconfig 1969-12-31 19:00:00.000000000 -0500
+++ tmp-linux-2.6.12-xen.patch/arch/xen/Kconfig 2005-07-26 14:25:02.000000000 -0400
@@ -0,0 +1,212 @@
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt.
+#
+
+mainmenu "Linux Kernel Configuration"
+
+config XEN
+ bool
+ default y
+ help
+ This is the Linux Xen port.
+
+config ARCH_XEN
+ bool
+ default y
+
+
+config NO_IDLE_HZ
+ bool
+ default y
+
+
+menu "XEN"
+
+config XEN_PRIVILEGED_GUEST
+ bool "Privileged Guest (domain 0)"
+ default n
+ select XEN_PHYSDEV_ACCESS
+ help
+ Support for privileged operation (domain 0)
+
+config XEN_PHYSDEV_ACCESS
+ bool "Physical device access"
+ default XEN_PRIVILEGED_GUEST
+ help
+ Assume access is available to physical hardware devices
+ (e.g., hard drives, network cards). This allows you to configure
+ such devices and also includes some low-level support that is
+ otherwise not compiled into the kernel.
+
+config XEN_BLKDEV_BACKEND
+ bool "Block-device backend driver"
+ depends on XEN_PHYSDEV_ACCESS
+ default y
+ help
+ The block-device backend driver allows the kernel to export its
+ block devices to other guests via a high-performance shared-memory
+ interface.
+
+config XEN_BLKDEV_TAP_BE
+ bool "Block Tap support for backend driver (DANGEROUS)"
+ depends on XEN_BLKDEV_BACKEND
+ default n
+ help
+ If you intend to use the block tap driver, the backend domain will
+ not know the domain id of the real frontend, and so will not be able
+ to map its data pages. This modifies the backend to attempt to map
+ from both the tap domain and the real frontend. This presents a
+ security risk, and so should ONLY be used for development
+ with the blktap. This option will be removed as the block drivers are
+ modified to use grant tables.
+
+config XEN_BLKDEV_GRANT
+ bool "Grant table substrate for block drivers"
+ depends on !XEN_BLKDEV_TAP_BE
+ default y
+ help
+ This introduces the use of grant tables as a data exhange mechanism
+ between the frontend and backend block drivers. This currently
+ conflicts with the block tap.
+
+config XEN_NETDEV_BACKEND
+ bool "Network-device backend driver"
+ depends on XEN_PHYSDEV_ACCESS
+ default y
+ help
+ The network-device backend driver allows the kernel to export its
+ network devices to other guests via a high-performance shared-memory
+ interface.
+
+config XEN_BLKDEV_FRONTEND
+ bool "Block-device frontend driver"
+ default y
+ help
+ The block-device frontend driver allows the kernel to access block
+ devices mounted within another guest OS. Unless you are building a
+ dedicated device-driver domain, or your master control domain
+ (domain 0), then you almost certainly want to say Y here.
+
+config XEN_NETDEV_FRONTEND
+ bool "Network-device frontend driver"
+ default y
+ help
+ The network-device frontend driver allows the kernel to access
+ network interfaces within another guest OS. Unless you are building a
+ dedicated device-driver domain, or your master control domain
+ (domain 0), then you almost certainly want to say Y here.
+
+config XEN_NETDEV_GRANT_TX
+ bool "Grant table substrate for net drivers tx path (DANGEROUS)"
+ default n
+ help
+ This introduces the use of grant tables as a data exhange mechanism
+ between the frontend and backend network drivers.
+
+config XEN_NETDEV_GRANT_RX
+ bool "Grant table substrate for net drivers rx path (DANGEROUS)"
+ default n
+ help
+ This introduces the use of grant tables as a data exhange mechanism
+ between the frontend and backend network drivers.
+
+config XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER
+ bool "Pipelined transmitter (DANGEROUS)"
+ depends on XEN_NETDEV_FRONTEND
+ default n
+ help
+ The driver will assume that the backend is pipelining packets for
+ transmission: whenever packets are pending in the remote backend,
+ the driver will not send asynchronous notifications when it queues
+ additional packets for transmission.
+ If the backend is a dumb domain, such as a transparent Ethernet
+ bridge with no local IP interface, it is safe to say Y here to get
+ slightly lower network overhead.
+ If the backend has a local IP interface; or may be doing smart things
+ like reassembling packets to perform firewall filtering; or if you
+ are unsure; or if you experience network hangs when this option is
+ enabled; then you must say N here.
+
+config XEN_BLKDEV_TAP
+ bool "Block device tap driver"
+ default n
+ help
+ This driver allows a VM to interact on block device channels
+ to other VMs. Block messages may be passed through or redirected
+ to a character device, allowing device prototyping in application
+ space. Odds are that you want to say N here.
+
+config XEN_SHADOW_MODE
+ bool "Fake shadow mode"
+ default n
+ help
+ fakes out a shadow mode kernel
+
+
+config XEN_SCRUB_PAGES
+ bool "Scrub memory before freeing it to Xen"
+ default y
+ help
+ Erase memory contents before freeing it back to Xen's global
+ pool. This ensures that any secrets contained within that
+ memory (e.g., private keys) cannot be found by other guests that
+ may be running on the machine. Most people will want to say Y here.
+ If security is not a concern then you may increase performance by
+ saying N.
+
+choice
+ prompt "Processor Type"
+ default XEN_X86
+
+config XEN_X86
+ bool "X86"
+ help
+ Choose this option if your computer is a X86 architecture.
+
+config XEN_X86_64
+ bool "X86_64"
+ help
+ Choose this option if your computer is a X86_64 architecture.
+
+endchoice
+
+endmenu
+
+config HAVE_ARCH_DEV_ALLOC_SKB
+ bool
+ default y
+
+source "init/Kconfig"
+
+if XEN_X86
+source "arch/xen/i386/Kconfig"
+endif
+
+if XEN_X86_64
+source "arch/xen/x86_64/Kconfig"
+endif
+
+menu "Executable file formats"
+
+source "fs/Kconfig.binfmt"
+
+endmenu
+
[...81268 lines suppressed...]
+ for (action = desc->action; action != NULL; action = action->next) {
+ if (action->dev_id != dev_id)
+ continue;
+
+ spin_unlock_irqrestore(&desc->lock,flags);
+
+ if (teardown_irq(irq, action) == 0)
+ kfree(action);
return;
}
+ printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
+ spin_unlock_irqrestore(&desc->lock,flags);
+ return;
}
EXPORT_SYMBOL(free_irq);
diff -Nurp ref-linux-2.6.12/mm/highmem.c tmp-linux-2.6.12-xen.patch/mm/highmem.c
--- ref-linux-2.6.12/mm/highmem.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/mm/highmem.c 2005-07-11 13:20:28.000000000 -0400
@@ -148,6 +148,15 @@ start:
return vaddr;
}
+void kmap_flush_unused(void)
+{
+ spin_lock(&kmap_lock);
+ flush_all_zero_pkmaps();
+ spin_unlock(&kmap_lock);
+}
+
+EXPORT_SYMBOL(kmap_flush_unused);
+
void fastcall *kmap_high(struct page *page)
{
unsigned long vaddr;
diff -Nurp ref-linux-2.6.12/mm/memory.c tmp-linux-2.6.12-xen.patch/mm/memory.c
--- ref-linux-2.6.12/mm/memory.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/mm/memory.c 2005-07-11 13:20:28.000000000 -0400
@@ -940,6 +940,24 @@ int get_user_pages(struct task_struct *t
continue;
}
+ if (vma && (vma->vm_flags & VM_FOREIGN))
+ {
+ struct page **map = vma->vm_private_data;
+ int offset = (start - vma->vm_start) >> PAGE_SHIFT;
+
+ if (map[offset] != NULL) {
+ if (pages) {
+ pages[i] = map[offset];
+ }
+ if (vmas)
+ vmas[i] = vma;
+ i++;
+ start += PAGE_SIZE;
+ len--;
+ continue;
+ }
+ }
+
if (!vma || (vma->vm_flags & VM_IO)
|| !(flags & vma->vm_flags))
return i ? : -EFAULT;
@@ -1796,12 +1814,12 @@ do_anonymous_page(struct mm_struct *mm,
page_add_anon_rmap(page, vma, addr);
}
- set_pte_at(mm, addr, page_table, entry);
+ set_pte_at(vma, addr, page_table, entry);
pte_unmap(page_table);
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, addr, entry);
- lazy_mmu_prot_update(entry);
+ lazy_mmu_prot_update(entry);
spin_unlock(&mm->page_table_lock);
out:
return VM_FAULT_MINOR;
@@ -1910,7 +1928,7 @@ retry:
entry = mk_pte(new_page, vma->vm_page_prot);
if (write_access)
entry = maybe_mkwrite(pte_mkdirty(entry), vma);
- set_pte_at(mm, address, page_table, entry);
+ set_pte_at(vma, address, page_table, entry);
if (anon) {
lru_cache_add_active(new_page);
page_add_anon_rmap(new_page, vma, address);
diff -Nurp ref-linux-2.6.12/mm/mmap.c tmp-linux-2.6.12-xen.patch/mm/mmap.c
--- ref-linux-2.6.12/mm/mmap.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/mm/mmap.c 2005-07-11 13:20:28.000000000 -0400
@@ -1904,6 +1904,10 @@ void exit_mmap(struct mm_struct *mm)
unsigned long nr_accounted = 0;
unsigned long end;
+#ifdef arch_exit_mmap
+ arch_exit_mmap(mm);
+#endif
+
lru_add_drain();
spin_lock(&mm->page_table_lock);
diff -Nurp ref-linux-2.6.12/mm/page_alloc.c tmp-linux-2.6.12-xen.patch/mm/page_alloc.c
--- ref-linux-2.6.12/mm/page_alloc.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/mm/page_alloc.c 2005-07-11 13:20:28.000000000 -0400
@@ -368,7 +368,8 @@ void __free_pages_ok(struct page *page,
LIST_HEAD(list);
int i;
- arch_free_page(page, order);
+ if (arch_free_page(page, order))
+ return;
mod_page_state(pgfree, 1 << order);
@@ -608,7 +609,8 @@ static void fastcall free_hot_cold_page(
struct per_cpu_pages *pcp;
unsigned long flags;
- arch_free_page(page, 0);
+ if (arch_free_page(page, 0))
+ return;
kernel_map_pages(page, 1, 0);
inc_page_state(pgfree);
diff -Nurp ref-linux-2.6.12/net/core/dev.c tmp-linux-2.6.12-xen.patch/net/core/dev.c
--- ref-linux-2.6.12/net/core/dev.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/net/core/dev.c 2005-07-11 13:20:28.000000000 -0400
@@ -115,6 +115,11 @@
#endif /* CONFIG_NET_RADIO */
#include <asm/current.h>
+#include <net/ip.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+
+
/* This define, if set, will randomly drop a packet when congestion
* is more than moderate. It helps fairness in the multi-interface
* case when one of them is a hog, but it kills performance for the
@@ -1261,6 +1266,30 @@ int dev_queue_xmit(struct sk_buff *skb)
__skb_linearize(skb, GFP_ATOMIC))
goto out_kfree_skb;
+ /* If a checksum-deferred packet is forwarded to a device that needs a
+ * checksum, correct the pointers and force checksumming.
+ */
+ if (skb->proto_csum_blank) {
+ if (skb->protocol != htons(ETH_P_IP))
+ goto out_kfree_skb;
+ skb->h.raw = (unsigned char *)skb->nh.iph + 4*skb->nh.iph->ihl;
+ if (skb->h.raw >= skb->tail)
+ goto out_kfree_skb;
+ switch (skb->nh.iph->protocol) {
+ case IPPROTO_TCP:
+ skb->csum = offsetof(struct tcphdr, check);
+ break;
+ case IPPROTO_UDP:
+ skb->csum = offsetof(struct udphdr, check);
+ break;
+ default:
+ goto out_kfree_skb;
+ }
+ if ((skb->h.raw + skb->csum + 2) > skb->tail)
+ goto out_kfree_skb;
+ skb->ip_summed = CHECKSUM_HW;
+ }
+
/* If packet is not checksummed and device does not support
* checksumming for this protocol, complete checksumming here.
*/
@@ -1680,6 +1709,17 @@ int netif_receive_skb(struct sk_buff *sk
}
#endif
+ switch (skb->ip_summed) {
+ case CHECKSUM_UNNECESSARY:
+ skb->proto_csum_valid = 1;
+ break;
+ case CHECKSUM_HW:
+ /* XXX Implement me. */
+ default:
+ skb->proto_csum_valid = 0;
+ break;
+ }
+
list_for_each_entry_rcu(ptype, &ptype_all, list) {
if (!ptype->dev || ptype->dev == skb->dev) {
if (pt_prev)
diff -Nurp ref-linux-2.6.12/net/core/skbuff.c tmp-linux-2.6.12-xen.patch/net/core/skbuff.c
--- ref-linux-2.6.12/net/core/skbuff.c 2005-06-17 15:48:29.000000000 -0400
+++ tmp-linux-2.6.12-xen.patch/net/core/skbuff.c 2005-07-11 13:20:28.000000000 -0400
@@ -353,6 +353,8 @@ struct sk_buff *skb_clone(struct sk_buff
C(local_df);
n->cloned = 1;
n->nohdr = 0;
+ C(proto_csum_valid);
+ C(proto_csum_blank);
C(pkt_type);
C(ip_summed);
C(priority);
--- linux-2.6.11-xen.patch DELETED ---
- Previous message (by thread): rpms/xen/FC-4 .cvsignore, 1.6, 1.7 sources, 1.17, 1.18 xen-misc-fixes.patch, 1.16, 1.17 xen.spec, 1.43, 1.44 xen-qemu.patch, 1.2, NONE xen-vmxfixes.patch, 1.2, NONE
- Next message (by thread): rpms/xen/FC-4 xen.spec,1.44,1.45
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-cvs-commits
mailing list