aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2008-02-13 10:37:18 -0700
committerAlex Williamson <alex.williamson@hp.com>2008-02-13 10:37:18 -0700
commit03c9b741df33f676c99c7885ca7f795190df37d5 (patch)
treee7be7f2772dbc50f46ff071cc48ae3e6f3eb3d7e
parent80e45574b2312905f67793262518a273d6bcdb13 (diff)
downloadxen-03c9b741df33f676c99c7885ca7f795190df37d5.tar.gz
xen-03c9b741df33f676c99c7885ca7f795190df37d5.tar.bz2
xen-03c9b741df33f676c99c7885ca7f795190df37d5.zip
[IA64] Cleanup: remove unused functions and definitions
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
-rw-r--r--xen/arch/ia64/vmx/vmmu.c76
-rw-r--r--xen/include/asm-ia64/vmmu.h39
2 files changed, 17 insertions, 98 deletions
diff --git a/xen/arch/ia64/vmx/vmmu.c b/xen/arch/ia64/vmx/vmmu.c
index 3028f5d0ec..ee03f6fc63 100644
--- a/xen/arch/ia64/vmx/vmmu.c
+++ b/xen/arch/ia64/vmx/vmmu.c
@@ -51,37 +51,6 @@ static void __init parse_vhpt_size(char *s)
custom_param("vti_vtlb_size", parse_vtlb_size);
custom_param("vti_vhpt_size", parse_vhpt_size);
-/*
- * Get the machine page frame number in 16KB unit
- * Input:
- * d:
- */
-static u64 get_mfn(struct domain *d, u64 gpfn)
-{
-// struct domain *d;
- u64 xen_gppn, xen_mppn, mpfn;
-/*
- if ( domid == DOMID_SELF ) {
- d = current->domain;
- }
- else {
- d = get_domain_by_id(domid);
- }
- */
- xen_gppn = arch_to_xen_ppn(gpfn);
- xen_mppn = gmfn_to_mfn(d, xen_gppn);
-/*
- for (i=0; i<pages; i++) {
- if ( gmfn_to_mfn(d, gpfn+i) == INVALID_MFN ) {
- return INVALID_MFN;
- }
- }
-*/
- mpfn= xen_to_arch_ppn(xen_mppn);
- mpfn = mpfn | (((1UL <<(PAGE_SHIFT-ARCH_PAGE_SHIFT))-1)&gpfn);
- return mpfn;
-
-}
static int init_domain_vhpt(struct vcpu *v)
{
@@ -131,51 +100,6 @@ void free_domain_tlb(struct vcpu *v)
free_domain_vhpt(v);
}
-/*
- * Insert guest TLB to machine TLB.
- * data: In TLB format
- */
-void machine_tlb_insert(struct vcpu *v, thash_data_t *tlb)
-{
- u64 psr;
- thash_data_t mtlb;
- unsigned int cl = tlb->cl;
- unsigned long mtlb_ppn;
- mtlb.ifa = tlb->vadr;
- mtlb.itir = tlb->itir & ~ITIR_RV_MASK;
- mtlb.page_flags = tlb->page_flags & ~PAGE_FLAGS_RV_MASK;
- mtlb.ppn = get_mfn(v->domain, tlb->ppn);
- mtlb_ppn=mtlb.ppn;
-
-#if 0
- if (mtlb_ppn == INVALID_MFN)
- panic_domain(vcpu_regs(v), "Machine tlb insert with invalid mfn number.\n");
-#endif
-
- psr = ia64_clear_ic();
- if ( cl == ISIDE_TLB ) {
- ia64_itc(1, mtlb.ifa, mtlb.page_flags, IA64_ITIR_PS_KEY(mtlb.ps, 0));
- }
- else {
- ia64_itc(2, mtlb.ifa, mtlb.page_flags, IA64_ITIR_PS_KEY(mtlb.ps, 0));
- }
- ia64_set_psr(psr);
- ia64_srlz_i();
- return;
-}
-
-/*
- * Purge machine tlb.
- * INPUT
- * rr: guest rr.
- * va: only bits 0:60 is valid
- * size: bits format (1<<size) for the address range to purge.
- *
- */
-void machine_tlb_purge(u64 va, u64 ps)
-{
- ia64_ptcl(va, ps << 2);
-}
int vhpt_enabled(VCPU *vcpu, uint64_t vadr, vhpt_ref_t ref)
{
diff --git a/xen/include/asm-ia64/vmmu.h b/xen/include/asm-ia64/vmmu.h
index d9d535b3f1..1fd3411676 100644
--- a/xen/include/asm-ia64/vmmu.h
+++ b/xen/include/asm-ia64/vmmu.h
@@ -50,6 +50,10 @@ enum {
#define VTLB_PTE_IO (1UL<<VTLB_PTE_IO_BIT)
#define VTLB_PTE_P (1UL<<VTLB_PTE_P_BIT)
+#define ITIR_RV_MASK (((1UL<<32)-1)<<32 | 0x3)
+#define PAGE_FLAGS_RV_MASK (0x2 | (0x3UL<<50)|(((1UL<<11)-1)<<53))
+#define PAGE_FLAGS_AR_PL_MASK ((0x7UL<<9)|(0x3UL<<7))
+
#ifndef __ASSEMBLY__
typedef struct thash_data {
union {
@@ -126,20 +130,6 @@ typedef struct thash_data {
#define INVALID_ENTRY(hcb, hdata) INVALID_VHPT(hdata)
-/*
- * Architecture ppn is in 4KB unit while XEN
- * page may be different(1<<PAGE_SHIFT).
- */
-static inline u64 arch_to_xen_ppn(u64 appn)
-{
- return (appn >>(PAGE_SHIFT-ARCH_PAGE_SHIFT));
-}
-
-static inline u64 xen_to_arch_ppn(u64 xppn)
-{
- return (xppn <<(PAGE_SHIFT- ARCH_PAGE_SHIFT));
-}
-
typedef struct thash_cb {
/* THASH base information */
thash_data_t *hash; // hash table pointer, aligned at thash_sz.
@@ -202,17 +192,9 @@ extern void thash_purge_all(struct vcpu *v);
extern thash_data_t *vtlb_lookup(struct vcpu *v,u64 va,int is_data);
-#define ITIR_RV_MASK (((1UL<<32)-1)<<32 | 0x3)
-#define PAGE_FLAGS_RV_MASK (0x2 | (0x3UL<<50)|(((1UL<<11)-1)<<53))
-#define PAGE_FLAGS_AR_PL_MASK ((0x7UL<<9)|(0x3UL<<7))
-extern u64 machine_ttag(PTA pta, u64 va);
-extern u64 machine_thash(PTA pta, u64 va);
-extern void machine_tlb_insert(struct vcpu *v, thash_data_t *tlb);
-extern ia64_rr vmmu_get_rr(struct vcpu *vcpu, u64 va);
extern int init_domain_tlb(struct vcpu *v);
extern void free_domain_tlb(struct vcpu *v);
extern thash_data_t * vhpt_lookup(u64 va);
-extern void machine_tlb_purge(u64 va, u64 ps);
extern unsigned long fetch_code(struct vcpu *vcpu, u64 gip, IA64_BUNDLE *pbundle);
extern void emulate_io_inst(struct vcpu *vcpu, u64 padr, u64 ma);
extern int vhpt_enabled(struct vcpu *vcpu, uint64_t vadr, vhpt_ref_t ref);
@@ -222,6 +204,19 @@ extern void thash_vhpt_insert(struct vcpu *v, u64 pte, u64 itir, u64 ifa,
extern u64 guest_vhpt_lookup(u64 iha, u64 *pte);
extern int vhpt_access_rights_fixup(struct vcpu *v, u64 ifa, int is_data);
+/*
+ * Purge machine tlb.
+ * INPUT
+ * rr: guest rr.
+ * va: only bits 0:60 is valid
+ * size: bits format (1<<size) for the address range to purge.
+ *
+ */
+static inline void machine_tlb_purge(u64 va, u64 ps)
+{
+ ia64_ptcl(va, ps << 2);
+}
+
static inline void vmx_vcpu_set_tr (thash_data_t *trp, u64 pte, u64 itir, u64 va, u64 rid)
{
trp->page_flags = pte;