Mailing List Archive

[IA64] struct mm is now a field of struct domain
# HG changeset patch
# User awilliam@xenbuild.aw
# Node ID 41e7549d7df95aad9a254827ae77af72b66d8c34
# Parent 8df6a730817826de45fca3c068f06c548a86f5ae
[IA64] struct mm is now a field of struct domain

struct mm is now a field of struct domain (instead of a pointer).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
---
xen/arch/ia64/linux-xen/setup.c | 10 ++++------
xen/arch/ia64/xen/domain.c | 32 +++++++++++++-------------------
xen/include/asm-ia64/domain.h | 18 ++++++------------
3 files changed, 23 insertions(+), 37 deletions(-)

diff -r 8df6a7308178 -r 41e7549d7df9 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c Wed May 17 15:53:00 2006 -0600
+++ b/xen/arch/ia64/linux-xen/setup.c Wed May 17 15:53:05 2006 -0600
@@ -800,8 +800,7 @@ cpu_init (void)
cpu_data = per_cpu_init();

#ifdef XEN
- printf ("cpu_init: current=%p, current->domain->arch.mm=%p\n",
- current, current->domain->arch.mm);
+ printf ("cpu_init: current=%p\n", current);
#endif

/*
@@ -871,12 +870,11 @@ cpu_init (void)
atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm;
#endif
-#ifdef XEN
- if (current->domain->arch.mm)
-#else
+#ifndef XEN
if (current->mm)
-#endif
BUG();
+#endif
+

#ifdef XEN
ia64_fph_enable();
diff -r 8df6a7308178 -r 41e7549d7df9 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Wed May 17 15:53:00 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c Wed May 17 15:53:05 2006 -0600
@@ -83,9 +83,7 @@ static void try_to_clear_PGC_allocate(st
/* this belongs in include/asm, but there doesn't seem to be a suitable place */
void arch_domain_destroy(struct domain *d)
{
- BUG_ON(d->arch.mm->pgd != NULL);
- if (d->arch.mm != NULL)
- xfree(d->arch.mm);
+ BUG_ON(d->arch.mm.pgd != NULL);
if (d->shared_info != NULL)
free_xenheap_page(d->shared_info);

@@ -242,22 +240,18 @@ int arch_domain_create(struct domain *d)
goto fail_nomem;
d->arch.sys_pgnr = 0;

- if ((d->arch.mm = xmalloc(struct mm_struct)) == NULL)
- goto fail_nomem;
- memset(d->arch.mm, 0, sizeof(*d->arch.mm));
+ memset(&d->arch.mm, 0, sizeof(d->arch.mm));

d->arch.physmap_built = 0;
- if ((d->arch.mm->pgd = pgd_alloc(d->arch.mm)) == NULL)
+ if ((d->arch.mm.pgd = pgd_alloc(&d->arch.mm)) == NULL)
goto fail_nomem;

printf ("arch_domain_create: domain=%p\n", d);
return 0;

fail_nomem:
- if (d->arch.mm->pgd != NULL)
- pgd_free(d->arch.mm->pgd);
- if (d->arch.mm != NULL)
- xfree(d->arch.mm);
+ if (d->arch.mm.pgd != NULL)
+ pgd_free(d->arch.mm.pgd);
if (d->shared_info != NULL)
free_xenheap_page(d->shared_info);
return -ENOMEM;
@@ -469,7 +463,7 @@ static void
static void
relinquish_mm(struct domain* d)
{
- struct mm_struct* mm = d->arch.mm;
+ struct mm_struct* mm = &d->arch.mm;
unsigned long i;
pgd_t* pgd;

@@ -622,7 +616,7 @@ static pte_t*
static pte_t*
lookup_alloc_domain_pte(struct domain* d, unsigned long mpaddr)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
@@ -650,7 +644,7 @@ static pte_t*
static pte_t*
lookup_noalloc_domain_pte(struct domain* d, unsigned long mpaddr)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
@@ -678,7 +672,7 @@ static pte_t*
static pte_t*
lookup_noalloc_domain_pte_none(struct domain* d, unsigned long mpaddr)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
@@ -917,7 +911,7 @@ static void
static void
zap_domain_page_one(struct domain *d, unsigned long mpaddr, int do_put_page)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pte_t *pte;
pte_t old_pte;
unsigned long mfn;
@@ -1071,7 +1065,7 @@ assign_domain_page_replace(struct domain
assign_domain_page_replace(struct domain *d, unsigned long mpaddr,
unsigned long mfn, unsigned int flags)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pte_t* pte;
pte_t old_pte;

@@ -1195,7 +1189,7 @@ destroy_grant_host_mapping(unsigned long
return GNTST_general_error;//XXX GNTST_bad_pseudo_phys_addr

// update pte
- old_pte = ptep_get_and_clear(d->arch.mm, gpaddr, pte);
+ old_pte = ptep_get_and_clear(&d->arch.mm, gpaddr, pte);
if (pte_present(old_pte)) {
old_mfn = pte_pfn(old_pte);//XXX
}
@@ -1316,7 +1310,7 @@ guest_physmap_remove_page(struct domain
/* Flush cache of domain d. */
void domain_cache_flush (struct domain *d, int sync_only)
{
- struct mm_struct *mm = d->arch.mm;
+ struct mm_struct *mm = &d->arch.mm;
pgd_t *pgd = mm->pgd;
unsigned long maddr;
int i,j,k, l;
diff -r 8df6a7308178 -r 41e7549d7df9 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h Wed May 17 15:53:00 2006 -0600
+++ b/xen/include/asm-ia64/domain.h Wed May 17 15:53:05 2006 -0600
@@ -22,8 +22,13 @@ extern void panic_domain(struct pt_regs
extern void panic_domain(struct pt_regs *, const char *, ...)
__attribute__ ((noreturn, format (printf, 2, 3)));

+struct mm_struct {
+ pgd_t * pgd;
+ // atomic_t mm_users; /* How many users with user space? */
+};
+
struct arch_domain {
- struct mm_struct *mm;
+ struct mm_struct mm;
unsigned long metaphysical_rr0;
unsigned long metaphysical_rr4;

@@ -105,17 +110,6 @@ struct arch_vcpu {
struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
};

-//#define thread arch._thread
-
-// FOLLOWING FROM linux-2.6.7/include/sched.h
-
-struct mm_struct {
- pgd_t * pgd;
- // atomic_t mm_users; /* How many users with user space? */
-};
-
-extern struct mm_struct init_mm;
-
struct page_info * assign_new_domain_page(struct domain *d, unsigned long mpaddr);
void assign_new_domain0_page(struct domain *d, unsigned long mpaddr);
void __assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);

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