# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 08378b83ea1e9df6e549544eaee3116b7fe8861b
# Parent fbc0e953732ef78292d9e87ff6dd7f3432ddd014
[IA64] cleanup
Disable a privify path.
Cleanup: warnings and static.
Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
---
xen/arch/ia64/linux-xen/time.c | 5 ++
xen/arch/ia64/vmx/vmmu.c | 6 ++-
xen/arch/ia64/xen/faults.c | 19 +++++----
xen/arch/ia64/xen/privop.c | 78 +++++++++++++++++++++--------------------
xen/include/asm-ia64/config.h | 12 +-----
5 files changed, 63 insertions(+), 57 deletions(-)
diff -r fbc0e953732e -r 08378b83ea1e xen/arch/ia64/linux-xen/time.c
--- a/xen/arch/ia64/linux-xen/time.c Thu Jun 15 10:23:57 2006 -0600
+++ b/xen/arch/ia64/linux-xen/time.c Fri Jun 16 09:06:40 2006 -0600
@@ -204,7 +204,12 @@ ia64_init_itm (void)
printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, "
"ITC freq=%lu.%03luMHz", smp_processor_id(),
platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000,
+#ifdef XEN
+ (u64)itc_ratio.num, (u64)itc_ratio.den,
+ itc_freq / 1000000, (itc_freq / 1000) % 1000);
+#else
itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq /
1000) % 1000);
+#endif
if (platform_base_drift != -1) {
itc_drift = platform_base_drift*itc_ratio.num/itc_ratio.den;
diff -r fbc0e953732e -r 08378b83ea1e xen/arch/ia64/vmx/vmmu.c
--- a/xen/arch/ia64/vmx/vmmu.c Thu Jun 15 10:23:57 2006 -0600
+++ b/xen/arch/ia64/vmx/vmmu.c Fri Jun 16 09:06:40 2006 -0600
@@ -504,16 +504,18 @@ static void ptc_ga_remote_func (void *va
static void ptc_ga_remote_func (void *varg)
{
u64 oldrid, moldrid;
- VCPU *v;
struct ptc_ga_args *args = (struct ptc_ga_args *)varg;
- v = args->vcpu;
+ VCPU *v = args->vcpu;
+
oldrid = VMX(v, vrr[0]);
VMX(v, vrr[0]) = args->rid;
moldrid = ia64_get_rr(0x0);
ia64_set_rr(0x0,vrrtomrr(v,args->rid));
+ ia64_srlz_d();
vmx_vcpu_ptc_l(v, args->vadr, args->ps);
VMX(v, vrr[0]) = oldrid;
ia64_set_rr(0x0,moldrid);
+ ia64_dv_serialize_data();
}
diff -r fbc0e953732e -r 08378b83ea1e xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c Thu Jun 15 10:23:57 2006 -0600
+++ b/xen/arch/ia64/xen/faults.c Fri Jun 16 09:06:40 2006 -0600
@@ -372,14 +372,16 @@ ia64_fault (unsigned long vector, unsign
{
struct pt_regs *regs = (struct pt_regs *) &stack;
unsigned long code;
- static const char *reason[] = {
+ static const char * const reason[] = {
"IA-64 Illegal Operation fault",
"IA-64 Privileged Operation fault",
"IA-64 Privileged Register fault",
"IA-64 Reserved Register/Field fault",
"Disabled Instruction Set Transition fault",
- "Unknown fault 5", "Unknown fault 6", "Unknown fault 7",
"Illegal Hazard fault",
- "Unknown fault 9", "Unknown fault 10", "Unknown fault 11",
"Unknown fault 12",
+ "Unknown fault 5", "Unknown fault 6",
+ "Unknown fault 7", "Illegal Hazard fault",
+ "Unknown fault 9", "Unknown fault 10",
+ "Unknown fault 11", "Unknown fault 12",
"Unknown fault 13", "Unknown fault 14", "Unknown fault 15"
};
@@ -566,10 +568,6 @@ ia64_handle_privop (unsigned long ifa, s
}
}
-/* Used in vhpt.h. */
-#define INTR_TYPE_MAX 10
-UINT64 int_counts[INTR_TYPE_MAX];
-
void
ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long
isr, unsigned long iim, unsigned long vector)
{
@@ -578,7 +576,7 @@ ia64_handle_reflection (unsigned long if
unsigned long psr = regs->cr_ipsr;
/* Following faults shouldn'g be seen from Xen itself */
- if (!(psr & IA64_PSR_CPL)) BUG();
+ BUG_ON (!(psr & IA64_PSR_CPL));
switch(vector) {
case 8:
@@ -601,6 +599,7 @@ ia64_handle_reflection (unsigned long if
break;
case 26:
if (((isr >> 4L) & 0xfL) == 1) {
+ /* Fault is due to a register NaT consumption fault. */
//regs->eml_unat = 0; FIXME: DO WE NEED THIS??
printf("ia64_handle_reflection: handling regNaT
fault\n");
vector = IA64_NAT_CONSUMPTION_VECTOR; break;
@@ -612,6 +611,9 @@ ia64_handle_reflection (unsigned long if
vector = IA64_NAT_CONSUMPTION_VECTOR; break;
}
#endif
+#ifdef CONFIG_PRIVIFY
+ /* Some privified operations are coded using reg+64 instead
+ of reg. */
printf("*** NaT fault... attempting to handle as privop\n");
printf("isr=%016lx, ifa=%016lx, iip=%016lx, ipsr=%016lx\n",
isr, ifa, regs->cr_iip, psr);
@@ -622,6 +624,7 @@ ia64_handle_reflection (unsigned long if
printf("*** Handled privop masquerading as NaT
fault\n");
return;
}
+#endif
vector = IA64_NAT_CONSUMPTION_VECTOR; break;
case 27:
//printf("*** Handled speculation vector,
itc=%lx!\n",ia64_get_itc());
diff -r fbc0e953732e -r 08378b83ea1e xen/arch/ia64/xen/privop.c
--- a/xen/arch/ia64/xen/privop.c Thu Jun 15 10:23:57 2006 -0600
+++ b/xen/arch/ia64/xen/privop.c Fri Jun 16 09:06:40 2006 -0600
@@ -12,7 +12,6 @@
#include <asm/delay.h> // Debug only
#include <asm/dom_fw.h>
#include <asm/vhpt.h>
-//#include <debug.h>
/* FIXME: where these declarations should be there ? */
extern int dump_reflect_counts(char *);
@@ -21,12 +20,15 @@ long priv_verbose=0;
long priv_verbose=0;
/* Set to 1 to handle privified instructions from the privify tool. */
+#ifndef CONFIG_PRIVIFY
static const int privify_en = 0;
+#else
+static const int privify_en = 1;
+#endif
/**************************************************************************
Hypercall bundle creation
**************************************************************************/
-
void build_hypercall_bundle(UINT64 *imva, UINT64 brkimm, UINT64 hypnum, UINT64
ret)
{
@@ -106,27 +108,27 @@ Privileged operation emulation routines
Privileged operation emulation routines
**************************************************************************/
-IA64FAULT priv_rfi(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_rfi(VCPU *vcpu, INST64 inst)
{
return vcpu_rfi(vcpu);
}
-IA64FAULT priv_bsw0(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_bsw0(VCPU *vcpu, INST64 inst)
{
return vcpu_bsw0(vcpu);
}
-IA64FAULT priv_bsw1(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_bsw1(VCPU *vcpu, INST64 inst)
{
return vcpu_bsw1(vcpu);
}
-IA64FAULT priv_cover(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_cover(VCPU *vcpu, INST64 inst)
{
return vcpu_cover(vcpu);
}
-IA64FAULT priv_ptc_l(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptc_l(VCPU *vcpu, INST64 inst)
{
UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
UINT64 log_range;
@@ -135,7 +137,7 @@ IA64FAULT priv_ptc_l(VCPU *vcpu, INST64
return vcpu_ptc_l(vcpu,vadr,log_range);
}
-IA64FAULT priv_ptc_e(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptc_e(VCPU *vcpu, INST64 inst)
{
UINT src = inst.M28.r3;
@@ -145,7 +147,7 @@ IA64FAULT priv_ptc_e(VCPU *vcpu, INST64
return vcpu_ptc_e(vcpu,vcpu_get_gr(vcpu,src));
}
-IA64FAULT priv_ptc_g(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptc_g(VCPU *vcpu, INST64 inst)
{
UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
UINT64 addr_range;
@@ -154,7 +156,7 @@ IA64FAULT priv_ptc_g(VCPU *vcpu, INST64
return vcpu_ptc_g(vcpu,vadr,addr_range);
}
-IA64FAULT priv_ptc_ga(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptc_ga(VCPU *vcpu, INST64 inst)
{
UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
UINT64 addr_range;
@@ -163,7 +165,7 @@ IA64FAULT priv_ptc_ga(VCPU *vcpu, INST64
return vcpu_ptc_ga(vcpu,vadr,addr_range);
}
-IA64FAULT priv_ptr_d(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptr_d(VCPU *vcpu, INST64 inst)
{
UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
UINT64 log_range;
@@ -172,7 +174,7 @@ IA64FAULT priv_ptr_d(VCPU *vcpu, INST64
return vcpu_ptr_d(vcpu,vadr,log_range);
}
-IA64FAULT priv_ptr_i(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ptr_i(VCPU *vcpu, INST64 inst)
{
UINT64 vadr = vcpu_get_gr(vcpu,inst.M45.r3);
UINT64 log_range;
@@ -181,7 +183,7 @@ IA64FAULT priv_ptr_i(VCPU *vcpu, INST64
return vcpu_ptr_i(vcpu,vadr,log_range);
}
-IA64FAULT priv_tpa(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_tpa(VCPU *vcpu, INST64 inst)
{
UINT64 padr;
UINT fault;
@@ -196,7 +198,7 @@ IA64FAULT priv_tpa(VCPU *vcpu, INST64 in
else return fault;
}
-IA64FAULT priv_tak(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_tak(VCPU *vcpu, INST64 inst)
{
UINT64 key;
UINT fault;
@@ -215,7 +217,7 @@ IA64FAULT priv_tak(VCPU *vcpu, INST64 in
* Insert translation register/cache
************************************/
-IA64FAULT priv_itr_d(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_itr_d(VCPU *vcpu, INST64 inst)
{
UINT64 fault, itir, ifa, pte, slot;
@@ -230,7 +232,7 @@ IA64FAULT priv_itr_d(VCPU *vcpu, INST64
return (vcpu_itr_d(vcpu,slot,pte,itir,ifa));
}
-IA64FAULT priv_itr_i(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_itr_i(VCPU *vcpu, INST64 inst)
{
UINT64 fault, itir, ifa, pte, slot;
@@ -245,7 +247,7 @@ IA64FAULT priv_itr_i(VCPU *vcpu, INST64
return (vcpu_itr_i(vcpu,slot,pte,itir,ifa));
}
-IA64FAULT priv_itc_d(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_itc_d(VCPU *vcpu, INST64 inst)
{
UINT64 fault, itir, ifa, pte;
@@ -259,7 +261,7 @@ IA64FAULT priv_itc_d(VCPU *vcpu, INST64
return (vcpu_itc_d(vcpu,pte,itir,ifa));
}
-IA64FAULT priv_itc_i(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_itc_i(VCPU *vcpu, INST64 inst)
{
UINT64 fault, itir, ifa, pte;
@@ -277,7 +279,7 @@ IA64FAULT priv_itc_i(VCPU *vcpu, INST64
* Moves to semi-privileged registers
*************************************/
-IA64FAULT priv_mov_to_ar_imm(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_ar_imm(VCPU *vcpu, INST64 inst)
{
// I27 and M30 are identical for these fields
UINT64 ar3 = inst.M30.ar3;
@@ -285,7 +287,7 @@ IA64FAULT priv_mov_to_ar_imm(VCPU *vcpu,
return (vcpu_set_ar(vcpu,ar3,imm));
}
-IA64FAULT priv_mov_to_ar_reg(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_ar_reg(VCPU *vcpu, INST64 inst)
{
// I26 and M29 are identical for these fields
UINT64 ar3 = inst.M29.ar3;
@@ -307,42 +309,42 @@ IA64FAULT priv_mov_to_ar_reg(VCPU *vcpu,
* Moves to privileged registers
********************************/
-IA64FAULT priv_mov_to_pkr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_pkr(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
return (vcpu_set_pkr(vcpu,r3,r2));
}
-IA64FAULT priv_mov_to_rr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_rr(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
return (vcpu_set_rr(vcpu,r3,r2));
}
-IA64FAULT priv_mov_to_dbr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_dbr(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
return (vcpu_set_dbr(vcpu,r3,r2));
}
-IA64FAULT priv_mov_to_ibr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_ibr(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
return (vcpu_set_ibr(vcpu,r3,r2));
}
-IA64FAULT priv_mov_to_pmc(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_pmc(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
return (vcpu_set_pmc(vcpu,r3,r2));
}
-IA64FAULT priv_mov_to_pmd(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_pmd(VCPU *vcpu, INST64 inst)
{
UINT64 r3 = vcpu_get_gr(vcpu,inst.M42.r3);
UINT64 r2 = vcpu_get_gr(vcpu,inst.M42.r2);
@@ -351,7 +353,7 @@ IA64FAULT priv_mov_to_pmd(VCPU *vcpu, IN
unsigned long to_cr_cnt[128] = { 0 };
-IA64FAULT priv_mov_to_cr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_cr(VCPU *vcpu, INST64 inst)
{
UINT64 val = vcpu_get_gr(vcpu, inst.M32.r2);
to_cr_cnt[inst.M32.cr3]++;
@@ -386,13 +388,13 @@ IA64FAULT priv_mov_to_cr(VCPU *vcpu, INS
}
}
-IA64FAULT priv_rsm(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_rsm(VCPU *vcpu, INST64 inst)
{
UINT64 imm24 = (inst.M44.i<<23)|(inst.M44.i2<<21)|inst.M44.imm;
return vcpu_reset_psr_sm(vcpu,imm24);
}
-IA64FAULT priv_ssm(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_ssm(VCPU *vcpu, INST64 inst)
{
UINT64 imm24 = (inst.M44.i<<23)|(inst.M44.i2<<21)|inst.M44.imm;
return vcpu_set_psr_sm(vcpu,imm24);
@@ -401,7 +403,7 @@ IA64FAULT priv_ssm(VCPU *vcpu, INST64 in
/**
* @todo Check for reserved bits and return IA64_RSVDREG_FAULT.
*/
-IA64FAULT priv_mov_to_psr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_to_psr(VCPU *vcpu, INST64 inst)
{
UINT64 val = vcpu_get_gr(vcpu, inst.M35.r2);
return vcpu_set_psr_l(vcpu,val);
@@ -411,7 +413,7 @@ IA64FAULT priv_mov_to_psr(VCPU *vcpu, IN
* Moves from privileged registers
**********************************/
-IA64FAULT priv_mov_from_rr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_rr(VCPU *vcpu, INST64 inst)
{
UINT64 val;
IA64FAULT fault;
@@ -432,7 +434,7 @@ IA64FAULT priv_mov_from_rr(VCPU *vcpu, I
return fault;
}
-IA64FAULT priv_mov_from_pkr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_pkr(VCPU *vcpu, INST64 inst)
{
UINT64 val;
IA64FAULT fault;
@@ -443,7 +445,7 @@ IA64FAULT priv_mov_from_pkr(VCPU *vcpu,
else return fault;
}
-IA64FAULT priv_mov_from_dbr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_dbr(VCPU *vcpu, INST64 inst)
{
UINT64 val;
IA64FAULT fault;
@@ -454,7 +456,7 @@ IA64FAULT priv_mov_from_dbr(VCPU *vcpu,
else return fault;
}
-IA64FAULT priv_mov_from_ibr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_ibr(VCPU *vcpu, INST64 inst)
{
UINT64 val;
IA64FAULT fault;
@@ -465,7 +467,7 @@ IA64FAULT priv_mov_from_ibr(VCPU *vcpu,
else return fault;
}
-IA64FAULT priv_mov_from_pmc(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_pmc(VCPU *vcpu, INST64 inst)
{
UINT64 val;
IA64FAULT fault;
@@ -492,7 +494,7 @@ unsigned long from_cr_cnt[128] = { 0 };
((fault = vcpu_get_##cr(vcpu,&val)) == IA64_NO_FAULT) ? \
vcpu_set_gr(vcpu, tgt, val, 0) : fault;
-IA64FAULT priv_mov_from_cr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_cr(VCPU *vcpu, INST64 inst)
{
UINT64 tgt = inst.M33.r1;
UINT64 val;
@@ -531,7 +533,7 @@ IA64FAULT priv_mov_from_cr(VCPU *vcpu, I
return IA64_ILLOP_FAULT;
}
-IA64FAULT priv_mov_from_psr(VCPU *vcpu, INST64 inst)
+static IA64FAULT priv_mov_from_psr(VCPU *vcpu, INST64 inst)
{
UINT64 tgt = inst.M33.r1;
UINT64 val;
@@ -601,7 +603,7 @@ struct {
unsigned long privop_trace = 0;
-IA64FAULT
+static IA64FAULT
priv_handle_op(VCPU *vcpu, REGS *regs, int privlvl)
{
IA64_BUNDLE bundle;
diff -r fbc0e953732e -r 08378b83ea1e xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h Thu Jun 15 10:23:57 2006 -0600
+++ b/xen/include/asm-ia64/config.h Fri Jun 16 09:06:40 2006 -0600
@@ -1,9 +1,6 @@
#ifndef _IA64_CONFIG_H_
#define _IA64_CONFIG_H_
-#undef USE_PAL_EMULATOR
-// control flags for turning on/off features under test
-#undef DOMU_BUILD_STAGING
#define VHPT_GLOBAL
#undef DEBUG_PFMON
@@ -170,12 +167,6 @@ void sort_extable(struct exception_table
struct exception_table_entry *finish);
void sort_main_extable(void);
-#if 0 /* Already defined in xen/lib.h */
-#define printk printf
-#endif
-
-#undef __ARCH_IRQ_STAT
-
#define find_first_set_bit(x) (ffs(x)-1) // FIXME: Is this right???
// see drivers/char/console.c
@@ -278,4 +269,7 @@ struct screen_info { };
Old as doesn't handle this. */
#define HAVE_SERIALIZE_DIRECTIVE
+/* Define CONFIG_PRIVIFY to support privified OS (deprecated). */
+#undef CONFIG_PRIVIFY
+
#endif /* _IA64_CONFIG_H_ */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|