[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-ia64-devel] PATCH: struct mm is now a field of struct domain [resubmited].
Hi,
I have only updated this patch.
Tested by boot+halt of dom0+domU.
Tristan.
# HG changeset patch
# User tristan.gingold@xxxxxxxx
# Node ID 45a3c14a587891189c57a7ca7f67706210331115
# Parent 5e930cae1bb9b32655214cbb47ccf1e26ea44a4d
struct mm is now a field of struct domain (instead of a pointer).
Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
diff -r 5e930cae1bb9 -r 45a3c14a5878 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c Wed May 17 04:46:35 2006
+++ b/xen/arch/ia64/linux-xen/setup.c Wed May 17 07:19:24 2006
@@ -800,8 +800,7 @@
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 @@
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 5e930cae1bb9 -r 45a3c14a5878 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Wed May 17 04:46:35 2006
+++ b/xen/arch/ia64/xen/domain.c Wed May 17 07:19:24 2006
@@ -83,9 +83,7 @@
/* 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 @@
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
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*
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*
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*
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;
@@ -919,7 +913,7 @@
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;
@@ -1073,7 +1067,7 @@
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;
pte_t npte;
@@ -1197,7 +1191,7 @@
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
}
@@ -1318,7 +1312,7 @@
/* 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 5e930cae1bb9 -r 45a3c14a5878 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h Wed May 17 04:46:35 2006
+++ b/xen/include/asm-ia64/domain.h Wed May 17 07:19:24 2006
@@ -22,8 +22,13 @@
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_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-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
This mailing list archive is a service of Copilotco.