ChangeSet 1.1346, 2005/03/17 14:08:58+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx
Some small header-include cleanups. No need for BIGLOCK in dom_mem_op
hypercall.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
arch/x86/smp.c | 6 ++----
arch/x86/x86_emulate.c | 1 +
common/dom_mem_ops.c | 4 ----
common/elf.c | 1 +
common/page_alloc.c | 3 ++-
common/xmalloc.c | 2 ++
include/asm-x86/mm.h | 36 +++++++++---------------------------
include/xen/sched.h | 12 +-----------
8 files changed, 18 insertions(+), 47 deletions(-)
diff -Nru a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c 2005-03-17 10:01:34 -05:00
+++ b/xen/arch/x86/smp.c 2005-03-17 10:01:34 -05:00
@@ -8,9 +8,11 @@
* later.
*/
+#include <xen/config.h>
#include <xen/irq.h>
#include <xen/sched.h>
#include <xen/delay.h>
+#include <xen/perfc.h>
#include <xen/spinlock.h>
#include <asm/smp.h>
#include <asm/mc146818rtc.h>
@@ -18,8 +20,6 @@
#include <asm/smpboot.h>
#include <asm/hardirq.h>
-#ifdef CONFIG_SMP
-
/*
* Some notes on x86 processor bugs affecting SMP operation:
*
@@ -420,5 +420,3 @@
atomic_inc(&call_data->finished);
}
}
-
-#endif /* CONFIG_SMP */
diff -Nru a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c 2005-03-17 10:01:34 -05:00
+++ b/xen/arch/x86/x86_emulate.c 2005-03-17 10:01:34 -05:00
@@ -22,6 +22,7 @@
#include <xen/config.h>
#include <xen/types.h>
#include <xen/lib.h>
+#include <xen/mm.h>
#include <asm/regs.h>
#endif
#include <asm-x86/x86_emulate.h>
diff -Nru a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c
--- a/xen/common/dom_mem_ops.c 2005-03-17 10:01:34 -05:00
+++ b/xen/common/dom_mem_ops.c 2005-03-17 10:01:34 -05:00
@@ -142,8 +142,6 @@
else if ( unlikely((d = find_domain_by_id(domid)) == NULL) )
return -ESRCH;
- LOCK_BIGLOCK(d);
-
switch ( op )
{
case MEMOP_increase_reservation:
@@ -161,8 +159,6 @@
if ( unlikely(domid != DOMID_SELF) )
put_domain(d);
-
- UNLOCK_BIGLOCK(d);
return rc;
}
diff -Nru a/xen/common/elf.c b/xen/common/elf.c
--- a/xen/common/elf.c 2005-03-17 10:01:34 -05:00
+++ b/xen/common/elf.c 2005-03-17 10:01:34 -05:00
@@ -9,6 +9,7 @@
#include <xen/lib.h>
#include <xen/mm.h>
#include <xen/elf.h>
+#include <xen/sched.h>
#ifdef CONFIG_X86
#define FORCE_XENELF_IMAGE 1
diff -Nru a/xen/common/page_alloc.c b/xen/common/page_alloc.c
--- a/xen/common/page_alloc.c 2005-03-17 10:01:34 -05:00
+++ b/xen/common/page_alloc.c 2005-03-17 10:01:34 -05:00
@@ -24,11 +24,12 @@
#include <xen/init.h>
#include <xen/types.h>
#include <xen/lib.h>
-#include <asm/page.h>
+#include <xen/perfc.h>
#include <xen/spinlock.h>
#include <xen/slab.h>
#include <xen/irq.h>
#include <asm/domain_page.h>
+#include <asm/page.h>
/*
* Comma-separated list of hexadecimal page numbers containing bad bytes.
diff -Nru a/xen/common/xmalloc.c b/xen/common/xmalloc.c
--- a/xen/common/xmalloc.c 2005-03-17 10:01:34 -05:00
+++ b/xen/common/xmalloc.c 2005-03-17 10:01:34 -05:00
@@ -27,10 +27,12 @@
* (Disadvantage is potentially greater internal fragmentation).
*/
+#include <xen/config.h>
#include <xen/mm.h>
#include <xen/spinlock.h>
#include <xen/ac_timer.h>
#include <xen/cache.h>
+#include <xen/prefetch.h>
static LIST_HEAD(freelist);
static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED;
diff -Nru a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h 2005-03-17 10:01:34 -05:00
+++ b/xen/include/asm-x86/mm.h 2005-03-17 10:01:34 -05:00
@@ -4,18 +4,7 @@
#include <xen/config.h>
#include <xen/list.h>
-#include <xen/spinlock.h>
-#include <xen/perfc.h>
-#include <xen/sched.h>
-
-#include <asm/processor.h>
-#include <asm/atomic.h>
-#include <asm/desc.h>
-#include <asm/flushtlb.h>
#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include <public/xen.h>
/*
* Per-page-frame information.
@@ -241,19 +230,11 @@
*/
#define __phys_to_machine_mapping ((unsigned long *)RO_MPT_VIRT_START)
-/* Returns the machine physical */
-static inline unsigned long phys_to_machine_mapping(unsigned long pfn)
-{
- unsigned long mfn;
- l1_pgentry_t pte;
-
- if (__get_user(l1_pgentry_val(pte), (__phys_to_machine_mapping + pfn)))
- mfn = 0;
- else
- mfn = l1_pgentry_to_phys(pte) >> PAGE_SHIFT;
-
- return mfn;
-}
+#define phys_to_machine_mapping(_pfn) \
+({ l1_pgentry_t l1e; unsigned long mfn; \
+ mfn = __get_user(l1_pgentry_val(l1e), &__phys_to_machine_mapping[_pfn]) \
+ ? 0 : l1_pgentry_to_pfn(l1e); \
+ mfn; })
#define set_machinetophys(_mfn, _pfn) machine_to_phys_mapping[(_mfn)] = (_pfn)
#define DEFAULT_GDT_ENTRIES (LAST_RESERVED_GDT_ENTRY+1)
@@ -339,9 +320,10 @@
void propagate_page_fault(unsigned long addr, u16 error_code);
-/* update_grant_va_mapping
- * Caller must own d's BIGLOCK, is responsible for flushing the TLB,
- * and have already get_page'd */
+/*
+ * Caller must own d's BIGLOCK, is responsible for flushing the TLB, and must
+ * hold a reference to the page.
+ */
int update_grant_va_mapping(unsigned long va,
unsigned long val,
struct domain *d,
diff -Nru a/xen/include/xen/sched.h b/xen/include/xen/sched.h
--- a/xen/include/xen/sched.h 2005-03-17 10:01:34 -05:00
+++ b/xen/include/xen/sched.h 2005-03-17 10:01:34 -05:00
@@ -89,19 +89,9 @@
struct arch_exec_domain arch;
};
-/*
-** SMH: do_mmu_update() grabs big_lock and subsequently can fault
-** on map_ldt_shadow_page(), enter do_page_fault() and then deadlock
-** trying to reacquire big_lock. A temporary fix is to make big_lock
-** recursive; overall probably needs more thought.
-*/
-#if 0
-#define LOCK_BIGLOCK(_d) spin_lock(&(_d)->big_lock)
-#define UNLOCK_BIGLOCK(_d) spin_unlock(&(_d)->big_lock)
-#else
+/* Per-domain lock can be recursively acquired in fault handlers. */
#define LOCK_BIGLOCK(_d) spin_lock_recursive(&(_d)->big_lock)
#define UNLOCK_BIGLOCK(_d) spin_unlock_recursive(&(_d)->big_lock)
-#endif
struct domain
{
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog
|