WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [IA64] cleanup in regionreg.c

# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID cc94ab1e0de09c9cb557492719de1fac3a3fbf10
# Parent  2133fb78dba3cf6b6b88d1566fc5cc9de3039f43
[IA64] cleanup in regionreg.c

get_impl_rid_bits: use pal call to get implemented_rid_bits.
clean up in regionreg.c

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>

diff -r 2133fb78dba3 -r cc94ab1e0de0 xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c       Wed Apr 05 12:19:52 2006 -0600
+++ b/xen/arch/ia64/xen/process.c       Thu Apr 06 15:51:59 2006 -0600
@@ -37,15 +37,12 @@
 
 extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
 /* FIXME: where these declarations shold be there ? */
-extern void load_region_regs(struct vcpu *);
 extern void panic_domain(struct pt_regs *, const char *, ...);
 extern long platform_is_hp_ski(void);
 extern int ia64_hyperprivop(unsigned long, REGS *);
 extern int ia64_hypercall(struct pt_regs *regs);
 extern void vmx_do_launch(struct vcpu *);
 extern unsigned long lookup_domain_mpa(struct domain *,unsigned long);
-
-extern unsigned long dom0_start, dom0_size;
 
 #define IA64_PSR_CPL1  (__IA64_UL(1) << IA64_PSR_CPL1_BIT)
 // note IA64_PSR_PK removed from following, why is this necessary?
diff -r 2133fb78dba3 -r cc94ab1e0de0 xen/arch/ia64/xen/regionreg.c
--- a/xen/arch/ia64/xen/regionreg.c     Wed Apr 05 12:19:52 2006 -0600
+++ b/xen/arch/ia64/xen/regionreg.c     Thu Apr 06 15:51:59 2006 -0600
@@ -52,7 +52,7 @@ ia64_set_rr (unsigned long rr, unsigned 
 #endif
 
 // use this to allocate a rid out of the "Xen reserved rid block"
-unsigned long allocate_reserved_rid(void)
+static unsigned long allocate_reserved_rid(void)
 {
        static unsigned long currentrid = XEN_DEFAULT_RID+1;
        unsigned long t = currentrid;
@@ -91,14 +91,14 @@ static int implemented_rid_bits = 0;
 static int implemented_rid_bits = 0;
 static struct domain *ridblock_owner[MAX_RID_BLOCKS] = { 0 };
 
-void get_impl_rid_bits(void)
-{
-       // FIXME (call PAL)
-//#ifdef CONFIG_MCKINLEY
-       implemented_rid_bits = IA64_MAX_IMPL_RID_BITS;
-//#else
-//#error "rid ranges won't work on Merced"
-//#endif
+static void get_impl_rid_bits(void)
+{
+       pal_vm_info_2_u_t vm_info_2;
+
+       /* Get machine rid_size.  */
+       BUG_ON (ia64_pal_vm_summary (NULL, &vm_info_2) != 0);
+       implemented_rid_bits = vm_info_2.pal_vm_info_2_s.rid_size;
+
        if (implemented_rid_bits <= IA64_MIN_IMPL_RID_BITS ||
            implemented_rid_bits > IA64_MAX_IMPL_RID_BITS)
                BUG();
@@ -177,29 +177,11 @@ int deallocate_rid_range(struct domain *
        return 1;
 }
 
-
-static inline void
-set_rr_no_srlz(unsigned long rr, unsigned long rrval)
-{
-       ia64_set_rr(rr, vmMangleRID(rrval));
-}
-
-void
+static void
 set_rr(unsigned long rr, unsigned long rrval)
 {
        ia64_set_rr(rr, vmMangleRID(rrval));
        ia64_srlz_d();
-}
-
-static inline int validate_page_size(unsigned long ps)
-{
-       switch(ps) {
-           case 12: case 13: case 14: case 16: case 18:
-           case 20: case 22: case 24: case 26: case 28:
-               return 1;
-           default:
-               return 0;
-       }
 }
 
 // validates and changes a single region register
@@ -280,8 +262,8 @@ int set_metaphysical_rr0(void)
 // validates/changes region registers 0-6 in the currently executing domain
 // Note that this is the one and only SP API (other than executing a privop)
 // for a domain to use to change region registers
-int set_all_rr( u64 rr0, u64 rr1, u64 rr2, u64 rr3,
-                    u64 rr4, u64 rr5, u64 rr6, u64 rr7)
+static int set_all_rr(u64 rr0, u64 rr1, u64 rr2, u64 rr3,
+                     u64 rr4, u64 rr5, u64 rr6, u64 rr7)
 {
        if (!set_one_rr(0x0000000000000000L, rr0)) return 0;
        if (!set_one_rr(0x2000000000000000L, rr1)) return 0;
@@ -316,25 +298,6 @@ if (!v->vcpu_info) { printf("Stopping in
 
 
 /* XEN/ia64 INTERNAL ROUTINES */
-
-unsigned long physicalize_rid(struct vcpu *v, unsigned long rrval)
-{
-       ia64_rr rrv;
-           
-       rrv.rrval = rrval;
-       rrv.rid += v->arch.starting_rid;
-       return rrv.rrval;
-}
-
-unsigned long
-virtualize_rid(struct vcpu *v, unsigned long rrval)
-{
-       ia64_rr rrv;
-           
-       rrv.rrval = rrval;
-       rrv.rid -= v->arch.starting_rid;
-       return rrv.rrval;
-}
 
 // loads a thread's region register (0-6) state into
 // the real physical region registers.  Returns the
diff -r 2133fb78dba3 -r cc94ab1e0de0 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Wed Apr 05 12:19:52 2006 -0600
+++ b/xen/arch/ia64/xen/vcpu.c  Thu Apr 06 15:51:59 2006 -0600
@@ -23,7 +23,6 @@ extern void getreg(unsigned long regnum,
 extern void getreg(unsigned long regnum, unsigned long *val, int *nat, struct 
pt_regs *regs);
 extern void setreg(unsigned long regnum, unsigned long val, int nat, struct 
pt_regs *regs);
 extern void panic_domain(struct pt_regs *, const char *, ...);
-extern int set_metaphysical_rr0(void);
 extern unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
 extern unsigned long translate_domain_mpaddr(unsigned long);
 extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
diff -r 2133fb78dba3 -r cc94ab1e0de0 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Wed Apr 05 12:19:52 2006 -0600
+++ b/xen/arch/ia64/xen/xenmisc.c       Thu Apr 06 15:51:59 2006 -0600
@@ -29,7 +29,6 @@ unsigned long loops_per_jiffy = (1<<12);
 unsigned long loops_per_jiffy = (1<<12);       // from linux/init/main.c
 
 /* FIXME: where these declarations should be there ? */
-extern void load_region_regs(struct vcpu *);
 extern void show_registers(struct pt_regs *regs);
 
 void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check 
abort handling)\n"); }
diff -r 2133fb78dba3 -r cc94ab1e0de0 xen/include/asm-ia64/regionreg.h
--- a/xen/include/asm-ia64/regionreg.h  Wed Apr 05 12:19:52 2006 -0600
+++ b/xen/include/asm-ia64/regionreg.h  Thu Apr 06 15:51:59 2006 -0600
@@ -65,6 +65,7 @@ vmMangleRID(unsigned long RIDVal)
 #define vmUnmangleRID(x)       vmMangleRID(x)
 
 extern unsigned long allocate_metaphysical_rr(void);
+extern int deallocate_metaphysical_rid(unsigned long rid);
 
 struct domain;
 extern int allocate_rid_range(struct domain *d, unsigned long ridbits);
@@ -73,4 +74,8 @@ struct vcpu;
 struct vcpu;
 extern void init_all_rr(struct vcpu *v);
 
+extern int set_metaphysical_rr0(void);
+
+extern void load_region_regs(struct vcpu *v);
+
 #endif         /* !_REGIONREG_H_ */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] cleanup in regionreg.c, Xen patchbot -unstable <=