mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1389.1.39 (4280b9edgpXcv7Ln0ytJwS4QaBJdSg)
Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
This commit is contained in:
commit
6828a6dc43
10 files changed
+50
-53
No files matched your search
@@ -54,11 +54,6 @@
|
||||
#include <asm/desc.h>
|
||||
#include <asm/arch_hooks.h>
|
||||
|
||||
#if 1
|
||||
#define Dprintk(args...)
|
||||
#else
|
||||
#include <mach_apic.h>
|
||||
#endif
|
||||
#include <mach_wakecpu.h>
|
||||
#include <smpboot_hooks.h>
|
||||
|
||||
@@ -472,7 +467,7 @@ extern void local_setup_timer(void);
|
||||
/*
|
||||
* Activate a secondary processor.
|
||||
*/
|
||||
static int __init start_secondary(void *unused)
|
||||
static void __init start_secondary(void *unused)
|
||||
{
|
||||
/*
|
||||
* Dont put anything before smp_callin(), SMP
|
||||
@@ -1278,9 +1273,11 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
|
||||
#if 0
|
||||
if (nmi_watchdog == NMI_LOCAL_APIC)
|
||||
check_nmi_watchdog();
|
||||
#endif
|
||||
|
||||
smpboot_setup_io_apic();
|
||||
|
||||
#if 0
|
||||
setup_boot_APIC_clock();
|
||||
|
||||
/*
|
||||
|
||||
@@ -43,16 +43,12 @@ static inline void smpboot_restore_warm_reset_vector(void)
|
||||
|
||||
static inline void smpboot_setup_io_apic(void)
|
||||
{
|
||||
#if 1
|
||||
printk("smpboot_setup_io_apic\n");
|
||||
#else
|
||||
/*
|
||||
* Here we can be sure that there is an IO-APIC in the system. Let's
|
||||
* go and set it up:
|
||||
*/
|
||||
if (!skip_ioapic_setup && nr_ioapics)
|
||||
setup_IO_APIC();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,16 +43,12 @@ static inline void smpboot_restore_warm_reset_vector(void)
|
||||
|
||||
static inline void smpboot_setup_io_apic(void)
|
||||
{
|
||||
#if 1
|
||||
printk("smpboot_setup_io_apic\n");
|
||||
#else
|
||||
/*
|
||||
* Here we can be sure that there is an IO-APIC in the system. Let's
|
||||
* go and set it up:
|
||||
*/
|
||||
if (!skip_ioapic_setup && nr_ioapics)
|
||||
setup_IO_APIC();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
verbose ?= n
|
||||
debug ?= n
|
||||
perfc ?= n
|
||||
perfc_arrays?= n
|
||||
trace ?= n
|
||||
optimize ?= y
|
||||
domu_debug ?= n
|
||||
@@ -54,6 +55,9 @@ endif
|
||||
|
||||
ifeq ($(perfc),y)
|
||||
CFLAGS += -DPERF_COUNTERS
|
||||
ifeq ($(perfc_arrays),y)
|
||||
CFLAGS += -DPERF_ARRAYS
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(trace),y)
|
||||
|
||||
@@ -647,7 +647,7 @@ acpi_find_rsdp (void)
|
||||
*/
|
||||
rsdp_phys = acpi_scan_rsdp (0, 0x400);
|
||||
if (!rsdp_phys)
|
||||
rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF);
|
||||
rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
|
||||
|
||||
return rsdp_phys;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1992,7 +1992,7 @@ int do_mmu_update(
|
||||
printk("privileged guest dom%d requests pfn=%lx to map mfn=%lx for dom%d\n",
|
||||
d->id, gpfn, mfn, FOREIGNDOM->id);
|
||||
set_machinetophys(mfn, gpfn);
|
||||
set_p2m_entry(FOREIGNDOM, gpfn, mfn, NULL, NULL);
|
||||
set_p2m_entry(FOREIGNDOM, gpfn, mfn, &sh_mapcache, &mapcache);
|
||||
okay = 1;
|
||||
shadow_unlock(FOREIGNDOM);
|
||||
break;
|
||||
|
||||
+19
-24
@@ -1901,37 +1901,34 @@ void shadow_mark_va_out_of_sync(
|
||||
* Returns 0 otherwise.
|
||||
*/
|
||||
static int snapshot_entry_matches(
|
||||
struct exec_domain *ed, unsigned long gmfn, unsigned index)
|
||||
struct domain *d, l1_pgentry_t *guest_pt,
|
||||
unsigned long gpfn, unsigned index)
|
||||
{
|
||||
unsigned long gpfn = __mfn_to_gpfn(ed->domain, gmfn);
|
||||
unsigned long smfn = __shadow_status(ed->domain, gpfn, PGT_snapshot);
|
||||
unsigned long *guest, *snapshot;
|
||||
int compare;
|
||||
|
||||
ASSERT( ! IS_INVALID_M2P_ENTRY(gpfn) );
|
||||
unsigned long smfn = __shadow_status(d, gpfn, PGT_snapshot);
|
||||
l1_pgentry_t *snapshot; // could be L1s or L2s or ...
|
||||
int entries_match;
|
||||
|
||||
perfc_incrc(snapshot_entry_matches_calls);
|
||||
|
||||
if ( !smfn )
|
||||
return 0;
|
||||
|
||||
guest = map_domain_mem(gmfn << PAGE_SHIFT);
|
||||
snapshot = map_domain_mem(smfn << PAGE_SHIFT);
|
||||
|
||||
// This could probably be smarter, but this is sufficent for
|
||||
// our current needs.
|
||||
//
|
||||
compare = (guest[index] == snapshot[index]);
|
||||
entries_match = !l1e_has_changed(&guest_pt[index], &snapshot[index],
|
||||
PAGE_FLAG_MASK);
|
||||
|
||||
unmap_domain_mem(guest);
|
||||
unmap_domain_mem(snapshot);
|
||||
|
||||
#ifdef PERF_COUNTERS
|
||||
if ( compare )
|
||||
if ( entries_match )
|
||||
perfc_incrc(snapshot_entry_matches_true);
|
||||
#endif
|
||||
|
||||
return compare;
|
||||
return entries_match;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1942,37 +1939,35 @@ int __shadow_out_of_sync(struct exec_domain *ed, unsigned long va)
|
||||
{
|
||||
struct domain *d = ed->domain;
|
||||
unsigned long l2mfn = pagetable_get_pfn(ed->arch.guest_table);
|
||||
unsigned long l2pfn = __mfn_to_gpfn(d, l2mfn);
|
||||
l2_pgentry_t l2e;
|
||||
unsigned long l1mfn;
|
||||
unsigned long l1pfn, l1mfn;
|
||||
|
||||
ASSERT(spin_is_locked(&d->arch.shadow_lock));
|
||||
ASSERT(VALID_M2P(l2pfn));
|
||||
|
||||
perfc_incrc(shadow_out_of_sync_calls);
|
||||
|
||||
// PERF BUG: snapshot_entry_matches will call map_domain_mem() on the l2
|
||||
// page, but it's already available at ed->arch.guest_vtable...
|
||||
// Ditto for the sl2 page and ed->arch.shadow_vtable.
|
||||
//
|
||||
if ( page_out_of_sync(&frame_table[l2mfn]) &&
|
||||
!snapshot_entry_matches(ed, l2mfn, l2_table_offset(va)) )
|
||||
!snapshot_entry_matches(d, (l1_pgentry_t *)ed->arch.guest_vtable,
|
||||
l2pfn, l2_table_offset(va)) )
|
||||
return 1;
|
||||
|
||||
__guest_get_l2e(ed, va, &l2e);
|
||||
if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
|
||||
return 0;
|
||||
|
||||
l1mfn = __gpfn_to_mfn(d, l2e_get_pfn(l2e));
|
||||
l1pfn = l2e_get_pfn(l2e);
|
||||
l1mfn = __gpfn_to_mfn(d, l1pfn);
|
||||
|
||||
// If the l1 pfn is invalid, it can't be out of sync...
|
||||
if ( !VALID_MFN(l1mfn) )
|
||||
return 0;
|
||||
|
||||
// PERF BUG: snapshot_entry_matches will call map_domain_mem() on the l1
|
||||
// page, but it's already available at linear_pg_table[l1_linear_offset()].
|
||||
// Ditto for the sl1 page and shadow_linear_pg_table[]...
|
||||
//
|
||||
if ( page_out_of_sync(&frame_table[l1mfn]) &&
|
||||
!snapshot_entry_matches(ed, l1mfn, l1_table_offset(va)) )
|
||||
!snapshot_entry_matches(
|
||||
d, &linear_pg_table[l1_linear_offset(va) & ~(L1_PAGETABLE_ENTRIES-1)],
|
||||
l1pfn, l1_table_offset(va)) )
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <xen/time.h>
|
||||
#include <xen/perfc.h>
|
||||
#include <xen/keyhandler.h>
|
||||
#include <xen/spinlock.h>
|
||||
#include <public/dom0_ops.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
@@ -66,6 +67,14 @@ void perfc_printall(unsigned char key)
|
||||
for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ )
|
||||
sum += atomic_read(&counters[j]);
|
||||
printk("TOTAL[%10d] ", sum);
|
||||
#ifdef PERF_ARRAYS
|
||||
for ( j = 0; j < perfc_info[i].nr_elements; j++ )
|
||||
{
|
||||
if ( (j != 0) && ((j % 4) == 0) )
|
||||
printk("\n ");
|
||||
printk("ARR%02d[%10d] ", j, atomic_read(&counters[j]));
|
||||
}
|
||||
#endif
|
||||
counters += j;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -518,9 +518,9 @@ update_hl2e(struct exec_domain *ed, unsigned long va)
|
||||
else
|
||||
new_hl2e = l1e_empty();
|
||||
|
||||
// only do the ref counting if something important changed.
|
||||
// only do the ref counting if something has changed.
|
||||
//
|
||||
if ( (l1e_has_changed(&old_hl2e, &new_hl2e, _PAGE_PRESENT)) )
|
||||
if ( (l1e_has_changed(&old_hl2e, &new_hl2e, PAGE_FLAG_MASK)) )
|
||||
{
|
||||
if ( (l1e_get_flags(new_hl2e) & _PAGE_PRESENT) &&
|
||||
!shadow_get_page(ed->domain, pfn_to_page(l1e_get_pfn(new_hl2e)),
|
||||
@@ -531,14 +531,15 @@ update_hl2e(struct exec_domain *ed, unsigned long va)
|
||||
shadow_put_page(ed->domain, pfn_to_page(l1e_get_pfn(old_hl2e)));
|
||||
need_flush = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ed->arch.hl2_vtable[l2_table_offset(va)] = new_hl2e;
|
||||
ed->arch.hl2_vtable[l2_table_offset(va)] = new_hl2e;
|
||||
|
||||
if ( need_flush )
|
||||
{
|
||||
perfc_incrc(update_hl2e_invlpg);
|
||||
local_flush_tlb_one(&linear_pg_table[l1_linear_offset(va)]);
|
||||
if ( need_flush )
|
||||
{
|
||||
perfc_incrc(update_hl2e_invlpg);
|
||||
// SMP BUG???
|
||||
local_flush_tlb_one(&linear_pg_table[l1_linear_offset(va)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1501,11 +1502,6 @@ shadow_set_l1e(unsigned long va, l1_pgentry_t new_spte, int create_l1_shadow)
|
||||
struct domain *d = ed->domain;
|
||||
l2_pgentry_t sl2e;
|
||||
|
||||
#if 0
|
||||
printk("shadow_set_l1e(va=%p, new_spte=%p, create=%d)\n",
|
||||
va, l1e_get_value(new_spte), create_l1_shadow);
|
||||
#endif
|
||||
|
||||
__shadow_get_l2e(ed, va, &sl2e);
|
||||
if ( !(l2e_get_flags(sl2e) & _PAGE_PRESENT) )
|
||||
{
|
||||
|
||||
@@ -87,6 +87,7 @@ extern struct perfcounter perfcounters;
|
||||
* Histogram: special treatment for 0 and 1 count. After that equally spaced
|
||||
* with last bucket taking the rest.
|
||||
*/
|
||||
#ifdef PERFC_ARRAYS
|
||||
#define perfc_incr_histo(_x,_v,_n) \
|
||||
do { \
|
||||
if ( (_v) == 0 ) \
|
||||
@@ -99,6 +100,9 @@ extern struct perfcounter perfcounters;
|
||||
else \
|
||||
perfc_incra(_x, PERFC_MAX_ ## _n - 1); \
|
||||
} while ( 0 )
|
||||
#else
|
||||
#define perfc_incr_histo(_x,_v,_n) ((void)0)
|
||||
#endif
|
||||
|
||||
#else /* PERF_COUNTERS */
|
||||
|
||||
|
||||