Mailing List Archive

More code cleanup
ChangeSet 1.1327.1.9, 2005/04/28 14:40:15-06:00, djm@kirby.fc.hp.com

More code cleanup



arch/ia64/Makefile | 2 +-
arch/ia64/patch/linux-2.6.11/cpumask.h | 15 +++------------
arch/ia64/patch/linux-2.6.11/time.c | 2 --
arch/ia64/tools/mkbuildtree | 16 +++++++++++-----
arch/ia64/xenmisc.c | 6 ++++++
include/asm-ia64/config.h | 17 ++++++++++++-----
6 files changed, 33 insertions(+), 25 deletions(-)


diff -Nru a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile
--- a/xen/arch/ia64/Makefile 2005-05-03 04:04:39 -04:00
+++ b/xen/arch/ia64/Makefile 2005-05-03 04:04:39 -04:00
@@ -9,7 +9,7 @@
sal.o cmdline.o mm_init.o tlb.o smpboot.o \
extable.o linuxextable.o \
regionreg.o entry.o unaligned.o privop.o vcpu.o \
- irq_ia64.o irq_lsapic.o hpsim_irq.o vhpt.o xenasm.o dom_fw.o
+ irq_ia64.o irq_lsapic.o vhpt.o xenasm.o dom_fw.o
# perfmon.o
# unwind.o needed for kernel unwinding (rare)

diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/cpumask.h b/xen/arch/ia64/patch/linux-2.6.11/cpumask.h
--- a/xen/arch/ia64/patch/linux-2.6.11/cpumask.h 2005-05-03 04:04:39 -04:00
+++ b/xen/arch/ia64/patch/linux-2.6.11/cpumask.h 2005-05-03 04:04:39 -04:00
@@ -1,20 +1,12 @@
- cpumask.h | 2 +-
- 1 files changed, 1 insertion(+), 1 deletion(-)
-
-Index: linux-2.6.11-xendiffs/include/linux/cpumask.h
-===================================================================
---- linux-2.6.11-xendiffs.orig/include/linux/cpumask.h 2005-03-02 01:38:00.000000000 -0600
-+++ linux-2.6.11-xendiffs/include/linux/cpumask.h 2005-03-24 15:06:18.408145243 -0600
-@@ -341,11 +341,11 @@ static inline int __cpumask_parse(const
- * main(){ set1(3); set2(5); }
+--- ../../linux-2.6.11/include/linux/cpumask.h 2005-03-02 00:38:00.000000000 -0700
++++ include/asm-ia64/linux/cpumask.h 2005-04-28 13:21:20.000000000 -0600
+@@ -342,7 +342,9 @@
*/

-+#if NR_CPUS > 1
extern cpumask_t cpu_possible_map;
++#ifndef XEN
extern cpumask_t cpu_online_map;
++#endif
extern cpumask_t cpu_present_map;

--#if NR_CPUS > 1
- #define num_online_cpus() cpus_weight(cpu_online_map)
- #define num_possible_cpus() cpus_weight(cpu_possible_map)
- #define num_present_cpus() cpus_weight(cpu_present_map)
+ #if NR_CPUS > 1
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/time.c b/xen/arch/ia64/patch/linux-2.6.11/time.c
--- a/xen/arch/ia64/patch/linux-2.6.11/time.c 2005-05-03 04:04:39 -04:00
+++ b/xen/arch/ia64/patch/linux-2.6.11/time.c 2005-05-03 04:04:39 -04:00
@@ -1,5 +1,5 @@
--- ../../linux-2.6.11/arch/ia64/kernel/time.c 2005-03-02 00:37:50.000000000 -0700
-+++ arch/ia64/time.c 2005-04-26 15:43:01.000000000 -0600
++++ arch/ia64/time.c 2005-04-28 14:29:58.000000000 -0600
@@ -10,16 +10,22 @@
*/
#include <linux/config.h>
@@ -49,7 +49,7 @@

+#ifdef XEN
+volatile unsigned long last_nsec_offset;
-+extern rwlock_t xtime_lock;
++extern seqlock_t xtime_lock;
+unsigned long cpu_khz; /* Detected as we calibrate the TSC */
+static s_time_t stime_irq; /* System time at last 'time update' */
+
diff -Nru a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree
--- a/xen/arch/ia64/tools/mkbuildtree 2005-05-03 04:04:39 -04:00
+++ b/xen/arch/ia64/tools/mkbuildtree 2005-05-03 04:04:39 -04:00
@@ -103,7 +103,7 @@
cp_patch arch/ia64/mm/contig.c arch/ia64/mm_contig.c mm_contig.c
cp_patch arch/ia64/mm/tlb.c arch/ia64/tlb.c tlb.c

-cp_patch arch/ia64/hp/sim/hpsim_irq.c arch/ia64/hpsim_irq.c hpsim_irq.c
+#cp_patch arch/ia64/hp/sim/hpsim_irq.c arch/ia64/hpsim_irq.c hpsim_irq.c

softlink arch/ia64/kernel/efi_stub.S arch/ia64/efi_stub.S
softlink arch/ia64/kernel/entry.h arch/ia64/entry.h
@@ -178,7 +178,8 @@
softlink include/asm-ia64/hw_irq.h include/asm-ia64/hw_irq.h
#cp_patch include/asm-ia64/ide.h include/asm-ia64/ide.h ide.h
cp_patch include/asm-ia64/io.h include/asm-ia64/io.h io.h
-cp_patch include/asm-ia64/irq.h include/asm-ia64/irq.h irq.h
+#cp_patch include/asm-ia64/irq.h include/asm-ia64/irq.h irq.h
+softlink include/asm-ia64/irq.h include/asm-ia64/irq.h
cp_patch include/asm-ia64/kregs.h include/asm-ia64/kregs.h kregs.h
cp_patch include/asm-ia64/page.h include/asm-ia64/page.h page.h
cp_patch include/asm-ia64/processor.h include/asm-ia64/processor.h processor.h
@@ -266,10 +267,12 @@
softlink include/linux/dma-mapping.h include/asm-ia64/linux/dma-mapping.h
#cp_patch include/linux/efi.h include/asm-ia64/linux/efi.h efi.h
softlink include/linux/efi.h include/asm-ia64/linux/efi.h
-cp_patch include/linux/hardirq.h include/asm-ia64/linux/hardirq.h linuxhardirq.h
+#cp_patch include/linux/hardirq.h include/asm-ia64/linux/hardirq.h linuxhardirq.h
+softlink include/linux/hardirq.h include/asm-ia64/linux/linuxhardirq.h
#cp_patch include/linux/init_task.h include/asm-ia64/linux/init_task.h init_task.h
cp_patch include/linux/interrupt.h include/asm-ia64/linux/interrupt.h interrupt.h
-cp_patch include/linux/mmzone.h include/asm-ia64/linux/mmzone.h mmzone.h
+#cp_patch include/linux/mmzone.h include/asm-ia64/linux/mmzone.h mmzone.h
+softlink include/linux/mmzone.h include/asm-ia64/linux/mmzone.h

#cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h
softlink include/linux/wait.h include/asm-ia64/linux/wait.h
@@ -277,7 +280,8 @@
#cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h

# following renamed to avoid conflict
-cp_patch include/linux/time.h include/xen/linuxtime.h linuxtime.h
+#cp_patch include/linux/time.h include/xen/linuxtime.h linuxtime.h
+softlink include/linux/time.h include/asm-ia64/linux/linuxtime.h

softlink include/linux/bcd.h include/asm-ia64/linux/bcd.h
softlink include/linux/bitmap.h include/asm-ia64/linux/bitmap.h
@@ -301,6 +305,7 @@
softlink include/linux/timex.h include/asm-ia64/linux/timex.h
softlink include/linux/topology.h include/asm-ia64/linux/topology.h
softlink include/linux/tty.h include/asm-ia64/linux/tty.h
+softlink include/linux/seqlock.h include/asm-ia64/linux/seqlock.h

null include/asm-ia64/linux/file.h
null include/asm-ia64/linux/module.h
@@ -309,6 +314,7 @@
null include/asm-ia64/linux/proc_fs.h
null include/asm-ia64/linux/rtc.h
null include/asm-ia64/linux/profile.h
+null include/asm-ia64/linux/seqlock.h

softlink include/linux/byteorder/generic.h include/asm-ia64/linux/byteorder/generic.h
softlink include/linux/byteorder/little_endian.h include/asm-ia64/linux/byteorder/little_endian.h
diff -Nru a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c
--- a/xen/arch/ia64/xenmisc.c 2005-05-03 04:04:39 -04:00
+++ b/xen/arch/ia64/xenmisc.c 2005-05-03 04:04:39 -04:00
@@ -259,6 +259,12 @@
}


+////////////////////////////////////
+// called from irq_ia64.c:init_IRQ()
+// (because CONFIG_IA64_HP_SIM is specified)
+////////////////////////////////////
+void hpsim_irq_init(void) { }
+

// accomodate linux extable.c
//const struct exception_table_entry *
diff -Nru a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h 2005-05-03 04:04:39 -04:00
+++ b/xen/include/asm-ia64/config.h 2005-05-03 04:04:39 -04:00
@@ -136,6 +136,7 @@
#define __cacheline_aligned
#define ____cacheline_aligned
#define ____cacheline_aligned_in_smp
+#define ____cacheline_maxaligned_in_smp

#include "asm/types.h" // for u64
struct device {
@@ -222,20 +223,26 @@
// FIXME following needs work
#define atomic_compareandswap(old, new, v) old

-// x86 typedef still used in sched.h, may go away later
-//typedef unsigned long l1_pgentry_t;
-
// see include/asm-ia64/mm.h, handle remaining pfn_info uses until gone
#define pfn_info page

// see common/keyhandler.c
#define nop() asm volatile ("nop 0")

-#define ARCH_HAS_EXEC_DOMAIN_MM_PTR
-
// from include/linux/preempt.h (needs including from interrupt.h or smp.h)
#define preempt_enable() do { } while (0)
#define preempt_disable() do { } while (0)
+
+// needed for include/xen/linuxtime.h
+typedef s64 time_t;
+typedef s64 suseconds_t;
+
+// used in common code
+#define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending)
+
+// dup'ed from signal.h to avoid changes to includes
+#define SA_SHIRQ 0x04000000
+#define SA_INTERRUPT 0x20000000

// these declarations got moved at some point, find a better place for them
extern int opt_noht;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
More code cleanup [ In reply to ]
ChangeSet 1.1327.1.11, 2005/04/28 16:24:03-06:00, djm@kirby.fc.hp.com

More code cleanup



b/xen/arch/ia64/Makefile | 2
b/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c | 99 +++++-------------------
b/xen/arch/ia64/patch/linux-2.6.11/unaligned.c | 83 ++------------------
b/xen/arch/ia64/tools/mkbuildtree | 6 -
b/xen/arch/ia64/xenmem.c | 67 ++++++++++++++++
b/xen/arch/ia64/xenmisc.c | 34 ++++++++
xen/arch/ia64/patch/linux-2.6.11/current.h | 21 -----
xen/arch/ia64/patch/linux-2.6.11/hardirq.h | 14 ---
xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c | 40 ---------
xen/arch/ia64/patch/linux-2.6.11/irq.h | 22 -----
xen/arch/ia64/patch/linux-2.6.11/kernel-time.c | 42 ----------
xen/arch/ia64/patch/linux-2.6.11/linuxextable.c | 15 ---
xen/arch/ia64/patch/linux-2.6.11/linuxtime.h | 35 --------
xen/arch/ia64/patch/linux-2.6.11/mmzone.h | 18 ----
xen/arch/ia64/patch/linux-2.6.11/sal.h | 38 ---------
xen/arch/ia64/patch/linux-2.6.11/slab.h | 18 ----
xen/arch/ia64/patch/linux-2.6.11/wait.h | 34 --------
17 files changed, 139 insertions(+), 449 deletions(-)


diff -Nru a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile
--- a/xen/arch/ia64/Makefile 2005-05-03 04:05:09 -04:00
+++ b/xen/arch/ia64/Makefile 2005-05-03 04:05:09 -04:00
@@ -6,7 +6,7 @@
xenmisc.o pdb-stub.o acpi.o hypercall.o \
machvec.o dom0_ops.o domain.o \
idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \
- sal.o cmdline.o mm_init.o tlb.o smpboot.o \
+ xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \
extable.o linuxextable.o \
regionreg.o entry.o unaligned.o privop.o vcpu.o \
irq_ia64.o irq_lsapic.o vhpt.o xenasm.o dom_fw.o
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/current.h b/xen/arch/ia64/patch/linux-2.6.11/current.h
--- a/xen/arch/ia64/patch/linux-2.6.11/current.h 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,22 +0,0 @@
- current.h | 8 ++++++++
- 1 files changed, 8 insertions(+)
-
-Index: linux-2.6.11/include/asm-ia64/current.h
-===================================================================
---- linux-2.6.11.orig/include/asm-ia64/current.h 2005-03-02 01:38:19.000000000 -0600
-+++ linux-2.6.11/include/asm-ia64/current.h 2005-03-19 12:39:41.410955288 -0600
-@@ -12,6 +12,14 @@
- * In kernel mode, thread pointer (r13) is used to point to the current task
- * structure.
- */
-+#ifdef XEN
-+struct domain;
-+#define get_current() ((struct exec_domain *) ia64_getreg(_IA64_REG_TP))
-+#define current get_current()
-+//#define set_current(d) ia64_setreg(_IA64_REG_TP,(void *)d);
-+#define set_current(d) (ia64_r13 = (void *)d)
-+#else
- #define current ((struct task_struct *) ia64_getreg(_IA64_REG_TP))
-+#endif
-
- #endif /* _ASM_IA64_CURRENT_H */
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/hardirq.h b/xen/arch/ia64/patch/linux-2.6.11/hardirq.h
--- a/xen/arch/ia64/patch/linux-2.6.11/hardirq.h 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,15 +0,0 @@
- hardirq.h | 1 +
- 1 files changed, 1 insertion(+)
-
-Index: linux-2.6.11-xendiffs/include/asm-ia64/hardirq.h
-===================================================================
---- linux-2.6.11-xendiffs.orig/include/asm-ia64/hardirq.h 2005-03-24 15:59:37.210502749 -0600
-+++ linux-2.6.11-xendiffs/include/asm-ia64/hardirq.h 2005-03-24 16:00:19.439540961 -0600
-@@ -20,6 +20,7 @@
- #define __ARCH_IRQ_STAT 1
-
- #define local_softirq_pending() (local_cpu_data->softirq_pending)
-+#define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending)
-
- #define HARDIRQ_BITS 14
-
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c b/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c
--- a/xen/arch/ia64/patch/linux-2.6.11/hpsim_irq.c 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,41 +0,0 @@
- hpsim_irq.c | 15 +++++++++++++++
- 1 files changed, 15 insertions(+)
-
-Index: linux-2.6.11/arch/ia64/hp/sim/hpsim_irq.c
-===================================================================
---- linux-2.6.11.orig/arch/ia64/hp/sim/hpsim_irq.c 2005-03-02 01:38:33.000000000 -0600
-+++ linux-2.6.11/arch/ia64/hp/sim/hpsim_irq.c 2005-03-19 13:33:57.312014806 -0600
-@@ -9,7 +9,17 @@
- #include <linux/kernel.h>
- #include <linux/sched.h>
- #include <linux/irq.h>
-+#ifdef XEN
-+#include <asm/hw_irq.h>
-+#endif
-
-+#if 1
-+void __init
-+hpsim_irq_init (void)
-+{
-+ printf("*** hpsim_irq_init called: NOT NEEDED?!?!?\n");
-+}
-+#else
- static unsigned int
- hpsim_irq_startup (unsigned int irq)
- {
-@@ -19,6 +29,10 @@ hpsim_irq_startup (unsigned int irq)
- static void
- hpsim_irq_noop (unsigned int irq)
- {
-+#if 1
-+printf("hpsim_irq_noop: irq=%d\n",irq);
-+while(irq);
-+#endif
- }
-
- static void
-@@ -49,3 +63,4 @@ hpsim_irq_init (void)
- idesc->handler = &irq_type_hp_sim;
- }
- }
-+#endif
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/irq.h b/xen/arch/ia64/patch/linux-2.6.11/irq.h
--- a/xen/arch/ia64/patch/linux-2.6.11/irq.h 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,23 +0,0 @@
- irq.h | 9 +++++++++
- 1 files changed, 9 insertions(+)
-
-Index: linux-2.6.11/include/asm-ia64/irq.h
-===================================================================
---- linux-2.6.11.orig/include/asm-ia64/irq.h 2005-03-02 01:38:33.000000000 -0600
-+++ linux-2.6.11/include/asm-ia64/irq.h 2005-03-19 13:42:27.957677364 -0600
-@@ -30,6 +30,15 @@ extern void disable_irq_nosync (unsigned
- extern void enable_irq (unsigned int);
- extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
-
-+#ifdef XEN
-+// dup'ed from signal.h to avoid changes to includes
-+#define SA_NOPROFILE 0x02000000
-+#define SA_SHIRQ 0x04000000
-+#define SA_RESTART 0x10000000
-+#define SA_INTERRUPT 0x20000000
-+#define SA_SAMPLE_RANDOM SA_RESTART
-+#endif
-+
- #ifdef CONFIG_SMP
- extern void move_irq(int irq);
- #else
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c b/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c
--- a/xen/arch/ia64/patch/linux-2.6.11/kernel-time.c 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,44 +0,0 @@
- time.c | 7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletion(-)
-
-Index: linux-2.6.11/kernel/time.c
-===================================================================
---- linux-2.6.11.orig/kernel/time.c 2005-03-02 01:37:50.000000000 -0600
-+++ linux-2.6.11/kernel/time.c 2005-03-19 14:56:40.767870674 -0600
-@@ -495,6 +495,7 @@ void getnstimeofday (struct timespec *tv
- tv->tv_nsec = nsec;
- }
-
-+#ifndef XEN
- int do_settimeofday (struct timespec *tv)
- {
- time_t wtm_sec, sec = tv->tv_sec;
-@@ -503,7 +504,9 @@ int do_settimeofday (struct timespec *tv
- if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
- return -EINVAL;
-
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
- write_seqlock_irq(&xtime_lock);
-+#endif
- {
- /*
- * This is revolting. We need to set "xtime" correctly. However, the value
-@@ -525,7 +528,9 @@ int do_settimeofday (struct timespec *tv
- time_esterror = NTP_PHASE_LIMIT;
- time_interpolator_reset();
- }
-+#ifdef TURN_ME_OFF_FOR_NOW_IA64_XEN
- write_sequnlock_irq(&xtime_lock);
-+#endif
- clock_was_set();
- return 0;
- }
-@@ -552,7 +557,7 @@ void do_gettimeofday (struct timeval *tv
- }
-
- EXPORT_SYMBOL(do_gettimeofday);
--
-+#endif
-
- #else
- /*
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c b/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c
--- a/xen/arch/ia64/patch/linux-2.6.11/linuxextable.c 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,16 +0,0 @@
- extable.c | 2 ++
- 1 files changed, 2 insertions(+)
-
-Index: linux-2.6.11-xendiffs/kernel/extable.c
-===================================================================
---- linux-2.6.11-xendiffs.orig/kernel/extable.c 2005-03-02 01:37:54.000000000 -0600
-+++ linux-2.6.11-xendiffs/kernel/extable.c 2005-04-08 14:30:46.283360881 -0500
-@@ -20,6 +20,8 @@
- #include <asm/uaccess.h>
- #include <asm/sections.h>
-
-+#define __module_text_address(addr) (NULL)
-+
- extern struct exception_table_entry __start___ex_table[];
- extern struct exception_table_entry __stop___ex_table[];
-
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h b/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h
--- a/xen/arch/ia64/patch/linux-2.6.11/linuxtime.h 2005-05-03 04:05:09 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,36 +0,0 @@
- time.h | 9 +++++++++
- 1 files changed, 9 insertions(+)
-
-Index: linux-2.6.11/include/linux/time.h
-===================================================================
---- linux-2.6.11.orig/include/linux/time.h 2005-03-02 01:38:12.000000000 -0600
-+++ linux-2.6.11/include/linux/time.h 2005-03-19 13:46:27.987225234 -0600
-@@ -1,11 +1,18 @@
- #ifndef _LINUX_TIME_H
- #define _LINUX_TIME_H
-
-+#ifdef XEN
-+typedef s64 time_t;
-+typedef s64 suseconds_t;
-+#endif
-+
- #include <linux/types.h>
-
-+#ifndef XEN
- #ifdef __KERNEL__
- #include <linux/seqlock.h>
- #endif
-+#endif
-
- #ifndef _STRUCT_TIMESPEC
- #define _STRUCT_TIMESPEC
-@@ -80,7 +87,9 @@ mktime (unsigned int year, unsigned int
-
- extern struct timespec xtime;
- extern struct timespec wall_to_monotonic;
-+#ifndef XEN
- extern seqlock_t xtime_lock;
-+#endif
-
- static inline unsigned long get_seconds(void)
- {
diff -Nru a/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c b/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c
--- a/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c 2005-05-03 04:05:09 -04:00
+++ b/xen/arch/ia64/patch/linux-2.6.11/mm_contig.c 2005-05-03 04:05:09 -04:00
@@ -1,220 +1,47 @@
- contig.c | 172 +++++++++++++++++----------------------------------------------
- 1 files changed, 48 insertions(+), 124 deletions(-)
-
-Index: linux-2.6.11-xendiffs/arch/ia64/mm/contig.c
-===================================================================
---- linux-2.6.11-xendiffs.orig/arch/ia64/mm/contig.c 2005-04-07 11:02:50.227598140 -0500
-+++ linux-2.6.11-xendiffs/arch/ia64/mm/contig.c 2005-04-07 11:05:21.724931959 -0500
-@@ -15,11 +15,21 @@
- * memory.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
More code cleanup [ In reply to ]
ChangeSet 1.1327.1.14, 2005/04/29 16:09:13-06:00, djm@kirby.fc.hp.com

More code cleanup



b/xen/arch/ia64/Makefile | 2
b/xen/arch/ia64/ivt.S | 1870 ++++++++++++++++++++++++++
b/xen/arch/ia64/patch/linux-2.6.11/efi.c | 29
b/xen/arch/ia64/patch/linux-2.6.11/entry.S | 170 +-
b/xen/arch/ia64/patch/linux-2.6.11/irq_ia64.c | 103 -
b/xen/arch/ia64/tools/mkbuildtree | 7
b/xen/arch/ia64/xenirq.c | 77 +
xen/arch/ia64/patch/linux-2.6.11/bootmem.h | 16
xen/arch/ia64/patch/linux-2.6.11/hpsim_ssc.h | 30
xen/arch/ia64/patch/linux-2.6.11/ivt.S | 532 -------
xen/arch/ia64/patch/linux-2.6.11/lds.S | 21
11 files changed, 2048 insertions(+), 809 deletions(-)


diff -Nru a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile
--- a/xen/arch/ia64/Makefile 2005-05-03 04:06:42 -04:00
+++ b/xen/arch/ia64/Makefile 2005-05-03 04:06:42 -04:00
@@ -7,7 +7,7 @@
machvec.o dom0_ops.o domain.o \
idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \
xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \
- extable.o linuxextable.o \
+ extable.o linuxextable.o xenirq.o \
regionreg.o entry.o unaligned.o privop.o vcpu.o \
irq_ia64.o irq_lsapic.o vhpt.o xenasm.o dom_fw.o
# perfmon.o
diff -Nru a/xen/arch/ia64/ivt.S b/xen/arch/ia64/ivt.S
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/xen/arch/ia64/ivt.S 2005-05-03 04:06:42 -04:00
@@ -0,0 +1,1870 @@
+
+#ifdef XEN
+//#define CONFIG_DISABLE_VHPT // FIXME: change when VHPT is enabled??
+// these are all hacked out for now as the entire IVT
+// will eventually be replaced... just want to use it
+// for startup code to handle TLB misses
+//#define ia64_leave_kernel 0
+//#define ia64_ret_from_syscall 0
+//#define ia64_handle_irq 0
+//#define ia64_fault 0
+#define ia64_illegal_op_fault 0
+#define ia64_prepare_handle_unaligned 0
+#define ia64_bad_break 0
+#define ia64_trace_syscall 0
+#define sys_call_table 0
+#define sys_ni_syscall 0
+#include <asm/vhpt.h>
+#endif
+/*
+ * arch/ia64/kernel/ivt.S
+ *
+ * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
+ * Stephane Eranian <eranian@hpl.hp.com>
+ * David Mosberger <davidm@hpl.hp.com>
+ * Copyright (C) 2000, 2002-2003 Intel Co
+ * Asit Mallick <asit.k.mallick@intel.com>
+ * Suresh Siddha <suresh.b.siddha@intel.com>
+ * Kenneth Chen <kenneth.w.chen@intel.com>
+ * Fenghua Yu <fenghua.yu@intel.com>
+ *
+ * 00/08/23 Asit Mallick <asit.k.mallick@intel.com> TLB handling for SMP
+ * 00/12/20 David Mosberger-Tang <davidm@hpl.hp.com> DTLB/ITLB handler now uses virtual PT.
+ */
+/*
+ * This file defines the interruption vector table used by the CPU.
+ * It does not include one entry per possible cause of interruption.
+ *
+ * The first 20 entries of the table contain 64 bundles each while the
+ * remaining 48 entries contain only 16 bundles each.
+ *
+ * The 64 bundles are used to allow inlining the whole handler for critical
+ * interruptions like TLB misses.
+ *
+ * For each entry, the comment is as follows:
+ *
+ * // 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51)
+ * entry offset ----/ / / / /
+ * entry number ---------/ / / /
+ * size of the entry -------------/ / /
+ * vector name -------------------------------------/ /
+ * interruptions triggering this vector ----------------------/
+ *
+ * The table is 32KB in size and must be aligned on 32KB boundary.
+ * (The CPU ignores the 15 lower bits of the address)
+ *
+ * Table is based upon EAS2.6 (Oct 1999)
+ */
+
+#include <linux/config.h>
+
+#include <asm/asmmacro.h>
+#include <asm/break.h>
+#include <asm/ia32.h>
+#include <asm/kregs.h>
+#include <asm/offsets.h>
+#include <asm/pgtable.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/thread_info.h>
+#include <asm/unistd.h>
+#include <asm/errno.h>
+
+#if 1
+# define PSR_DEFAULT_BITS psr.ac
+#else
+# define PSR_DEFAULT_BITS 0
+#endif
+
+#if 0
+ /*
+ * This lets you track the last eight faults that occurred on the CPU. Make sure ar.k2 isn't
+ * needed for something else before enabling this...
+ */
+# define DBG_FAULT(i) mov r16=ar.k2;; shl r16=r16,8;; add r16=(i),r16;;mov ar.k2=r16
+#else
+# define DBG_FAULT(i)
+#endif
+
+#define MINSTATE_VIRT /* needed by minstate.h */
+#include "minstate.h"
+
+#define FAULT(n) \
+ mov r31=pr; \
+ mov r19=n;; /* prepare to save predicates */ \
+ br.sptk.many dispatch_to_fault_handler
+
+#ifdef XEN
+#define REFLECT(n) \
+ mov r31=pr; \
+ mov r19=n;; /* prepare to save predicates */ \
+ br.sptk.many dispatch_reflection
+#endif
+
+ .section .text.ivt,"ax"
+
+ .align 32768 // align on 32KB boundary
+ .global ia64_ivt
+ia64_ivt:
+/////////////////////////////////////////////////////////////////////////////////////////
+// 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47)
+ENTRY(vhpt_miss)
+ DBG_FAULT(0)
+ /*
+ * The VHPT vector is invoked when the TLB entry for the virtual page table
+ * is missing. This happens only as a result of a previous
+ * (the "original") TLB miss, which may either be caused by an instruction
+ * fetch or a data access (or non-access).
+ *
+ * What we do here is normal TLB miss handing for the _original_ miss, followed
+ * by inserting the TLB entry for the virtual page table page that the VHPT
+ * walker was attempting to access. The latter gets inserted as long
+ * as both L1 and L2 have valid mappings for the faulting address.
+ * The TLB entry for the original miss gets inserted only if
+ * the L3 entry indicates that the page is present.
+ *
+ * do_page_fault gets invoked in the following cases:
+ * - the faulting virtual address uses unimplemented address bits
+ * - the faulting virtual address has no L1, L2, or L3 mapping
+ */
+ mov r16=cr.ifa // get address that caused the TLB miss
+#ifdef CONFIG_HUGETLB_PAGE
+ movl r18=PAGE_SHIFT
+ mov r25=cr.itir
+#endif
+ ;;
+ rsm psr.dt // use physical addressing for data
+ mov r31=pr // save the predicate registers
+ mov r19=IA64_KR(PT_BASE) // get page table base address
+ shl r21=r16,3 // shift bit 60 into sign bit
+ shr.u r17=r16,61 // get the region number into r17
+ ;;
+ shr r22=r21,3
+#ifdef CONFIG_HUGETLB_PAGE
+ extr.u r26=r25,2,6
+ ;;
+ cmp.ne p8,p0=r18,r26
+ sub r27=r26,r18
+ ;;
+(p8) dep r25=r18,r25,2,6
+(p8) shr r22=r22,r27
+#endif
+ ;;
+ cmp.eq p6,p7=5,r17 // is IFA pointing into to region 5?
+ shr.u r18=r22,PGDIR_SHIFT // get bits 33-63 of the faulting address
+ ;;
+(p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place
+
+ srlz.d
+ LOAD_PHYSICAL(p6, r19, swapper_pg_dir) // region 5 is rooted at swapper_pg_dir
+
+ .pred.rel "mutex", p6, p7
+(p6) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT
+(p7) shr.u r21=r21,PGDIR_SHIFT+PAGE_SHIFT-3
+ ;;
+(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8
+(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)
+ cmp.eq p7,p6=0,r21 // unused address bits all zeroes?
+ shr.u r18=r22,PMD_SHIFT // shift L2 index into position
+ ;;
+ ld8 r17=[r17] // fetch the L1 entry (may be 0)
+ ;;
+(p7) cmp.eq p6,p7=r17,r0 // was L1 entry NULL?
+ dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry
+ ;;
+(p7) ld8 r20=[r17] // fetch the L2 entry (may be 0)
+ shr.u r19=r22,PAGE_SHIFT // shift L3 index into position
+ ;;
+(p7) cmp.eq.or.andcm p6,p7=r20,r0 // was L2 entry NULL?
+ dep r21=r19,r20,3,(PAGE_SHIFT-3) // compute address of L3 page table entry
+ ;;
+(p7) ld8 r18=[r21] // read the L3 PTE
+ mov r19=cr.isr // cr.isr bit 0 tells us if this is an insn miss
+ ;;
+(p7) tbit.z p6,p7=r18,_PAGE_P_BIT // page present bit cleared?
+ mov r22=cr.iha // get the VHPT address that caused the TLB miss
+ ;; // avoid RAW on p7
+(p7) tbit.nz.unc p10,p11=r19,32 // is it an instruction TLB miss?
+ dep r23=0,r20,0,PAGE_SHIFT // clear low bits to get page address
+ ;;
+(p10) itc.i r18 // insert the instruction TLB entry
+(p11) itc.d r18 // insert the data TLB entry
+(p6) br.cond.spnt.many page_fault // handle bad address/page not present (page fault)
+ mov cr.ifa=r22
+
+#ifdef CONFIG_HUGETLB_PAGE
+(p8) mov cr.itir=r25 // change to default page-size for VHPT
+#endif
+
+ /*
+ * Now compute and insert the TLB entry for the virtual page table. We never
+ * execute in a page table page so there is no need to set the exception deferral
+ * bit.
+ */
+ adds r24=__DIRTY_BITS_NO_ED|_PAGE_PL_0|_PAGE_AR_RW,r23
+ ;;
+(p7) itc.d r24
+ ;;
+#ifdef CONFIG_SMP
+ /*
+ * Tell the assemblers dependency-violation checker that the above "itc" instructions
+ * cannot possibly affect the following loads:
+ */
+ dv_serialize_data
+
+ /*
+ * Re-check L2 and L3 pagetable. If they changed, we may have received a ptc.g
+ * between reading the pagetable and the "itc". If so, flush the entry we
+ * inserted and retry.
+ */
+ ld8 r25=[r21] // read L3 PTE again
+ ld8 r26=[r17] // read L2 entry again
+ ;;
+ cmp.ne p6,p7=r26,r20 // did L2 entry change
+ mov r27=PAGE_SHIFT<<2
+ ;;
+(p6) ptc.l r22,r27 // purge PTE page translation
+(p7) cmp.ne.or.andcm p6,p7=r25,r18 // did L3 PTE change
+ ;;
+(p6) ptc.l r16,r27 // purge translation
+#endif
+
+ mov pr=r31,-1 // restore predicate registers
+ rfi

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog