Accepting request 49271 from Virtualization

checked in (request 49271)

OBS-URL: https://build.opensuse.org/request/show/49271
OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=75
This commit is contained in:
OBS User autobuild 2010-09-27 22:07:20 +00:00 committed by Git OBS Bridge
parent 7e89789f0a
commit 06b9899ef9
186 changed files with 5183 additions and 2357 deletions

View File

@ -54,11 +54,9 @@ up in order for it to be usable.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/io_apic.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/io_apic.c
+++ xen-4.0.1-testing/xen/arch/x86/io_apic.c
@@ -2231,6 +2231,7 @@ int __init io_apic_get_redir_entries (in
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2111,6 +2111,7 @@ int __init io_apic_get_redir_entries (in
int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
{
@ -66,7 +64,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/io_apic.c
struct IO_APIC_route_entry entry;
unsigned long flags;
int vector;
@@ -2282,7 +2283,12 @@ int io_apic_set_pci_routing (int ioapic,
@@ -2162,7 +2163,12 @@ int io_apic_set_pci_routing (int ioapic,
io_apic_write(ioapic, 0x11+2*pin, *(((int *)&entry)+1));
io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
set_native_irq_info(irq, TARGET_CPUS);
@ -80,11 +78,9 @@ Index: xen-4.0.1-testing/xen/arch/x86/io_apic.c
return 0;
}
Index: xen-4.0.1-testing/xen/arch/x86/mpparse.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/mpparse.c
+++ xen-4.0.1-testing/xen/arch/x86/mpparse.c
@@ -1102,6 +1102,8 @@ int mp_register_gsi (u32 gsi, int trigge
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -1103,6 +1103,8 @@ int mp_register_gsi (u32 gsi, int trigge
int ioapic = -1;
int ioapic_pin = 0;
int idx, bit = 0;
@ -93,7 +89,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/mpparse.c
/*
* Mapping between Global System Interrups, which
@@ -1126,8 +1128,13 @@ int mp_register_gsi (u32 gsi, int trigge
@@ -1127,8 +1129,13 @@ int mp_register_gsi (u32 gsi, int trigge
if (ioapic_renumber_irq)
gsi = ioapic_renumber_irq(ioapic, gsi);

154
21109-x86-cpu-hotplug.patch Normal file
View File

@ -0,0 +1,154 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1270624140 -3600
# Node ID 7794f61c61f3b0c90e367a87b287850b31645742
# Parent adce8bc43fcccf8730b1da962be60c457c51fa1b
x86, cpu hotplug: Synchronise vcpu state earlier during cpu offline.
Needs to happen before non-idle VCPU is fully descheduled after CPU is
removed from cpu_online_map. Else sync_vcpu_execstate() doesn't work
properly.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1270737112 -3600
# Node ID c9e8369e49be7396eca444cfce27e6782e4aa248
# Parent a33909be109cefb0aef251c7c7e48168ed05512a
Fix two issues for CPU online/offline.
Firstly, we should return if we fail to get spin lock in cpu_down.
Secondly, in credit scheduler, the idlers need be limited only to
online map.
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271090027 -3600
# Node ID 5d4038d41fd894f9fc71e64043d559d7c465bd15
# Parent 1d3bec66528900b1b442b6d36f24cd35ca076506
cpufreq: fix racing issue for cpu hotplug
To eliminate racing between dbs timer handler and cpufreq_del_cpu,
using kill_timer instead of stop_timer to make sure timer handler
execution finished before other stuff in cpufreq_del_cpu.
BTW, fix a lost point of cpufreq_statistic_lock taking sequence.
Signed-off-by: Wei Gang <gang.wei@intel.com>
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1442,7 +1442,8 @@ void context_switch(struct vcpu *prev, s
set_current(next);
- if ( (per_cpu(curr_vcpu, cpu) == next) || is_idle_vcpu(next) )
+ if ( (per_cpu(curr_vcpu, cpu) == next) ||
+ (is_idle_vcpu(next) && cpu_online(cpu)) )
{
local_irq_enable();
}
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -997,17 +997,13 @@ static int __devinit do_boot_cpu(int api
return boot_error;
}
-static void idle_task_exit(void)
-{
- /* Give up lazy state borrowed by this idle vcpu */
- __sync_lazy_execstate();
-}
-
void cpu_exit_clear(void)
{
int cpu = raw_smp_processor_id();
- idle_task_exit();
+ /* Previous non-idle state should be synchronised already. */
+ if (__sync_lazy_execstate())
+ BUG();
cpucount --;
cpu_uninit();
@@ -1302,6 +1298,13 @@ int __cpu_disable(void)
remove_siblinginfo(cpu);
+ /*
+ * If we are running the idle vcpu, sync last non-idle vcpu's state
+ * before changing cpu_online_map. If we are running non-idle vcpu,
+ * we will synchronously sync the state in context_switch() later.
+ */
+ __sync_lazy_execstate();
+
/* It's now safe to remove this processor from the online map */
cpu_clear(cpu, cpu_online_map);
fixup_irqs();
@@ -1340,10 +1343,8 @@ int cpu_down(unsigned int cpu)
int err = 0;
/* spin_trylock() avoids deadlock with stop_machine_run(). */
- if (!spin_trylock(&cpu_add_remove_lock)) {
- err = -EBUSY;
- goto out;
- }
+ if (!spin_trylock(&cpu_add_remove_lock))
+ return -EBUSY;
if (num_online_cpus() == 1) {
err = -EBUSY;
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -410,7 +410,7 @@ _csched_cpu_pick(struct vcpu *vc, bool_t
* like run two VCPUs on co-hyperthreads while there are idle cores
* or sockets.
*/
- idlers = csched_priv.idlers;
+ cpus_and(idlers, cpu_online_map, csched_priv.idlers);
cpu_set(cpu, idlers);
cpus_and(cpus, cpus, idlers);
cpu_clear(cpu, cpus);
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -86,12 +86,13 @@ int do_get_pm_info(struct xen_sysctl_get
case PMSTAT_get_pxstat:
{
uint32_t ct;
- struct pm_px *pxpt = cpufreq_statistic_data[op->cpuid];
+ struct pm_px *pxpt;
spinlock_t *cpufreq_statistic_lock =
&per_cpu(cpufreq_statistic_lock, op->cpuid);
spin_lock(cpufreq_statistic_lock);
+ pxpt = cpufreq_statistic_data[op->cpuid];
if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt )
{
spin_unlock(cpufreq_statistic_lock);
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -196,9 +196,8 @@ static void dbs_timer_init(struct cpu_db
{
dbs_info->enable = 1;
- if ( !dbs_timer[dbs_info->cpu].function )
- init_timer(&dbs_timer[dbs_info->cpu], do_dbs_timer,
- (void *)dbs_info, dbs_info->cpu);
+ init_timer(&dbs_timer[dbs_info->cpu], do_dbs_timer,
+ (void *)dbs_info, dbs_info->cpu);
set_timer(&dbs_timer[dbs_info->cpu], NOW()+dbs_tuners_ins.sampling_rate);
@@ -213,7 +212,7 @@ static void dbs_timer_exit(struct cpu_db
{
dbs_info->enable = 0;
dbs_info->stoppable = 0;
- stop_timer(&dbs_timer[dbs_info->cpu]);
+ kill_timer(&dbs_timer[dbs_info->cpu]);
}
int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event)

View File

@ -0,0 +1,31 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271053336 -3600
# Node ID b5f9c6274d917db5bbe6cb9cc0d59910cc07a8a6
# Parent 5bc70100b514d98bd3938cdeca1e182726c26df2
libxc: Flush I/O before xc_domain_save completion
The final, flushing call to discard_file_cache also discards any
errors from fsync. Call fsync explicitly before leaving, to check if
all VM memory actually made it to the disk.
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Index: xen-4.0.0-testing/tools/libxc/xc_domain_save.c
===================================================================
--- xen-4.0.0-testing.orig/tools/libxc/xc_domain_save.c
+++ xen-4.0.0-testing/tools/libxc/xc_domain_save.c
@@ -1764,6 +1764,13 @@ int xc_domain_save(int xc_handle, int io
goto out;
}
+ /* Flush last write and check for errors. */
+ if ( fsync(io_fd) && errno != EINVAL )
+ {
+ PERROR("Error when flushing state file");
+ goto out;
+ }
+
/* Success! */
rc = 0;

View File

@ -0,0 +1,22 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271053401 -3600
# Node ID bf74d9c31674c9001a7c4aa8d93227552edf53b1
# Parent b5f9c6274d917db5bbe6cb9cc0d59910cc07a8a6
blktap2: a little fix to xen-hotplug-cleanup
Signed-off-by: James (Song Wei) <jsong@novell.com>
Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
===================================================================
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-hotplug-cleanup
+++ xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
@@ -21,7 +21,7 @@ if [ "$vm" != "" ]; then
# if the vm path does not exist and the device class is 'vbd' then we may have
# a tap2 device
- if [ $(xenstore-read "$vm_dev" 2>/dev/null) != "" ] \
+ if [ "$(xenstore-read "$vm_dev" 2>/dev/null)" != "" ] \
&& [ "${path_array[1]}" = "vbd" ]; then
vm_dev="$vm/device/tap2/${path_array[3]}"
fi

68
21150-shadow-race.patch Normal file
View File

@ -0,0 +1,68 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271091116 -3600
# Node ID 78488a63bbc200095413824cc146134b54635da9
# Parent b010b792c0f814de725f669d8a6bee738df68963
x86, shadow: Fix read-to-use race condition
If OOS mode is enabled, after last possible resync, read the guest l1e
one last time. If it's different than the original read, start over
again.
This fixes a race which can result in inconsistent in-sync shadow
tables, leading to corruption:
v1: take page fault, read gl1e from an out-of-sync PT.
v2: modify gl1e, lowering permissions
[v1,v3]: resync l1 which was just read.
v1: propagate change to l1 shadow using stale gl1e
Now we have an in-sync shadow with more permissions than the guest.
The resync can happen either as a result of a 3rd vcpu doing a cr3
update, or under certain conditions by v1 itself.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -240,6 +240,23 @@ shadow_check_gwalk(struct vcpu *v, unsig
return !mismatch;
}
+static int
+shadow_check_gl1e(struct vcpu *v, walk_t *gw)
+{
+ guest_l1e_t *l1p, nl1e;
+
+ if ( !mfn_valid(gw->l1mfn) )
+ return 0;
+
+ /* Can't just pull-through because mfn may have changed */
+ l1p = map_domain_page(mfn_x(gw->l1mfn));
+ nl1e.l1 = l1p[guest_l1_table_offset(gw->va)].l1;
+ unmap_domain_page(l1p);
+
+ return gw->l1e.l1 != nl1e.l1;
+}
+
+
/* Remove write access permissions from a gwalk_t in a batch, and
* return OR-ed result for TLB flush hint and need to rewalk the guest
* pages.
@@ -3235,6 +3252,15 @@ static int sh_page_fault(struct vcpu *v,
shadow_unlock(d);
return 0;
}
+
+ /* Final check: if someone has synced a page, it's possible that
+ * our l1e is stale. Compare the entries, and rewalk if necessary. */
+ if ( shadow_check_gl1e(v, &gw) )
+ {
+ perfc_incr(shadow_inconsistent_gwalk);
+ shadow_unlock(d);
+ goto rewalk;
+ }
#endif /* OOS */
/* Calculate the shadow entry and write it */

View File

@ -0,0 +1,205 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271091288 -3600
# Node ID 94cae4dfa25bcf9aaeb93fb374926cb40411ebdf
# Parent 78488a63bbc200095413824cc146134b54635da9
xentrace: Bounds checking and error handling
Check tbuf_size to make sure that it will fit on the t_info struct
allocated at boot. Also deal with allocation failures more
gracefully.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278093165 -3600
# Node ID 2f3a68a0b55b1b7df4d6632dfc151040ba08e9ea
# Parent 2846fd19945cb2ab32d1513531c3500278133484
trace: Fix T_INFO_FIRST_OFFSET calculation
This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.
Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278093190 -3600
# Node ID 1390e2ab45c7b63d79ba9496d609cf59af4b44ee
# Parent 2f3a68a0b55b1b7df4d6632dfc151040ba08e9ea
trace: improve check_tbuf_size()
It didn't consider the case of the incoming size not allowing for the
2*data_size range for t_buf->{prod,cons}
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -48,10 +48,12 @@ integer_param("tbuf_size", opt_tbuf_size
/* Pointers to the meta-data objects for all system trace buffers */
static struct t_info *t_info;
#define T_INFO_PAGES 2 /* Size fixed at 2 pages for now. */
+#define T_INFO_SIZE ((T_INFO_PAGES)*(PAGE_SIZE))
static DEFINE_PER_CPU_READ_MOSTLY(struct t_buf *, t_bufs);
static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, t_data);
static DEFINE_PER_CPU_READ_MOSTLY(spinlock_t, t_lock);
static int data_size;
+static u32 t_info_first_offset __read_mostly;
/* High water mark for trace buffers; */
/* Send virtual interrupt when buffer level reaches this point */
@@ -71,6 +73,39 @@ static cpumask_t tb_cpu_mask = CPU_MASK_
/* which tracing events are enabled */
static u32 tb_event_mask = TRC_ALL;
+/* Return the number of elements _type necessary to store at least _x bytes of data
+ * i.e., sizeof(_type) * ans >= _x. */
+#define fit_to_type(_type, _x) (((_x)+sizeof(_type)-1) / sizeof(_type))
+
+static void calc_tinfo_first_offset(void)
+{
+ int offset_in_bytes;
+
+ offset_in_bytes = offsetof(struct t_info, mfn_offset[NR_CPUS]);
+
+ t_info_first_offset = fit_to_type(uint32_t, offset_in_bytes);
+
+ gdprintk(XENLOG_INFO, "%s: NR_CPUs %d, offset_in_bytes %d, t_info_first_offset %u\n",
+ __func__, NR_CPUS, offset_in_bytes, (unsigned)t_info_first_offset);
+}
+
+/**
+ * check_tbuf_size - check to make sure that the proposed size will fit
+ * in the currently sized struct t_info and allows prod and cons to
+ * reach double the value without overflow.
+ */
+static int check_tbuf_size(u32 pages)
+{
+ struct t_buf dummy;
+ typeof(dummy.prod) size;
+
+ size = ((typeof(dummy.prod))pages) * PAGE_SIZE;
+
+ return (size / PAGE_SIZE != pages)
+ || (size + size < size)
+ || (num_online_cpus() * pages + t_info_first_offset > T_INFO_SIZE / sizeof(uint32_t));
+}
+
/**
* alloc_trace_bufs - performs initialization of the per-cpu trace buffers.
*
@@ -87,7 +122,9 @@ static int alloc_trace_bufs(void)
unsigned long nr_pages;
/* Start after a fixed-size array of NR_CPUS */
uint32_t *t_info_mfn_list = (uint32_t *)t_info;
- int offset = (NR_CPUS * 2 + 1 + 1) / 4;
+ int offset = t_info_first_offset;
+
+ BUG_ON(check_tbuf_size(opt_tbuf_size));
if ( opt_tbuf_size == 0 )
return -EINVAL;
@@ -180,7 +217,8 @@ out_dealloc:
}
spin_unlock_irqrestore(&per_cpu(t_lock, cpu), flags);
}
- return -EINVAL;
+
+ return -ENOMEM;
}
@@ -197,19 +235,35 @@ static int tb_set_size(int size)
* boot time or via control tools, but not by both. Once buffers
* are created they cannot be destroyed.
*/
- if ( (opt_tbuf_size != 0) || (size <= 0) )
+ int ret = 0;
+
+
+
+ if ( (opt_tbuf_size != 0) )
{
- gdprintk(XENLOG_INFO, "tb_set_size from %d to %d not implemented\n",
- opt_tbuf_size, size);
+ if ( size != opt_tbuf_size )
+ gdprintk(XENLOG_INFO, "tb_set_size from %d to %d not implemented\n",
+ opt_tbuf_size, size);
return -EINVAL;
}
- opt_tbuf_size = size;
- if ( alloc_trace_bufs() != 0 )
+ if ( size <= 0 )
return -EINVAL;
- printk("Xen trace buffers: initialized\n");
- return 0;
+ if ( check_tbuf_size(size) )
+ {
+ gdprintk(XENLOG_INFO, "tb size %d too large\n", size);
+ return -EINVAL;
+ }
+
+ opt_tbuf_size = size;
+
+ if ( (ret = alloc_trace_bufs()) == 0 )
+ printk("Xen trace buffers: initialized\n");
+ else
+ opt_tbuf_size = 0;
+
+ return ret;
}
int trace_will_trace_event(u32 event)
@@ -248,6 +302,10 @@ int trace_will_trace_event(u32 event)
void __init init_trace_bufs(void)
{
int i;
+
+ /* Calculate offset in u32 of first mfn */
+ calc_tinfo_first_offset();
+
/* t_info size fixed at 2 pages for now. That should be big enough / small enough
* until it's worth making it dynamic. */
t_info = alloc_xenheap_pages(1, 0);
@@ -265,13 +323,18 @@ void __init init_trace_bufs(void)
share_xen_page_with_privileged_guests(
virt_to_page(t_info) + i, XENSHARE_writable);
-
-
if ( opt_tbuf_size == 0 )
{
printk("Xen trace buffers: disabled\n");
return;
}
+ else if ( check_tbuf_size(opt_tbuf_size) )
+ {
+ gdprintk(XENLOG_INFO, "Xen trace buffers: "
+ "tb size %d too large, disabling\n",
+ opt_tbuf_size);
+ opt_tbuf_size = 0;
+ }
if ( alloc_trace_bufs() == 0 )
{
@@ -279,6 +342,13 @@ void __init init_trace_bufs(void)
wmb(); /* above must be visible before tb_init_done flag set */
tb_init_done = 1;
}
+ else
+ {
+ gdprintk(XENLOG_INFO, "Xen trace buffers: "
+ "allocation size %d failed, disabling\n",
+ opt_tbuf_size);
+ opt_tbuf_size = 0;
+ }
}
/**

View File

@ -0,0 +1,27 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271162458 -3600
# Node ID 859a372efa66e6bcba8e1fd968e521cb16da12ea
# Parent da90dd1a09b93ae41ab451d223ff87dca04356f5
sysctl: Fix XEN_SYSCTL_debug_keys error path.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -169,12 +169,14 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
if ( ret )
break;
+ ret = -EFAULT;
for ( i = 0; i < op->u.debug_keys.nr_keys; i++ )
{
if ( copy_from_guest_offset(&c, op->u.debug_keys.keys, i, 1) )
- return -EFAULT;
+ goto out;
handle_keypress(c, guest_cpu_user_regs());
}
+ ret = 0;
}
break;

View File

@ -0,0 +1,53 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271353678 -3600
# Node ID d18e6a6c618af4f25a9e1a57c9e3eac55921678c
# Parent ffffddc4b1e030cce6bd4d12c4409c94599c1abf
x86_emulate: Emulate CLFLUSH instruction
We recently found that FreeBSD 8.0 guest failed to install and boot on
Xen. The reason was that FreeBSD detected clflush feature and invoked
this instruction to flush MMIO space. This caused a page fault; but
x86_emulate.c failed to emulate this instruction (not supported). As a
result, a page fault was detected inside FreeBSD. A similar issue was
reported earlier.
http://lists.xensource.com/archives/html/xen-devel/2010-03/msg00362.html
From: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-4.0.0-testing/xen/arch/x86/x86_emulate/x86_emulate.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c
+++ xen-4.0.0-testing/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -227,7 +227,8 @@ static uint8_t twobyte_table[256] = {
DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, 0, 0,
/* 0xA8 - 0xAF */
ImplicitOps, ImplicitOps, 0, DstBitBase|SrcReg|ModRM,
- DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, 0, DstReg|SrcMem|ModRM,
+ DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM,
+ ImplicitOps|ModRM, DstReg|SrcMem|ModRM,
/* 0xB0 - 0xB7 */
ByteOp|DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM,
DstReg|SrcMem|ModRM|Mov, DstBitBase|SrcReg|ModRM,
@@ -4008,6 +4009,19 @@ x86_emulate(
emulate_2op_SrcV_nobyte("bts", src, dst, _regs.eflags);
break;
+ case 0xae: /* Grp15 */
+ switch ( modrm_reg & 7 )
+ {
+ case 7: /* clflush */
+ fail_if(ops->wbinvd == NULL);
+ if ( (rc = ops->wbinvd(ctxt)) != 0 )
+ goto done;
+ break;
+ default:
+ goto cannot_emulate;
+ }
+ break;
+
case 0xaf: /* imul */
_regs.eflags &= ~(EFLG_OF|EFLG_CF);
switch ( dst.bytes )

23
21193-blktap-script.patch Normal file
View File

@ -0,0 +1,23 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271663923 -3600
# Node ID ae1abcdd4a670e34509e39d5280834a75afc0f6a
# Parent 6860c523d2daf1d110b130a9596469a0957b4032
tools/hotplug/Linux/blktap: remove optional tapdisk: prefix
Perhaps this should even be further generalized (e.g. to remove any
"[!/]*:" pattern prefixes) to be more forward compatible?
Signed-off-by: Jan Beulich <jbeulich@novell.com>
diff -r 6860c523d2da -r ae1abcdd4a67 tools/hotplug/Linux/blktap
--- a/tools/hotplug/Linux/blktap Mon Apr 19 08:55:33 2010 +0100
+++ b/tools/hotplug/Linux/blktap Mon Apr 19 08:58:43 2010 +0100
@@ -59,6 +59,7 @@
if [ -n "$t" ]
then
p=$(xenstore_read "$XENBUS_PATH/params")
+ p=${p#tapdisk:}
# if we have a ':', chew from head including :
if echo $p | grep -q \:
then

12
21194-ioemu-subtype.patch Normal file
View File

@ -0,0 +1,12 @@
diff -r c02cc832cb2d tools/python/xen/xend/server/BlktapController.py
--- a/tools/python/xen/xend/server/BlktapController.py Tue Apr 13 18:19:33 2010 +0100
+++ b/tools/python/xen/xend/server/BlktapController.py Fri Apr 16 12:05:39 2010 -0600
@@ -189,7 +189,7 @@
blktap2_installed=1;
if typ in ('tap'):
- if subtyp in ('tapdisk'):
+ if subtyp in ('tapdisk', 'ioemu'):
if params not in blktap2_disk_types or not blktap2_installed:
# pass this device off to BlktapController
log.warn('WARNING: using deprecated blktap module')

View File

@ -0,0 +1,32 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271925757 -3600
# Node ID 5b72f9832cc21ebdbbd8569836578817353314d8
# Parent 11d20f17f82c1c6fc6c003c363835a964338b311
xend: don't drop device config on domain start failure
If domain creation in xend fails before devices are configured, e.g.
insufficient memory, device config is dropped from xend's managed
domain config.
Once xend is restarted, the domain's devices are lost.
This patch fixes a bug in XendConfig where only the device
controller was consulted for device configuration.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
@@ -1166,8 +1166,8 @@ class XendConfig(dict):
config.append(['VDI', dev_cfg.get('VDI', '')])
sxpr.append(['device', config])
+ found = True
- found = True
except:
log.exception("dumping sxp from device controllers")
pass

77
21225-conring-iommu.patch Normal file
View File

@ -0,0 +1,77 @@
References: bnc#600794
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271954636 -3600
# Node ID 2b97855a629f1d79e1d075a6d2a8b569018b2094
# Parent a7947fd90328287dd097294b241753063c858597
console: Make initial static console buffer __initdata.
The previous scheme --- freeing an area of BSS --- did not interact
nicely with device passthrough as IOMMU will not have any Xen BSS area
in guest device pagetables. Hence if the freed BSS space gets
allocated to a guest, DMAs to guest's own memory can fail.
The simple solution here is to always free the static buffer at end of
boot (initmem is specially handled for IOMMUs) and require a
dynamically-allocated buffer always to be created.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -65,11 +65,7 @@ size_param("conring_size", opt_conring_s
#define _CONRING_SIZE 16384
#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
-static char
-#if _CONRING_SIZE >= PAGE_SIZE
- __attribute__((__section__(".bss.page_aligned"), __aligned__(PAGE_SIZE)))
-#endif
- _conring[_CONRING_SIZE];
+static char __initdata _conring[_CONRING_SIZE];
static char *__read_mostly conring = _conring;
static uint32_t __read_mostly conring_size = _CONRING_SIZE;
static uint32_t conringc, conringp;
@@ -596,25 +592,20 @@ void __init console_init_preirq(void)
void __init console_init_postirq(void)
{
char *ring;
- unsigned int i;
+ unsigned int i, order;
serial_init_postirq();
if ( !opt_conring_size )
opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh);
- /* Round size down to a power of two. */
- while ( opt_conring_size & (opt_conring_size - 1) )
- opt_conring_size &= opt_conring_size - 1;
- if ( opt_conring_size < conring_size )
- return;
-
- ring = alloc_xenheap_pages(get_order_from_bytes(opt_conring_size), 0);
- if ( ring == NULL )
+
+ order = get_order_from_bytes(max(opt_conring_size, conring_size));
+ while ( (ring = alloc_xenheap_pages(order, 0)) == NULL )
{
- printk("Unable to allocate console ring of %u bytes.\n",
- opt_conring_size);
- return;
+ BUG_ON(order == 0);
+ order--;
}
+ opt_conring_size = PAGE_SIZE << order;
spin_lock_irq(&console_lock);
for ( i = conringc ; i != conringp; i++ )
@@ -625,8 +616,6 @@ void __init console_init_postirq(void)
spin_unlock_irq(&console_lock);
printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
-
- init_xenheap_pages(__pa(_conring), __pa(_conring + _CONRING_SIZE));
}
void __init console_endboot(void)

View File

@ -0,0 +1,34 @@
References: bnc#595124
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1272280290 -3600
# Node ID d01ea51fc929c57c7d5f427e1aafa0de7a436473
# Parent f766f2142a8515d1dc71783355dc4fc1813d95c4
x86: make pxm_to_node() return sane values when disabling NUMA internally
Otherwise, pass-through code may call memory allocation functions with
invalid node IDs, causing the allocations to fail.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -25,7 +25,7 @@ static struct acpi_table_slit *__read_mo
static nodemask_t nodes_parsed __initdata;
static nodemask_t nodes_found __initdata;
static struct node nodes[MAX_NUMNODES] __initdata;
-static u8 __read_mostly pxm2node[256] = { [0 ... 255] = 0xff };
+static u8 __read_mostly pxm2node[256] = { [0 ... 255] = NUMA_NO_NODE };
static int num_node_memblks;
@@ -112,6 +112,8 @@ static __init void bad_srat(void)
acpi_numa = -1;
for (i = 0; i < MAX_LOCAL_APIC; i++)
apicid_to_node[i] = NUMA_NO_NODE;
+ for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
+ pxm2node[i] = NUMA_NO_NODE;
}
#ifdef CONFIG_X86_64

View File

@ -33,11 +33,9 @@ This still needs to be hooked up for ia64.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/setup.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/setup.c
+++ xen-4.0.1-testing/xen/arch/x86/setup.c
@@ -664,6 +664,11 @@ void __init __start_xen(unsigned long mb
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -642,6 +642,11 @@ void __init __start_xen(unsigned long mb
memcpy(&boot_e820, &e820, sizeof(e820));
/* Early kexec reservation (explicit static start address). */
@ -49,11 +47,9 @@ Index: xen-4.0.1-testing/xen/arch/x86/setup.c
kexec_reserve_area(&boot_e820);
/*
Index: xen-4.0.1-testing/xen/common/kexec.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/kexec.c
+++ xen-4.0.1-testing/xen/common/kexec.c
@@ -49,15 +49,109 @@ static unsigned char vmcoreinfo_data[VMC
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -47,15 +47,109 @@ static unsigned char vmcoreinfo_data[VMC
static size_t vmcoreinfo_size = 0;
xen_kexec_reserve_t kexec_crash_area;
@ -166,10 +162,8 @@ Index: xen-4.0.1-testing/xen/common/kexec.c
static void one_cpu_only(void)
{
/* Only allow the first cpu to continue - force other cpus to spin */
Index: xen-4.0.1-testing/xen/include/xen/kexec.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/kexec.h
+++ xen-4.0.1-testing/xen/include/xen/kexec.h
--- a/xen/include/xen/kexec.h
+++ b/xen/include/xen/kexec.h
@@ -12,6 +12,8 @@ typedef struct xen_kexec_reserve {
extern xen_kexec_reserve_t kexec_crash_area;

View File

@ -0,0 +1,24 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1272972545 -3600
# Node ID 6d21da6feb59db33eceb3aa6bcb8afac15ac7fd8
# Parent 71cf9b12ac9effe2b7cf0aec058f92ee36430e0a
vmx, tboot: Check the correct in/outside-SMX flag when init'ing VMX.
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -360,8 +360,9 @@ int vmx_cpu_up(void)
bios_locked = !!(eax & IA32_FEATURE_CONTROL_MSR_LOCK);
if ( bios_locked )
{
- if ( !(eax & (IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX |
- IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX)) )
+ if ( !(eax & (tboot_in_measured_env()
+ ? IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_INSIDE_SMX
+ : IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON_OUTSIDE_SMX)) )
{
printk("CPU%d: VMX disabled by BIOS.\n", cpu);
return 0;

View File

@ -12,11 +12,9 @@ the hypervisor. Add a new MMUEXT operation for this.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/mm.c
+++ xen-4.0.1-testing/xen/arch/x86/mm.c
@@ -2889,6 +2889,27 @@ int do_mmuext_op(
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2887,6 +2887,27 @@ int do_mmuext_op(
}
break;
@ -44,10 +42,8 @@ Index: xen-4.0.1-testing/xen/arch/x86/mm.c
case MMUEXT_SET_LDT:
{
unsigned long ptr = op.arg1.linear_addr;
Index: xen-4.0.1-testing/xen/include/public/xen.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/public/xen.h
+++ xen-4.0.1-testing/xen/include/public/xen.h
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -239,6 +239,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
*
* cmd: MMUEXT_FLUSH_CACHE

View File

@ -0,0 +1,99 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1272973341 -3600
# Node ID b07edd50661e7f768088c08215dabb9becb5c5b6
# Parent 6c7b905b03ff1cf171187bafe7129e3e213e5787
x86: fix Dom0 booting time regression
References: bnc#593536
Unfortunately the changes in c/s 21035 caused boot time to go up
significantly on certain large systems. To rectify this without going
back to the old behavior, introduce a new memory allocation flag so
that Dom0 allocations can exhaust non-DMA memory before starting to
consume DMA memory. For the latter, the behavior introduced in
aforementioned c/s gets retained, while for the former we can now even
try larger chunks first.
This builds on the fact that alloc_chunk() gets called with non-
increasing 'max_pages' arguments, end hence it can store locally the
allocation order last used (as larger order allocations can't succeed
during subsequent invocations if they failed once).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -125,26 +125,36 @@ string_param("dom0_ioports_disable", opt
static struct page_info * __init alloc_chunk(
struct domain *d, unsigned long max_pages)
{
+ static unsigned int __initdata last_order = MAX_ORDER;
+ static unsigned int __initdata memflags = MEMF_no_dma;
struct page_info *page;
- unsigned int order, free_order;
+ unsigned int order = get_order_from_pages(max_pages), free_order;
- /*
- * Allocate up to 2MB at a time: It prevents allocating very large chunks
- * from DMA pools before the >4GB pool is fully depleted.
- */
- if ( max_pages > (2UL << (20 - PAGE_SHIFT)) )
- max_pages = 2UL << (20 - PAGE_SHIFT);
- order = get_order_from_pages(max_pages);
- if ( (max_pages & (max_pages-1)) != 0 )
- order--;
- while ( (page = alloc_domheap_pages(d, order, 0)) == NULL )
+ if ( order > last_order )
+ order = last_order;
+ else if ( max_pages & (max_pages - 1) )
+ --order;
+ while ( (page = alloc_domheap_pages(d, order, memflags)) == NULL )
if ( order-- == 0 )
break;
+ if ( page )
+ last_order = order;
+ else if ( memflags )
+ {
+ /*
+ * Allocate up to 2MB at a time: It prevents allocating very large
+ * chunks from DMA pools before the >4GB pool is fully depleted.
+ */
+ last_order = 21 - PAGE_SHIFT;
+ memflags = 0;
+ return alloc_chunk(d, max_pages);
+ }
+
/*
* Make a reasonable attempt at finding a smaller chunk at a higher
* address, to avoid allocating from low memory as much as possible.
*/
- for ( free_order = order; page && order--; )
+ for ( free_order = order; !memflags && page && order--; )
{
struct page_info *pg2;
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1157,8 +1157,9 @@ struct page_info *alloc_domheap_pages(
pg = alloc_heap_pages(dma_zone + 1, zone_hi, node, order, memflags);
if ( (pg == NULL) &&
- ((pg = alloc_heap_pages(MEMZONE_XEN + 1, zone_hi,
- node, order, memflags)) == NULL) )
+ ((memflags & MEMF_no_dma) ||
+ ((pg = alloc_heap_pages(MEMZONE_XEN + 1, zone_hi,
+ node, order, memflags)) == NULL)) )
return NULL;
if ( (d != NULL) && assign_pages(d, pg, order, memflags) )
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -79,6 +79,8 @@ int assign_pages(
#define MEMF_populate_on_demand (1U<<_MEMF_populate_on_demand)
#define _MEMF_tmem 2
#define MEMF_tmem (1U<<_MEMF_tmem)
+#define _MEMF_no_dma 3
+#define MEMF_no_dma (1U<<_MEMF_no_dma)
#define _MEMF_node 8
#define MEMF_node(n) ((((n)+1)&0xff)<<_MEMF_node)
#define _MEMF_bits 24

26
21273-linux-autconf.patch Normal file
View File

@ -0,0 +1,26 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1272973376 -3600
# Node ID d2373000996d850c46297740fbd11ea1d93d59d9
# Parent b07edd50661e7f768088c08215dabb9becb5c5b6
linux pvdrv: generalize location of autoconf.h
The location of the file in the build tree changed in recent Linux;
since there can be only one such file, using a wild card instead of
an explicit directory name seems the easiest solution.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/overrides.mk
===================================================================
--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/overrides.mk
+++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/overrides.mk
@@ -11,7 +11,7 @@ ifeq ($(ARCH),ia64)
_XEN_CPPFLAGS += -DCONFIG_VMX_GUEST
endif
-_XEN_CPPFLAGS += -include $(objtree)/include/linux/autoconf.h
+_XEN_CPPFLAGS += -include $(wildcard $(objtree)/include/*/autoconf.h)
EXTRA_CFLAGS += $(_XEN_CPPFLAGS)
EXTRA_AFLAGS += $(_XEN_CPPFLAGS)

View File

@ -11,11 +11,9 @@ makes sense to also allow HVM guests to make use of it.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.0.1-testing/xen/arch/x86/hvm/hvm.c
@@ -603,11 +603,12 @@ static int hvm_load_cpu_ctxt(struct doma
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -629,11 +629,12 @@ static int hvm_load_cpu_ctxt(struct doma
return -EINVAL;
}
@ -29,7 +27,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/hvm/hvm.c
(!cpu_has_ffxsr && (ctxt.msr_efer & EFER_FFXSE)) ||
((ctxt.msr_efer & (EFER_LME|EFER_LMA)) == EFER_LMA) )
{
@@ -960,10 +961,11 @@ int hvm_set_efer(uint64_t value)
@@ -984,10 +985,11 @@ int hvm_set_efer(uint64_t value)
value &= ~EFER_LMA;
@ -42,11 +40,9 @@ Index: xen-4.0.1-testing/xen/arch/x86/hvm/hvm.c
(!cpu_has_ffxsr && (value & EFER_FFXSE)) )
{
gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
Index: xen-4.0.1-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-4.0.1-testing/xen/arch/x86/hvm/svm/svm.c
@@ -57,6 +57,9 @@
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -56,6 +56,9 @@
u32 svm_feature_flags;
@ -56,7 +52,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/hvm/svm/svm.c
#define set_segment_register(name, value) \
asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
@@ -871,6 +874,29 @@ static int svm_cpu_up(struct cpuinfo_x86
@@ -847,6 +850,29 @@ static int svm_cpu_up(struct cpuinfo_x86
/* Initialize core's ASID handling. */
svm_asid_init(c);
@ -86,11 +82,9 @@ Index: xen-4.0.1-testing/xen/arch/x86/hvm/svm/svm.c
return 1;
}
Index: xen-4.0.1-testing/xen/include/asm-x86/hvm/hvm.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-4.0.1-testing/xen/include/asm-x86/hvm/hvm.h
@@ -143,6 +143,7 @@ struct hvm_function_table {
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -131,6 +131,7 @@ struct hvm_function_table {
extern struct hvm_function_table hvm_funcs;
extern int hvm_enabled;

View File

@ -11,10 +11,8 @@ a tasklet-based alternative mechanism to handle Dom0 state dumps.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/common/keyhandler.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/keyhandler.c
+++ xen-4.0.1-testing/xen/common/keyhandler.c
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -19,6 +19,7 @@
static struct keyhandler *key_table[256];
@ -68,7 +66,7 @@ Index: xen-4.0.1-testing/xen/common/keyhandler.c
}
static struct keyhandler dump_dom0_registers_keyhandler = {
@@ -434,8 +465,28 @@ static struct keyhandler do_debug_key_ke
@@ -425,8 +456,28 @@ static struct keyhandler do_debug_key_ke
.desc = "trap to xendbg"
};

View File

@ -0,0 +1,23 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273220860 -3600
# Node ID 5ac6e33fa3a7fe6645eaeb7de530a29be2865c34
# Parent 7af536406c255bdc9d3429679710b0827d52bdaf
xend: support blktap2 in xend blkif utils
Support tap2 device type in xend blkif utils parse method.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 7af536406c25 -r 5ac6e33fa3a7 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py Fri May 07 09:26:49 2010 +0100
+++ b/tools/python/xen/util/blkif.py Fri May 07 09:27:40 2010 +0100
@@ -86,7 +86,7 @@
else:
fn = "/dev/%s" %(fn,)
- if typ == "tap":
+ if typ in ("tap", "tap2"):
(taptype, fn) = fn.split(":", 1)
return (fn, taptype)

View File

@ -0,0 +1,41 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273256548 -3600
# Node ID bbf009817ffbe15a7cbbda8bddd82640f290ce0c
# Parent a97ef0eb0b9d520b8b6b97d240771cc27de978e3
svm: Avoid VINTR injection during NMI shadow
It is invalid because we get vmexit via IRET interception in this
case. VINTR is unaware of NMI shadows and may vmexit early, leaving us
in an endless loop of VINTR injections and interceptions.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -88,10 +88,21 @@ static void enable_intr_window(struct vc
* guest can accept the real interrupt.
*
* TODO: Better NMI handling. We need a way to skip a MOV SS interrupt
- * shadow. This is hard to do without hardware support. We should also
- * track 'NMI blocking' from NMI injection until IRET. This can be done
- * quite easily in software by intercepting the unblocking IRET.
+ * shadow. This is hard to do without hardware support. Also we should
+ * not be waiting for EFLAGS.IF to become 1.
*/
+
+ /*
+ * NMI-blocking window is handled by IRET interception. We should not
+ * inject a VINTR in this case as VINTR is unaware of NMI-blocking and
+ * hence we can enter an endless loop (VINTR intercept fires, yet
+ * hvm_interrupt_blocked() still indicates NMI-blocking is active, so
+ * we inject a VINTR, ...).
+ */
+ if ( (intack.source == hvm_intsrc_nmi) &&
+ (vmcb->general1_intercepts & GENERAL1_INTERCEPT_IRET) )
+ return;
+
intr = vmcb->vintr;
intr.fields.irq = 1;
intr.fields.vector = 0;

View File

@ -0,0 +1,26 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273479772 -3600
# Node ID 93c5beba9d04d3e8d2522241bad14107433c3121
# Parent 3b6e33ebb57b670a48ad138aecb47cbd32a4e986
xentrace: fix bug in t_info size
t_info size should be in bytes, not pages. This fixes a bug
that crashes the hypervisor if the total number of all pages
is more than 1024 but less than 2048.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Index: xen-4.0.0-testing/xen/common/trace.c
===================================================================
--- xen-4.0.0-testing.orig/xen/common/trace.c
+++ xen-4.0.0-testing/xen/common/trace.c
@@ -367,7 +367,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc
case XEN_SYSCTL_TBUFOP_get_info:
tbc->evt_mask = tb_event_mask;
tbc->buffer_mfn = t_info ? virt_to_mfn(t_info) : 0;
- tbc->size = T_INFO_PAGES;
+ tbc->size = T_INFO_PAGES * PAGE_SIZE;
break;
case XEN_SYSCTL_TBUFOP_set_cpu_mask:
xenctl_cpumap_to_cpumask(&tb_cpu_mask, &tbc->cpu_mask);

View File

@ -0,0 +1,56 @@
References: bnc#603008
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273563345 -3600
# Node ID 220fa418eaae499cdc14359e83092401290a6211
# Parent 804304d4e05d98289de9a107c6b26c5a1db09cd8
VT-d: prevent watchdog timer from kicking in when
initializing on systems with huge amounts of memory
Process pending soft-IRQs every 4G worth of pages initialized for Dom0
to keep timekeeping happy and prevent the NMI watchdog (when enabled)
from kicking in.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/drivers/passthrough/vtd/ia64/vtd.c
+++ b/xen/drivers/passthrough/vtd/ia64/vtd.c
@@ -19,6 +19,7 @@
*/
#include <xen/sched.h>
+#include <xen/softirq.h>
#include <xen/domain_page.h>
#include <xen/iommu.h>
#include <xen/numa.h>
@@ -110,6 +111,9 @@ static int do_dom0_iommu_mapping(unsigne
iommu_map_page(d, (pfn*tmp+j), (pfn*tmp+j));
page_addr += PAGE_SIZE;
+
+ if (!(pfn & (0xfffff >> (PAGE_SHIFT - PAGE_SHIFT_4K))))
+ process_pending_softirqs();
}
return 0;
}
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -19,6 +19,7 @@
*/
#include <xen/sched.h>
+#include <xen/softirq.h>
#include <xen/domain_page.h>
#include <asm/paging.h>
#include <xen/iommu.h>
@@ -153,6 +154,9 @@ void iommu_set_dom0_mapping(struct domai
tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K);
for ( j = 0; j < tmp; j++ )
iommu_map_page(d, (i*tmp+j), (i*tmp+j));
+
+ if (!(i & (0xfffff >> (PAGE_SHIFT - PAGE_SHIFT_4K))))
+ process_pending_softirqs();
}
}

View File

@ -0,0 +1,67 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273573287 -3600
# Node ID 7d4deb86b9661b8585fc2b5c41334f2b34b0922b
# Parent 2077d6ad60780bbe0631c0dee1ef2e2b8eb03867
x86: Detect and handle unexpected platform-timer counter wrap.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -571,26 +571,48 @@ static u64 plt_stamp64; /* 64-b
static u64 plt_stamp; /* hardware-width platform counter stamp */
static struct timer plt_overflow_timer;
+static s_time_t __read_platform_stime(u64 platform_time)
+{
+ u64 diff = platform_time - platform_timer_stamp;
+ ASSERT(spin_is_locked(&platform_timer_lock));
+ return (stime_platform_stamp + scale_delta(diff, &plt_scale));
+}
+
static void plt_overflow(void *unused)
{
+ int i;
u64 count;
+ s_time_t now, plt_now, plt_wrap;
spin_lock_irq(&platform_timer_lock);
+
count = plt_src.read_counter();
plt_stamp64 += (count - plt_stamp) & plt_mask;
plt_stamp = count;
+
+ now = NOW();
+ plt_wrap = __read_platform_stime(plt_stamp64);
+ for ( i = 0; i < 10; i++ )
+ {
+ plt_now = plt_wrap;
+ plt_wrap = __read_platform_stime(plt_stamp64 + plt_mask + 1);
+ if ( __builtin_llabs(plt_wrap - now) > __builtin_llabs(plt_now - now) )
+ break;
+ plt_stamp64 += plt_mask + 1;
+ }
+ if ( i != 0 )
+ {
+ static bool_t warned_once;
+ if ( !test_and_set_bool(warned_once) )
+ printk("Platform timer appears to have unexpectedly wrapped "
+ "%u%s times.\n", i, (i == 10) ? " or more" : "");
+ }
+
spin_unlock_irq(&platform_timer_lock);
set_timer(&plt_overflow_timer, NOW() + plt_overflow_period);
}
-static s_time_t __read_platform_stime(u64 platform_time)
-{
- u64 diff = platform_time - platform_timer_stamp;
- ASSERT(spin_is_locked(&platform_timer_lock));
- return (stime_platform_stamp + scale_delta(diff, &plt_scale));
-}
-
static s_time_t read_platform_stime(void)
{
u64 count;

313
21349-x86-memcpy.patch Normal file
View File

@ -0,0 +1,313 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273583128 -3600
# Node ID d77a88f938c635c3ccfedaa00f946e4d9ed26098
# Parent 2b5e14e4c5e57b0064d1c0415d9c4629bd0aac9b
x86: Replace our own specialised versions of memset and memcpy with
direct use of gcc's built-in versions.
This dramatically simplifies our code while also avoiding compile
warnings with certain intermediate versions of gcc.
This patch is based on an initial version by Jan Beulich.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-4.0.0-testing/xen/arch/x86/string.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/string.c
+++ xen-4.0.0-testing/xen/arch/x86/string.c
@@ -14,25 +14,12 @@ void *memcpy(void *dest, const void *src
long d0, d1, d2;
asm volatile (
-#ifdef __i386__
- " rep movsl ; "
-#else
- " rep movsq ; "
- " testb $4,%b4 ; "
- " je 0f ; "
- " movsl ; "
- "0: ; "
-#endif
- " testb $2,%b4 ; "
- " je 1f ; "
- " movsw ; "
- "1: testb $1,%b4 ; "
- " je 2f ; "
- " movsb ; "
- "2: "
+ " rep ; movs"__OS" ; "
+ " mov %4,%3 ; "
+ " rep ; movsb "
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
- : "0" (n/sizeof(long)), "q" (n), "1" (dest), "2" (src)
- : "memory");
+ : "0" (n/BYTES_PER_LONG), "r" (n%BYTES_PER_LONG), "1" (dest), "2" (src)
+ : "memory" );
return dest;
}
@@ -55,7 +42,7 @@ void *memset(void *s, int c, size_t n)
void *memmove(void *dest, const void *src, size_t n)
{
long d0, d1, d2;
-
+
if ( dest < src )
return memcpy(dest, src, n);
Index: xen-4.0.0-testing/xen/include/asm-x86/string.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/string.h
+++ xen-4.0.0-testing/xen/include/asm-x86/string.h
@@ -3,246 +3,14 @@
#include <xen/config.h>
-static inline void *__variable_memcpy(void *to, const void *from, size_t n)
-{
- long d0, d1, d2;
- __asm__ __volatile__ (
- " rep ; movs"__OS"\n"
- " mov %4,%3 \n"
- " rep ; movsb \n"
- : "=&c" (d0), "=&D" (d1), "=&S" (d2)
- : "0" (n/BYTES_PER_LONG), "r" (n%BYTES_PER_LONG), "1" (to), "2" (from)
- : "memory" );
- return to;
-}
-
-/*
- * This looks horribly ugly, but the compiler can optimize it totally,
- * as the count is constant.
- */
-static always_inline void * __constant_memcpy(
- void * to, const void * from, size_t n)
-{
- switch ( n )
- {
- case 0:
- return to;
- case 1:
- *(u8 *)to = *(const u8 *)from;
- return to;
- case 2:
- *(u16 *)to = *(const u16 *)from;
- return to;
- case 3:
- *(u16 *)to = *(const u16 *)from;
- *(2+(u8 *)to) = *(2+(const u8 *)from);
- return to;
- case 4:
- *(u32 *)to = *(const u32 *)from;
- return to;
- case 5:
- *(u32 *)to = *(const u32 *)from;
- *(4+(u8 *)to) = *(4+(const u8 *)from);
- return to;
- case 6:
- *(u32 *)to = *(const u32 *)from;
- *(2+(u16 *)to) = *(2+(const u16 *)from);
- return to;
- case 7:
- *(u32 *)to = *(const u32 *)from;
- *(2+(u16 *)to) = *(2+(const u16 *)from);
- *(6+(u8 *)to) = *(6+(const u8 *)from);
- return to;
- case 8:
- *(u64 *)to = *(const u64 *)from;
- return to;
- case 12:
- *(u64 *)to = *(const u64 *)from;
- *(2+(u32 *)to) = *(2+(const u32 *)from);
- return to;
- case 16:
- *(u64 *)to = *(const u64 *)from;
- *(1+(u64 *)to) = *(1+(const u64 *)from);
- return to;
- case 20:
- *(u64 *)to = *(const u64 *)from;
- *(1+(u64 *)to) = *(1+(const u64 *)from);
- *(4+(u32 *)to) = *(4+(const u32 *)from);
- return to;
- }
-#define COMMON(x) \
- __asm__ __volatile__ ( \
- "rep ; movs"__OS \
- x \
- : "=&c" (d0), "=&D" (d1), "=&S" (d2) \
- : "0" (n/BYTES_PER_LONG), "1" (to), "2" (from) \
- : "memory" );
- {
- long d0, d1, d2;
- switch ( n % BYTES_PER_LONG )
- {
- case 0: COMMON(""); return to;
- case 1: COMMON("\n\tmovsb"); return to;
- case 2: COMMON("\n\tmovsw"); return to;
- case 3: COMMON("\n\tmovsw\n\tmovsb"); return to;
- case 4: COMMON("\n\tmovsl"); return to;
- case 5: COMMON("\n\tmovsl\n\tmovsb"); return to;
- case 6: COMMON("\n\tmovsl\n\tmovsw"); return to;
- case 7: COMMON("\n\tmovsl\n\tmovsw\n\tmovsb"); return to;
- }
- }
-#undef COMMON
- return to;
-}
-
#define __HAVE_ARCH_MEMCPY
-/* align source to a 64-bit boundary */
-static always_inline
-void *__var_memcpy(void *t, const void *f, size_t n)
-{
- int off = (unsigned long)f & 0x7;
- /* just do alignment if needed and if size is worth */
- if ( (n > 32) && off ) {
- size_t n1 = 8 - off;
- __variable_memcpy(t, f, n1);
- __variable_memcpy(t + n1, f + n1, n - n1);
- return t;
- } else {
- return (__variable_memcpy(t, f, n));
- }
-}
-
-#define memcpy(t,f,n) (__memcpy((t),(f),(n)))
-static always_inline
-void *__memcpy(void *t, const void *f, size_t n)
-{
- return (__builtin_constant_p(n) ?
- __constant_memcpy((t),(f),(n)) :
- __var_memcpy((t),(f),(n)));
-}
+#define memcpy(t,f,n) (__builtin_memcpy((t),(f),(n)))
-/* Some version of gcc don't have this builtin. It's non-critical anyway. */
+/* Some versions of gcc don't have this builtin. It's non-critical anyway. */
#define __HAVE_ARCH_MEMMOVE
extern void *memmove(void *dest, const void *src, size_t n);
-static inline void *__memset_generic(void *s, char c, size_t count)
-{
- long d0, d1;
- __asm__ __volatile__ (
- "rep ; stosb"
- : "=&c" (d0), "=&D" (d1) : "a" (c), "1" (s), "0" (count) : "memory" );
- return s;
-}
-
-/* we might want to write optimized versions of these later */
-#define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count))
-
-/*
- * memset(x,0,y) is a reasonably common thing to do, so we want to fill
- * things 32 bits at a time even when we don't know the size of the
- * area at compile-time..
- */
-static inline void *__constant_c_memset(void *s, unsigned long c, size_t count)
-{
- long d0, d1;
- __asm__ __volatile__(
- " rep ; stos"__OS"\n"
- " mov %3,%4 \n"
- " rep ; stosb \n"
- : "=&c" (d0), "=&D" (d1)
- : "a" (c), "r" (count%BYTES_PER_LONG),
- "0" (count/BYTES_PER_LONG), "1" (s)
- : "memory" );
- return s;
-}
-
-/*
- * This looks horribly ugly, but the compiler can optimize it totally,
- * as we by now know that both pattern and count is constant..
- */
-static always_inline void *__constant_c_and_count_memset(
- void *s, unsigned long pattern, size_t count)
-{
- switch ( count )
- {
- case 0:
- return s;
- case 1:
- *(u8 *)s = pattern;
- return s;
- case 2:
- *(u16 *)s = pattern;
- return s;
- case 3:
- *(u16 *)s = pattern;
- *(2+(u8 *)s) = pattern;
- return s;
- case 4:
- *(u32 *)s = pattern;
- return s;
- case 5:
- *(u32 *)s = pattern;
- *(4+(u8 *)s) = pattern;
- return s;
- case 6:
- *(u32 *)s = pattern;
- *(2+(u16 *)s) = pattern;
- return s;
- case 7:
- *(u32 *)s = pattern;
- *(2+(u16 *)s) = pattern;
- *(6+(u8 *)s) = pattern;
- return s;
- case 8:
- *(u64 *)s = pattern;
- return s;
- }
-#define COMMON(x) \
- __asm__ __volatile__ ( \
- "rep ; stos"__OS \
- x \
- : "=&c" (d0), "=&D" (d1) \
- : "a" (pattern), "0" (count/BYTES_PER_LONG), "1" (s) \
- : "memory" )
- {
- long d0, d1;
- switch ( count % BYTES_PER_LONG )
- {
- case 0: COMMON(""); return s;
- case 1: COMMON("\n\tstosb"); return s;
- case 2: COMMON("\n\tstosw"); return s;
- case 3: COMMON("\n\tstosw\n\tstosb"); return s;
- case 4: COMMON("\n\tstosl"); return s;
- case 5: COMMON("\n\tstosl\n\tstosb"); return s;
- case 6: COMMON("\n\tstosl\n\tstosw"); return s;
- case 7: COMMON("\n\tstosl\n\tstosw\n\tstosb"); return s;
- }
- }
-#undef COMMON
- return s;
-}
-
-#define __constant_c_x_memset(s, c, count) \
-(__builtin_constant_p(count) ? \
- __constant_c_and_count_memset((s),(c),(count)) : \
- __constant_c_memset((s),(c),(count)))
-
-#define __var_x_memset(s, c, count) \
-(__builtin_constant_p(count) ? \
- __constant_count_memset((s),(c),(count)) : \
- __memset_generic((s),(c),(count)))
-
-#ifdef CONFIG_X86_64
-#define MEMSET_PATTERN_MUL 0x0101010101010101UL
-#else
-#define MEMSET_PATTERN_MUL 0x01010101UL
-#endif
-
#define __HAVE_ARCH_MEMSET
-#define memset(s, c, count) (__memset((s),(c),(count)))
-#define __memset(s, c, count) \
-(__builtin_constant_p(c) ? \
- __constant_c_x_memset((s),(MEMSET_PATTERN_MUL*(unsigned char)(c)),(count)) : \
- __var_x_memset((s),(c),(count)))
+#define memset(s,c,n) (__builtin_memset((s),(c),(n)))
#endif /* __X86_STRING_H__ */

View File

@ -0,0 +1,20 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273651780 -3600
# Node ID fa94385978e6317732e2c12000923ca6a5e0d2ed
# Parent 0079f76e906f378f81044da4e135df2fbb878fa5
mce: MCE polling logic should check mce_disabled during initialisation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -91,7 +91,7 @@ static int __init init_nonfatal_mce_chec
struct cpuinfo_x86 *c = &boot_cpu_data;
/* Check for MCE support */
- if (!mce_available(c))
+ if (mce_disabled || !mce_available(c))
return -ENODEV;
/*

View File

@ -0,0 +1,42 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273740260 -3600
# Node ID 6c22d2dfed4882d5febf98d2afbb96ec9bedd043
# Parent 97da07c523ddc2565da67b6cfeec006d742bb06d
x86: Fix a few on_{selected,each}_cpus callers who should wait for completion.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -195,7 +195,7 @@ static void drv_write(struct drv_cmd *cm
cpu_isset(smp_processor_id(), cmd->mask))
do_drv_write((void *)cmd);
else
- on_selected_cpus(&cmd->mask, do_drv_write, cmd, 0);
+ on_selected_cpus(&cmd->mask, do_drv_write, cmd, 1);
}
static u32 get_cur_val(cpumask_t mask)
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -122,7 +122,7 @@ static int powernow_cpufreq_target(struc
cmd.val = next_perf_state;
- on_selected_cpus(&cmd.mask, transition_pstate, &cmd, 0);
+ on_selected_cpus(&cmd.mask, transition_pstate, &cmd, 1);
for_each_cpu_mask(j, online_policy_cpus)
cpufreq_statistic_update(j, perf->state, next_perf_state);
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1610,7 +1610,7 @@ long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u
add_taint(TAINT_ERROR_INJECT);
if ( mce_broadcast )
- on_each_cpu(x86_mc_mceinject, mc_mceinject, 0);
+ on_each_cpu(x86_mc_mceinject, mc_mceinject, 1);
else
on_selected_cpus(cpumask_of(target), x86_mc_mceinject,
mc_mceinject, 1);

View File

@ -0,0 +1,48 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1273741742 -3600
# Node ID 1ec412805622fd7ec0e88bf3b7ab681d024994bc
# Parent 6c22d2dfed4882d5febf98d2afbb96ec9bedd043
Even 'dummy' domains (e.g., dom_xen a.k.a. DOMID_XEN) must have valid I/O caps.
Ensure the rangesets are always initialised. Certain (privileged)
invocations of hypercalls such as mmu_update can end up interrogating
these special domains for possible I/O capabilities.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -245,12 +245,17 @@ struct domain *domain_create(
d->disable_migrate = 1;
}
- if ( domcr_flags & DOMCRF_dummy )
- return d;
-
rangeset_domain_initialise(d);
init_status |= INIT_rangeset;
+ d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
+ d->irq_caps = rangeset_new(d, "Interrupts", 0);
+ if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
+ goto fail;
+
+ if ( domcr_flags & DOMCRF_dummy )
+ return d;
+
if ( !is_idle_domain(d) )
{
if ( xsm_domain_create(d, ssidref) != 0 )
@@ -285,11 +290,6 @@ struct domain *domain_create(
goto fail;
init_status |= INIT_arch;
- d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex);
- d->irq_caps = rangeset_new(d, "Interrupts", 0);
- if ( (d->iomem_caps == NULL) || (d->irq_caps == NULL) )
- goto fail;
-
if ( sched_init_domain(d) != 0 )
goto fail;

141
21408-amd-erratum-383.patch Normal file
View File

@ -0,0 +1,141 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1274178085 -3600
# Node ID f40acba36be886e4b4e87afeacf39688f316dfe4
# Parent e4028345ad48c442eb55b7bc08afdf1aede0aa2e
svm: Fix for AMD erratum 383 on Family 10h CPUs
This patches implements the workaround of AMD erratum 383 on family
10h CPUs. It destroys the guest VM when a MC error with a special
pattern is detected. Without this patch, a guest VM failure can
potentially crash Xen hypervisor and the whole system. The erratum
will be published in next version of guide.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
Index: xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c
@@ -72,6 +72,8 @@ static void *hsa[NR_CPUS] __read_mostly;
/* vmcb used for extended host state */
static void *root_vmcb[NR_CPUS] __read_mostly;
+static bool_t amd_erratum383_found __read_mostly;
+
static void inline __update_guest_eip(
struct cpu_user_regs *regs, unsigned int inst_len)
{
@@ -822,6 +824,20 @@ static int svm_cpu_prepare(unsigned int
return 0;
}
+static void svm_init_erratum_383(struct cpuinfo_x86 *c)
+{
+ uint64_t msr_content;
+
+ /* only family 10h is affected */
+ if ( c->x86 != 0x10 )
+ return;
+
+ rdmsrl(MSR_AMD64_DC_CFG, msr_content);
+ wrmsrl(MSR_AMD64_DC_CFG, msr_content | (1ULL << 47));
+
+ amd_erratum383_found = 1;
+}
+
static int svm_cpu_up(struct cpuinfo_x86 *c)
{
u32 eax, edx, phys_hsa_lo, phys_hsa_hi;
@@ -847,6 +863,9 @@ static int svm_cpu_up(struct cpuinfo_x86
phys_hsa_hi = (u32)(phys_hsa >> 32);
wrmsr(MSR_K8_VM_HSAVE_PA, phys_hsa_lo, phys_hsa_hi);
+ /* check for erratum 383 */
+ svm_init_erratum_383(c);
+
/* Initialize core's ASID handling. */
svm_asid_init(c);
@@ -1244,6 +1263,47 @@ static void svm_vmexit_ud_intercept(stru
}
}
+extern unsigned int nr_mce_banks; /* from mce.h */
+
+static int svm_is_erratum_383(struct cpu_user_regs *regs)
+{
+ uint64_t msr_content;
+ uint32_t i;
+ struct vcpu *v = current;
+
+ if ( !amd_erratum383_found )
+ return 0;
+
+ rdmsrl(MSR_IA32_MC0_STATUS, msr_content);
+ /* Bit 62 may or may not be set for this mce */
+ msr_content &= ~(1ULL << 62);
+
+ if ( msr_content != 0xb600000000010015ULL )
+ return 0;
+
+ /* Clear MCi_STATUS registers */
+ for (i = 0; i < nr_mce_banks; i++)
+ wrmsrl(MSR_IA32_MCx_STATUS(i), 0ULL);
+
+ rdmsrl(MSR_IA32_MCG_STATUS, msr_content);
+ wrmsrl(MSR_IA32_MCG_STATUS, msr_content & ~(1ULL << 2));
+
+ /* flush TLB */
+ flush_tlb_mask(&v->domain->domain_dirty_cpumask);
+
+ return 1;
+}
+
+static void svm_vmexit_mce_intercept(
+ struct vcpu *v, struct cpu_user_regs *regs)
+{
+ if ( svm_is_erratum_383(regs) )
+ {
+ gdprintk(XENLOG_ERR, "SVM hits AMD erratum 383\n");
+ domain_crash(v->domain);
+ }
+}
+
static void wbinvd_ipi(void *info)
{
wbinvd();
@@ -1432,6 +1492,7 @@ asmlinkage void svm_vmexit_handler(struc
/* Asynchronous event, handled when we STGI'd after the VMEXIT. */
case VMEXIT_EXCEPTION_MC:
HVMTRACE_0D(MCE);
+ svm_vmexit_mce_intercept(v, regs);
break;
case VMEXIT_VINTR:
Index: xen-4.0.0-testing/xen/include/asm-x86/msr-index.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/msr-index.h
+++ xen-4.0.0-testing/xen/include/asm-x86/msr-index.h
@@ -146,6 +146,11 @@
#define MSR_IA32_MC8_ADDR 0x00000422
#define MSR_IA32_MC8_MISC 0x00000423
+#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
+#define MSR_IA32_MCx_STATUS(x) (MSR_IA32_MC0_STATUS + 4*(x))
+#define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x))
+#define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x))
+
#define MSR_P6_PERFCTR0 0x000000c1
#define MSR_P6_PERFCTR1 0x000000c2
#define MSR_P6_EVNTSEL0 0x00000186
@@ -224,6 +229,7 @@
/* AMD64 MSRs */
#define MSR_AMD64_NB_CFG 0xc001001f
+#define MSR_AMD64_DC_CFG 0xc0011022
#define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT 46
/* AMD Family10h machine check MSRs */

View File

@ -18,11 +18,9 @@ device is deassigned from a domain.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/ia64/ats.c
===================================================================
--- xen-4.0.1-testing.orig/xen/drivers/passthrough/vtd/ia64/ats.c
+++ xen-4.0.1-testing/xen/drivers/passthrough/vtd/ia64/ats.c
@@ -47,6 +47,11 @@ int enable_ats_device(int seg, int bus,
--- a/xen/drivers/passthrough/vtd/ia64/ats.c
+++ b/xen/drivers/passthrough/vtd/ia64/ats.c
@@ -47,6 +47,11 @@ int enable_ats_device(int seg, int bus,
return 0;
}
@ -34,11 +32,9 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/ia64/ats.c
int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
u64 addr, unsigned int size_order, u64 type)
{
Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/iommu.c
===================================================================
--- xen-4.0.1-testing.orig/xen/drivers/passthrough/vtd/iommu.c
+++ xen-4.0.1-testing/xen/drivers/passthrough/vtd/iommu.c
@@ -1331,6 +1331,9 @@ static int domain_context_mapping(struct
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1324,6 +1324,9 @@ static int domain_context_mapping(struct
dprintk(VTDPREFIX, "d%d:PCIe: map bdf = %x:%x.%x\n",
domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn);
@ -48,7 +44,7 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/iommu.c
break;
case DEV_TYPE_PCI:
@@ -1460,6 +1463,9 @@ static int domain_context_unmap(struct d
@@ -1453,6 +1456,9 @@ static int domain_context_unmap(struct d
dprintk(VTDPREFIX, "d%d:PCIe: unmap bdf = %x:%x.%x\n",
domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
ret = domain_context_unmap_one(domain, iommu, bus, devfn);
@ -58,7 +54,7 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/iommu.c
break;
case DEV_TYPE_PCI:
@@ -1788,8 +1794,6 @@ static void setup_dom0_devices(struct do
@@ -1771,8 +1777,6 @@ static void setup_dom0_devices(struct do
list_add(&pdev->domain_list, &d->arch.pdev_list);
domain_context_mapping(d, pdev->bus, pdev->devfn);
pci_enable_acs(pdev);
@ -67,10 +63,8 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/iommu.c
}
}
spin_unlock(&pcidevs_lock);
Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/x86/ats.c
===================================================================
--- xen-4.0.1-testing.orig/xen/drivers/passthrough/vtd/x86/ats.c
+++ xen-4.0.1-testing/xen/drivers/passthrough/vtd/x86/ats.c
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -92,6 +92,9 @@ int ats_device(int seg, int bus, int dev
pdev = pci_get_pdev(bus, devfn);
@ -81,7 +75,7 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/x86/ats.c
if ( !ecap_queued_inval(drhd->iommu->ecap) ||
!ecap_dev_iotlb(drhd->iommu->ecap) )
return 0;
@@ -144,6 +147,9 @@ int enable_ats_device(int seg, int bus,
@@ -144,6 +147,9 @@ int enable_ats_device(int seg, int bus,
value = pci_conf_read16(bus, PCI_SLOT(devfn),
PCI_FUNC(devfn), pos + ATS_REG_CTL);
@ -91,7 +85,7 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/vtd/x86/ats.c
value |= ATS_ENABLE;
pci_conf_write16(bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
pos + ATS_REG_CTL, value);
@@ -153,10 +159,50 @@ int enable_ats_device(int seg, int bus,
@@ -153,10 +159,50 @@ int enable_ats_device(int seg, int bus,
pdev->devfn = devfn;
pdev->ats_queue_depth = queue_depth;
list_add(&(pdev->list), &ats_devices);

View File

@ -0,0 +1,45 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1274298365 -3600
# Node ID c414129c8e129422d03898ec5822f56b2d2da4f8
# Parent fe18437da295d0fdad2d852a603144eec62d29cd
vmx: Do not modify global vmx_vm{entry,exit}_control fields in init_vmcs_config()
The function shoudl only have single-domain effect.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -558,6 +558,8 @@ static int construct_vmcs(struct vcpu *v
struct domain *d = v->domain;
uint16_t sysenter_cs;
unsigned long sysenter_eip;
+ u32 vmexit_ctl = vmx_vmexit_control;
+ u32 vmentry_ctl = vmx_vmentry_control;
vmx_vmcs_enter(v);
@@ -584,17 +586,17 @@ static int construct_vmcs(struct vcpu *v
v->arch.hvm_vmx.secondary_exec_control &=
~(SECONDARY_EXEC_ENABLE_EPT |
SECONDARY_EXEC_UNRESTRICTED_GUEST);
- vmx_vmexit_control &= ~(VM_EXIT_SAVE_GUEST_PAT |
- VM_EXIT_LOAD_HOST_PAT);
- vmx_vmentry_control &= ~VM_ENTRY_LOAD_GUEST_PAT;
+ vmexit_ctl &= ~(VM_EXIT_SAVE_GUEST_PAT |
+ VM_EXIT_LOAD_HOST_PAT);
+ vmentry_ctl &= ~VM_ENTRY_LOAD_GUEST_PAT;
}
/* Do not enable Monitor Trap Flag unless start single step debug */
v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
__vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
- __vmwrite(VM_EXIT_CONTROLS, vmx_vmexit_control);
- __vmwrite(VM_ENTRY_CONTROLS, vmx_vmentry_control);
+ __vmwrite(VM_EXIT_CONTROLS, vmexit_ctl);
+ __vmwrite(VM_ENTRY_CONTROLS, vmentry_ctl);
if ( cpu_has_vmx_ple )
{

View File

@ -0,0 +1,268 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278094440 -3600
# Node ID a9c458ab90e4ecb25383456be653368ecd900ee4
# Parent 322468d5ab6ceca4afa21977a02f4492308d2ddc
x86: TSC handling cleanups (version 2)
"I am removing the tsc_scaled variable that is never actually used
because when tsc needs to be scaled vtsc is 1. I am also making this
more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz
that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta,
&d->arch.ns_to_vtsc) to scale the tsc value before returning it to the
guest like in the pv case. I added a feature flag to specify that the
pvclock algorithm is safe to be used in an HVM guest so that the guest
can now use it without hanging."
Version 2 fixes a bug which breaks PV domU time.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset: 21445:c1ed00d49534
xen-unstable date: Sat May 22 06:31:47 2010 +0100
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
@@ -152,32 +152,6 @@ void hvm_set_rdtsc_exiting(struct domain
hvm_funcs.set_rdtsc_exiting(v, enable);
}
-int hvm_gtsc_need_scale(struct domain *d)
-{
- uint32_t gtsc_mhz, htsc_mhz;
-
- if ( d->arch.vtsc )
- return 0;
-
- gtsc_mhz = d->arch.hvm_domain.gtsc_khz / 1000;
- htsc_mhz = (uint32_t)cpu_khz / 1000;
-
- d->arch.hvm_domain.tsc_scaled = (gtsc_mhz && (gtsc_mhz != htsc_mhz));
- return d->arch.hvm_domain.tsc_scaled;
-}
-
-static u64 hvm_h2g_scale_tsc(struct vcpu *v, u64 host_tsc)
-{
- uint32_t gtsc_khz, htsc_khz;
-
- if ( !v->domain->arch.hvm_domain.tsc_scaled )
- return host_tsc;
-
- htsc_khz = cpu_khz;
- gtsc_khz = v->domain->arch.hvm_domain.gtsc_khz;
- return muldiv64(host_tsc, gtsc_khz, htsc_khz);
-}
-
void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
{
uint64_t tsc;
@@ -185,11 +159,11 @@ void hvm_set_guest_tsc(struct vcpu *v, u
if ( v->domain->arch.vtsc )
{
tsc = hvm_get_guest_time(v);
+ tsc = gtime_to_gtsc(v->domain, tsc);
}
else
{
rdtscll(tsc);
- tsc = hvm_h2g_scale_tsc(v, tsc);
}
v->arch.hvm_vcpu.cache_tsc_offset = guest_tsc - tsc;
@@ -203,12 +177,12 @@ u64 hvm_get_guest_tsc(struct vcpu *v)
if ( v->domain->arch.vtsc )
{
tsc = hvm_get_guest_time(v);
+ tsc = gtime_to_gtsc(v->domain, tsc);
v->domain->arch.vtsc_kerncount++;
}
else
{
rdtscll(tsc);
- tsc = hvm_h2g_scale_tsc(v, tsc);
}
return tsc + v->arch.hvm_vcpu.cache_tsc_offset;
Index: xen-4.0.0-testing/xen/arch/x86/hvm/save.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/save.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/save.c
@@ -33,7 +33,7 @@ void arch_hvm_save(struct domain *d, str
hdr->cpuid = eax;
/* Save guest's preferred TSC. */
- hdr->gtsc_khz = d->arch.hvm_domain.gtsc_khz;
+ hdr->gtsc_khz = d->arch.tsc_khz;
}
int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
@@ -62,8 +62,8 @@ int arch_hvm_load(struct domain *d, stru
/* Restore guest's preferred TSC frequency. */
if ( hdr->gtsc_khz )
- d->arch.hvm_domain.gtsc_khz = hdr->gtsc_khz;
- if ( hvm_gtsc_need_scale(d) )
+ d->arch.tsc_khz = hdr->gtsc_khz;
+ if ( d->arch.vtsc )
{
hvm_set_rdtsc_exiting(d, 1);
gdprintk(XENLOG_WARNING, "Domain %d expects freq %uMHz "
Index: xen-4.0.0-testing/xen/arch/x86/hvm/vpt.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/vpt.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/vpt.c
@@ -32,9 +32,6 @@ void hvm_init_guest_time(struct domain *
spin_lock_init(&pl->pl_time_lock);
pl->stime_offset = -(u64)get_s_time();
pl->last_guest_time = 0;
-
- d->arch.hvm_domain.gtsc_khz = cpu_khz;
- d->arch.hvm_domain.tsc_scaled = 0;
}
u64 hvm_get_guest_time(struct vcpu *v)
Index: xen-4.0.0-testing/xen/arch/x86/time.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/time.c
+++ xen-4.0.0-testing/xen/arch/x86/time.c
@@ -850,8 +850,13 @@ static void __update_vcpu_system_time(st
if ( d->arch.vtsc )
{
- u64 delta = max_t(s64, t->stime_local_stamp - d->arch.vtsc_offset, 0);
- tsc_stamp = scale_delta(delta, &d->arch.ns_to_vtsc);
+ u64 stime = t->stime_local_stamp;
+ if ( is_hvm_domain(d) )
+ {
+ struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+ stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+ }
+ tsc_stamp = gtime_to_gtsc(d, stime);
}
else
{
@@ -874,6 +879,8 @@ static void __update_vcpu_system_time(st
_u.tsc_to_system_mul = t->tsc_scale.mul_frac;
_u.tsc_shift = (s8)t->tsc_scale.shift;
}
+ if ( is_hvm_domain(d) )
+ _u.tsc_timestamp += v->arch.hvm_vcpu.cache_tsc_offset;
/* Don't bother unless timestamp record has changed or we are forced. */
_u.version = u->version; /* make versions match for memcmp test */
@@ -1640,11 +1647,17 @@ struct tm wallclock_time(void)
* PV SoftTSC Emulation.
*/
+u64 gtime_to_gtsc(struct domain *d, u64 tsc)
+{
+ if ( !is_hvm_domain(d) )
+ tsc = max_t(s64, tsc - d->arch.vtsc_offset, 0);
+ return scale_delta(tsc, &d->arch.ns_to_vtsc);
+}
+
void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp)
{
s_time_t now = get_s_time();
struct domain *d = v->domain;
- u64 delta;
spin_lock(&d->arch.vtsc_lock);
@@ -1660,8 +1673,7 @@ void pv_soft_rdtsc(struct vcpu *v, struc
spin_unlock(&d->arch.vtsc_lock);
- delta = max_t(s64, now - d->arch.vtsc_offset, 0);
- now = scale_delta(delta, &d->arch.ns_to_vtsc);
+ now = gtime_to_gtsc(d, now);
regs->eax = (uint32_t)now;
regs->edx = (uint32_t)(now >> 32);
@@ -1802,8 +1814,10 @@ void tsc_set_info(struct domain *d,
d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
d->arch.tsc_khz = gtsc_khz ? gtsc_khz : cpu_khz;
set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 );
- /* use native TSC if initial host has safe TSC and not migrated yet */
- if ( host_tsc_is_safe() && incarnation == 0 )
+ /* use native TSC if initial host has safe TSC, has not migrated
+ * yet and tsc_khz == cpu_khz */
+ if ( host_tsc_is_safe() && incarnation == 0 &&
+ d->arch.tsc_khz == cpu_khz )
d->arch.vtsc = 0;
else
d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns);
@@ -1828,7 +1842,7 @@ void tsc_set_info(struct domain *d,
}
d->arch.incarnation = incarnation + 1;
if ( is_hvm_domain(d) )
- hvm_set_rdtsc_exiting(d, d->arch.vtsc || hvm_gtsc_need_scale(d));
+ hvm_set_rdtsc_exiting(d, d->arch.vtsc);
}
/* vtsc may incur measurable performance degradation, diagnose with this */
Index: xen-4.0.0-testing/xen/common/kernel.c
===================================================================
--- xen-4.0.0-testing.orig/xen/common/kernel.c
+++ xen-4.0.0-testing/xen/common/kernel.c
@@ -243,6 +243,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) |
(1U << XENFEAT_highmem_assist) |
(1U << XENFEAT_gnttab_map_avail_bits);
+ else
+ fi.submap |= (1U << XENFEAT_hvm_safe_pvclock);
#endif
break;
default:
Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/domain.h
+++ xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h
@@ -45,8 +45,6 @@ struct hvm_domain {
struct hvm_ioreq_page ioreq;
struct hvm_ioreq_page buf_ioreq;
- uint32_t gtsc_khz; /* kHz */
- bool_t tsc_scaled;
struct pl_time pl_time;
struct hvm_io_handler io_handler;
Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h
@@ -290,7 +290,6 @@ int hvm_event_needs_reinjection(uint8_t
uint8_t hvm_combine_hw_exceptions(uint8_t vec1, uint8_t vec2);
void hvm_set_rdtsc_exiting(struct domain *d, bool_t enable);
-int hvm_gtsc_need_scale(struct domain *d);
static inline int
hvm_cpu_prepare(unsigned int cpu)
Index: xen-4.0.0-testing/xen/include/asm-x86/time.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/time.h
+++ xen-4.0.0-testing/xen/include/asm-x86/time.h
@@ -60,6 +60,7 @@ uint64_t acpi_pm_tick_to_ns(uint64_t tic
uint64_t ns_to_acpi_pm_tick(uint64_t ns);
void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp);
+u64 gtime_to_gtsc(struct domain *d, u64 tsc);
void tsc_set_info(struct domain *d, uint32_t tsc_mode, uint64_t elapsed_nsec,
uint32_t gtsc_khz, uint32_t incarnation);
Index: xen-4.0.0-testing/xen/include/public/features.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/public/features.h
+++ xen-4.0.0-testing/xen/include/public/features.h
@@ -68,6 +68,9 @@
*/
#define XENFEAT_gnttab_map_avail_bits 7
+/* x86: pvclock algorithm is safe to use on HVM */
+#define XENFEAT_hvm_safe_pvclock 9
+
#define XENFEAT_NR_SUBMAPS 1
#endif /* __XEN_PUBLIC_FEATURES_H__ */

View File

@ -0,0 +1,29 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1274506601 -3600
# Node ID 93410e5e4ad8799932ad31820d0d82c74d1f63a2
# Parent c1ed00d495342334980be576bbb8a2b1037b89c9
iommu: Gracefully fail to initialise iommu on generic x86 platforms.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/include/asm-x86/hvm/iommu.h
+++ b/xen/include/asm-x86/hvm/iommu.h
@@ -1,6 +1,8 @@
#ifndef __ASM_X86_HVM_IOMMU_H__
#define __ASM_X86_HVM_IOMMU_H__
+#include <xen/errno.h>
+
struct iommu_ops;
extern const struct iommu_ops intel_iommu_ops;
extern const struct iommu_ops amd_iommu_ops;
@@ -31,7 +33,7 @@ static inline int iommu_hardware_setup(v
case X86_VENDOR_AMD:
return amd_iov_detect();
default:
- BUG();
+ return -ENODEV;
}
return 0;

View File

@ -0,0 +1,31 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1274857281 -3600
# Node ID 5addb6cb16fd64c664b1e3dd335c76b3426e05e9
# Parent 459f35d8cac4f19e6eae0a7396f6c97e20ae955c
x86 shadow: Avoid remove-all-shadows after shadow teardown
If dom0 alters the p2m of a domain that's being destroyed, we can end
up doing a remove-all-shadows after the shadow hash table has been
freed. Since no hash table implies no shadows, just return
immediately.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2173,8 +2173,13 @@ static void hash_foreach(struct vcpu *v,
struct domain *d = v->domain;
struct page_info *x;
- /* Say we're here, to stop hash-lookups reordering the chains */
ASSERT(shadow_locked_by_me(d));
+
+ /* Can be called via p2m code &c after shadow teardown. */
+ if ( unlikely(!d->arch.paging.shadow.hash_table) )
+ return;
+
+ /* Say we're here, to stop hash-lookups reordering the chains */
ASSERT(d->arch.paging.shadow.hash_walking == 0);
d->arch.paging.shadow.hash_walking = 1;

View File

@ -0,0 +1,22 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1274857778 -3600
# Node ID a69d09da4917c7b57ceed65224e4bbc389601081
# Parent 32cdd423d4ebab2b2d03a4501be08438c5dc7050
compat-guest accessor macros do not need address check for hvm guests.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
--- a/xen/include/xen/compat.h
+++ b/xen/include/xen/compat.h
@@ -90,8 +90,9 @@
* Allows use of faster __copy_* functions.
*/
#define compat_handle_okay(hnd, nr) \
+ (paging_mode_external(current->domain) || \
compat_array_access_ok((void *)(full_ptr_t)(hnd).c, (nr), \
- sizeof(**(hnd)._))
+ sizeof(**(hnd)._)))
#define __copy_to_compat_offset(hnd, off, ptr, nr) ({ \
const typeof(*(ptr)) *_s = (ptr); \

27
21459-block-script.patch Normal file
View File

@ -0,0 +1,27 @@
# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# Date 1274807602 21600
# Node ID 14d040342c6618365750b2c3b96ca01ff4a5e5dd
# Parent 93410e5e4ad8799932ad31820d0d82c74d1f63a2
Allow space in vbd path name
c/s 20393 breaks existing domain configuration that contains
spaces in the vbd path name. Fixed by this trivial patch which
provides missing quotes.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 93410e5e4ad8 -r 14d040342c66 tools/hotplug/Linux/block
--- a/tools/hotplug/Linux/block Sat May 22 06:36:41 2010 +0100
+++ b/tools/hotplug/Linux/block Tue May 25 11:13:22 2010 -0600
@@ -272,8 +272,8 @@
if [ "x$mode" != 'x!' ]
then
- inode=$(stat -c '%i' $file)
- dev=$(stat -c '%D' $file)
+ inode=$(stat -c '%i' "$file")
+ dev=$(stat -c '%D' "$file")
if [ -z "$inode" ] || [ -z "$dev" ]
then
fatal "Unable to lookup $file: dev: $dev inode: $inode"

View File

@ -0,0 +1,25 @@
# HG changeset patch
# User Jim Fehlig <jfehlig@novell.com>
# Date 1274822804 21600
# Node ID a83e97657ba0f3ea232fe0dfb9edccf8e28aa982
# Parent 14d040342c6618365750b2c3b96ca01ff4a5e5dd
tools: Fix time offset when localtime=0
localtime can be stored in vm config as a string, resulting in
incorrect calculation of rtc_timeoffset. Cast localtime to int
to ensure rtc_timeoffset is calculated properly.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 14d040342c66 -r a83e97657ba0 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Tue May 25 11:13:22 2010 -0600
+++ b/tools/python/xen/xend/image.py Tue May 25 15:26:44 2010 -0600
@@ -129,7 +129,7 @@
self.dmargs = self.parseDeviceModelArgs(vmConfig)
self.pid = None
rtc_timeoffset = int(vmConfig['platform'].get('rtc_timeoffset', 0))
- if vmConfig['platform'].get('localtime', 0):
+ if int(vmConfig['platform'].get('localtime', 0)):
if time.localtime(time.time())[8]:
rtc_timeoffset -= time.altzone
else:

View File

@ -0,0 +1,23 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1275040447 -3600
# Node ID 96917cf25bf3ad42c6b6cddb7ff4f03857ae9619
# Parent 95acf74586d782d8d4d39016b3426a1eae127e97
x86: Fix guest-pointer-array memmove in __pirq_guest_unbind().
Thanks to Alex Zefefrt for finding this.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1242,7 +1242,8 @@ static irq_guest_action_t *__pirq_guest_
for ( i = 0; (i < action->nr_guests) && (action->guest[i] != d); i++ )
continue;
BUG_ON(i == action->nr_guests);
- memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1);
+ memmove(&action->guest[i], &action->guest[i+1],
+ (action->nr_guests-i-1) * sizeof(action->guest[0]));
action->nr_guests--;
switch ( action->ack_type )

View File

@ -8,201 +8,76 @@ Intel: Add CPUID feature mask support for NHM processors.
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1276604335 -3600
# Node ID 2501732e291b001711a0dc1c474bb89ce77f3110
# Parent a2cc1db1af9c8f9b148c80f8b2c3f64bde7542f9
x86: fix pv cpuid masking
Invert initial values of the variables parsed into from the command
line, so that completely clearing out one or more of the four bit
fields is possible.
Further, consolidate the command line parameter specifications into
a single place.
Finally, as per "Intel Virtualization Technology FlexMigration
Application Note" (http://www.intel.com/Assets/PDF/manual/323850.pdf),
also handle family 6 model 0x1f.
What remains open is the question whether pv_cpuid() shouldn't also
consume these masks.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/xen/arch/x86/cpu/amd.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/cpu/amd.c
+++ xen-4.0.1-testing/xen/arch/x86/cpu/amd.c
@@ -33,14 +33,6 @@ void start_svm(struct cpuinfo_x86 *c);
static char opt_famrev[14];
string_param("cpuid_mask_cpu", opt_famrev);
-/* Finer-grained CPUID feature control. */
-static unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
-integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
-integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
-static unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx;
-integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx);
-integer_param("cpuid_mask_ext_edx", opt_cpuid_mask_ext_edx);
-
static inline void wrmsr_amd(unsigned int index, unsigned int lo,
unsigned int hi)
{
@@ -61,7 +53,7 @@ static inline void wrmsr_amd(unsigned in
*
* The processor revision string parameter has precedene.
*/
-static void __devinit set_cpuidmask(struct cpuinfo_x86 *c)
+static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
{
static unsigned int feat_ecx, feat_edx;
static unsigned int extfeat_ecx, extfeat_edx;
@@ -76,12 +68,12 @@ static void __devinit set_cpuidmask(stru
ASSERT((status == not_parsed) && (smp_processor_id() == 0));
status = no_mask;
- if (opt_cpuid_mask_ecx | opt_cpuid_mask_edx |
- opt_cpuid_mask_ext_ecx | opt_cpuid_mask_ext_edx) {
- feat_ecx = opt_cpuid_mask_ecx ? : ~0U;
- feat_edx = opt_cpuid_mask_edx ? : ~0U;
- extfeat_ecx = opt_cpuid_mask_ext_ecx ? : ~0U;
- extfeat_edx = opt_cpuid_mask_ext_edx ? : ~0U;
+ if (~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx &
+ opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx)) {
+ feat_ecx = opt_cpuid_mask_ecx;
+ feat_edx = opt_cpuid_mask_edx;
+ extfeat_ecx = opt_cpuid_mask_ext_ecx;
+ extfeat_edx = opt_cpuid_mask_ext_edx;
} else if (*opt_famrev == '\0') {
return;
} else if (!strcmp(opt_famrev, "fam_0f_rev_c")) {
Index: xen-4.0.1-testing/xen/arch/x86/cpu/common.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/cpu/common.c
+++ xen-4.0.1-testing/xen/arch/x86/cpu/common.c
@@ -22,6 +22,15 @@ static int cachesize_override __cpuinitd
static int disable_x86_fxsr __cpuinitdata;
static int disable_x86_serial_nr __cpuinitdata;
+unsigned int __devinitdata opt_cpuid_mask_ecx = ~0u;
+integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
+unsigned int __devinitdata opt_cpuid_mask_edx = ~0u;
+integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
+unsigned int __devinitdata opt_cpuid_mask_ext_ecx = ~0u;
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -29,6 +29,9 @@ extern int trap_init_f00f_bug(void);
static unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
+static unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx;
+integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx);
+unsigned int __devinitdata opt_cpuid_mask_ext_edx = ~0u;
+integer_param("cpuid_mask_ext_edx", opt_cpuid_mask_ext_edx);
+
struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
/*
Index: xen-4.0.1-testing/xen/arch/x86/cpu/cpu.h
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/cpu/cpu.h
+++ xen-4.0.1-testing/xen/arch/x86/cpu/cpu.h
@@ -21,6 +21,9 @@ struct cpu_dev {
extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM];
+extern unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
+extern unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx;
+
extern int get_model_name(struct cpuinfo_x86 *c);
extern void display_cacheinfo(struct cpuinfo_x86 *c);
Index: xen-4.0.1-testing/xen/arch/x86/cpu/intel.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/cpu/intel.c
+++ xen-4.0.1-testing/xen/arch/x86/cpu/intel.c
@@ -20,16 +20,6 @@
extern int trap_init_f00f_bug(void);
-/*
- * opt_cpuid_mask_ecx/edx: cpuid.1[ecx, edx] feature mask.
- * For example, E8400[Intel Core 2 Duo Processor series] ecx = 0x0008E3FD,
- * edx = 0xBFEBFBFF when executing CPUID.EAX = 1 normally. If you want to
- * 'rev down' to E8400, you can set these values in these Xen boot parameters.
- */
-static unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
-integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
-integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
-
static int use_xsave = 1;
boolean_param("xsave", use_xsave);
@@ -40,24 +30,57 @@ boolean_param("xsave", use_xsave);
@@ -40,24 +43,46 @@ boolean_param("xsave", use_xsave);
struct movsl_mask movsl_mask __read_mostly;
#endif
-static void __devinit set_cpuidmask(void)
+/*
+ * opt_cpuid_mask_ecx/edx: cpuid.1[ecx, edx] feature mask.
+ * For example, E8400[Intel Core 2 Duo Processor series] ecx = 0x0008E3FD,
+ * edx = 0xBFEBFBFF when executing CPUID.EAX = 1 normally. If you want to
+ * 'rev down' to E8400, you can set these values in these Xen boot parameters.
+ */
+static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
+static void __devinit set_cpuidmask(struct cpuinfo_x86 *c)
{
- unsigned int eax, ebx, ecx, edx, model;
+ const char *extra = "";
+ unsigned int model = c->x86_model;
- if (!(opt_cpuid_mask_ecx | opt_cpuid_mask_edx))
+ if (!~(opt_cpuid_mask_ecx & opt_cpuid_mask_edx &
+ opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx))
+ if (!(opt_cpuid_mask_ecx | opt_cpuid_mask_edx |
+ opt_cpuid_mask_ext_ecx | opt_cpuid_mask_ext_edx))
return;
- cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
- model = ((eax & 0xf0000) >> 12) | ((eax & 0xf0) >> 4);
- if (!((model == 0x1d) || ((model == 0x17) && ((eax & 0xf) >= 4)))) {
- printk(XENLOG_ERR "Cannot set CPU feature mask on CPU#%d\n",
- smp_processor_id());
+ /* Only family 6 supports this feature */
+ switch ((c->x86 == 6) * c->x86_model) {
+ case 0x17:
+ if ((c->x86_mask & 0x0f) < 4)
+ break;
+ /* fall through */
+ case 0x1d:
+ wrmsr(MSR_INTEL_CPUID_FEATURE_MASK,
+ opt_cpuid_mask_ecx,
+ opt_cpuid_mask_edx);
+ if (!~(opt_cpuid_mask_ext_ecx & opt_cpuid_mask_ext_edx))
+ return;
+ extra = "extended ";
+ break;
+/*
+ if (c->x86 != 0x6) /* Only family 6 supports this feature */
+ return;
+
+ if ((model == 0x1d) || ((model == 0x17) && (c->x86_mask >= 4))) {
+ wrmsr(MSR_IA32_CPUID_FEATURE_MASK1,
+ opt_cpuid_mask_ecx ? : ~0u,
+ opt_cpuid_mask_edx ? : ~0u);
+ }
+/*
+ * CPU supports this feature if the processor signature meets the following:
+ * (CPUID.(EAX=01h):EAX) > 000106A2h, or
+ * (CPUID.(EAX=01h):EAX) == 000106Exh, 0002065xh, 000206Cxh, 000206Exh, or 000206Fxh
+ *
+ */
+ case 0x1a:
+ if ((c->x86_mask & 0x0f) <= 2)
+ break;
+ /* fall through */
+ case 0x1e: case 0x1f:
+ case 0x25: case 0x2c: case 0x2e: case 0x2f:
+ wrmsr(MSR_INTEL_CPUID1_FEATURE_MASK,
+ opt_cpuid_mask_ecx,
+ opt_cpuid_mask_edx);
+ wrmsr(MSR_INTEL_CPUID80000001_FEATURE_MASK,
+ opt_cpuid_mask_ext_ecx,
+ opt_cpuid_mask_ext_edx);
+ else if (((model == 0x1a) && (c->x86_mask > 2))
+ || model == 0x1e
+ || model == 0x25
+ || model == 0x2c
+ || model == 0x2e
+ || model == 0x2f) {
+ wrmsr(MSR_IA32_CPUID1_FEATURE_MASK,
+ opt_cpuid_mask_ecx ? : ~0u,
+ opt_cpuid_mask_edx ? : ~0u);
+ wrmsr(MSR_IA32_CPUID80000001_FEATURE_MASK,
+ opt_cpuid_mask_ext_ecx ? : ~0u,
+ opt_cpuid_mask_ext_edx ? : ~0u);
+ }
+ else {
printk(XENLOG_ERR "Cannot set CPU feature mask on CPU#%d\n",
smp_processor_id());
return;
}
-
- wrmsr(MSR_IA32_CPUID_FEATURE_MASK1,
- opt_cpuid_mask_ecx ? : ~0u,
- opt_cpuid_mask_edx ? : ~0u);
+ printk(XENLOG_ERR "Cannot set CPU feature mask on CPU#%d\n",
+ smp_processor_id());
}
void __devinit early_intel_workaround(struct cpuinfo_x86 *c)
@@ -179,7 +202,7 @@ static void __devinit init_intel(struct
@@ -179,7 +204,7 @@ static void __devinit init_intel(struct
detect_ht(c);
@ -211,20 +86,14 @@ Index: xen-4.0.1-testing/xen/arch/x86/cpu/intel.c
/* Work around errata */
Intel_errata_workarounds(c);
Index: xen-4.0.1-testing/xen/include/asm-x86/msr-index.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/asm-x86/msr-index.h
+++ xen-4.0.1-testing/xen/include/asm-x86/msr-index.h
@@ -156,8 +156,10 @@
#define MSR_P6_EVNTSEL0 0x00000186
#define MSR_P6_EVNTSEL1 0x00000187
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -158,6 +158,8 @@
-/* MSR for cpuid feature mask */
-#define MSR_IA32_CPUID_FEATURE_MASK1 0x00000478
+/* MSRs for Intel cpuid feature mask */
+#define MSR_INTEL_CPUID_FEATURE_MASK 0x00000478
+#define MSR_INTEL_CPUID1_FEATURE_MASK 0x00000130
+#define MSR_INTEL_CPUID80000001_FEATURE_MASK 0x00000131
/* MSR for cpuid feature mask */
#define MSR_IA32_CPUID_FEATURE_MASK1 0x00000478
+#define MSR_IA32_CPUID1_FEATURE_MASK 0x00000130
+#define MSR_IA32_CPUID80000001_FEATURE_MASK 0x00000131
/* MSRs & bits used for VMX enabling */
#define MSR_IA32_VMX_BASIC 0x480

View File

@ -9,11 +9,11 @@ Clear APIC TMICT when we mask APIC LVTT.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Index: xen-4.0.1-testing/xen/arch/x86/apic.c
Index: xen-4.0.0-testing/xen/arch/x86/apic.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/apic.c
+++ xen-4.0.1-testing/xen/arch/x86/apic.c
@@ -198,6 +198,9 @@ void clear_local_APIC(void)
--- xen-4.0.0-testing.orig/xen/arch/x86/apic.c
+++ xen-4.0.0-testing/xen/arch/x86/apic.c
@@ -195,6 +195,9 @@ void clear_local_APIC(void)
maxlvt = get_maxlvt();
@ -23,7 +23,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/apic.c
/*
* Masking an LVT entry on a P6 can trigger a local APIC error
* if the vector is zero. Mask LVTERR first to prevent this.
@@ -1335,7 +1338,10 @@ void disable_APIC_timer(void)
@@ -1184,7 +1187,10 @@ void disable_APIC_timer(void)
{
if (using_apic_timer) {
unsigned long v;
@ -35,10 +35,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/apic.c
v = apic_read(APIC_LVTT);
apic_write_around(APIC_LVTT, v | APIC_LVT_MASKED);
}
Index: xen-4.0.1-testing/xen/arch/x86/hpet.c
Index: xen-4.0.0-testing/xen/arch/x86/hpet.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/hpet.c
+++ xen-4.0.1-testing/xen/arch/x86/hpet.c
--- xen-4.0.0-testing.orig/xen/arch/x86/hpet.c
+++ xen-4.0.0-testing/xen/arch/x86/hpet.c
@@ -659,8 +659,7 @@ void hpet_broadcast_enter(void)
if ( hpet_attach_channel )
hpet_attach_channel(cpu, ch);

View File

@ -17,10 +17,8 @@ guests, meaning that the input to these must be treated as GMFNs.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.1-testing/tools/libxc/xc_domain_save.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxc/xc_domain_save.c
+++ xen-4.0.1-testing/tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1282,58 +1282,64 @@ int xc_domain_save(int xc_handle, int io
goto out;
}
@ -58,11 +56,11 @@ Index: xen-4.0.1-testing/tools/libxc/xc_domain_save.c
- goto out;
- }
+ unsigned long gmfn = pfn_batch[j];
+
+ if ( !hvm )
+ gmfn = pfn_to_mfn(gmfn);
- for ( j = 0; j < batch; j++ )
+ if ( !hvm )
+ gmfn = pfn_to_mfn(gmfn);
+
+ if ( pfn_err[j] )
{
- unsigned long mfn = pfn_to_mfn(pfn_batch[j]);
@ -124,11 +122,9 @@ Index: xen-4.0.1-testing/tools/libxc/xc_domain_save.c
if ( write_exact(io_fd, &batch, sizeof(unsigned int)) )
{
PERROR("Error when writing to state file (2)");
Index: xen-4.0.1-testing/xen/arch/x86/domctl.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/domctl.c
+++ xen-4.0.1-testing/xen/arch/x86/domctl.c
@@ -206,11 +206,12 @@ long arch_do_domctl(
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -207,11 +207,12 @@ long arch_do_domctl(
for ( j = 0; j < k; j++ )
{
@ -143,7 +139,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/domctl.c
type = XEN_DOMCTL_PFINFO_XTAB;
else if ( xsm_getpageframeinfo(page) != 0 )
;
@@ -305,14 +306,15 @@ long arch_do_domctl(
@@ -306,14 +307,15 @@ long arch_do_domctl(
for ( j = 0; j < k; j++ )
{
struct page_info *page;

View File

@ -0,0 +1,34 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1276604463 -3600
# Node ID b0f7f710f512aba0fca814467e4f5fe7b906ada3
# Parent 972b7e305138759d4ef42b75d5fe5c6fd2d2e30c
x86: return value of domain_pirq_to_irq() is signed
That value can, for forcibly unbound PIRQs, validly be negative, and
for the respective check to catch those cases (and prevent using these
negative values as array index), the respective variables must be of
signed type.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -879,7 +879,7 @@ static void __do_IRQ_guest(int irq)
struct irq_desc *domain_spin_lock_irq_desc(
struct domain *d, int pirq, unsigned long *pflags)
{
- unsigned int irq;
+ int irq;
unsigned long flags;
struct irq_desc *desc;
@@ -1046,7 +1046,7 @@ extern int ioapic_ack_new;
static int pirq_acktype(struct domain *d, int pirq)
{
struct irq_desc *desc;
- unsigned int irq;
+ int irq;
irq = domain_pirq_to_irq(d, pirq);
if ( irq <= 0 )

View File

@ -7,11 +7,9 @@ cpuidle: fix wrapped ticks calculation for pm timer.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Index: xen-4.0.1-testing/xen/arch/x86/acpi/cpu_idle.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/acpi/cpu_idle.c
+++ xen-4.0.1-testing/xen/arch/x86/acpi/cpu_idle.c
@@ -127,9 +127,9 @@ static inline u32 ticks_elapsed(u32 t1,
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -127,9 +127,9 @@ static inline u32 ticks_elapsed(u32 t1,
if ( t2 >= t1 )
return (t2 - t1);
else if ( !(acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER) )

View File

@ -0,0 +1,25 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277110750 -3600
# Node ID 31708477f0a92be70a940d1c8ff1aa721051bba8
# Parent 46a4c936b77e483971d2b3eb0b544c61700f824a
vmx: Fix bug in VMX VPMU fixed function PMC offset
This is a minor fix to the calculation of bit-width of fixed function
perfmon counters in Intel processors. Bits 5-12 of edx register
should be calculated as (edx & 0x1fe0) >>5 instead of using 0x1f70.
From: "John, Jaiber J" <jaiber.j.john@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -82,7 +82,7 @@ static int core2_get_bitwidth_fix_count(
{
u32 eax, ebx, ecx, edx;
cpuid(0xa, &eax, &ebx, &ecx, &edx);
- return ((edx & 0x1f70) >> 5);
+ return ((edx & 0x1fe0) >> 5);
}
static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)

View File

@ -16,10 +16,10 @@ validity before doing device_add, there will be no problem.
Signed-off-by Chunyan Liu <CYLiu@novell.com>
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -847,11 +847,6 @@ class XendDomainInfo:
@type dev_config: SXP object (parsed config)
"""

View File

@ -16,10 +16,10 @@ change manually as it had been mangled.)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by Chunyan Liu <CYLiu@novell.com>
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -847,6 +847,8 @@ class XendDomainInfo:
@type dev_config: SXP object (parsed config)
"""

View File

@ -0,0 +1,26 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277738876 -3600
# Node ID 7e46fdbe8a1187cee2ab609256300d7967f37f06
# Parent bf64e1081333696c68c9430cbc32c8bd6ee18796
xentrace: restrict trace buffer MFNs
Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -152,7 +152,8 @@ static int alloc_trace_bufs(void)
char *rawbuf;
struct t_buf *buf;
- if ( (rawbuf = alloc_xenheap_pages(order, 0)) == NULL )
+ if ( (rawbuf = alloc_xenheap_pages(
+ order, MEMF_bits(32 + PAGE_SHIFT))) == NULL )
{
printk("Xen trace buffers: memory allocation failed\n");
opt_tbuf_size = 0;

View File

@ -7,10 +7,8 @@ vtd: Only kill_timer() an init_timer()'ed timer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-4.0.1-testing/xen/drivers/passthrough/io.c
===================================================================
--- xen-4.0.1-testing.orig/xen/drivers/passthrough/io.c
+++ xen-4.0.1-testing/xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -27,7 +27,7 @@
static void hvm_dirq_assist(unsigned long _d);
@ -20,10 +18,8 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/io.c
{
return !(flags & (HVM_IRQ_DPCI_GUEST_MSI | HVM_IRQ_DPCI_TRANSLATE));
}
Index: xen-4.0.1-testing/xen/drivers/passthrough/pci.c
===================================================================
--- xen-4.0.1-testing.orig/xen/drivers/passthrough/pci.c
+++ xen-4.0.1-testing/xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -257,7 +257,9 @@ static void pci_clean_dpci_irqs(struct d
i = find_next_bit(hvm_irq_dpci->mapping, d->nr_pirqs, i + 1) )
{
@ -35,11 +31,9 @@ Index: xen-4.0.1-testing/xen/drivers/passthrough/pci.c
list_for_each_safe ( digl_list, tmp,
&hvm_irq_dpci->mirq[i].digl_list )
Index: xen-4.0.1-testing/xen/include/xen/iommu.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/iommu.h
+++ xen-4.0.1-testing/xen/include/xen/iommu.h
@@ -103,6 +103,7 @@ void hvm_dpci_isairq_eoi(struct domain *
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -92,6 +92,7 @@ void hvm_dpci_isairq_eoi(struct domain *
struct hvm_irq_dpci *domain_get_irq_dpci(struct domain *domain);
int domain_set_irq_dpci(struct domain *domain, struct hvm_irq_dpci *dpci);
void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);

View File

@ -0,0 +1,286 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277831801 -3600
# Node ID 6b5a5bfaf3577a050c6779b0b62245560fda53f6
# Parent 3ea84fd20b263a8e443e3bb16d5495cd3dbd8033
x86: Only build memory-event features on 64-bit Xen
32-bit Xen doesn't have enough p2m types to support them.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278579370 -3600
# Node ID a7a680442b738928eb963b31e22a3e428ac111a0
# Parent 92ac9536ac5abc17f414f024f3df92658cf2ee96
xend: Continue domain building even if memshr extensions are not
present in the hypervisor.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-4.0.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.0-testing/tools/python/xen/xend/image.py
@@ -830,8 +830,10 @@ class HVMImageHandler(ImageHandler):
self.acpi = int(vmConfig['platform'].get('acpi', 0))
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
self.memory_sharing = int(vmConfig['memory_sharing'])
- xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
-
+ try:
+ xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
+ except:
+ pass
# Return a list of cmd line args to the device models based on the
# xm config file
Index: xen-4.0.0-testing/xen/arch/x86/domctl.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/domctl.c
+++ xen-4.0.0-testing/xen/arch/x86/domctl.c
@@ -1420,6 +1420,7 @@ long arch_do_domctl(
break;
#endif /* XEN_GDBSX_CONFIG */
+#ifdef __x86_64__
case XEN_DOMCTL_mem_event_op:
{
struct domain *d;
@@ -1450,6 +1451,7 @@ long arch_do_domctl(
}
}
break;
+#endif /* __x86_64__ */
default:
ret = -ENOSYS;
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
@@ -922,6 +922,7 @@ bool_t hvm_hap_nested_page_fault(unsigne
return 1;
}
+#ifdef __x86_64__
/* Check if the page has been paged out */
if ( p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_out) )
p2m_mem_paging_populate(current->domain, gfn);
@@ -932,6 +933,7 @@ bool_t hvm_hap_nested_page_fault(unsigne
mem_sharing_unshare_page(current->domain, gfn, 0);
return 1;
}
+#endif
/* Spurious fault? PoD and log-dirty also take this path. */
if ( p2m_is_ram(p2mt) )
Index: xen-4.0.0-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/mm.c
+++ xen-4.0.0-testing/xen/arch/x86/mm.c
@@ -3179,20 +3179,23 @@ int do_mmu_update(
rc = -ENOENT;
break;
}
+#ifdef __x86_64__
/* XXX: Ugly: pull all the checks into a separate function.
* Don't want to do it now, not to interfere with mem_paging
* patches */
else if ( p2m_ram_shared == l1e_p2mt )
{
/* Unshare the page for RW foreign mappings */
- if(l1e_get_flags(l1e) & _PAGE_RW)
+ if ( l1e_get_flags(l1e) & _PAGE_RW )
{
rc = mem_sharing_unshare_page(pg_owner,
l1e_get_pfn(l1e),
0);
- if(rc) break;
+ if ( rc )
+ break;
}
}
+#endif
okay = mod_l1_entry(va, l1e, mfn,
cmd == MMU_PT_UPDATE_PRESERVE_AD, v,
@@ -4537,8 +4540,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
return rc;
}
+#ifdef __x86_64__
case XENMEM_get_sharing_freed_pages:
return mem_sharing_get_nr_saved_mfns();
+#endif
default:
return subarch_memory_op(op, arg);
Index: xen-4.0.0-testing/xen/arch/x86/mm/Makefile
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/mm/Makefile
+++ xen-4.0.0-testing/xen/arch/x86/mm/Makefile
@@ -6,9 +6,9 @@ obj-y += p2m.o
obj-y += guest_walk_2.o
obj-y += guest_walk_3.o
obj-$(x86_64) += guest_walk_4.o
-obj-y += mem_event.o
-obj-y += mem_paging.o
-obj-y += mem_sharing.o
+obj-$(x86_64) += mem_event.o
+obj-$(x86_64) += mem_paging.o
+obj-$(x86_64) += mem_sharing.o
guest_walk_%.o: guest_walk.c Makefile
$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
Index: xen-4.0.0-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-4.0.0-testing/xen/arch/x86/mm/p2m.c
@@ -1708,17 +1708,23 @@ void p2m_teardown(struct domain *d)
{
struct page_info *pg;
struct p2m_domain *p2m = d->arch.p2m;
+#ifdef __x86_64__
unsigned long gfn;
p2m_type_t t;
mfn_t mfn;
+#endif
p2m_lock(p2m);
- for(gfn=0; gfn < p2m->max_mapped_pfn; gfn++)
+
+#ifdef __x86_64__
+ for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
{
mfn = p2m->get_entry(d, gfn, &t, p2m_query);
- if(mfn_valid(mfn) && (t == p2m_ram_shared))
+ if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
BUG_ON(mem_sharing_unshare_page(d, gfn, MEM_SHARING_DESTROY_GFN));
}
+#endif
+
d->arch.phys_table = pagetable_null();
while ( (pg = page_list_remove_head(&p2m->pages)) )
@@ -2410,6 +2416,7 @@ clear_mmio_p2m_entry(struct domain *d, u
return rc;
}
+#ifdef __x86_64__
int
set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
{
@@ -2592,7 +2599,7 @@ void p2m_mem_paging_resume(struct domain
/* Unpause any domains that were paused because the ring was full */
mem_event_unpause_vcpus(d);
}
-
+#endif /* __x86_64__ */
/*
* Local variables:
Index: xen-4.0.0-testing/xen/include/asm-x86/mem_sharing.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/mem_sharing.h
+++ xen-4.0.0-testing/xen/include/asm-x86/mem_sharing.h
@@ -22,6 +22,8 @@
#ifndef __MEM_SHARING_H__
#define __MEM_SHARING_H__
+#ifdef __x86_64__
+
#define sharing_supported(_d) \
(is_hvm_domain(_d) && (_d)->arch.hvm_domain.hap_enabled)
@@ -43,4 +45,10 @@ int mem_sharing_domctl(struct domain *d,
xen_domctl_mem_sharing_op_t *mec);
void mem_sharing_init(void);
+#else
+
+#define mem_sharing_init() do { } while (0)
+
+#endif /* __x86_64__ */
+
#endif /* __MEM_SHARING_H__ */
Index: xen-4.0.0-testing/xen/include/asm-x86/p2m.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/p2m.h
+++ xen-4.0.0-testing/xen/include/asm-x86/p2m.h
@@ -77,11 +77,12 @@ typedef enum {
p2m_grant_map_rw = 7, /* Read/write grant mapping */
p2m_grant_map_ro = 8, /* Read-only grant mapping */
+ /* Likewise, although these are defined in all builds, they can only
+ * be used in 64-bit builds */
p2m_ram_paging_out = 9, /* Memory that is being paged out */
p2m_ram_paged = 10, /* Memory that has been paged out */
p2m_ram_paging_in = 11, /* Memory that is being paged in */
p2m_ram_paging_in_start = 12, /* Memory that is being paged in */
-
p2m_ram_shared = 13, /* Shared or sharable memory */
} p2m_type_t;
@@ -154,6 +155,7 @@ typedef enum {
#define p2m_is_sharable(_t) (p2m_to_mask(_t) & P2M_SHARABLE_TYPES)
#define p2m_is_shared(_t) (p2m_to_mask(_t) & P2M_SHARED_TYPES)
+
/* Populate-on-demand */
#define POPULATE_ON_DEMAND_MFN (1<<9)
#define POD_PAGE_ORDER 9
@@ -314,20 +316,21 @@ static inline mfn_t gfn_to_mfn_unshare(s
int must_succeed)
{
mfn_t mfn;
- int ret;
mfn = gfn_to_mfn(d, gfn, p2mt);
- if(p2m_is_shared(*p2mt))
+#ifdef __x86_64__
+ if ( p2m_is_shared(*p2mt) )
{
- ret = mem_sharing_unshare_page(d, gfn,
- must_succeed ? MEM_SHARING_MUST_SUCCEED : 0);
- if(ret < 0)
+ if ( mem_sharing_unshare_page(d, gfn,
+ must_succeed
+ ? MEM_SHARING_MUST_SUCCEED : 0) )
{
BUG_ON(must_succeed);
return mfn;
}
mfn = gfn_to_mfn(d, gfn, p2mt);
}
+#endif
return mfn;
}
@@ -429,10 +432,11 @@ p2m_type_t p2m_change_type(struct domain
/* Set mmio addresses in the p2m table (for pass-through) */
int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn);
-/* Modify p2m table for shared gfn */
-int
-set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+
+#ifdef __x86_64__
+/* Modify p2m table for shared gfn */
+int set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
/* Check if a nominated gfn is valid to be paged out */
int p2m_mem_paging_nominate(struct domain *d, unsigned long gfn);
/* Evict a frame */
@@ -443,6 +447,10 @@ void p2m_mem_paging_populate(struct doma
int p2m_mem_paging_prep(struct domain *d, unsigned long gfn);
/* Resume normal operation (in case a domain was paused) */
void p2m_mem_paging_resume(struct domain *d);
+#else
+static inline void p2m_mem_paging_populate(struct domain *d, unsigned long gfn)
+{ }
+#endif
#endif /* _XEN_P2M_H */

View File

@ -0,0 +1,90 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277831922 -3600
# Node ID c5f3fe17374cead91fdaa94f60cf7b3115eaa091
# Parent 2a3a5979e3f16d77f5b526050c45acba186482b0
trace: share t_info pages only in read-only mode
There's no need to share writably the t_info pages (Dom0 only wants
[and needs] to read it)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -84,7 +84,7 @@ typedef struct settings_st {
} settings_t;
struct t_struct {
- struct t_info *t_info; /* Structure with information about individual buffers */
+ const struct t_info *t_info; /* Structure with information about individual buffers */
struct t_buf **meta; /* Pointers to trace buffer metadata */
unsigned char **data; /* Pointers to trace buffer data areas */
};
@@ -376,9 +376,8 @@ static struct t_struct *map_tbufs(unsign
}
/* Map t_info metadata structure */
- tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN,
- tinfo_size, PROT_READ | PROT_WRITE,
- tbufs_mfn);
+ tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN, tinfo_size,
+ PROT_READ, tbufs_mfn);
if ( tbufs.t_info == 0 )
{
@@ -404,7 +403,8 @@ static struct t_struct *map_tbufs(unsign
for(i=0; i<num; i++)
{
- uint32_t *mfn_list = ((uint32_t *)tbufs.t_info) + tbufs.t_info->mfn_offset[i];
+ const uint32_t *mfn_list = (const uint32_t *)tbufs.t_info
+ + tbufs.t_info->mfn_offset[i];
int j;
xen_pfn_t pfn_list[tbufs.t_info->tbuf_size];
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -62,7 +62,7 @@ typedef struct settings_st {
} settings_t;
struct t_struct {
- struct t_info *t_info; /* Structure with information about individual buffers */
+ const struct t_info *t_info; /* Structure with information about individual buffers */
struct t_buf **meta; /* Pointers to trace buffer metadata */
unsigned char **data; /* Pointers to trace buffer data areas */
};
@@ -459,9 +459,8 @@ static struct t_struct *map_tbufs(unsign
int i;
/* Map t_info metadata structure */
- tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN,
- tinfo_size, PROT_READ | PROT_WRITE,
- tbufs_mfn);
+ tbufs.t_info = xc_map_foreign_range(xc_handle, DOMID_XEN, tinfo_size,
+ PROT_READ, tbufs_mfn);
if ( tbufs.t_info == 0 )
{
@@ -487,7 +486,8 @@ static struct t_struct *map_tbufs(unsign
for(i=0; i<num; i++)
{
- uint32_t *mfn_list = ((uint32_t *)tbufs.t_info) + tbufs.t_info->mfn_offset[i];
+ const uint32_t *mfn_list = (const uint32_t *)tbufs.t_info
+ + tbufs.t_info->mfn_offset[i];
int j;
xen_pfn_t pfn_list[tbufs.t_info->tbuf_size];
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -322,7 +322,7 @@ void __init init_trace_bufs(void)
for(i=0; i<T_INFO_PAGES; i++)
share_xen_page_with_privileged_guests(
- virt_to_page(t_info) + i, XENSHARE_writable);
+ virt_to_page(t_info) + i, XENSHARE_readonly);
if ( opt_tbuf_size == 0 )
{

View File

@ -0,0 +1,20 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277917869 -3600
# Node ID 81d6471ff1235fde2c30428b920cb6e00ba546d6
# Parent a9caa0f2d693a1d0d008b4295e49da3ea1d70334
x86: fix an off-by-one pirq range check
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1019,7 +1019,7 @@ static void __pirq_guest_eoi(struct doma
int pirq_guest_eoi(struct domain *d, int irq)
{
- if ( (irq < 0) || (irq > d->nr_pirqs) )
+ if ( (irq < 0) || (irq >= d->nr_pirqs) )
return -EINVAL;
__pirq_guest_eoi(d, irq);

View File

@ -0,0 +1,24 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277917902 -3600
# Node ID 7cda3ad44c6d4e799e65b2ffe21e609f50cdb94b
# Parent 81d6471ff1235fde2c30428b920cb6e00ba546d6
Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing P2M types
Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing
P2M types since we do not really want to force a PoD allocation
as a side effect.
Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2351,7 +2351,7 @@ p2m_type_t p2m_change_type(struct domain
p2m_lock(d->arch.p2m);
- mfn = gfn_to_mfn(d, gfn, &pt);
+ mfn = gfn_to_mfn_query(d, gfn, &pt);
if ( pt == ot )
set_p2m_entry(d, gfn, mfn, 0, nt);

View File

@ -0,0 +1,25 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1277917963 -3600
# Node ID fae04060a4f4e364c5012692b97ae1eeec3a326e
# Parent 7cda3ad44c6d4e799e65b2ffe21e609f50cdb94b
Fix #GPF injection into compat guests in vm86 code
not to let the guest disable interrupts in the real EFLAGS.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
--- a/xen/arch/x86/x86_64/compat/traps.c
+++ b/xen/arch/x86/x86_64/compat/traps.c
@@ -127,9 +127,8 @@ unsigned int compat_iret(void)
ti = &v->arch.guest_context.trap_ctxt[13];
if ( TI_GET_IF(ti) )
eflags &= ~X86_EFLAGS_IF;
- regs->_eflags = eflags & ~(X86_EFLAGS_VM|X86_EFLAGS_RF|
- X86_EFLAGS_NT|X86_EFLAGS_TF);
-
+ regs->_eflags &= ~(X86_EFLAGS_VM|X86_EFLAGS_RF|
+ X86_EFLAGS_NT|X86_EFLAGS_TF);
if ( unlikely(__put_user(0, (u32 *)regs->rsp)) )
goto exit_and_crash;
regs->_eip = ti->address;

51
21705-trace-printk.patch Normal file
View File

@ -0,0 +1,51 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278093217 -3600
# Node ID 19f4d637a52b8723ac1fbcf666c146951bee8e57
# Parent 1390e2ab45c7b63d79ba9496d609cf59af4b44ee
trace: adjust printk()s
They should be lower level or rate limited.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -137,7 +137,7 @@ static int alloc_trace_bufs(void)
}
t_info->tbuf_size = opt_tbuf_size;
- printk("tbuf_size %d\n", t_info->tbuf_size);
+ printk(XENLOG_INFO "tbuf_size %d\n", t_info->tbuf_size);
nr_pages = opt_tbuf_size;
order = get_order_from_pages(nr_pages);
@@ -194,7 +194,7 @@ static int alloc_trace_bufs(void)
/* Write list first, then write per-cpu offset. */
wmb();
t_info->mfn_offset[cpu]=offset;
- printk("p%d mfn %"PRIx32" offset %d\n",
+ printk(XENLOG_INFO "p%d mfn %"PRIx32" offset %d\n",
cpu, mfn, offset);
offset+=i;
}
@@ -489,12 +489,13 @@ static inline int __insert_record(struct
/* Double-check once more that we have enough space.
* Don't bugcheck here, in case the userland tool is doing
* something stupid. */
- if ( calc_bytes_avail(buf) < rec_size )
+ next = calc_bytes_avail(buf);
+ if ( next < rec_size )
{
- printk("%s: %u bytes left (%u - ((%u - %u) %% %u) recsize %u.\n",
- __func__,
- calc_bytes_avail(buf),
- data_size, buf->prod, buf->cons, data_size, rec_size);
+ if ( printk_ratelimit() )
+ printk(XENLOG_WARNING
+ "%s: avail=%u (size=%08x prod=%08x cons=%08x) rec=%u\n",
+ __func__, next, data_size, buf->prod, buf->cons, rec_size);
return 0;
}
rmb();

396
21706-trace-security.patch Normal file
View File

@ -0,0 +1,396 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278093394 -3600
# Node ID ae68758f8862bc43ab6bbe4ad3a8594c28b9bc39
# Parent 19f4d637a52b8723ac1fbcf666c146951bee8e57
trace: fix security issues
After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)
[GWD: Volatile quantifiers have been taken out and moved to another
patch]
To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).
I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278314658 -3600
# Node ID 9074d50d09358cd8349d54c7ab2e2ead81fa1570
# Parent f483b5ce7be235494156fee164decd73e0472cb7
trace: insert compiler memory barriers
This is to ensure fields shared writably with Dom0 get read only once
for any consistency checking followed by actual calculations.
I realized there was another multiple-read issue, a fix for which is
also included (which at once simplifies __insert_record()).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -52,12 +52,12 @@ static struct t_info *t_info;
static DEFINE_PER_CPU_READ_MOSTLY(struct t_buf *, t_bufs);
static DEFINE_PER_CPU_READ_MOSTLY(unsigned char *, t_data);
static DEFINE_PER_CPU_READ_MOSTLY(spinlock_t, t_lock);
-static int data_size;
+static u32 data_size;
static u32 t_info_first_offset __read_mostly;
/* High water mark for trace buffers; */
/* Send virtual interrupt when buffer level reaches this point */
-static int t_buf_highwater;
+static u32 t_buf_highwater;
/* Number of records lost due to per-CPU trace buffer being full. */
static DEFINE_PER_CPU(unsigned long, lost_records);
@@ -162,7 +162,7 @@ static int alloc_trace_bufs(void)
spin_lock_irqsave(&per_cpu(t_lock, cpu), flags);
- buf = per_cpu(t_bufs, cpu) = (struct t_buf *)rawbuf;
+ per_cpu(t_bufs, cpu) = buf = (struct t_buf *)rawbuf;
buf->cons = buf->prod = 0;
per_cpu(t_data, cpu) = (unsigned char *)(buf + 1);
@@ -213,6 +213,7 @@ out_dealloc:
spin_lock_irqsave(&per_cpu(t_lock, cpu), flags);
if ( (rawbuf = (char *)per_cpu(t_bufs, cpu)) )
{
+ per_cpu(t_bufs, cpu) = NULL;
ASSERT(!(virt_to_page(rawbuf)->count_info & PGC_allocated));
free_xenheap_pages(rawbuf, order);
}
@@ -418,19 +419,39 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc
return rc;
}
-static inline int calc_rec_size(int cycles, int extra)
+static inline unsigned int calc_rec_size(bool_t cycles, unsigned int extra)
{
- int rec_size;
- rec_size = 4;
+ unsigned int rec_size = 4;
+
if ( cycles )
rec_size += 8;
rec_size += extra;
return rec_size;
}
-static inline int calc_unconsumed_bytes(struct t_buf *buf)
+static inline bool_t bogus(u32 prod, u32 cons)
{
- int x = buf->prod - buf->cons;
+ if ( unlikely(prod & 3) || unlikely(prod >= 2 * data_size) ||
+ unlikely(cons & 3) || unlikely(cons >= 2 * data_size) )
+ {
+ tb_init_done = 0;
+ printk(XENLOG_WARNING "trc#%u: bogus prod (%08x) and/or cons (%08x)\n",
+ smp_processor_id(), prod, cons);
+ return 1;
+ }
+ return 0;
+}
+
+static inline u32 calc_unconsumed_bytes(const struct t_buf *buf)
+{
+ u32 prod = buf->prod, cons = buf->cons;
+ s32 x;
+
+ barrier(); /* must read buf->prod and buf->cons only once */
+ if ( bogus(prod, cons) )
+ return data_size;
+
+ x = prod - cons;
if ( x < 0 )
x += 2*data_size;
@@ -440,9 +461,16 @@ static inline int calc_unconsumed_bytes(
return x;
}
-static inline int calc_bytes_to_wrap(struct t_buf *buf)
+static inline u32 calc_bytes_to_wrap(const struct t_buf *buf)
{
- int x = data_size - buf->prod;
+ u32 prod = buf->prod, cons = buf->cons;
+ s32 x;
+
+ barrier(); /* must read buf->prod and buf->cons only once */
+ if ( bogus(prod, cons) )
+ return 0;
+
+ x = data_size - prod;
if ( x <= 0 )
x += data_size;
@@ -452,55 +480,60 @@ static inline int calc_bytes_to_wrap(str
return x;
}
-static inline int calc_bytes_avail(struct t_buf *buf)
+static inline u32 calc_bytes_avail(const struct t_buf *buf)
{
return data_size - calc_unconsumed_bytes(buf);
}
-static inline struct t_rec *
-next_record(struct t_buf *buf)
+static inline struct t_rec *next_record(const struct t_buf *buf,
+ uint32_t *next)
{
- int x = buf->prod;
+ u32 x = buf->prod, cons = buf->cons;
+
+ barrier(); /* must read buf->prod and buf->cons only once */
+ *next = x;
+ if ( !tb_init_done || bogus(x, cons) )
+ return NULL;
+
if ( x >= data_size )
x -= data_size;
- ASSERT(x >= 0);
ASSERT(x < data_size);
return (struct t_rec *)&this_cpu(t_data)[x];
}
-static inline int __insert_record(struct t_buf *buf,
- unsigned long event,
- int extra,
- int cycles,
- int rec_size,
- unsigned char *extra_data)
+static inline void __insert_record(struct t_buf *buf,
+ unsigned long event,
+ unsigned int extra,
+ bool_t cycles,
+ unsigned int rec_size,
+ const void *extra_data)
{
struct t_rec *rec;
unsigned char *dst;
- unsigned long extra_word = extra/sizeof(u32);
- int local_rec_size = calc_rec_size(cycles, extra);
+ unsigned int extra_word = extra / sizeof(u32);
+ unsigned int local_rec_size = calc_rec_size(cycles, extra);
uint32_t next;
BUG_ON(local_rec_size != rec_size);
BUG_ON(extra & 3);
+ rec = next_record(buf, &next);
+ if ( !rec )
+ return;
/* Double-check once more that we have enough space.
* Don't bugcheck here, in case the userland tool is doing
* something stupid. */
- next = calc_bytes_avail(buf);
- if ( next < rec_size )
+ if ( (unsigned char *)rec + rec_size > this_cpu(t_data) + data_size )
{
if ( printk_ratelimit() )
printk(XENLOG_WARNING
- "%s: avail=%u (size=%08x prod=%08x cons=%08x) rec=%u\n",
- __func__, next, data_size, buf->prod, buf->cons, rec_size);
- return 0;
+ "%s: size=%08x prod=%08x cons=%08x rec=%u\n",
+ __func__, data_size, next, buf->cons, rec_size);
+ return;
}
- rmb();
- rec = next_record(buf);
rec->event = event;
rec->extra_u32 = extra_word;
dst = (unsigned char *)rec->u.nocycles.extra_u32;
@@ -517,21 +550,19 @@ static inline int __insert_record(struct
wmb();
- next = buf->prod + rec_size;
+ next += rec_size;
if ( next >= 2*data_size )
next -= 2*data_size;
- ASSERT(next >= 0);
ASSERT(next < 2*data_size);
buf->prod = next;
-
- return rec_size;
}
-static inline int insert_wrap_record(struct t_buf *buf, int size)
+static inline void insert_wrap_record(struct t_buf *buf,
+ unsigned int size)
{
- int space_left = calc_bytes_to_wrap(buf);
- unsigned long extra_space = space_left - sizeof(u32);
- int cycles = 0;
+ u32 space_left = calc_bytes_to_wrap(buf);
+ unsigned int extra_space = space_left - sizeof(u32);
+ bool_t cycles = 0;
BUG_ON(space_left > size);
@@ -543,17 +574,13 @@ static inline int insert_wrap_record(str
ASSERT((extra_space/sizeof(u32)) <= TRACE_EXTRA_MAX);
}
- return __insert_record(buf,
- TRC_TRACE_WRAP_BUFFER,
- extra_space,
- cycles,
- space_left,
- NULL);
+ __insert_record(buf, TRC_TRACE_WRAP_BUFFER, extra_space, cycles,
+ space_left, NULL);
}
#define LOST_REC_SIZE (4 + 8 + 16) /* header + tsc + sizeof(struct ed) */
-static inline int insert_lost_records(struct t_buf *buf)
+static inline void insert_lost_records(struct t_buf *buf)
{
struct {
u32 lost_records;
@@ -568,12 +595,8 @@ static inline int insert_lost_records(st
this_cpu(lost_records) = 0;
- return __insert_record(buf,
- TRC_LOST_RECORDS,
- sizeof(ed),
- 1 /* cycles */,
- LOST_REC_SIZE,
- (unsigned char *)&ed);
+ __insert_record(buf, TRC_LOST_RECORDS, sizeof(ed), 1 /* cycles */,
+ LOST_REC_SIZE, &ed);
}
/*
@@ -595,13 +618,15 @@ static DECLARE_TASKLET(trace_notify_dom0
* failure, otherwise 0. Failure occurs only if the trace buffers are not yet
* initialised.
*/
-void __trace_var(u32 event, int cycles, int extra, unsigned char *extra_data)
+void __trace_var(u32 event, bool_t cycles, unsigned int extra,
+ const void *extra_data)
{
struct t_buf *buf;
- unsigned long flags, bytes_to_tail, bytes_to_wrap;
- int rec_size, total_size;
- int extra_word;
- int started_below_highwater = 0;
+ unsigned long flags;
+ u32 bytes_to_tail, bytes_to_wrap;
+ unsigned int rec_size, total_size;
+ unsigned int extra_word;
+ bool_t started_below_highwater;
if( !tb_init_done )
return;
@@ -640,7 +665,11 @@ void __trace_var(u32 event, int cycles,
buf = this_cpu(t_bufs);
if ( unlikely(!buf) )
+ {
+ /* Make gcc happy */
+ started_below_highwater = 0;
goto unlock;
+ }
started_below_highwater = (calc_unconsumed_bytes(buf) < t_buf_highwater);
@@ -721,8 +750,9 @@ unlock:
spin_unlock_irqrestore(&this_cpu(t_lock), flags);
/* Notify trace buffer consumer that we've crossed the high water mark. */
- if ( started_below_highwater &&
- (calc_unconsumed_bytes(buf) >= t_buf_highwater) )
+ if ( likely(buf!=NULL)
+ && started_below_highwater
+ && (calc_unconsumed_bytes(buf) >= t_buf_highwater) )
tasklet_schedule(&trace_notify_dom0_tasklet);
}
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -36,7 +36,7 @@ int tb_control(struct xen_sysctl_tbuf_op
int trace_will_trace_event(u32 event);
-void __trace_var(u32 event, int cycles, int extra, unsigned char *extra_data);
+void __trace_var(u32 event, bool_t cycles, unsigned int extra, const void *);
static inline void trace_var(u32 event, int cycles, int extra,
unsigned char *extra_data)
@@ -57,7 +57,7 @@ static inline void trace_var(u32 event,
{ \
u32 _d[1]; \
_d[0] = d1; \
- __trace_var(_e, 1, sizeof(*_d), (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )
@@ -68,7 +68,7 @@ static inline void trace_var(u32 event,
u32 _d[2]; \
_d[0] = d1; \
_d[1] = d2; \
- __trace_var(_e, 1, sizeof(*_d)*2, (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )
@@ -80,7 +80,7 @@ static inline void trace_var(u32 event,
_d[0] = d1; \
_d[1] = d2; \
_d[2] = d3; \
- __trace_var(_e, 1, sizeof(*_d)*3, (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )
@@ -93,7 +93,7 @@ static inline void trace_var(u32 event,
_d[1] = d2; \
_d[2] = d3; \
_d[3] = d4; \
- __trace_var(_e, 1, sizeof(*_d)*4, (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )
@@ -107,7 +107,7 @@ static inline void trace_var(u32 event,
_d[2] = d3; \
_d[3] = d4; \
_d[4] = d5; \
- __trace_var(_e, 1, sizeof(*_d)*5, (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )
@@ -122,7 +122,7 @@ static inline void trace_var(u32 event,
_d[3] = d4; \
_d[4] = d5; \
_d[5] = d6; \
- __trace_var(_e, 1, sizeof(*_d)*6, (unsigned char *)_d); \
+ __trace_var(_e, 1, sizeof(_d), _d); \
} \
} while ( 0 )

400
21712-amd-osvw.patch Normal file
View File

@ -0,0 +1,400 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278093897 -3600
# Node ID f483b5ce7be235494156fee164decd73e0472cb7
# Parent 4d091e6e04918ba3ef19cc45ae2fffaee4f18afe
AMD OSVW (OS Visible Workaround) for Xen
This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a
specific erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW
feature isn't applicable. This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
Index: xen-4.0.0-testing/xen/arch/x86/cpu/amd.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/cpu/amd.c
+++ xen-4.0.0-testing/xen/arch/x86/cpu/amd.c
@@ -7,11 +7,11 @@
#include <asm/io.h>
#include <asm/msr.h>
#include <asm/processor.h>
+#include <asm/amd.h>
#include <asm/hvm/support.h>
#include <asm/setup.h> /* amd_init_cpu */
#include "cpu.h"
-#include "amd.h"
void start_svm(struct cpuinfo_x86 *c);
@@ -157,6 +157,54 @@ static void __devinit set_cpuidmask(stru
}
/*
+ * Check for the presence of an AMD erratum. Arguments are defined in amd.h
+ * for each known erratum. Return 1 if erratum is found.
+ */
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw, ...)
+{
+ va_list ap;
+ u32 range;
+ u32 ms;
+
+ if (cpu->x86_vendor != X86_VENDOR_AMD)
+ return 0;
+
+ va_start(ap, osvw);
+
+ if (osvw) {
+ u16 osvw_id = va_arg(ap, int);
+
+ if (cpu_has(cpu, X86_FEATURE_OSVW)) {
+ u64 osvw_len;
+ rdmsrl(MSR_AMD_OSVW_ID_LENGTH, osvw_len);
+
+ if (osvw_id < osvw_len) {
+ u64 osvw_bits;
+ rdmsrl(MSR_AMD_OSVW_STATUS + (osvw_id >> 6),
+ osvw_bits);
+
+ va_end(ap);
+ return (osvw_bits >> (osvw_id & 0x3f)) & 0x01;
+ }
+ }
+ }
+
+ /* OSVW unavailable or ID unknown, match family-model-stepping range */
+ ms = (cpu->x86_model << 8) | cpu->x86_mask;
+ while ((range = va_arg(ap, int))) {
+ if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
+ (ms >= AMD_MODEL_RANGE_START(range)) &&
+ (ms <= AMD_MODEL_RANGE_END(range))) {
+ va_end(ap);
+ return 1;
+ }
+ }
+
+ va_end(ap);
+ return 0;
+}
+
+/*
* amd_flush_filter={on,off}. Forcibly Enable or disable the TLB flush
* filter on AMD 64-bit processors.
*/
Index: xen-4.0.0-testing/xen/arch/x86/cpu/amd.h
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/cpu/amd.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * amd.h - AMD processor specific definitions
- */
-
-#ifndef __AMD_H__
-#define __AMD_H__
-
-#include <asm/cpufeature.h>
-
-/* CPUID masked for use by AMD-V Extended Migration */
-
-#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
-#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
-
-/* Family 0Fh, Revision C */
-#define AMD_FEATURES_K8_REV_C_ECX 0
-#define AMD_FEATURES_K8_REV_C_EDX ( \
- __bit(X86_FEATURE_FPU) | __bit(X86_FEATURE_VME) | \
- __bit(X86_FEATURE_DE) | __bit(X86_FEATURE_PSE) | \
- __bit(X86_FEATURE_TSC) | __bit(X86_FEATURE_MSR) | \
- __bit(X86_FEATURE_PAE) | __bit(X86_FEATURE_MCE) | \
- __bit(X86_FEATURE_CX8) | __bit(X86_FEATURE_APIC) | \
- __bit(X86_FEATURE_SEP) | __bit(X86_FEATURE_MTRR) | \
- __bit(X86_FEATURE_PGE) | __bit(X86_FEATURE_MCA) | \
- __bit(X86_FEATURE_CMOV) | __bit(X86_FEATURE_PAT) | \
- __bit(X86_FEATURE_PSE36) | __bit(X86_FEATURE_CLFLSH)| \
- __bit(X86_FEATURE_MMX) | __bit(X86_FEATURE_FXSR) | \
- __bit(X86_FEATURE_XMM) | __bit(X86_FEATURE_XMM2))
-#define AMD_EXTFEATURES_K8_REV_C_ECX 0
-#define AMD_EXTFEATURES_K8_REV_C_EDX ( \
- __bit(X86_FEATURE_FPU) | __bit(X86_FEATURE_VME) | \
- __bit(X86_FEATURE_DE) | __bit(X86_FEATURE_PSE) | \
- __bit(X86_FEATURE_TSC) | __bit(X86_FEATURE_MSR) | \
- __bit(X86_FEATURE_PAE) | __bit(X86_FEATURE_MCE) | \
- __bit(X86_FEATURE_CX8) | __bit(X86_FEATURE_APIC) | \
- __bit(X86_FEATURE_SYSCALL) | __bit(X86_FEATURE_MTRR) | \
- __bit(X86_FEATURE_PGE) | __bit(X86_FEATURE_MCA) | \
- __bit(X86_FEATURE_CMOV) | __bit(X86_FEATURE_PAT) | \
- __bit(X86_FEATURE_PSE36) | __bit(X86_FEATURE_NX) | \
- __bit(X86_FEATURE_MMXEXT) | __bit(X86_FEATURE_MMX) | \
- __bit(X86_FEATURE_FXSR) | __bit(X86_FEATURE_LM) | \
- __bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
-
-/* Family 0Fh, Revision D */
-#define AMD_FEATURES_K8_REV_D_ECX AMD_FEATURES_K8_REV_C_ECX
-#define AMD_FEATURES_K8_REV_D_EDX AMD_FEATURES_K8_REV_C_EDX
-#define AMD_EXTFEATURES_K8_REV_D_ECX (AMD_EXTFEATURES_K8_REV_C_ECX |\
- __bit(X86_FEATURE_LAHF_LM))
-#define AMD_EXTFEATURES_K8_REV_D_EDX (AMD_EXTFEATURES_K8_REV_C_EDX |\
- __bit(X86_FEATURE_FFXSR))
-
-/* Family 0Fh, Revision E */
-#define AMD_FEATURES_K8_REV_E_ECX (AMD_FEATURES_K8_REV_D_ECX | \
- __bit(X86_FEATURE_XMM3))
-#define AMD_FEATURES_K8_REV_E_EDX (AMD_FEATURES_K8_REV_D_EDX | \
- __bit(X86_FEATURE_HT))
-#define AMD_EXTFEATURES_K8_REV_E_ECX (AMD_EXTFEATURES_K8_REV_D_ECX |\
- __bit(X86_FEATURE_CMP_LEGACY))
-#define AMD_EXTFEATURES_K8_REV_E_EDX AMD_EXTFEATURES_K8_REV_D_EDX
-
-/* Family 0Fh, Revision F */
-#define AMD_FEATURES_K8_REV_F_ECX (AMD_FEATURES_K8_REV_E_ECX | \
- __bit(X86_FEATURE_CX16))
-#define AMD_FEATURES_K8_REV_F_EDX AMD_FEATURES_K8_REV_E_EDX
-#define AMD_EXTFEATURES_K8_REV_F_ECX (AMD_EXTFEATURES_K8_REV_E_ECX |\
- __bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) | \
- __bit(X86_FEATURE_ALTMOVCR))
-#define AMD_EXTFEATURES_K8_REV_F_EDX (AMD_EXTFEATURES_K8_REV_E_EDX |\
- __bit(X86_FEATURE_RDTSCP))
-
-/* Family 0Fh, Revision G */
-#define AMD_FEATURES_K8_REV_G_ECX AMD_FEATURES_K8_REV_F_ECX
-#define AMD_FEATURES_K8_REV_G_EDX AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_K8_REV_G_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
- __bit(X86_FEATURE_3DNOWPF))
-#define AMD_EXTFEATURES_K8_REV_G_EDX AMD_EXTFEATURES_K8_REV_F_EDX
-
-/* Family 10h, Revision B */
-#define AMD_FEATURES_FAM10h_REV_B_ECX (AMD_FEATURES_K8_REV_F_ECX | \
- __bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
-#define AMD_FEATURES_FAM10h_REV_B_EDX AMD_FEATURES_K8_REV_F_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
- __bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | \
- __bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | \
- __bit(X86_FEATURE_IBS))
-#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
- __bit(X86_FEATURE_PAGE1GB))
-
-/* Family 10h, Revision C */
-#define AMD_FEATURES_FAM10h_REV_C_ECX AMD_FEATURES_FAM10h_REV_B_ECX
-#define AMD_FEATURES_FAM10h_REV_C_EDX AMD_FEATURES_FAM10h_REV_B_EDX
-#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
- __bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
-#define AMD_EXTFEATURES_FAM10h_REV_C_EDX AMD_EXTFEATURES_FAM10h_REV_B_EDX
-
-/* Family 11h, Revision B */
-#define AMD_FEATURES_FAM11h_REV_B_ECX AMD_FEATURES_K8_REV_G_ECX
-#define AMD_FEATURES_FAM11h_REV_B_EDX AMD_FEATURES_K8_REV_G_EDX
-#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
- __bit(X86_FEATURE_SKINIT))
-#define AMD_EXTFEATURES_FAM11h_REV_B_EDX AMD_EXTFEATURES_K8_REV_G_EDX
-
-#endif /* __AMD_H__ */
Index: xen-4.0.0-testing/xen/arch/x86/hvm/svm/asid.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/svm/asid.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/svm/asid.c
@@ -21,14 +21,14 @@
#include <xen/lib.h>
#include <xen/perfc.h>
#include <asm/hvm/svm/asid.h>
+#include <asm/amd.h>
void svm_asid_init(struct cpuinfo_x86 *c)
{
int nasids = 0;
/* Check for erratum #170, and leave ASIDs disabled if it's present. */
- if ( (c->x86 == 0x10) ||
- ((c->x86 == 0xf) && (c->x86_model >= 0x68) && (c->x86_mask >= 1)) )
+ if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
nasids = cpuid_ebx(0x8000000A);
hvm_asid_init(nasids);
Index: xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c
@@ -34,6 +34,7 @@
#include <asm/regs.h>
#include <asm/cpufeature.h>
#include <asm/processor.h>
+#include <asm/amd.h>
#include <asm/types.h>
#include <asm/debugreg.h>
#include <asm/msr.h>
@@ -828,8 +829,8 @@ static void svm_init_erratum_383(struct
{
uint64_t msr_content;
- /* only family 10h is affected */
- if ( c->x86 != 0x10 )
+ /* check whether CPU is affected */
+ if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_383) )
return;
rdmsrl(MSR_AMD64_DC_CFG, msr_content);
Index: xen-4.0.0-testing/xen/include/asm-x86/amd.h
===================================================================
--- /dev/null
+++ xen-4.0.0-testing/xen/include/asm-x86/amd.h
@@ -0,0 +1,137 @@
+/*
+ * amd.h - AMD processor specific definitions
+ */
+
+#ifndef __AMD_H__
+#define __AMD_H__
+
+#include <asm/cpufeature.h>
+
+/* CPUID masked for use by AMD-V Extended Migration */
+
+#define X86_FEATURE_BITPOS(_feature_) ((_feature_) % 32)
+#define __bit(_x_) (1U << X86_FEATURE_BITPOS(_x_))
+
+/* Family 0Fh, Revision C */
+#define AMD_FEATURES_K8_REV_C_ECX 0
+#define AMD_FEATURES_K8_REV_C_EDX ( \
+ __bit(X86_FEATURE_FPU) | __bit(X86_FEATURE_VME) | \
+ __bit(X86_FEATURE_DE) | __bit(X86_FEATURE_PSE) | \
+ __bit(X86_FEATURE_TSC) | __bit(X86_FEATURE_MSR) | \
+ __bit(X86_FEATURE_PAE) | __bit(X86_FEATURE_MCE) | \
+ __bit(X86_FEATURE_CX8) | __bit(X86_FEATURE_APIC) | \
+ __bit(X86_FEATURE_SEP) | __bit(X86_FEATURE_MTRR) | \
+ __bit(X86_FEATURE_PGE) | __bit(X86_FEATURE_MCA) | \
+ __bit(X86_FEATURE_CMOV) | __bit(X86_FEATURE_PAT) | \
+ __bit(X86_FEATURE_PSE36) | __bit(X86_FEATURE_CLFLSH)| \
+ __bit(X86_FEATURE_MMX) | __bit(X86_FEATURE_FXSR) | \
+ __bit(X86_FEATURE_XMM) | __bit(X86_FEATURE_XMM2))
+#define AMD_EXTFEATURES_K8_REV_C_ECX 0
+#define AMD_EXTFEATURES_K8_REV_C_EDX ( \
+ __bit(X86_FEATURE_FPU) | __bit(X86_FEATURE_VME) | \
+ __bit(X86_FEATURE_DE) | __bit(X86_FEATURE_PSE) | \
+ __bit(X86_FEATURE_TSC) | __bit(X86_FEATURE_MSR) | \
+ __bit(X86_FEATURE_PAE) | __bit(X86_FEATURE_MCE) | \
+ __bit(X86_FEATURE_CX8) | __bit(X86_FEATURE_APIC) | \
+ __bit(X86_FEATURE_SYSCALL) | __bit(X86_FEATURE_MTRR) | \
+ __bit(X86_FEATURE_PGE) | __bit(X86_FEATURE_MCA) | \
+ __bit(X86_FEATURE_CMOV) | __bit(X86_FEATURE_PAT) | \
+ __bit(X86_FEATURE_PSE36) | __bit(X86_FEATURE_NX) | \
+ __bit(X86_FEATURE_MMXEXT) | __bit(X86_FEATURE_MMX) | \
+ __bit(X86_FEATURE_FXSR) | __bit(X86_FEATURE_LM) | \
+ __bit(X86_FEATURE_3DNOWEXT) | __bit(X86_FEATURE_3DNOW))
+
+/* Family 0Fh, Revision D */
+#define AMD_FEATURES_K8_REV_D_ECX AMD_FEATURES_K8_REV_C_ECX
+#define AMD_FEATURES_K8_REV_D_EDX AMD_FEATURES_K8_REV_C_EDX
+#define AMD_EXTFEATURES_K8_REV_D_ECX (AMD_EXTFEATURES_K8_REV_C_ECX |\
+ __bit(X86_FEATURE_LAHF_LM))
+#define AMD_EXTFEATURES_K8_REV_D_EDX (AMD_EXTFEATURES_K8_REV_C_EDX |\
+ __bit(X86_FEATURE_FFXSR))
+
+/* Family 0Fh, Revision E */
+#define AMD_FEATURES_K8_REV_E_ECX (AMD_FEATURES_K8_REV_D_ECX | \
+ __bit(X86_FEATURE_XMM3))
+#define AMD_FEATURES_K8_REV_E_EDX (AMD_FEATURES_K8_REV_D_EDX | \
+ __bit(X86_FEATURE_HT))
+#define AMD_EXTFEATURES_K8_REV_E_ECX (AMD_EXTFEATURES_K8_REV_D_ECX |\
+ __bit(X86_FEATURE_CMP_LEGACY))
+#define AMD_EXTFEATURES_K8_REV_E_EDX AMD_EXTFEATURES_K8_REV_D_EDX
+
+/* Family 0Fh, Revision F */
+#define AMD_FEATURES_K8_REV_F_ECX (AMD_FEATURES_K8_REV_E_ECX | \
+ __bit(X86_FEATURE_CX16))
+#define AMD_FEATURES_K8_REV_F_EDX AMD_FEATURES_K8_REV_E_EDX
+#define AMD_EXTFEATURES_K8_REV_F_ECX (AMD_EXTFEATURES_K8_REV_E_ECX |\
+ __bit(X86_FEATURE_SVME) | __bit(X86_FEATURE_EXTAPICSPACE) | \
+ __bit(X86_FEATURE_ALTMOVCR))
+#define AMD_EXTFEATURES_K8_REV_F_EDX (AMD_EXTFEATURES_K8_REV_E_EDX |\
+ __bit(X86_FEATURE_RDTSCP))
+
+/* Family 0Fh, Revision G */
+#define AMD_FEATURES_K8_REV_G_ECX AMD_FEATURES_K8_REV_F_ECX
+#define AMD_FEATURES_K8_REV_G_EDX AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_K8_REV_G_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
+ __bit(X86_FEATURE_3DNOWPF))
+#define AMD_EXTFEATURES_K8_REV_G_EDX AMD_EXTFEATURES_K8_REV_F_EDX
+
+/* Family 10h, Revision B */
+#define AMD_FEATURES_FAM10h_REV_B_ECX (AMD_FEATURES_K8_REV_F_ECX | \
+ __bit(X86_FEATURE_POPCNT) | __bit(X86_FEATURE_MWAIT))
+#define AMD_FEATURES_FAM10h_REV_B_EDX AMD_FEATURES_K8_REV_F_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_F_ECX |\
+ __bit(X86_FEATURE_ABM) | __bit(X86_FEATURE_SSE4A) | \
+ __bit(X86_FEATURE_MISALIGNSSE) | __bit(X86_FEATURE_OSVW) | \
+ __bit(X86_FEATURE_IBS))
+#define AMD_EXTFEATURES_FAM10h_REV_B_EDX (AMD_EXTFEATURES_K8_REV_F_EDX |\
+ __bit(X86_FEATURE_PAGE1GB))
+
+/* Family 10h, Revision C */
+#define AMD_FEATURES_FAM10h_REV_C_ECX AMD_FEATURES_FAM10h_REV_B_ECX
+#define AMD_FEATURES_FAM10h_REV_C_EDX AMD_FEATURES_FAM10h_REV_B_EDX
+#define AMD_EXTFEATURES_FAM10h_REV_C_ECX (AMD_EXTFEATURES_FAM10h_REV_B_ECX |\
+ __bit(X86_FEATURE_SKINIT) | __bit(X86_FEATURE_WDT))
+#define AMD_EXTFEATURES_FAM10h_REV_C_EDX AMD_EXTFEATURES_FAM10h_REV_B_EDX
+
+/* Family 11h, Revision B */
+#define AMD_FEATURES_FAM11h_REV_B_ECX AMD_FEATURES_K8_REV_G_ECX
+#define AMD_FEATURES_FAM11h_REV_B_EDX AMD_FEATURES_K8_REV_G_EDX
+#define AMD_EXTFEATURES_FAM11h_REV_B_ECX (AMD_EXTFEATURES_K8_REV_G_ECX |\
+ __bit(X86_FEATURE_SKINIT))
+#define AMD_EXTFEATURES_FAM11h_REV_B_EDX AMD_EXTFEATURES_K8_REV_G_EDX
+
+/* AMD errata checking
+ *
+ * Errata are defined using the AMD_LEGACY_ERRATUM() or AMD_OSVW_ERRATUM()
+ * macros. The latter is intended for newer errata that have an OSVW id
+ * assigned, which it takes as first argument. Both take a variable number
+ * of family-specific model-stepping ranges created by AMD_MODEL_RANGE().
+ *
+ * Example 1:
+ * #define AMD_ERRATUM_319 \
+ * AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0x4, 0x2), \
+ * AMD_MODEL_RANGE(0x10, 0x8, 0x0, 0x8, 0x0), \
+ * AMD_MODEL_RANGE(0x10, 0x9, 0x0, 0x9, 0x0))
+ * Example 2:
+ * #define AMD_ERRATUM_400 \
+ * AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), \
+ * AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
+ */
+
+#define AMD_LEGACY_ERRATUM(...) 0 /* legacy */, __VA_ARGS__, 0
+#define AMD_OSVW_ERRATUM(osvw_id, ...) 1 /* osvw */, osvw_id, __VA_ARGS__, 0
+#define AMD_MODEL_RANGE(f, m_start, s_start, m_end, s_end) \
+ ((f << 24) | (m_start << 16) | (s_start << 12) | (m_end << 4) | (s_end))
+#define AMD_MODEL_RANGE_FAMILY(range) (((range) >> 24) & 0xff)
+#define AMD_MODEL_RANGE_START(range) (((range) >> 12) & 0xfff)
+#define AMD_MODEL_RANGE_END(range) ((range) & 0xfff)
+
+#define AMD_ERRATUM_170 \
+ AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))
+
+#define AMD_ERRATUM_383 \
+ AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf), \
+ AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0))
+
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
+#endif /* __AMD_H__ */
Index: xen-4.0.0-testing/xen/include/asm-x86/msr-index.h
===================================================================
--- xen-4.0.0-testing.orig/xen/include/asm-x86/msr-index.h
+++ xen-4.0.0-testing/xen/include/asm-x86/msr-index.h
@@ -251,6 +251,10 @@
#define MSR_AMD_PATCHLEVEL 0x0000008b
#define MSR_AMD_PATCHLOADER 0xc0010020
+/* AMD OS Visible Workaround MSRs */
+#define MSR_AMD_OSVW_ID_LENGTH 0xc0010140
+#define MSR_AMD_OSVW_STATUS 0xc0010141
+
/* K6 MSRs */
#define MSR_K6_EFER 0xc0000080
#define MSR_K6_STAR 0xc0000081

View File

@ -16,10 +16,10 @@ VM" or " API"
Signed-off-by James (Song Wei) <jsong@novell.com>
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomain.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomain.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py
@@ -250,6 +250,18 @@ class XendDomain:
@return: path to config file.
"""
@ -39,10 +39,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomain.py
def _managed_check_point_path(self, domuuid):
"""Returns absolute path to check point file for managed domain.
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -327,6 +327,8 @@ class XendDomainInfo:
@type info: dictionary
@ivar domid: Domain ID (if VM has started)
@ -60,10 +60,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
maxmem = self.info.get('memory_static_max', 0)
memory = self.info.get('memory_dynamic_max', 0)
Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvDomain.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-4.0.1-testing/tools/python/xen/xend/server/SrvDomain.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py
@@ -225,6 +225,20 @@ class SrvDomain(SrvDir):
self.acceptCommand(req)
return self.xd.domain_reset(self.dom.getName())
@ -85,10 +85,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvDomain.py
def op_usb_add(self, op, req):
self.acceptCommand(req)
return req.threadRequest(self.do_usb_add, op, req)
Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
Index: xen-4.0.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.0.1-testing/tools/python/xen/xm/main.py
--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.0.0-testing/tools/python/xen/xm/main.py
@@ -165,6 +165,8 @@ SUBCOMMAND_HELP = {
#usb
'usb-add' : ('<domain> <[host:bus.addr] [host:vendor_id:product_id]>','Add the usb device to FV VM.'),
@ -144,7 +144,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
def xm_dump_core(args):
live = False
@@ -1517,6 +1524,32 @@ def xm_usb_add(args):
@@ -1515,6 +1522,32 @@ def xm_usb_add(args):
arg_check(args, "usb-add", 2)
server.xend.domain.usb_add(args[0],args[1])
@ -177,7 +177,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
def xm_usb_del(args):
arg_check(args, "usb-del", 2)
server.xend.domain.usb_del(args[0],args[1])
@@ -3542,6 +3575,8 @@ commands = {
@@ -3538,6 +3571,8 @@ commands = {
#usb
"usb-add": xm_usb_add,
"usb-del": xm_usb_del,

View File

@ -0,0 +1,27 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1278578686 -3600
# Node ID df63728e1680ce7827bd58f6bda453f70ed41ad9
# Parent a0f0ae5be814f19590d5a59d91ab7183cd1a325f
x86/cpufreq: check array index before use
... rather than after.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -210,9 +210,11 @@
if (!cpu_isset(cpu, mask))
cpu = first_cpu(mask);
+ if (cpu >= NR_CPUS)
+ return 0;
+
policy = cpufreq_cpu_policy[cpu];
-
- if (cpu >= NR_CPUS || !policy || !drv_data[policy->cpu])
+ if (!policy || !drv_data[policy->cpu])
return 0;
switch (drv_data[policy->cpu]->cpu_feature) {

View File

@ -37,10 +37,10 @@ Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
Comment from Masaki Kanno <kanno.masaki@jp.fujitsu.com>: "Well done"
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Index: xen-4.0.1-testing/tools/examples/xend-config.sxp
Index: xen-4.0.0-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-4.0.1-testing.orig/tools/examples/xend-config.sxp
+++ xen-4.0.1-testing/tools/examples/xend-config.sxp
--- xen-4.0.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-4.0.0-testing/tools/examples/xend-config.sxp
@@ -277,3 +277,11 @@
# we have to realize this may incur security issue and we can't make sure the
# device assignment could really work properly even after we do this.
@ -50,13 +50,13 @@ Index: xen-4.0.1-testing/tools/examples/xend-config.sxp
+# because xend scans all the device paths to build its internal PSCSI device
+# list. If we need only a few devices for assigning to a guest, we can reduce
+# the scan to this device. Set list list of device paths in same syntax like in
+# command lsscsi, e.g. ('16:0:0:0' '15:0')
+# command lsscsi, e.g. ('16:0:0:0' '15:0')
+# (pscsi-device-mask ('*'))
+
Index: xen-4.0.1-testing/tools/python/xen/util/vscsi_util.py
Index: xen-4.0.0-testing/tools/python/xen/util/vscsi_util.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/util/vscsi_util.py
+++ xen-4.0.1-testing/tools/python/xen/util/vscsi_util.py
--- xen-4.0.0-testing.orig/tools/python/xen/util/vscsi_util.py
+++ xen-4.0.0-testing/tools/python/xen/util/vscsi_util.py
@@ -148,11 +148,12 @@ def _vscsi_get_scsidevices_by_sysfs():
return devices
@ -85,10 +85,10 @@ Index: xen-4.0.1-testing/tools/python/xen/util/vscsi_util.py
scsi_record = _make_scsi_record(scsi_info)
scsi_records.append(scsi_record)
return scsi_records
Index: xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
@@ -323,7 +323,12 @@ class XendNode:
pscsi_table = {}
pscsi_HBA_table = {}
@ -103,10 +103,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
scsi_id = pscsi_record['scsi_id']
if scsi_id:
saved_HBA_uuid = None
Index: xen-4.0.1-testing/tools/python/xen/xend/XendOptions.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendOptions.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendOptions.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendOptions.py
@@ -164,6 +164,9 @@ class XendOptions:
"""
print >>sys.stderr, "xend [ERROR]", fmt % args

View File

@ -18,10 +18,10 @@ Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
Acked-by: Jim Fehlig <jfehlig@novell.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendAPI.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAPI.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py
@@ -1667,7 +1667,8 @@ class XendAPI(object):
def VM_set_actions_after_crash(self, session, vm_ref, action):
if action not in XEN_API_ON_CRASH_BEHAVIOUR:
@ -32,10 +32,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
def VM_set_HVM_boot_policy(self, session, vm_ref, value):
if value != "" and value != "BIOS order":
Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPIConstants.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendAPIConstants.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendAPIConstants.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendAPIConstants.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAPIConstants.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendAPIConstants.py
@@ -63,6 +63,18 @@ XEN_API_ON_CRASH_BEHAVIOUR_FILTER = {
'rename_restart' : 'rename_restart',
}
@ -55,10 +55,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPIConstants.py
XEN_API_VBD_MODE = ['RO', 'RW']
XEN_API_VDI_TYPE = ['system', 'user', 'ephemeral']
XEN_API_VBD_TYPE = ['CD', 'Disk']
Index: xen-4.0.1-testing/tools/python/xen/xend/XendConfig.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendConfig.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
@@ -41,6 +41,7 @@ from xen.util.pci import pci_opts_list_f
from xen.xend.XendSXPDev import dev_dict_to_sxp
from xen.util import xsconstants

View File

@ -1,48 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1280486194 -3600
# Node ID c9e7850ec9a18d7085c7468407e175bb64513846
# Parent 754877be695ba3050f140002dbd185a27a437fcc
x86: unmask CPUID levels on Intel CPUs
References: bnc#640773
If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to
make all CPUID information available. This is required for some
features to work, such as MWAIT in cpuidle, get cpu topology, XSAVE,
etc.
Signed-off-by: Wei Gang <gang.wei@intel.com>
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -90,6 +90,20 @@ void __devinit early_intel_workaround(st
/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
if (c->x86 == 15 && c->x86_cache_alignment == 64)
c->x86_cache_alignment = 128;
+
+ /* Unmask CPUID levels if masked: */
+ if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
+ u64 misc_enable;
+
+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+
+ if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) {
+ misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
+ wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+ c->cpuid_level = cpuid_eax(0);
+ printk("revised cpuid_level = %d\n", c->cpuid_level);
+ }
+ }
}
/*
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -324,6 +324,7 @@
#define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1<<11)
#define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1<<12)
#define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18)
+#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1<<22)
#define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23)
/* Intel Model 6 */

View File

@ -1,30 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1282069957 -3600
# Node ID 5218db847b58a151d8f320b7141efc984f759b35
# Parent 542e8cd16a6cf036e89b597ba6343245fcaafa25
x86 cpuidle: check whether cpu is online in cpu idle control
We observed a 2.6.18.8 dom0 kernel crash when Xen has maxcpus < num
of physical cores (maxcpus=3D4 for a 12-core system). It appeared that
hypervisor doesn't check whether CPU is online or not. This small
patch fixed the issue.
Signed-off-by: Uwe Dannowski <uwe.dannowski@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
--- a/xen/arch/x86/acpi/cpuidle_menu.c
+++ b/xen/arch/x86/acpi/cpuidle_menu.c
@@ -270,9 +270,10 @@ static void menu_reflect(struct acpi_pro
static int menu_enable_device(struct acpi_processor_power *power)
{
- struct menu_device *data = &per_cpu(menu_devices, power->cpu);
+ if (!cpu_online(power->cpu))
+ return -1;
- memset(data, 0, sizeof(struct menu_device));
+ memset(&per_cpu(menu_devices, power->cpu), 0, sizeof(struct menu_device));
return 0;
}

View File

@ -1,203 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1282466228 -3600
# Node ID 59ff5820534f4c5ec006d1ddca0f4356634c3b22
# Parent f77261710856aad506dda92cfa3b92b923be4e15
x86: Automatically EOI guest-bound interrupts if guest takes too long.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Includes the x86 IRQ specific parts of c/s 21508:
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1275480791 -3600
# Node ID 5aabc6f94df5f275647d55caa24780eff0c81355
# Parent a3bdee5a20daf590ae7a440dad4e3b104b99c620
timers: Track inactive timers and migrate them on cpu offline.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -46,8 +46,6 @@ static DECLARE_BITMAP(used_vectors, NR_V
struct irq_cfg __read_mostly *irq_cfg = NULL;
-static struct timer *__read_mostly irq_guest_eoi_timer;
-
static DEFINE_SPINLOCK(vector_lock);
DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
@@ -274,18 +272,15 @@ int init_irq_data(void)
irq_desc = xmalloc_array(struct irq_desc, nr_irqs);
irq_cfg = xmalloc_array(struct irq_cfg, nr_irqs);
irq_status = xmalloc_array(int, nr_irqs);
- irq_guest_eoi_timer = xmalloc_array(struct timer, nr_irqs);
irq_vector = xmalloc_array(u8, nr_irqs_gsi);
- if (!irq_desc || !irq_cfg || !irq_status ||! irq_vector ||
- !irq_guest_eoi_timer)
+ if ( !irq_desc || !irq_cfg || !irq_status ||! irq_vector )
return -ENOMEM;
memset(irq_desc, 0, nr_irqs * sizeof(*irq_desc));
memset(irq_cfg, 0, nr_irqs * sizeof(*irq_cfg));
memset(irq_status, 0, nr_irqs * sizeof(*irq_status));
memset(irq_vector, 0, nr_irqs_gsi * sizeof(*irq_vector));
- memset(irq_guest_eoi_timer, 0, nr_irqs * sizeof(*irq_guest_eoi_timer));
for (irq = 0; irq < nr_irqs; irq++) {
desc = irq_to_desc(irq);
@@ -740,6 +735,7 @@ typedef struct {
#define ACKTYPE_UNMASK 1 /* Unmask PIC hardware (from any CPU) */
#define ACKTYPE_EOI 2 /* EOI on the CPU that was interrupted */
cpumask_t cpu_eoi_map; /* CPUs that need to EOI this interrupt */
+ struct timer eoi_timer;
struct domain *guest[IRQ_MAX_GUESTS];
} irq_guest_action_t;
@@ -784,13 +780,55 @@ static void _irq_guest_eoi(struct irq_de
desc->handler->enable(irq);
}
+static void set_eoi_ready(void *data);
+
static void irq_guest_eoi_timer_fn(void *data)
{
struct irq_desc *desc = data;
+ unsigned int irq = desc - irq_desc;
+ irq_guest_action_t *action;
+ cpumask_t cpu_eoi_map;
unsigned long flags;
spin_lock_irqsave(&desc->lock, flags);
- _irq_guest_eoi(desc);
+
+ if ( !(desc->status & IRQ_GUEST) )
+ goto out;
+
+ action = (irq_guest_action_t *)desc->action;
+
+ if ( action->ack_type != ACKTYPE_NONE )
+ {
+ unsigned int i;
+ for ( i = 0; i < action->nr_guests; i++ )
+ {
+ struct domain *d = action->guest[i];
+ unsigned int pirq = domain_irq_to_pirq(d, irq);
+ if ( test_and_clear_bit(pirq, d->pirq_mask) )
+ action->in_flight--;
+ }
+ }
+
+ if ( action->in_flight != 0 )
+ goto out;
+
+ switch ( action->ack_type )
+ {
+ case ACKTYPE_UNMASK:
+ desc->handler->end(irq);
+ break;
+ case ACKTYPE_EOI:
+ cpu_eoi_map = action->cpu_eoi_map;
+ spin_unlock_irq(&desc->lock);
+ on_selected_cpus(&cpu_eoi_map, set_eoi_ready, desc, 0);
+ spin_lock_irq(&desc->lock);
+ break;
+ case ACKTYPE_NONE:
+ _irq_guest_eoi(desc);
+ break;
+ }
+
+ out:
spin_unlock_irqrestore(&desc->lock, flags);
}
@@ -847,9 +885,11 @@ static void __do_IRQ_guest(int irq)
}
}
- if ( already_pending == action->nr_guests )
+ stop_timer(&action->eoi_timer);
+
+ if ( (action->ack_type == ACKTYPE_NONE) &&
+ (already_pending == action->nr_guests) )
{
- stop_timer(&irq_guest_eoi_timer[irq]);
desc->handler->disable(irq);
desc->status |= IRQ_GUEST_EOI_PENDING;
for ( i = 0; i < already_pending; ++i )
@@ -865,10 +905,10 @@ static void __do_IRQ_guest(int irq)
* - skip the timer setup below.
*/
}
- init_timer(&irq_guest_eoi_timer[irq],
- irq_guest_eoi_timer_fn, desc, smp_processor_id());
- set_timer(&irq_guest_eoi_timer[irq], NOW() + MILLISECS(1));
}
+
+ migrate_timer(&action->eoi_timer, smp_processor_id());
+ set_timer(&action->eoi_timer, NOW() + MILLISECS(1));
}
/*
@@ -978,7 +1018,7 @@ static void __pirq_guest_eoi(struct doma
if ( action->ack_type == ACKTYPE_NONE )
{
ASSERT(!test_bit(pirq, d->pirq_mask));
- stop_timer(&irq_guest_eoi_timer[irq]);
+ stop_timer(&action->eoi_timer);
_irq_guest_eoi(desc);
}
@@ -1162,6 +1202,7 @@ int pirq_guest_bind(struct vcpu *v, int
action->shareable = will_share;
action->ack_type = pirq_acktype(v->domain, pirq);
cpus_clear(action->cpu_eoi_map);
+ init_timer(&action->eoi_timer, irq_guest_eoi_timer_fn, desc, 0);
desc->depth = 0;
desc->status |= IRQ_GUEST;
@@ -1266,7 +1307,7 @@ static irq_guest_action_t *__pirq_guest_
}
break;
case ACKTYPE_NONE:
- stop_timer(&irq_guest_eoi_timer[irq]);
+ stop_timer(&action->eoi_timer);
_irq_guest_eoi(desc);
break;
}
@@ -1306,9 +1347,7 @@ static irq_guest_action_t *__pirq_guest_
BUG_ON(!cpus_empty(action->cpu_eoi_map));
desc->action = NULL;
- desc->status &= ~IRQ_GUEST;
- desc->status &= ~IRQ_INPROGRESS;
- kill_timer(&irq_guest_eoi_timer[irq]);
+ desc->status &= ~(IRQ_GUEST|IRQ_GUEST_EOI_PENDING|IRQ_INPROGRESS);
desc->handler->shutdown(irq);
/* Caller frees the old guest descriptor block. */
@@ -1342,7 +1381,10 @@ void pirq_guest_unbind(struct domain *d,
spin_unlock_irq(&desc->lock);
if ( oldaction != NULL )
+ {
+ kill_timer(&oldaction->eoi_timer);
xfree(oldaction);
+ }
}
static int pirq_guest_force_unbind(struct domain *d, int irq)
@@ -1380,7 +1422,10 @@ static int pirq_guest_force_unbind(struc
spin_unlock_irq(&desc->lock);
if ( oldaction != NULL )
+ {
+ kill_timer(&oldaction->eoi_timer);
xfree(oldaction);
+ }
return bound;
}

View File

@ -1,31 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1282817774 -3600
# Node ID 3eb5127e46365242401e37df292fbe290fa0a974
# Parent eccfdeb41b803d07bcb4f7fa912a8341fdb19162
Fix bind_irq_vector() destination
The "mask" covered all online cpus in the "domain". It should be used
as destination later, instead of using "domain" directly.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -88,14 +88,14 @@ static int __bind_irq_vector(int irq, in
cpus_and(mask, domain, cpu_online_map);
if (cpus_empty(mask))
return -EINVAL;
- if ((cfg->vector == vector) && cpus_equal(cfg->domain, domain))
+ if ((cfg->vector == vector) && cpus_equal(cfg->domain, mask))
return 0;
if (cfg->vector != IRQ_VECTOR_UNASSIGNED)
return -EBUSY;
for_each_cpu_mask(cpu, mask)
per_cpu(vector_irq, cpu)[vector] = irq;
cfg->vector = vector;
- cfg->domain = domain;
+ cfg->domain = mask;
irq_status[irq] = IRQ_USED;
if (IO_APIC_IRQ(irq))
irq_vector[irq] = vector;

View File

@ -1,35 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1282817816 -3600
# Node ID 3c4c3d48a8350994f4450314c6b759771c7ad4ef
# Parent 3eb5127e46365242401e37df292fbe290fa0a974
VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -318,9 +318,10 @@ static int ioapic_rte_to_remap_entry(str
*(((u32 *)&new_rte) + 0) = value;
new_ire.lo.fpd = 0;
new_ire.lo.dm = new_rte.dest_mode;
- new_ire.lo.rh = 0;
new_ire.lo.tm = new_rte.trigger;
new_ire.lo.dlm = new_rte.delivery_mode;
+ /* Hardware require RH = 1 for LPR delivery mode */
+ new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = new_rte.vector;
@@ -630,9 +631,10 @@ static int msi_msg_to_remap_entry(
/* Set interrupt remapping table entry */
new_ire.lo.fpd = 0;
new_ire.lo.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1;
- new_ire.lo.rh = 0;
new_ire.lo.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1;
new_ire.lo.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1;
+ /* Hardware require RH = 1 for LPR delivery mode */
+ new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &

View File

@ -1,45 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1283153992 -3600
# Node ID c5aed2e049bce2724b035dd6aa09c4c4e609c27c
# Parent 20920c12bc4815b1f755786c0924393809664807
ept: Put locks around ept_get_entry
There's a subtle race in ept_get_entry, such that if tries to read an
entry that ept_set_entry is modifying, it gets neither the old entry
nor the new entry, but empty. In the case of multi-cpu
populate-on-demand guests, this manifests as a guest crash when one
vcpu tries to read a page which another page is trying to populate,
and ept_get_entry returns p2m_mmio_dm.
This bug can also be fixed by making both ept_set_entry and
ept_next_level access-once (i.e., ept_next_level reads full ept_entry
and then works with local value; ept_set_entry construct the entry
locally and then sets it in one write). But there doesn't seem to be
any major performance implications of just making ept_get_entry use
locks; so the simpler, the better.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
--- a/xen/arch/x86/mm/hap/p2m-ept.c
+++ b/xen/arch/x86/mm/hap/p2m-ept.c
@@ -387,6 +387,10 @@ static mfn_t ept_get_entry(struct domain
int i;
int ret = 0;
mfn_t mfn = _mfn(INVALID_MFN);
+ int do_locking = !p2m_locked_by_me(d->arch.p2m);
+
+ if ( do_locking )
+ p2m_lock(d->arch.p2m);
*t = p2m_mmio_dm;
@@ -464,6 +468,8 @@ static mfn_t ept_get_entry(struct domain
}
out:
+ if ( do_locking )
+ p2m_unlock(d->arch.p2m);
unmap_domain_page(table);
return mfn;
}

View File

@ -1,22 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1283332754 -3600
# Node ID ae0cd4e5cc0149ceb5d3dd61a003aadc008f036e
# Parent 972d90ff31349816cc8c785a8b2defb2f70ed441
x86 intel: Disable XSAVE support.
It breaks HVM save/restore.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -20,7 +20,7 @@
extern int trap_init_f00f_bug(void);
-static int use_xsave = 1;
+static int use_xsave;
boolean_param("xsave", use_xsave);
#ifdef CONFIG_X86_INTEL_USERCOPY

View File

@ -1,51 +0,0 @@
References: bnc#638465
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1284394111 -3600
# Node ID 69e8bb164683c76e0cd787df21b98c73905a61e6
# Parent e300bfa3c0323ac08e7b8cd9fb40f9f1ab548543
page_alloc: Hold heap_lock while adjusting page states to/from PGC_state_free.
This avoids races with buddy-merging logic in free_heap_pages().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -378,8 +378,6 @@ static struct page_info *alloc_heap_page
total_avail_pages -= request;
ASSERT(total_avail_pages >= 0);
- spin_unlock(&heap_lock);
-
cpus_clear(mask);
for ( i = 0; i < (1 << order); i++ )
@@ -401,6 +399,8 @@ static struct page_info *alloc_heap_page
page_set_owner(&pg[i], NULL);
}
+ spin_unlock(&heap_lock);
+
if ( unlikely(!cpus_empty(mask)) )
{
perfc_incr(need_flush_tlb_flush);
@@ -496,6 +496,8 @@ static void free_heap_pages(
ASSERT(order <= MAX_ORDER);
ASSERT(node >= 0);
+ spin_lock(&heap_lock);
+
for ( i = 0; i < (1 << order); i++ )
{
/*
@@ -523,8 +525,6 @@ static void free_heap_pages(
pg[i].tlbflush_timestamp = tlbflush_current_time();
}
- spin_lock(&heap_lock);
-
avail[node][zone] += 1 << order;
total_avail_pages += 1 << order;

View File

@ -1,24 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1284395845 -3600
# Node ID a254d1236c1a52264beb0253352ef64d65a98eb3
# Parent f0a1229cb0a6505f3240ac59a3bb6ade2acfa1a2
Fix serial interrupt's destination
Lowest Priority can't use with invalid cpu_mask, and the default value
of CPU_MASK_ALL may cover CPU which wasn't online.
From: "Yang, Sheng" <sheng.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1602,7 +1602,7 @@ void __init smp_intr_init(void)
irq_vector[irq] = FIRST_HIPRIORITY_VECTOR + seridx + 1;
per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR + seridx + 1] = irq;
irq_cfg[irq].vector = FIRST_HIPRIORITY_VECTOR + seridx + 1;
- irq_cfg[irq].domain = (cpumask_t)CPU_MASK_ALL;
+ irq_cfg[irq].domain = cpu_online_map;
}
/* IPI for cleanuping vectors after irq move */

View File

@ -1,8 +1,8 @@
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2920,7 +2920,7 @@ class XendDomainInfo:
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2917,7 +2917,7 @@ class XendDomainInfo:
self.guest_bitsize = self.image.getBitSize()
# Make sure there's enough RAM available for the domain

View File

@ -1,118 +0,0 @@
# HG changeset patch
# User Ian Jackson <ian.jackson@eu.citrix.com>
# Date 1284481903 -3600
# Node ID f71a4c18e34e86e1011662fa42c10ec54bff0688
# Parent 080b5a094d4e0acab6646125f91f988911409016
ioemu: fix VNC altgr-insert behavior
When access to a Xen DomU (Linux) from a VNC client in Windows, alt-gr
key is not working properly with Spanish keyboard. When Alt + another
key pressed, vncserver receives Altgr down, Altgr up and key down
messages in order, that causes incorrect output.
With following patch, when vncerver receives key down message, it
first check if the keysym needs altgr modifer, if it needs altgr
modifier but altgr is not 'down', sending altgr keycode before sending
key keycode.
Signed-off-by: Chunyan Liu <cyliu@novell.com>
committer: Ian Jackson <Ian.Jackson@eu.citrix.com>
git-commit-id: f95d202ed6444dacb15fbea4dee185eb0e048d9a
diff -r 080b5a094d4e -r f71a4c18e34e keymaps.c
--- a/tools/ioemu-qemu-xen/keymaps.c Wed Sep 08 16:38:09 2010 +0100
+++ b//tools/ioemu-qemu-xen/keymaps.c Tue Sep 14 17:31:43 2010 +0100
@@ -51,6 +51,7 @@
struct key_range *numlock_range;
struct key_range *shift_range;
struct key_range *localstate_range;
+ struct key_range *altgr_range;
} kbd_layout_t;
static void add_to_key_range(struct key_range **krp, int code) {
@@ -133,7 +134,11 @@
add_to_key_range(&k->localstate_range, keycode);
//fprintf(stderr, "localstate keysym %04x keycode %d\n", keysym, keycode);
}
-
+ if (rest && strstr(rest, "altgr")) {
+ add_to_key_range(&k->altgr_range, keysym);
+ //fprintf(stderr, "altgr keysym %04x keycode %d\n", keysym, keycode);
+ }
+
/* if(keycode&0x80)
keycode=(keycode<<8)^0x80e0; */
if (keysym < MAX_NORMAL_KEYCODE) {
@@ -233,3 +238,16 @@
return 0;
return 1;
}
+
+static inline int keysym_is_altgr(void *kbd_layout, int keysym)
+{
+ kbd_layout_t *k = kbd_layout;
+ struct key_range *kr;
+
+ for (kr = k->altgr_range; kr; kr = kr->next)
+ if (keysym >= kr->start && keysym <= kr->end){
+ return 1;
+ }
+ return 0;
+}
+
diff -r 080b5a094d4e -r f71a4c18e34e vnc.c
--- a/tools/ioemu-qemu-xen/vnc.c Wed Sep 08 16:38:09 2010 +0100
+++ b/tools/ioemu-qemu-xen/vnc.c Tue Sep 14 17:31:43 2010 +0100
@@ -1274,12 +1274,27 @@
}
}
+static void press_key_altgr_down(VncState *vs, int down)
+{
+ kbd_put_keycode(0xe0);
+ if (down){
+ kbd_put_keycode(0xb8 & 0x7f);
+ vs->modifiers_state[0xb8] = 1;
+ }
+ else {
+ kbd_put_keycode(0xb8 | 0x80);
+ vs->modifiers_state[0xb8] = 0;
+ }
+}
+
static void do_key_event(VncState *vs, int down, uint32_t sym)
{
int keycode;
int shift_keys = 0;
int shift = 0;
int keypad = 0;
+ int altgr = 0;
+ int altgr_keys = 0;
if (is_graphic_console()) {
if (sym >= 'A' && sym <= 'Z') {
@@ -1289,8 +1304,11 @@
else {
shift = keysym_is_shift(vs->kbd_layout, sym & 0xFFFF);
}
+
+ altgr = keysym_is_altgr(vs->kbd_layout, sym & 0xFFFF);
}
shift_keys = vs->modifiers_state[0x2a] | vs->modifiers_state[0x36];
+ altgr_keys = vs->modifiers_state[0xb8];
keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF);
if (keycode == 0) {
@@ -1357,6 +1375,11 @@
}
if (is_graphic_console()) {
+
+ if (altgr && !altgr_keys) {
+ press_key_altgr_down(vs, down);
+ }
+
/* If the shift state needs to change then simulate an additional
keypress before sending this one. Ignore for non shiftable keys.
*/

View File

@ -464,6 +464,9 @@ The hypervisor and domain 0 kernel are a matched set, and usually must be
upgraded together. Consult the online documentation for a matrix of supported
32- and 64-bit combinations
A 64-bit paravirtualized VM will not run on 32-bit host but a 32-bit
paravirtualized VM will run on a 64-bit host.
On certain machines with 2GB or less of RAM, domain 0 Linux may fail to boot,
printing the following messages:
PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
@ -495,8 +498,8 @@ file (viewable with the "xm dmesg" command).
If problems persist, check if a newer version is available. Well-tested
versions will be shipped with SUSE and via YaST Online Update. More frequent
(but less supported) updates are available on Novell's Forge site:
http://forge.novell.com/modules/xfmod/project/?xenpreview
(but less supported) updates are available on the Xen Technical Preview site:
ftp://ftp.novell.com/forge/XenTechnicalPreview/
Known Issues

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/block.c
Index: xen-4.0.0-testing/tools/ioemu-remote/block.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/block.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/block.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/block.c
+++ xen-4.0.0-testing/tools/ioemu-remote/block.c
@@ -350,7 +350,7 @@ int bdrv_file_open(BlockDriverState **pb
int bdrv_open(BlockDriverState *bs, const char *filename, int flags)
@ -18,7 +18,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/block.c
- /* Note: for compatibility, we open disk image files as RDWR, and
- RDONLY as fallback */
if (!(flags & BDRV_O_FILE))
- open_flags = (flags & BDRV_O_ACCESS) | (flags & BDRV_O_CACHE_MASK);
- open_flags = BDRV_O_RDWR | (flags & BDRV_O_CACHE_MASK);
+ open_flags = flags;
else
open_flags = flags & ~(BDRV_O_FILE | BDRV_O_SNAPSHOT);
@ -28,10 +28,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/block.c
ret = drv->bdrv_open(bs, filename, open_flags);
if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) {
ret = drv->bdrv_open(bs, filename, open_flags & ~BDRV_O_RDWR);
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/usb-msd.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/usb-msd.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/hw/usb-msd.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/usb-msd.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/usb-msd.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/usb-msd.c
@@ -551,7 +551,7 @@ USBDevice *usb_msd_init(const char *file
s = qemu_mallocz(sizeof(MSDState));
@ -41,10 +41,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/usb-msd.c
goto fail;
s->bs = bdrv;
*pbs = bdrv;
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-img.c
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-img.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/qemu-img.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-img.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-img.c
+++ xen-4.0.0-testing/tools/ioemu-remote/qemu-img.c
@@ -32,7 +32,7 @@
#endif
@ -54,7 +54,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-img.c
static void QEMU_NORETURN error(const char *fmt, ...)
{
@@ -185,7 +185,7 @@ static int read_password(char *buf, int
@@ -185,7 +185,7 @@ static int read_password(char *buf, int
#endif
static BlockDriverState *bdrv_new_open(const char *filename,
@ -118,7 +118,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-img.c
error("Could not open '%s'", filename);
}
bdrv_get_format(bs, fmt_name, sizeof(fmt_name));
@@ -810,7 +811,7 @@ static void img_snapshot(int argc, char
@@ -810,7 +811,7 @@ static void img_snapshot(int argc, char
if (!bs)
error("Not enough memory");

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/hw/xen_blktap.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/xen_blktap.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -227,6 +227,7 @@ static int open_disk(struct td_state *s,
BlockDriver* drv;
char* devname;
@ -19,10 +19,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/hw/xen_blktap.c
fprintf(stderr, "Could not open image file %s\n", path);
return -ENOMEM;
}
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/xenstore.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -136,7 +136,8 @@ static void insert_media(void *opaque)
else
format = &bdrv_raw;
@ -33,7 +33,19 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
#ifdef CONFIG_STUBDOM
{
char *buf, *backend, *params_path, *params;
@@ -469,7 +470,8 @@ void xenstore_parse_domain_config(int hv
@@ -400,9 +401,9 @@ void xenstore_parse_domain_config(int hv
{
char **e_danger = NULL;
char *buf = NULL;
- char *fpath = NULL, *bpath = NULL, *btype = NULL,
+ char *fpath = NULL, *bpath = NULL, *btype = NULL, *mode = NULL,
*dev = NULL, *params = NULL, *drv = NULL;
- int i, j, ret, is_tap;
+ int i, j, ret, is_tap, flags;
unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs;
BlockDriver *format;
@@ -464,7 +465,8 @@ void xenstore_parse_domain_config(int hv
}
for (i = 0; i < num; i++) {
@ -43,7 +55,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
/* read the backend path */
xenstore_get_backend_path(&bpath, "vbd", danger_path, hvm_domid, e_danger[i]);
if (bpath == NULL)
@@ -555,6 +557,17 @@ void xenstore_parse_domain_config(int hv
@@ -550,6 +552,17 @@ void xenstore_parse_domain_config(int hv
format = &bdrv_raw;
}
@ -61,7 +73,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
#if 0
/* Phantom VBDs are disabled because the use of paths
* from guest-controlled areas in xenstore is unsafe.
@@ -622,7 +635,7 @@ void xenstore_parse_domain_config(int hv
@@ -617,7 +630,7 @@ void xenstore_parse_domain_config(int hv
#ifdef CONFIG_STUBDOM
if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1)
continue;
@ -70,10 +82,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
pstrcpy(bs->filename, sizeof(bs->filename), params);
}
#else
@@ -668,7 +681,7 @@ void xenstore_parse_domain_config(int hv
fprintf(stderr, "Using file %s in read-%s mode\n", bs->filename, is_readonly ? "only" : "write");
@@ -646,7 +659,7 @@ void xenstore_parse_domain_config(int hv
}
}
pstrcpy(bs->filename, sizeof(bs->filename), params);
- if (bdrv_open2(bs, params, BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) {
+ if (bdrv_open2(bs, params, flags|BDRV_O_CACHE_WB /* snapshot and write-back */, format) < 0) {
fprintf(stderr, "qemu: could not open vbd '%s' or hard disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : "?", format ? format->format_name : "0");

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/blktap/drivers/block-cdrom.c
Index: xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/blktap/drivers/block-cdrom.c
+++ xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c
@@ -0,0 +1,535 @@
+/* block-cdrom.c
+ *
@ -538,10 +538,10 @@ Index: xen-4.0.1-testing/tools/blktap/drivers/block-cdrom.c
+ .td_get_parent_id = tdcdrom_get_parent_id,
+ .td_validate_parent = tdcdrom_validate_parent
+};
Index: xen-4.0.1-testing/xen/include/public/io/cdromif.h
Index: xen-4.0.0-testing/xen/include/public/io/cdromif.h
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/xen/include/public/io/cdromif.h
+++ xen-4.0.0-testing/xen/include/public/io/cdromif.h
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * cdromif.h
@ -665,10 +665,10 @@ Index: xen-4.0.1-testing/xen/include/public/io/cdromif.h
+ sizeof(struct vcd_generic_command) - sizeof(struct request_sense))
+
+#endif
Index: xen-4.0.1-testing/tools/blktap/drivers/Makefile
Index: xen-4.0.0-testing/tools/blktap/drivers/Makefile
===================================================================
--- xen-4.0.1-testing.orig/tools/blktap/drivers/Makefile
+++ xen-4.0.1-testing/tools/blktap/drivers/Makefile
--- xen-4.0.0-testing.orig/tools/blktap/drivers/Makefile
+++ xen-4.0.0-testing/tools/blktap/drivers/Makefile
@@ -28,8 +28,9 @@ CFLAGS += -DMEMSHR
MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
endif
@ -676,7 +676,7 @@ Index: xen-4.0.1-testing/tools/blktap/drivers/Makefile
-LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm -lpthread
-LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz
+LDFLAGS_xen := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore)
+LDFLAGS_blktapctrl := $(LDFLAGS_xen) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm -lpthread $(LDFLAGS_xen)
+LDFLAGS_blktapctrl := $(LDFLAGS_xen) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm -lpthread
+LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz $(LDFLAGS_xen)
BLK-OBJS-y := block-aio.o
@ -689,10 +689,10 @@ Index: xen-4.0.1-testing/tools/blktap/drivers/Makefile
BLK-OBJS-y += aes.o
BLK-OBJS-y += tapaio.o
BLK-OBJS-$(CONFIG_Linux) += blk_linux.o
Index: xen-4.0.1-testing/tools/blktap/drivers/tapdisk.h
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
===================================================================
--- xen-4.0.1-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-4.0.1-testing/tools/blktap/drivers/tapdisk.h
--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
@@ -137,6 +137,9 @@ struct tap_disk {
int (*td_get_parent_id) (struct disk_driver *dd, struct disk_id *id);
int (*td_validate_parent)(struct disk_driver *dd,
@ -737,10 +737,10 @@ Index: xen-4.0.1-testing/tools/blktap/drivers/tapdisk.h
};
typedef struct driver_list_entry {
Index: xen-4.0.1-testing/tools/blktap/lib/blktaplib.h
Index: xen-4.0.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-4.0.1-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-4.0.1-testing/tools/blktap/lib/blktaplib.h
--- xen-4.0.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-4.0.0-testing/tools/blktap/lib/blktaplib.h
@@ -220,6 +220,7 @@ typedef struct msg_pid {
#define DISK_TYPE_RAM 3
#define DISK_TYPE_QCOW 4
@ -749,10 +749,10 @@ Index: xen-4.0.1-testing/tools/blktap/lib/blktaplib.h
/* xenstore/xenbus: */
#define DOMNAME "Domain-0"
Index: xen-4.0.1-testing/xen/include/public/io/blkif.h
Index: xen-4.0.0-testing/xen/include/public/io/blkif.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/public/io/blkif.h
+++ xen-4.0.1-testing/xen/include/public/io/blkif.h
--- xen-4.0.0-testing.orig/xen/include/public/io/blkif.h
+++ xen-4.0.0-testing/xen/include/public/io/blkif.h
@@ -76,6 +76,10 @@
* "feature-flush-cache" node!
*/
@ -764,10 +764,10 @@ Index: xen-4.0.1-testing/xen/include/public/io/blkif.h
/*
* Maximum scatter/gather segments per request.
Index: xen-4.0.1-testing/tools/blktap/drivers/tapdisk.c
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.c
===================================================================
--- xen-4.0.1-testing.orig/tools/blktap/drivers/tapdisk.c
+++ xen-4.0.1-testing/tools/blktap/drivers/tapdisk.c
--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.c
+++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.c
@@ -735,6 +735,22 @@ static void get_io_request(struct td_sta
goto out;
}
@ -791,10 +791,10 @@ Index: xen-4.0.1-testing/tools/blktap/drivers/tapdisk.c
default:
DPRINTF("Unknown block operation\n");
break;
Index: xen-4.0.1-testing/tools/python/xen/xend/server/BlktapController.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/BlktapController.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/server/BlktapController.py
+++ xen-4.0.1-testing/tools/python/xen/xend/server/BlktapController.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/BlktapController.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/BlktapController.py
@@ -20,6 +20,7 @@ blktap1_disk_types = [
'ram',
'qcow',

View File

@ -1,10 +1,10 @@
bug #239173
bug #242953
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -3290,7 +3290,7 @@ class XendDomainInfo:
(fn, BOOTLOADER_LOOPBACK_DEVICE))
@ -14,10 +14,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
'device': BOOTLOADER_LOOPBACK_DEVICE,
}
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/xenstore.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -397,9 +397,9 @@ void xenstore_parse_domain_config(int hv
{
char **e_danger = NULL;
@ -30,7 +30,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs;
BlockDriver *format;
@@ -444,6 +444,14 @@ void xenstore_parse_domain_config(int hv
@@ -439,6 +439,14 @@ void xenstore_parse_domain_config(int hv
e_danger[i]);
if (bpath == NULL)
continue;
@ -45,8 +45,8 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
/* read the name of the device */
if (pasprintf(&buf, "%s/dev", bpath) == -1)
continue;
@@ -738,6 +746,7 @@ void xenstore_parse_domain_config(int hv
free(mode);
@@ -715,6 +723,7 @@ void xenstore_parse_domain_config(int hv
free(danger_type);
free(params);
free(dev);
+ free(btype);

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/blktap/drivers/tapdisk.h
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
===================================================================
--- xen-4.0.1-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-4.0.1-testing/tools/blktap/drivers/tapdisk.h
--- xen-4.0.0-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
@@ -168,7 +168,7 @@ static disk_info_t aio_disk = {
"raw image (aio)",
"aio",

View File

@ -98,9 +98,9 @@ function activate_lvm ()
{
# First scan for PVs and VGs; we may then have to activate the VG
# first, but can ignore errors:
# /sbin/pvscan || :
# /sbin/vgscan --mknodes || :
# /sbin/vgchange -ay ${1%/*} || :
/sbin/pvscan || :
/sbin/vgscan --mknodes || :
/sbin/vgchange -ay ${1%/*} || :
/sbin/lvchange -ay $1
return $?
}
@ -110,9 +110,9 @@ function deactivate_lvm ()
/sbin/lvchange -an $1
if [ $? -eq 0 ]; then
# We may have to deactivate the VG now, but can ignore errors:
# /sbin/vgchange -an ${1%/*} || :
/sbin/vgchange -an ${1%/*} || :
# Maybe we need to cleanup the LVM cache:
# /sbin/vgscan --mknodes || :
/sbin/vgscan --mknodes || :
return 0
fi
return 1

34
block-flags.diff Normal file
View File

@ -0,0 +1,34 @@
Index: xen-3.5.0-testing/tools/hotplug/Linux/block
===================================================================
--- xen-3.5.0-testing.orig/tools/hotplug/Linux/block
+++ xen-3.5.0-testing/tools/hotplug/Linux/block
@@ -225,11 +225,14 @@ case "$command" in
;;
file)
+ lo_flags=""
+ [ "${mode/S}" = "$mode" ] || lo_flags="-y"
# Canonicalise the file, for sharing check comparison, and the mode
# for ease of use here.
file=$(readlink -f "$p") || fatal "$p does not exist."
test -f "$file" || fatal "$file does not exist."
mode=$(canonicalise_mode "$mode")
+ [ "$mode" = "r" ] && lo_flags="$lo_flags -r"
claim_lock "block"
@@ -338,12 +341,12 @@ mount it read-write in a guest domain."
fatal 'Failed to find an unused loop device'
fi
- losetup "$loopdev" "$file" && losetup_failure="" && break
+ losetup $lo_flags "$loopdev" "$file" && losetup_failure="" && break
done
if [ "$losetup_failure" ]
then
- fatal 'losetup $loopdev $file'
+ fatal 'losetup $lo_flags $loopdev $file'
fi
xenstore_write "$XENBUS_PATH/node" "$loopdev"

211
block-losetup-retry.diff Normal file
View File

@ -0,0 +1,211 @@
Index: xen-3.5.0-testing/tools/hotplug/Linux/block
===================================================================
--- xen-3.5.0-testing.orig/tools/hotplug/Linux/block
+++ xen-3.5.0-testing/tools/hotplug/Linux/block
@@ -241,107 +241,111 @@ case "$command" in
mount it read-write in a guest domain."
fi
- loopdev=''
- for dev in /dev/loop*
+ losetup_failure=1
+ for do_losetup in 1 2 3
do
- if [ ! -b "$dev" ]
- then
- continue
- fi
-
- f=$(losetup "$dev" 2>/dev/null) || f=''
-
- if [ "$f" ]
- then
- # $dev is in use. Check sharing.
- if [ "x$mode" = 'x!' ]
+ loopdev=''
+ for dev in /dev/loop*
+ do
+ if [ ! -b "$dev" ]
then
continue
fi
- f=$(echo "$f" | sed -e 's/.*(\(.*\)).*/\1/g')
+ f=$(losetup "$dev" 2>/dev/null) || f=''
- # $f is the filename, as read from losetup, but the loopback
- # driver truncates filenames at 64 characters, so we need to go
- # trawling through the store if it's longer than that. Truncation
- # is indicated by an asterisk at the end of the filename.
- if expr index "$f" '*' >/dev/null
+ if [ "$f" ]
then
- found=""
- for dom in $(xenstore-list "$XENBUS_BASE_PATH")
- do
- for domdev in $(xenstore-list "$XENBUS_BASE_PATH/$dom")
+ # $dev is in use. Check sharing.
+ if [ "x$mode" = 'x!' ]
+ then
+ continue
+ fi
+
+ f=$(echo "$f" | sed -e 's/.*(\(.*\)).*/\1/g')
+
+ # $f is the filename, as read from losetup, but the loopback
+ # driver truncates filenames at 64 characters, so we need to go
+ # trawling through the store if it's longer than that. Truncation
+ # is indicated by an asterisk at the end of the filename.
+ if expr index "$f" '*' >/dev/null
+ then
+ found=""
+ for dom in $(xenstore-list "$XENBUS_BASE_PATH")
do
- d=$(xenstore_read_default \
- "$XENBUS_BASE_PATH/$dom/$domdev/node" "")
- if [ "$d" = "$dev" ]
- then
- f=$(xenstore_read "$XENBUS_BASE_PATH/$dom/$domdev/params")
- found=1
- break 2
- fi
+ for domdev in $(xenstore-list "$XENBUS_BASE_PATH/$dom")
+ do
+ d=$(xenstore_read_default \
+ "$XENBUS_BASE_PATH/$dom/$domdev/node" "")
+ if [ "$d" = "$dev" ]
+ then
+ f=$(xenstore_read "$XENBUS_BASE_PATH/$dom/$domdev/params")
+ found=1
+ break 2
+ fi
+ done
done
- done
- if [ ! "$found" ]
- then
- # This loopback device is in use by someone else, so skip it.
- log debug "Loopback sharing check skips device $dev."
- continue
+ if [ ! "$found" ]
+ then
+ # This loopback device is in use by someone else, so skip it.
+ log debug "Loopback sharing check skips device $dev."
+ continue
+ fi
fi
- fi
- # Canonicalise the filename for the comparison.
+ # Canonicalise the filename for the comparison.
- # I have seen this readlink fails because the filename given by
- # losetup is only the basename. This cannot happen when the loop
- # device is set up through this script, because file is
- # canonicalised above, but it may happen when loop devices are set
- # up some other way. This readlink may also conceivably fail if
- # the file backing this loop device has been removed.
+ # I have seen this readlink fails because the filename given by
+ # losetup is only the basename. This cannot happen when the loop
+ # device is set up through this script, because file is
+ # canonicalised above, but it may happen when loop devices are set
+ # up some other way. This readlink may also conceivably fail if
+ # the file backing this loop device has been removed.
- # For maximum safety, in the case that $f does not resolve, we
- # assume that $file and $f are in the same directory.
+ # For maximum safety, in the case that $f does not resolve, we
+ # assume that $file and $f are in the same directory.
- # If you create a loopback filesystem, remove it and continue to
- # run on it, and then create another file with the same name, then
- # this check will block that -- don't do that.
+ # If you create a loopback filesystem, remove it and continue to
+ # run on it, and then create another file with the same name, then
+ # this check will block that -- don't do that.
- # If you create loop devices through some other mechanism, use
- # relative filenames, and then use the same filename through this
- # script, then this check will block that -- don't do that either.
+ # If you create loop devices through some other mechanism, use
+ # relative filenames, and then use the same filename through this
+ # script, then this check will block that -- don't do that either.
- f=$(readlink -f "$f" || echo $(dirname "$file")/$(basename "$f"))
+ f=$(readlink -f "$f" || echo $(dirname "$file")/$(basename "$f"))
- if [ "$f" = "$file" ]
- then
- check_file_sharing "$file" "$dev" "$mode"
- fi
- else
- # $dev is not in use, so we'll remember it for use later; we want
- # to finish the sharing check first.
+ if [ "$f" = "$file" ]
+ then
+ check_file_sharing "$file" "$dev" "$mode"
+ fi
+ else
+ # $dev is not in use, so we'll remember it for use later; we want
+ # to finish the sharing check first.
- if [ "$loopdev" = '' ]
- then
- loopdev="$dev"
+ if [ "$loopdev" = '' ]
+ then
+ loopdev="$dev"
+ fi
fi
+ done
+
+ if [ "$loopdev" = '' ]
+ then
+ release_lock "block"
+ fatal 'Failed to find an unused loop device'
fi
+
+ losetup "$loopdev" "$file" && losetup_failure="" && break
done
- if [ "$loopdev" = '' ]
+ if [ "$losetup_failure" ]
then
- release_lock "block"
- fatal 'Failed to find an unused loop device'
+ fatal 'losetup $loopdev $file'
fi
- if LANG=C losetup -h 2>&1 | grep read-only >/dev/null
- then
- roflag="-$mode"; roflag="${roflag#-w}"; roflag="${roflag#-!}"
- else
- roflag=''
- fi
- do_or_die losetup $roflag "$loopdev" "$file"
xenstore_write "$XENBUS_PATH/node" "$loopdev"
write_dev "$loopdev"
release_lock "block"
@@ -364,8 +368,18 @@ mount it read-write in a guest domain."
file)
node=$(xenstore_read "$XENBUS_PATH/node")
- losetup -d "$node"
- exit 0
+
+ #In case the loopback is temporarily blocked, retry the losetup -d.
+ for i in 1 2 3 4 5
+ do
+ if losetup -d "$node"
+ then
+ exit 0
+ fi
+ sleep 1
+ done
+ log err "losetup -d $node failed."
+ exit 1
;;
"")

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-4.0.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
@@ -245,6 +245,9 @@ op_start () {
claim_lock "network-bridge"

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-4.0.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
@@ -270,19 +270,19 @@ op_stop () {
transfer_addrs ${bridge} ${pdev}
if ! ifdown ${bridge}; then

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-4.0.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
@@ -253,6 +253,11 @@ op_start () {
create_bridge ${tdev}

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-4.0.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.1-testing/tools/hotplug/Linux/network-bridge
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
@@ -193,6 +193,28 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT
}

View File

@ -15,10 +15,10 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
tapdisk-ioemu.c | 17 -----------------
4 files changed, 17 insertions(+), 26 deletions(-)
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/Makefile
Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/Makefile
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/Makefile
--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile
+++ xen-4.0.0-testing/tools/ioemu-remote/Makefile
@@ -46,14 +46,6 @@ $(filter %-user,$(SUBDIR_RULES)): libqem
recurse-all: $(SUBDIR_RULES)
@ -56,10 +56,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/Makefile
######################################################################
# libqemu_common.a: Target independent part of system emulation. The
# long term path is to suppress *all* target specific code in case of
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/configure
Index: xen-4.0.0-testing/tools/ioemu-remote/configure
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/configure
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/configure
--- xen-4.0.0-testing.orig/tools/ioemu-remote/configure
+++ xen-4.0.0-testing/tools/ioemu-remote/configure
@@ -1511,7 +1511,7 @@ bsd)
;;
esac
@ -69,10 +69,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/configure
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
tools="qemu-img\$(EXESUF) $tools"
if [ "$linux" = "yes" ] ; then
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-tool.c
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-tool.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/qemu-tool.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-tool.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-tool.c
+++ xen-4.0.0-testing/tools/ioemu-remote/qemu-tool.c
@@ -68,7 +68,7 @@ void qemu_bh_delete(QEMUBH *bh)
qemu_free(bh);
}
@ -82,10 +82,10 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/qemu-tool.c
IOCanRWHandler *fd_read_poll,
IOHandler *fd_read,
IOHandler *fd_write,
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/tapdisk-ioemu.c
Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/tapdisk-ioemu.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/tapdisk-ioemu.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c
+++ xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
@@ -12,34 +12,12 @@
extern void qemu_aio_init(void);

View File

@ -1,8 +1,7 @@
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/vnc.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/vnc.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/vnc.c
@@ -1344,6 +1344,11 @@ static void do_key_event(VncState *vs, i
diff -r c2f19aa8a584 tools/ioemu-remote/vnc.c
--- a/tools/ioemu-remote/vnc.c Wed Apr 07 11:13:49 2010 +0800
+++ b/tools/ioemu-remote/vnc.c Mon May 24 13:56:22 2010 +0800
@@ -1326,6 +1326,11 @@
}
break;
case 0x3a: /* CapsLock */

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/python/xen/xend/server/HalDaemon.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/HalDaemon.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xend/server/HalDaemon.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/HalDaemon.py
@@ -0,0 +1,243 @@
+#!/usr/bin/env python
+# -*- mode: python; -*-
@ -246,10 +246,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/HalDaemon.py
+ print 'Falling off end'
+
+
Index: xen-4.0.1-testing/tools/python/xen/xend/server/Hald.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/Hald.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xend/server/Hald.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/Hald.py
@@ -0,0 +1,125 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -376,10 +376,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/Hald.py
+ watcher.run()
+ time.sleep(10)
+ watcher.shutdown()
Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py
@@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir
from SrvRoot import SrvRoot
@ -397,10 +397,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
def create():
root = SrvDir()
Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-4.0.1-testing.orig/tools/ioemu-qemu-xen/xenstore.c
+++ xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -18,6 +18,7 @@
#include "exec-all.h"
#include "sysemu.h"
@ -409,7 +409,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
#include "hw.h"
#include "pci.h"
#include "qemu-timer.h"
@@ -553,6 +554,21 @@ void xenstore_parse_domain_config(int hv
@@ -548,6 +549,21 @@ void xenstore_parse_domain_config(int hv
#endif
bs = bdrv_new(dev);
@ -431,7 +431,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
/* check if it is a cdrom */
if (danger_type && !strcmp(danger_type, "cdrom")) {
bdrv_set_type_hint(bs, BDRV_TYPE_CDROM);
@@ -961,6 +977,50 @@ void xenstore_record_dm_state(const char
@@ -938,6 +954,50 @@ void xenstore_record_dm_state(const char
xenstore_record_dm("state", state);
}
@ -482,7 +482,7 @@ Index: xen-4.0.1-testing/tools/ioemu-qemu-xen/xenstore.c
void xenstore_process_event(void *opaque)
{
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
@@ -991,6 +1051,11 @@ void xenstore_process_event(void *opaque
@@ -968,6 +1028,11 @@ void xenstore_process_event(void *opaque
xenstore_watch_callbacks[i].cb(vec[XS_WATCH_TOKEN],
xenstore_watch_callbacks[i].opaque);

View File

@ -1,48 +0,0 @@
diff -r ce65e0e03a57 tools/python/xen/xend/server/DevController.py
--- a/tools/python/xen/xend/server/DevController.py Fri Aug 27 16:53:00 2010 +0800
+++ b/tools/python/xen/xend/server/DevController.py Fri Aug 27 17:13:32 2010 +0800
@@ -149,7 +149,10 @@
(status, err) = self.waitForBackend(devid)
if status == Timeout:
- self.destroyDevice(devid, False)
+ #Clean timeout backend resource
+ dev = self.convertToDeviceNumber(devid)
+ self.writeBackend(dev, HOTPLUG_STATUS_NODE, HOTPLUG_STATUS_ERROR)
+ self.destroyDevice(devid, True)
raise VmError("Device %s (%s) could not be connected. "
"Hotplug scripts not working." %
(devid, self.deviceClass))
@@ -554,7 +557,17 @@
xswatch(statusPath, hotplugStatusCallback, ev, result)
- ev.wait(DEVICE_CREATE_TIMEOUT)
+ for i in range(1, 50):
+ ev.wait(DEVICE_CREATE_TIMEOUT/50)
+ status = xstransact.Read(statusPath)
+ if status is not None:
+ if status == HOTPLUG_STATUS_ERROR:
+ result['status'] = Error
+ elif status == HOTPLUG_STATUS_BUSY:
+ result['status'] = Busy
+ else:
+ result['status'] = Connected
+ break
err = xstransact.Read(backpath, HOTPLUG_ERROR_NODE)
@@ -571,7 +584,12 @@
xswatch(statusPath, deviceDestroyCallback, ev, result)
- ev.wait(DEVICE_DESTROY_TIMEOUT)
+ for i in range(1, 50):
+ ev.wait(DEVICE_DESTROY_TIMEOUT/50)
+ status = xstransact.Read(statusPath)
+ if status is None:
+ result['status'] = Disconnected
+ break
return result['status']

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/python/xen/xend/XendCheckpoint.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendCheckpoint.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -165,7 +165,7 @@ def save(fd, dominfo, network, live, dst
dominfo.destroy()
dominfo.testDeviceComplete()

View File

@ -1,7 +1,5 @@
Index: xen-4.0.1-testing/docs/xen-api/coversheet.tex
===================================================================
--- xen-4.0.1-testing.orig/docs/xen-api/coversheet.tex
+++ xen-4.0.1-testing/docs/xen-api/coversheet.tex
--- a/docs/xen-api/coversheet.tex
+++ b/docs/xen-api/coversheet.tex
@@ -52,6 +52,7 @@ Mike Day, IBM & Daniel Veillard, Red Hat
Jim Fehlig, Novell & Tom Wilkie, University of Cambridge \\
Jon Harrop, XenSource & Yosuke Iwamatsu, NEC \\
@ -10,10 +8,8 @@ Index: xen-4.0.1-testing/docs/xen-api/coversheet.tex
\end{tabular}
\end{large}
Index: xen-4.0.1-testing/docs/xen-api/revision-history.tex
===================================================================
--- xen-4.0.1-testing.orig/docs/xen-api/revision-history.tex
+++ xen-4.0.1-testing/docs/xen-api/revision-history.tex
--- a/docs/xen-api/revision-history.tex
+++ b/docs/xen-api/revision-history.tex
@@ -50,6 +50,12 @@
between classes. Added host.PSCSI\_HBAs and VM.DSCSI\_HBAs
fields.\tabularnewline
@ -27,10 +23,8 @@ Index: xen-4.0.1-testing/docs/xen-api/revision-history.tex
\end{tabular}
\end{center}
\end{flushleft}
Index: xen-4.0.1-testing/docs/xen-api/xenapi-coversheet.tex
===================================================================
--- xen-4.0.1-testing.orig/docs/xen-api/xenapi-coversheet.tex
+++ xen-4.0.1-testing/docs/xen-api/xenapi-coversheet.tex
--- a/docs/xen-api/xenapi-coversheet.tex
+++ b/docs/xen-api/xenapi-coversheet.tex
@@ -17,12 +17,12 @@
\newcommand{\coversheetlogo}{xen.eps}
@ -46,10 +40,8 @@ Index: xen-4.0.1-testing/docs/xen-api/xenapi-coversheet.tex
%% Document authors
\newcommand{\docauthors}{
Index: xen-4.0.1-testing/docs/xen-api/xenapi-datamodel-graph.dot
===================================================================
--- xen-4.0.1-testing.orig/docs/xen-api/xenapi-datamodel-graph.dot
+++ xen-4.0.1-testing/docs/xen-api/xenapi-datamodel-graph.dot
--- a/docs/xen-api/xenapi-datamodel-graph.dot
+++ b/docs/xen-api/xenapi-datamodel-graph.dot
@@ -14,7 +14,7 @@ fontname="Verdana";
node [ shape=box ]; session VM host network VIF PIF SR VDI VBD PBD user;
@ -67,10 +59,8 @@ Index: xen-4.0.1-testing/docs/xen-api/xenapi-datamodel-graph.dot
+cpu_pool -> VM [ arrowhead="crow", arrowtail="none" ]
+host -> cpu_pool [ arrowhead="crow", arrowtail="none" ]
}
Index: xen-4.0.1-testing/docs/xen-api/xenapi-datamodel.tex
===================================================================
--- xen-4.0.1-testing.orig/docs/xen-api/xenapi-datamodel.tex
+++ xen-4.0.1-testing/docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex
+++ b/docs/xen-api/xenapi-datamodel.tex
@@ -56,6 +56,7 @@ Name & Description \\
{\tt debug} & A basic class for testing \\
{\tt XSPolicy} & A class for handling Xen Security Policies \\
@ -89,7 +79,7 @@ Index: xen-4.0.1-testing/docs/xen-api/xenapi-datamodel.tex
\hline
\end{tabular}\end{center}
@@ -499,6 +503,56 @@ error code and a message describing the
@@ -499,6 +503,56 @@ error code and a message describing the
\begin{verbatim}SECURITY_ERROR(xserr, message)\end{verbatim}
\begin{center}\rule{10em}{0.1pt}\end{center}

View File

@ -1,7 +1,5 @@
Index: xen-4.0.1-testing/tools/libxc/Makefile
===================================================================
--- xen-4.0.1-testing.orig/tools/libxc/Makefile
+++ xen-4.0.1-testing/tools/libxc/Makefile
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -8,6 +8,7 @@ CTRL_SRCS-y :=
CTRL_SRCS-y += xc_core.c
CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
@ -10,10 +8,8 @@ Index: xen-4.0.1-testing/tools/libxc/Makefile
CTRL_SRCS-y += xc_domain.c
CTRL_SRCS-y += xc_evtchn.c
CTRL_SRCS-y += xc_misc.c
Index: xen-4.0.1-testing/tools/libxc/xc_cpupool.c
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * xc_cpupool.c
@ -180,10 +176,8 @@ Index: xen-4.0.1-testing/tools/libxc/xc_cpupool.c
+
+ return 0;
+}
Index: xen-4.0.1-testing/tools/libxc/xc_domain.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxc/xc_domain.c
+++ xen-4.0.1-testing/tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -220,6 +220,7 @@ int xc_domain_getinfo(int xc_handle,
info->cpu_time = domctl.u.getdomaininfo.cpu_time;
info->nr_online_vcpus = domctl.u.getdomaininfo.nr_online_vcpus;
@ -192,11 +186,9 @@ Index: xen-4.0.1-testing/tools/libxc/xc_domain.c
memcpy(info->handle, domctl.u.getdomaininfo.handle,
sizeof(xen_domain_handle_t));
Index: xen-4.0.1-testing/tools/libxc/xenctrl.h
===================================================================
--- xen-4.0.1-testing.orig/tools/libxc/xenctrl.h
+++ xen-4.0.1-testing/tools/libxc/xenctrl.h
@@ -161,6 +161,7 @@ typedef struct xc_dominfo {
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -171,6 +171,7 @@ typedef struct xc_dominfo {
unsigned int nr_online_vcpus;
unsigned int max_vcpu_id;
xen_domain_handle_t handle;
@ -204,7 +196,7 @@ Index: xen-4.0.1-testing/tools/libxc/xenctrl.h
} xc_dominfo_t;
typedef xen_domctl_getdomaininfo_t xc_domaininfo_t;
@@ -492,6 +493,100 @@ int xc_domain_setdebugging(int xc_handle
@@ -502,6 +503,100 @@ int xc_domain_setdebugging(int xc_handle
unsigned int enable);
/*

View File

@ -1,17 +1,17 @@
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_all.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_all.h
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/include/xen/api/xen_all.h
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_all.h
--- xen-4.0.0-testing.orig/tools/libxen/include/xen/api/xen_all.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_all.h
@@ -37,4 +37,5 @@
#include <xen/api/xen_vm_power_state.h>
#include <xen/api/xen_vtpm.h>
#include <xen/api/xen_xspolicy.h>
+#include <xen/api/xen_cpu_pool.h>
#endif
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_cpu_pool.h
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_cpu_pool.h
@@ -0,0 +1,424 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
@ -437,10 +437,10 @@ Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool.h
+
+
+#endif
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool_decl.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_cpu_pool_decl.h
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool_decl.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_cpu_pool_decl.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
@ -472,10 +472,10 @@ Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_cpu_pool_decl.h
+struct xen_cpu_pool_record_opt_set;
+
+#endif
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_host.h
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/include/xen/api/xen_host.h
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host.h
--- xen-4.0.0-testing.orig/tools/libxen/include/xen/api/xen_host.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_host.h
@@ -29,7 +29,7 @@
#include <xen/api/xen_string_set.h>
#include <xen/api/xen_string_string_map.h>
@ -505,10 +505,10 @@ Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host.h
+ xen_host host);
+
#endif
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host_cpu.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_host_cpu.h
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/include/xen/api/xen_host_cpu.h
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host_cpu.h
--- xen-4.0.0-testing.orig/tools/libxen/include/xen/api/xen_host_cpu.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_host_cpu.h
@@ -22,6 +22,7 @@
#include <xen/api/xen_common.h>
#include <xen/api/xen_host_cpu_decl.h>
@ -544,10 +544,10 @@ Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_host_cpu.h
+
+
#endif
Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_vm.h
Index: xen-4.0.0-testing/tools/libxen/include/xen/api/xen_vm.h
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/include/xen/api/xen_vm.h
+++ xen-4.0.1-testing/tools/libxen/include/xen/api/xen_vm.h
--- xen-4.0.0-testing.orig/tools/libxen/include/xen/api/xen_vm.h
+++ xen-4.0.0-testing/tools/libxen/include/xen/api/xen_vm.h
@@ -34,6 +34,7 @@
#include <xen/api/xen_vm_metrics_decl.h>
#include <xen/api/xen_vm_power_state.h>
@ -599,10 +599,10 @@ Index: xen-4.0.1-testing/tools/libxen/include/xen/api/xen_vm.h
+xen_vm_cpu_pool_migrate(xen_session *session, xen_vm vm, xen_cpu_pool cpu_pool);
+
#endif
Index: xen-4.0.1-testing/tools/libxen/src/xen_cpu_pool.c
Index: xen-4.0.0-testing/tools/libxen/src/xen_cpu_pool.c
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/libxen/src/xen_cpu_pool.c
+++ xen-4.0.0-testing/tools/libxen/src/xen_cpu_pool.c
@@ -0,0 +1,671 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
@ -1275,10 +1275,10 @@ Index: xen-4.0.1-testing/tools/libxen/src/xen_cpu_pool.c
+ return session->ok;
+}
+
Index: xen-4.0.1-testing/tools/libxen/src/xen_host.c
Index: xen-4.0.0-testing/tools/libxen/src/xen_host.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/src/xen_host.c
+++ xen-4.0.1-testing/tools/libxen/src/xen_host.c
--- xen-4.0.0-testing.orig/tools/libxen/src/xen_host.c
+++ xen-4.0.0-testing/tools/libxen/src/xen_host.c
@@ -30,6 +30,7 @@
#include <xen/api/xen_sr.h>
#include <xen/api/xen_string_string_map.h>
@ -1330,10 +1330,10 @@ Index: xen-4.0.1-testing/tools/libxen/src/xen_host.c
+ return session->ok;
+}
+
Index: xen-4.0.1-testing/tools/libxen/src/xen_host_cpu.c
Index: xen-4.0.0-testing/tools/libxen/src/xen_host_cpu.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/src/xen_host_cpu.c
+++ xen-4.0.1-testing/tools/libxen/src/xen_host_cpu.c
--- xen-4.0.0-testing.orig/tools/libxen/src/xen_host_cpu.c
+++ xen-4.0.0-testing/tools/libxen/src/xen_host_cpu.c
@@ -24,6 +24,7 @@
#include <xen/api/xen_common.h>
#include <xen/api/xen_host.h>
@ -1397,10 +1397,10 @@ Index: xen-4.0.1-testing/tools/libxen/src/xen_host_cpu.c
+
+
+
Index: xen-4.0.1-testing/tools/libxen/src/xen_vm.c
Index: xen-4.0.0-testing/tools/libxen/src/xen_vm.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/src/xen_vm.c
+++ xen-4.0.1-testing/tools/libxen/src/xen_vm.c
--- xen-4.0.0-testing.orig/tools/libxen/src/xen_vm.c
+++ xen-4.0.0-testing/tools/libxen/src/xen_vm.c
@@ -36,6 +36,7 @@
#include <xen/api/xen_vm_guest_metrics.h>
#include <xen/api/xen_vm_metrics.h>
@ -1504,10 +1504,10 @@ Index: xen-4.0.1-testing/tools/libxen/src/xen_vm.c
+}
+
+
Index: xen-4.0.1-testing/tools/libxen/test/test_bindings.c
Index: xen-4.0.0-testing/tools/libxen/test/test_bindings.c
===================================================================
--- xen-4.0.1-testing.orig/tools/libxen/test/test_bindings.c
+++ xen-4.0.1-testing/tools/libxen/test/test_bindings.c
--- xen-4.0.0-testing.orig/tools/libxen/test/test_bindings.c
+++ xen-4.0.0-testing/tools/libxen/test/test_bindings.c
@@ -28,6 +28,7 @@
#include <xen/api/xen_all.h>

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/python/xen/lowlevel/xc/xc.c
Index: xen-4.0.0-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-4.0.1-testing/tools/python/xen/lowlevel/xc/xc.c
--- xen-4.0.0-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-4.0.0-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -106,8 +106,8 @@ static PyObject *pyxc_domain_create(XcOb
static char *kwd_list[] = { "domid", "ssidref", "handle", "flags", "target", NULL };
@ -289,10 +289,10 @@ Index: xen-4.0.1-testing/tools/python/xen/lowlevel/xc/xc.c
{ NULL, NULL, 0, NULL }
};
Index: xen-4.0.1-testing/tools/python/xen/util/sxputils.py
Index: xen-4.0.0-testing/tools/python/xen/util/sxputils.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/util/sxputils.py
+++ xen-4.0.0-testing/tools/python/xen/util/sxputils.py
@@ -0,0 +1,64 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -358,10 +358,10 @@ Index: xen-4.0.1-testing/tools/python/xen/util/sxputils.py
+ return sxphash
+
+
Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendAPI.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAPI.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendAPI.py
@@ -51,6 +51,7 @@ from XendDPCI import XendDPCI
from XendPSCSI import XendPSCSI, XendPSCSI_HBA
from XendDSCSI import XendDSCSI, XendDSCSI_HBA
@ -553,10 +553,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendAPI.py
# Xen API: Class VBD
# ----------------------------------------------------------------
Index: xen-4.0.1-testing/tools/python/xen/xend/XendCPUPool.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendCPUPool.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xend/XendCPUPool.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendCPUPool.py
@@ -0,0 +1,903 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -1461,10 +1461,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendCPUPool.py
+
+ unbound_cpus = classmethod(unbound_cpus)
+
Index: xen-4.0.1-testing/tools/python/xen/xend/XendConfig.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendConfig.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
@@ -134,6 +134,7 @@ XENAPI_CFG_TO_LEGACY_CFG = {
'PV_bootloader': 'bootloader',
'PV_bootloader_args': 'bootloader_args',
@ -1505,10 +1505,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendConfig.py
'superpages': 0,
'description': '',
}
Index: xen-4.0.1-testing/tools/python/xen/xend/XendConstants.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConstants.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendConstants.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendConstants.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConstants.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConstants.py
@@ -133,6 +133,8 @@ VTPM_DELETE_SCRIPT = auxbin.scripts_dir(
XS_VMROOT = "/vm/"
@ -1518,10 +1518,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendConstants.py
NR_PCI_FUNC = 8
NR_PCI_DEV = 32
NR_PCI_DEVFN = NR_PCI_FUNC * NR_PCI_DEV
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -60,6 +60,7 @@ from xen.xend.xenstore.xsutil import Get
from xen.xend.xenstore.xswatch import xswatch
from xen.xend.XendConstants import *
@ -1574,10 +1574,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
def get_power_state(self):
return XEN_API_VM_POWER_STATE[self._stateGet()]
def get_platform(self):
Index: xen-4.0.1-testing/tools/python/xen/xend/XendError.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendError.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendError.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendError.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendError.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendError.py
@@ -18,6 +18,7 @@
from xmlrpclib import Fault
@ -1613,10 +1613,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendError.py
class VDIError(XendAPIError):
def __init__(self, error, vdi):
XendAPIError.__init__(self)
Index: xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
@@ -43,6 +43,7 @@ from XendStateStore import XendStateStor
from XendMonitor import XendMonitor
from XendPPCI import XendPPCI
@ -1690,10 +1690,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/XendNode.py
'max_free_memory',
'max_para_memory',
'max_hvm_memory',
Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py
@@ -52,6 +52,7 @@ from xen.xend import XendNode, XendOptio
from xen.xend.XendLogging import log
from xen.xend.XendClient import XEN_API_SOCKET
@ -1715,10 +1715,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/SrvServer.py
# Reaching this point means we can auto start domains
try:
xenddomain().autostart_domains()
Index: xen-4.0.1-testing/tools/python/xen/xend/server/XMLRPCServer.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/XMLRPCServer.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/server/XMLRPCServer.py
+++ xen-4.0.1-testing/tools/python/xen/xend/server/XMLRPCServer.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/XMLRPCServer.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/XMLRPCServer.py
@@ -33,6 +33,7 @@ from xen.xend.XendClient import XML_RPC_
from xen.xend.XendConstants import DOM_STATE_RUNNING
from xen.xend.XendLogging import log
@ -1750,10 +1750,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xend/server/XMLRPCServer.py
# Functions in XendNode and XendDmesg
for type, lst, n in [(XendNode,
['info', 'pciinfo', 'send_debug_keys',
Index: xen-4.0.1-testing/tools/python/xen/xm/create.dtd
Index: xen-4.0.0-testing/tools/python/xen/xm/create.dtd
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xm/create.dtd
+++ xen-4.0.1-testing/tools/python/xen/xm/create.dtd
--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.dtd
+++ xen-4.0.0-testing/tools/python/xen/xm/create.dtd
@@ -50,6 +50,7 @@
s3_integrity CDATA #REQUIRED
vcpus_max CDATA #REQUIRED
@ -1762,10 +1762,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/create.dtd
actions_after_shutdown %NORMAL_EXIT; #REQUIRED
actions_after_reboot %NORMAL_EXIT; #REQUIRED
actions_after_crash %CRASH_BEHAVIOUR; #REQUIRED
Index: xen-4.0.1-testing/tools/python/xen/xm/create.py
Index: xen-4.0.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-4.0.1-testing/tools/python/xen/xm/create.py
--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-4.0.0-testing/tools/python/xen/xm/create.py
@@ -659,6 +659,10 @@ gopts.var('suppress_spurious_page_faults
fn=set_bool, default=None,
use="""Do not inject spurious page faults into this guest""")
@ -1777,7 +1777,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/create.py
gopts.var('pci_msitranslate', val='TRANSLATE',
fn=set_int, default=1,
use="""Global PCI MSI-INTx translation flag (0=disable;
@@ -1157,6 +1161,8 @@ def make_config(vals):
@@ -1149,6 +1153,8 @@ def make_config(vals):
config.append(['localtime', vals.localtime])
if vals.oos:
config.append(['oos', vals.oos])
@ -1786,10 +1786,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/create.py
config_image = configure_image(vals)
if vals.bootloader:
Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
Index: xen-4.0.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.0.1-testing/tools/python/xen/xm/main.py
--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.0.0-testing/tools/python/xen/xm/main.py
@@ -56,6 +56,7 @@ from xen.util.xmlrpcclient import Server
import xen.util.xsm.xsm as security
from xen.util.xsm.xsm import XSMError
@ -1939,7 +1939,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
if use_long:
map(PrettyPrint.prettyprint, doms)
@@ -1841,6 +1894,13 @@ def xm_info(args):
@@ -1839,6 +1892,13 @@ def xm_info(args):
else:
return ""
@ -1953,7 +1953,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
info = {
"host": getVal(["name_label"]),
"release": getVal(["software_version", "release"]),
@@ -1852,6 +1912,7 @@ def xm_info(args):
@@ -1850,6 +1910,7 @@ def xm_info(args):
"threads_per_core": getVal(["cpu_configuration", "threads_per_core"]),
"cpu_mhz": getCpuMhz(),
"hw_caps": getCpuFeatures(),
@ -1961,7 +1961,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
"total_memory": int(host_metrics_record["memory_total"])/1024/1024,
"free_memory": int(host_metrics_record["memory_free"])/1024/1024,
"xen_major": getVal(["software_version", "xen_major"]),
@@ -3486,6 +3547,169 @@ def xm_tmem_shared_auth(args):
@@ -3484,6 +3545,169 @@ def xm_tmem_shared_auth(args):
else:
return server.xend.node.tmem_shared_auth(domid,uuid_str,auth)
@ -2131,7 +2131,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
commands = {
"shell": xm_shell,
@@ -3571,6 +3795,14 @@ commands = {
@@ -3569,6 +3793,14 @@ commands = {
"usb-list-assignable-devices": xm_usb_list_assignable_devices,
"usb-hc-create": xm_usb_hc_create,
"usb-hc-destroy": xm_usb_hc_destroy,
@ -2146,7 +2146,7 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
# tmem
"tmem-thaw": xm_tmem_thaw,
"tmem-freeze": xm_tmem_freeze,
@@ -3604,6 +3836,8 @@ IMPORTED_COMMANDS = [
@@ -3602,6 +3834,8 @@ IMPORTED_COMMANDS = [
'resetpolicy',
'getenforce',
'setenforce',
@ -2155,10 +2155,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/main.py
]
for c in IMPORTED_COMMANDS:
Index: xen-4.0.1-testing/tools/python/xen/xm/pool-create.py
Index: xen-4.0.0-testing/tools/python/xen/xm/pool-create.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xm/pool-create.py
+++ xen-4.0.0-testing/tools/python/xen/xm/pool-create.py
@@ -0,0 +1,51 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -2211,10 +2211,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/pool-create.py
+if __name__ == '__main__':
+ main(sys.argv)
+
Index: xen-4.0.1-testing/tools/python/xen/xm/pool-new.py
Index: xen-4.0.0-testing/tools/python/xen/xm/pool-new.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xm/pool-new.py
+++ xen-4.0.0-testing/tools/python/xen/xm/pool-new.py
@@ -0,0 +1,50 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -2266,10 +2266,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/pool-new.py
+if __name__ == '__main__':
+ main(sys.argv)
+
Index: xen-4.0.1-testing/tools/python/xen/xm/pool.py
Index: xen-4.0.0-testing/tools/python/xen/xm/pool.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/python/xen/xm/pool.py
+++ xen-4.0.0-testing/tools/python/xen/xm/pool.py
@@ -0,0 +1,236 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
@ -2507,10 +2507,10 @@ Index: xen-4.0.1-testing/tools/python/xen/xm/pool.py
+def help():
+ return str(GOPTS)
+
Index: xen-4.0.1-testing/tools/python/xen/xm/xenapi_create.py
Index: xen-4.0.0-testing/tools/python/xen/xm/xenapi_create.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xm/xenapi_create.py
+++ xen-4.0.1-testing/tools/python/xen/xm/xenapi_create.py
--- xen-4.0.0-testing.orig/tools/python/xen/xm/xenapi_create.py
+++ xen-4.0.0-testing/tools/python/xen/xm/xenapi_create.py
@@ -310,6 +310,8 @@ class xenapi_create:
get_child_nodes_as_dict(vm, "platform", "key", "value"),
"other_config":

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/tools/xm-test/configure.ac
Index: xen-4.0.0-testing/tools/xm-test/configure.ac
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/configure.ac
+++ xen-4.0.1-testing/tools/xm-test/configure.ac
--- xen-4.0.0-testing.orig/tools/xm-test/configure.ac
+++ xen-4.0.0-testing/tools/xm-test/configure.ac
@@ -161,6 +161,7 @@ AC_CONFIG_FILES([
tests/vtpm/Makefile
tests/xapi/Makefile
@ -10,16 +10,16 @@ Index: xen-4.0.1-testing/tools/xm-test/configure.ac
lib/XmTestReport/xmtest.py
lib/XmTestLib/config.py
])
Index: xen-4.0.1-testing/tools/xm-test/grouptest/cpupool
Index: xen-4.0.0-testing/tools/xm-test/grouptest/cpupool
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/grouptest/cpupool
+++ xen-4.0.0-testing/tools/xm-test/grouptest/cpupool
@@ -0,0 +1 @@
+cpupool
Index: xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/NetConfig.py
Index: xen-4.0.0-testing/tools/xm-test/lib/XmTestLib/NetConfig.py
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/NetConfig.py
--- xen-4.0.0-testing.orig/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ xen-4.0.0-testing/tools/xm-test/lib/XmTestLib/NetConfig.py
@@ -56,17 +56,21 @@ def getXendNetConfig():
val = pin.get_val()
while val[0] != 'network-script':
@ -51,10 +51,10 @@ Index: xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/NetConfig.py
configfile.close()
return netenv
Index: xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/XenDomain.py
Index: xen-4.0.0-testing/tools/xm-test/lib/XmTestLib/XenDomain.py
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/lib/XmTestLib/XenDomain.py
+++ xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/XenDomain.py
--- xen-4.0.0-testing.orig/tools/xm-test/lib/XmTestLib/XenDomain.py
+++ xen-4.0.0-testing/tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -181,6 +181,7 @@ class XenDomain:
if not self.isManaged:
@ -63,10 +63,10 @@ Index: xen-4.0.1-testing/tools/xm-test/lib/XmTestLib/XenDomain.py
else:
ret, output = traceCommand("xm new %s" % self.config)
if ret != 0:
Index: xen-4.0.1-testing/tools/xm-test/runtest.sh
Index: xen-4.0.0-testing/tools/xm-test/runtest.sh
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/runtest.sh
+++ xen-4.0.1-testing/tools/xm-test/runtest.sh
--- xen-4.0.0-testing.orig/tools/xm-test/runtest.sh
+++ xen-4.0.0-testing/tools/xm-test/runtest.sh
@@ -91,7 +91,7 @@ runnable_tests() {
echo "Error: ramdisk/initrd.img is from an old version, or is not for this "
echo "architecture ($ARCH)."
@ -76,10 +76,10 @@ Index: xen-4.0.1-testing/tools/xm-test/runtest.sh
fi
# See if xend is running
Index: xen-4.0.1-testing/tools/xm-test/tests/Makefile.am
Index: xen-4.0.0-testing/tools/xm-test/tests/Makefile.am
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/tests/Makefile.am
+++ xen-4.0.1-testing/tools/xm-test/tests/Makefile.am
--- xen-4.0.0-testing.orig/tools/xm-test/tests/Makefile.am
+++ xen-4.0.0-testing/tools/xm-test/tests/Makefile.am
@@ -28,7 +28,8 @@ SUBDIRS = \
vcpu-pin \
vtpm \
@ -90,10 +90,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/Makefile.am
EXTRA_DIST = $(SUBDIRS) Makefile.am.template
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/01_cpupool_basic_pos.py
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/01_cpupool_basic_pos.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/01_cpupool_basic_pos.py
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/01_cpupool_basic_pos.py
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+
@ -167,10 +167,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/01_cpupool_basic_pos.py
+destroyAllDomUs()
+
+
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/02_cpupool_manage_pos.py
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/02_cpupool_manage_pos.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/02_cpupool_manage_pos.py
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/02_cpupool_manage_pos.py
@@ -0,0 +1,152 @@
+#!/usr/bin/python
+
@ -324,10 +324,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/02_cpupool_manage_pos.py
+ FAIL("'Pool-1' not deleted")
+
+
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/03_cpupool_domain.py
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/03_cpupool_domain.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/03_cpupool_domain.py
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/03_cpupool_domain.py
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+
@ -455,10 +455,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/03_cpupool_domain.py
+for pool in pool_names:
+ destroyPool(pool, True)
+
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/04_cpupool_migrate.py
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/04_cpupool_migrate.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/04_cpupool_migrate.py
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/04_cpupool_migrate.py
@@ -0,0 +1,84 @@
+#!/usr/bin/python
+
@ -544,10 +544,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/04_cpupool_migrate.py
+#
+cleanupPoolsDomains()
+
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/Makefile.am
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/Makefile.am
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/Makefile.am
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/Makefile.am
@@ -0,0 +1,22 @@
+SUBDIRS =
+
@ -571,16 +571,16 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/Makefile.am
+ rm -f *log
+ rm -f *~
+
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/pool1.cfg
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/pool1.cfg
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/pool1.cfg
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/pool1.cfg
@@ -0,0 +1 @@
+name="Pool-1"
Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/pools.py
Index: xen-4.0.0-testing/tools/xm-test/tests/cpupool/pools.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/cpupool/pools.py
+++ xen-4.0.0-testing/tools/xm-test/tests/cpupool/pools.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
@ -660,10 +660,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/cpupool/pools.py
+ break
+ time.sleep(1)
+
Index: xen-4.0.1-testing/tools/xm-test/tests/xapi/20_xapi-cpu_pool_basic.py
Index: xen-4.0.0-testing/tools/xm-test/tests/xapi/20_xapi-cpu_pool_basic.py
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/tools/xm-test/tests/xapi/20_xapi-cpu_pool_basic.py
+++ xen-4.0.0-testing/tools/xm-test/tests/xapi/20_xapi-cpu_pool_basic.py
@@ -0,0 +1,157 @@
+#!/usr/bin/python
+
@ -822,10 +822,10 @@ Index: xen-4.0.1-testing/tools/xm-test/tests/xapi/20_xapi-cpu_pool_basic.py
+if pool1 in session.xenapi.cpu_pool.get_all():
+ FAIL("cpu_pool.destroy() has not removed pool")
+
Index: xen-4.0.1-testing/tools/xm-test/tests/xapi/Makefile.am
Index: xen-4.0.0-testing/tools/xm-test/tests/xapi/Makefile.am
===================================================================
--- xen-4.0.1-testing.orig/tools/xm-test/tests/xapi/Makefile.am
+++ xen-4.0.1-testing/tools/xm-test/tests/xapi/Makefile.am
--- xen-4.0.0-testing.orig/tools/xm-test/tests/xapi/Makefile.am
+++ xen-4.0.0-testing/tools/xm-test/tests/xapi/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS =
TESTS = 01_xapi-vm_basic.test \
02_xapi-vbd_basic.test \

View File

@ -9,11 +9,9 @@
missing adjustments get detected at build time)
- remove boot time per-CPU pool assignment messages (bnc#572146)
Index: xen-4.0.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/domain.c
+++ xen-4.0.1-testing/xen/arch/x86/domain.c
@@ -1585,6 +1585,7 @@ int continue_hypercall_on_cpu(int cpu, v
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1581,6 +1581,7 @@ int continue_hypercall_on_cpu(int cpu, v
v->arch.schedule_tail = continue_hypercall_on_cpu_helper;
v->arch.continue_info = info;
@ -21,7 +19,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
}
else
{
@@ -1595,8 +1596,7 @@ int continue_hypercall_on_cpu(int cpu, v
@@ -1591,8 +1592,7 @@ int continue_hypercall_on_cpu(int cpu, v
info->func = func;
info->data = data;
@ -31,10 +29,8 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
raise_softirq(SCHEDULE_SOFTIRQ);
/* Dummy return value will be overwritten by new schedule_tail. */
Index: xen-4.0.1-testing/xen/common/sched_credit.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/sched_credit.c
+++ xen-4.0.1-testing/xen/common/sched_credit.c
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -176,7 +176,6 @@ struct csched_private {
/*
* Global variables
@ -58,10 +54,8 @@ Index: xen-4.0.1-testing/xen/common/sched_credit.c
.init_domain = csched_dom_init,
.destroy_domain = csched_dom_destroy,
Index: xen-4.0.1-testing/xen/common/softirq.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/softirq.c
+++ xen-4.0.1-testing/xen/common/softirq.c
--- a/xen/common/softirq.c
+++ b/xen/common/softirq.c
@@ -104,12 +104,15 @@ static void tasklet_schedule_list(struct
{
BUG_ON(!list_empty(&t->list));
@ -105,10 +99,8 @@ Index: xen-4.0.1-testing/xen/common/softirq.c
}
/*
Index: xen-4.0.1-testing/xen/include/public/domctl.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/public/domctl.h
+++ xen-4.0.1-testing/xen/include/public/domctl.h
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -35,7 +35,7 @@
#include "xen.h"
#include "grant_table.h"
@ -118,10 +110,8 @@ Index: xen-4.0.1-testing/xen/include/public/domctl.h
struct xenctl_cpumap {
XEN_GUEST_HANDLE_64(uint8) bitmap;
Index: xen-4.0.1-testing/xen/include/xen/softirq.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/softirq.h
+++ xen-4.0.1-testing/xen/include/xen/softirq.h
--- a/xen/include/xen/softirq.h
+++ b/xen/include/xen/softirq.h
@@ -50,15 +50,17 @@ struct tasklet
bool_t is_scheduled;
bool_t is_running;

View File

@ -1,9 +1,9 @@
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Index: xen-4.0.1-testing/xen/arch/x86/acpi/power.c
Index: xen-4.0.0-testing/xen/arch/x86/acpi/power.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/acpi/power.c
+++ xen-4.0.1-testing/xen/arch/x86/acpi/power.c
--- xen-4.0.0-testing.orig/xen/arch/x86/acpi/power.c
+++ xen-4.0.0-testing/xen/arch/x86/acpi/power.c
@@ -234,7 +234,7 @@ static int enter_state(u32 state)
return error;
}
@ -22,11 +22,11 @@ Index: xen-4.0.1-testing/xen/arch/x86/acpi/power.c
}
static int acpi_get_wake_status(void)
Index: xen-4.0.1-testing/xen/arch/x86/domain.c
Index: xen-4.0.0-testing/xen/arch/x86/domain.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/domain.c
+++ xen-4.0.1-testing/xen/arch/x86/domain.c
@@ -1522,42 +1522,52 @@ void sync_vcpu_execstate(struct vcpu *v)
--- xen-4.0.0-testing.orig/xen/arch/x86/domain.c
+++ xen-4.0.0-testing/xen/arch/x86/domain.c
@@ -1518,42 +1518,52 @@ void sync_vcpu_execstate(struct vcpu *v)
}
struct migrate_info {
@ -96,7 +96,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
info = v->arch.continue_info;
if ( info == NULL )
@@ -1566,16 +1576,12 @@ int continue_hypercall_on_cpu(int cpu, l
@@ -1562,16 +1572,12 @@ int continue_hypercall_on_cpu(int cpu, l
if ( info == NULL )
return -ENOMEM;
@ -117,7 +117,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
v->arch.schedule_tail = continue_hypercall_on_cpu_helper;
v->arch.continue_info = info;
@@ -1583,17 +1589,17 @@ int continue_hypercall_on_cpu(int cpu, l
@@ -1579,17 +1585,17 @@ int continue_hypercall_on_cpu(int cpu, l
else
{
BUG_ON(info->nest != 0);
@ -139,10 +139,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
return 0;
}
Index: xen-4.0.1-testing/xen/arch/x86/domain_build.c
Index: xen-4.0.0-testing/xen/arch/x86/domain_build.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/domain_build.c
+++ xen-4.0.1-testing/xen/arch/x86/domain_build.c
--- xen-4.0.0-testing.orig/xen/arch/x86/domain_build.c
+++ xen-4.0.0-testing/xen/arch/x86/domain_build.c
@@ -9,6 +9,7 @@
#include <xen/lib.h>
#include <xen/ctype.h>
@ -183,10 +183,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain_build.c
/* Set up CR3 value for write_ptbase */
if ( paging_mode_enabled(d) )
Index: xen-4.0.1-testing/xen/arch/x86/microcode.c
Index: xen-4.0.0-testing/xen/arch/x86/microcode.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/microcode.c
+++ xen-4.0.1-testing/xen/arch/x86/microcode.c
--- xen-4.0.0-testing.orig/xen/arch/x86/microcode.c
+++ xen-4.0.0-testing/xen/arch/x86/microcode.c
@@ -114,7 +114,7 @@ static int microcode_update_cpu(const vo
return err;
}
@ -214,11 +214,11 @@ Index: xen-4.0.1-testing/xen/arch/x86/microcode.c
+ return continue_hypercall_on_cpu(info->cpu, NULL,
+ do_microcode_update, info);
}
Index: xen-4.0.1-testing/xen/arch/x86/mm.c
Index: xen-4.0.0-testing/xen/arch/x86/mm.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/mm.c
+++ xen-4.0.1-testing/xen/arch/x86/mm.c
@@ -243,7 +243,7 @@ void __init arch_init_memory(void)
--- xen-4.0.0-testing.orig/xen/arch/x86/mm.c
+++ xen-4.0.0-testing/xen/arch/x86/mm.c
@@ -242,7 +242,7 @@ void __init arch_init_memory(void)
* Any Xen-heap pages that we will allow to be mapped will have
* their domain field set to dom_xen.
*/
@ -227,7 +227,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/mm.c
BUG_ON(dom_xen == NULL);
/*
@@ -251,14 +251,14 @@ void __init arch_init_memory(void)
@@ -250,14 +250,14 @@ void __init arch_init_memory(void)
* This domain owns I/O pages that are within the range of the page_info
* array. Mappings occur at the priv of the caller.
*/
@ -244,10 +244,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/mm.c
BUG_ON(dom_cow == NULL);
/* First 1MB of RAM is historically marked as I/O. */
Index: xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
Index: xen-4.0.0-testing/xen/arch/x86/platform_hypercall.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/platform_hypercall.c
+++ xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
--- xen-4.0.0-testing.orig/xen/arch/x86/platform_hypercall.c
+++ xen-4.0.0-testing/xen/arch/x86/platform_hypercall.c
@@ -19,6 +19,7 @@
#include <xen/iocap.h>
#include <xen/guest_access.h>
@ -280,7 +280,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
cpu_frequency_change_helper,
NULL);
break;
@@ -406,7 +407,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
@@ -403,7 +404,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
g_info = &op->u.pcpu_info;
/* spin_trylock() avoids deadlock with stop_machine_run(). */
@ -289,7 +289,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
{
ret = -EBUSY;
break;
@@ -429,7 +430,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
@@ -426,7 +427,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
g_info->max_present = last_cpu(cpu_present_map);
@ -298,7 +298,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
}
@@ -470,7 +471,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
@@ -467,7 +468,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
break;
}
ret = continue_hypercall_on_cpu(
@ -307,10 +307,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/platform_hypercall.c
break;
}
break;
Index: xen-4.0.1-testing/xen/arch/x86/setup.c
Index: xen-4.0.0-testing/xen/arch/x86/setup.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/setup.c
+++ xen-4.0.1-testing/xen/arch/x86/setup.c
--- xen-4.0.0-testing.orig/xen/arch/x86/setup.c
+++ xen-4.0.0-testing/xen/arch/x86/setup.c
@@ -2,6 +2,7 @@
#include <xen/init.h>
#include <xen/lib.h>
@ -328,7 +328,7 @@ Index: xen-4.0.1-testing/xen/arch/x86/setup.c
if ( idle_domain == NULL )
BUG();
idle_domain->vcpu = idle_vcpu;
@@ -1122,8 +1123,13 @@ void __init __start_xen(unsigned long mb
@@ -1094,8 +1095,13 @@ void __init __start_xen(unsigned long mb
if ( !tboot_protect_mem_regions() )
panic("Could not protect TXT memory regions\n");
@ -343,10 +343,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/setup.c
if ( (dom0 == NULL) || (alloc_dom0_vcpu0() == NULL) )
panic("Error creating domain 0\n");
Index: xen-4.0.1-testing/xen/arch/x86/smpboot.c
Index: xen-4.0.0-testing/xen/arch/x86/smpboot.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/smpboot.c
+++ xen-4.0.1-testing/xen/arch/x86/smpboot.c
--- xen-4.0.0-testing.orig/xen/arch/x86/smpboot.c
+++ xen-4.0.0-testing/xen/arch/x86/smpboot.c
@@ -39,6 +39,7 @@
#include <xen/mm.h>
#include <xen/domain.h>
@ -468,10 +468,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/smpboot.c
cpufreq_add_cpu(cpu);
return 0;
}
Index: xen-4.0.1-testing/xen/arch/x86/sysctl.c
Index: xen-4.0.0-testing/xen/arch/x86/sysctl.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/sysctl.c
+++ xen-4.0.1-testing/xen/arch/x86/sysctl.c
--- xen-4.0.0-testing.orig/xen/arch/x86/sysctl.c
+++ xen-4.0.0-testing/xen/arch/x86/sysctl.c
@@ -29,7 +29,7 @@
#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
@ -490,10 +490,10 @@ Index: xen-4.0.1-testing/xen/arch/x86/sysctl.c
break;
case XEN_SYSCTL_CPU_HOTPLUG_STATUS:
ret = 0;
Index: xen-4.0.1-testing/xen/common/Makefile
Index: xen-4.0.0-testing/xen/common/Makefile
===================================================================
--- xen-4.0.1-testing.orig/xen/common/Makefile
+++ xen-4.0.1-testing/xen/common/Makefile
--- xen-4.0.0-testing.orig/xen/common/Makefile
+++ xen-4.0.0-testing/xen/common/Makefile
@@ -1,5 +1,6 @@
obj-y += bitmap.o
obj-y += cpu.o
@ -501,10 +501,10 @@ Index: xen-4.0.1-testing/xen/common/Makefile
obj-y += domctl.o
obj-y += domain.o
obj-y += event_channel.o
Index: xen-4.0.1-testing/xen/common/cpupool.c
Index: xen-4.0.0-testing/xen/common/cpupool.c
===================================================================
--- /dev/null
+++ xen-4.0.1-testing/xen/common/cpupool.c
+++ xen-4.0.0-testing/xen/common/cpupool.c
@@ -0,0 +1,585 @@
+/******************************************************************************
+ * cpupool.c
@ -1091,10 +1091,10 @@ Index: xen-4.0.1-testing/xen/common/cpupool.c
+ * indent-tabs-mode: nil
+ * End:
+ */
Index: xen-4.0.1-testing/xen/common/domain.c
Index: xen-4.0.0-testing/xen/common/domain.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/domain.c
+++ xen-4.0.1-testing/xen/common/domain.c
--- xen-4.0.0-testing.orig/xen/common/domain.c
+++ xen-4.0.0-testing/xen/common/domain.c
@@ -209,7 +209,7 @@ static void __init parse_extra_guest_irq
custom_param("extra_guest_irqs", parse_extra_guest_irqs);
@ -1104,7 +1104,7 @@ Index: xen-4.0.1-testing/xen/common/domain.c
{
struct domain *d, **pd;
enum { INIT_xsm = 1u<<0, INIT_rangeset = 1u<<1, INIT_evtchn = 1u<<2,
@@ -292,6 +292,9 @@ struct domain *domain_create(
@@ -290,6 +290,9 @@ struct domain *domain_create(
goto fail;
init_status |= INIT_arch;
@ -1114,7 +1114,7 @@ Index: xen-4.0.1-testing/xen/common/domain.c
if ( sched_init_domain(d) != 0 )
goto fail;
@@ -603,6 +606,8 @@ static void complete_domain_destroy(stru
@@ -597,6 +600,8 @@ static void complete_domain_destroy(stru
rangeset_domain_destroy(d);
@ -1123,10 +1123,10 @@ Index: xen-4.0.1-testing/xen/common/domain.c
sched_destroy_domain(d);
/* Free page used by xen oprofile buffer. */
Index: xen-4.0.1-testing/xen/common/domctl.c
Index: xen-4.0.0-testing/xen/common/domctl.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/domctl.c
+++ xen-4.0.1-testing/xen/common/domctl.c
--- xen-4.0.0-testing.orig/xen/common/domctl.c
+++ xen-4.0.0-testing/xen/common/domctl.c
@@ -11,6 +11,7 @@
#include <xen/lib.h>
#include <xen/mm.h>
@ -1135,7 +1135,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
#include <xen/domain.h>
#include <xen/event.h>
#include <xen/domain_page.h>
@@ -141,10 +142,12 @@ void getdomaininfo(struct domain *d, str
@@ -140,10 +141,12 @@ void getdomaininfo(struct domain *d, str
info->shared_info_frame = mfn_to_gmfn(d, __pa(d->shared_info)>>PAGE_SHIFT);
BUG_ON(SHARED_M2P(info->shared_info_frame));
@ -1149,7 +1149,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
{
struct domain *d;
struct vcpu *v;
@@ -174,7 +177,7 @@ static unsigned int default_vcpu0_locati
@@ -173,7 +176,7 @@ static unsigned int default_vcpu0_locati
if ( cpus_weight(per_cpu(cpu_sibling_map, 0)) > 1 )
cpu = next_cpu(cpu, per_cpu(cpu_sibling_map, 0));
cpu_exclude_map = per_cpu(cpu_sibling_map, 0);
@ -1158,7 +1158,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
{
if ( cpu_isset(i, cpu_exclude_map) )
continue;
@@ -389,6 +392,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
@@ -388,6 +391,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
domid_t dom;
static domid_t rover = 0;
unsigned int domcr_flags;
@ -1166,7 +1166,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
ret = -EINVAL;
if ( supervisor_mode_kernel ||
@@ -432,7 +436,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
@@ -431,7 +435,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
domcr_flags |= DOMCRF_oos_off;
ret = -ENOMEM;
@ -1175,7 +1175,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
if ( d == NULL )
break;
@@ -451,6 +455,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
@@ -450,6 +454,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
{
struct domain *d;
unsigned int i, max = op->u.max_vcpus.max, cpu;
@ -1183,7 +1183,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
ret = -ESRCH;
if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
@@ -499,6 +504,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
@@ -498,6 +503,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
goto maxvcpu_out;
ret = -ENOMEM;
@ -1191,7 +1191,7 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
if ( max > d->max_vcpus )
{
struct vcpu **vcpus;
@@ -522,8 +528,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
@@ -521,8 +527,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
continue;
cpu = (i == 0) ?
@ -1202,32 +1202,10 @@ Index: xen-4.0.1-testing/xen/common/domctl.c
if ( alloc_vcpu(d, i, cpu) == NULL )
goto maxvcpu_out;
Index: xen-4.0.1-testing/xen/common/kexec.c
Index: xen-4.0.0-testing/xen/common/sched_credit.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/kexec.c
+++ xen-4.0.1-testing/xen/common/kexec.c
@@ -235,7 +235,7 @@ void kexec_crash(void)
BUG();
}
-static long kexec_reboot(void *_image)
+static long kexec_reboot(void *hdl, void *_image)
{
xen_kexec_image_t *image = _image;
@@ -584,7 +584,7 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
{
case KEXEC_TYPE_DEFAULT:
image = &kexec_image[base + pos];
- ret = continue_hypercall_on_cpu(0, kexec_reboot, image);
+ ret = continue_hypercall_on_cpu(0, NULL, kexec_reboot, image);
break;
case KEXEC_TYPE_CRASH:
kexec_crash(); /* Does not return */
Index: xen-4.0.1-testing/xen/common/sched_credit.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/sched_credit.c
+++ xen-4.0.1-testing/xen/common/sched_credit.c
--- xen-4.0.0-testing.orig/xen/common/sched_credit.c
+++ xen-4.0.0-testing/xen/common/sched_credit.c
@@ -70,11 +70,15 @@
/*
* Useful macros
@ -2130,10 +2108,10 @@ Index: xen-4.0.1-testing/xen/common/sched_credit.c
.tick_suspend = csched_tick_suspend,
.tick_resume = csched_tick_resume,
Index: xen-4.0.1-testing/xen/common/sched_sedf.c
Index: xen-4.0.0-testing/xen/common/sched_sedf.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/sched_sedf.c
+++ xen-4.0.1-testing/xen/common/sched_sedf.c
--- xen-4.0.0-testing.orig/xen/common/sched_sedf.c
+++ xen-4.0.0-testing/xen/common/sched_sedf.c
@@ -21,6 +21,9 @@
printk(_a ); \
} while ( 0 )
@ -2416,10 +2394,10 @@ Index: xen-4.0.1-testing/xen/common/sched_sedf.c
.do_schedule = sedf_do_schedule,
.pick_cpu = sedf_pick_cpu,
.dump_cpu_state = sedf_dump_cpu_state,
Index: xen-4.0.1-testing/xen/common/schedule.c
Index: xen-4.0.0-testing/xen/common/schedule.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/schedule.c
+++ xen-4.0.1-testing/xen/common/schedule.c
--- xen-4.0.0-testing.orig/xen/common/schedule.c
+++ xen-4.0.0-testing/xen/common/schedule.c
@@ -53,10 +53,11 @@ static void poll_timer_fn(void *data);
/* This is global for now so that private implementations can reach it */
@ -2730,7 +2708,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
/* Block the currently-executing domain until a pertinent event occurs. */
static long do_block(void)
{
@@ -783,7 +861,7 @@ long sched_adjust(struct domain *d, stru
@@ -762,7 +840,7 @@ long sched_adjust(struct domain *d, stru
struct vcpu *v;
long ret;
@ -2739,7 +2717,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
((op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
(op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) )
return -EINVAL;
@@ -810,7 +888,7 @@ long sched_adjust(struct domain *d, stru
@@ -789,7 +867,7 @@ long sched_adjust(struct domain *d, stru
if ( d == current->domain )
vcpu_schedule_lock_irq(current);
@ -2748,7 +2726,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
if ( d == current->domain )
@@ -857,6 +935,7 @@ static void schedule(void)
@@ -836,6 +914,7 @@ static void schedule(void)
{
struct vcpu *prev = current, *next = NULL;
s_time_t now = NOW();
@ -2756,7 +2734,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
struct schedule_data *sd;
struct task_slice next_slice;
@@ -872,7 +951,7 @@ static void schedule(void)
@@ -851,7 +930,7 @@ static void schedule(void)
stop_timer(&sd->s_timer);
/* get policy-specific decision on scheduling... */
@ -2765,7 +2743,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
next = next_slice.task;
@@ -978,6 +1057,19 @@ static void poll_timer_fn(void *data)
@@ -951,6 +1030,19 @@ static void poll_timer_fn(void *data)
vcpu_unblock(v);
}
@ -2785,7 +2763,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
/* Initialise the data structures. */
void __init scheduler_init(void)
{
@@ -985,12 +1077,6 @@ void __init scheduler_init(void)
@@ -958,12 +1050,6 @@ void __init scheduler_init(void)
open_softirq(SCHEDULE_SOFTIRQ, schedule);
@ -2798,7 +2776,7 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
for ( i = 0; schedulers[i] != NULL; i++ )
{
ops = *schedulers[i];
@@ -1004,43 +1090,123 @@ void __init scheduler_init(void)
@@ -977,43 +1063,123 @@ void __init scheduler_init(void)
ops = *schedulers[0];
}
@ -2938,10 +2916,10 @@ Index: xen-4.0.1-testing/xen/common/schedule.c
}
#ifdef CONFIG_COMPAT
Index: xen-4.0.1-testing/xen/common/softirq.c
Index: xen-4.0.0-testing/xen/common/softirq.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/softirq.c
+++ xen-4.0.1-testing/xen/common/softirq.c
--- xen-4.0.0-testing.orig/xen/common/softirq.c
+++ xen-4.0.0-testing/xen/common/softirq.c
@@ -88,9 +88,11 @@ void raise_softirq(unsigned int nr)
}
@ -3035,10 +3013,10 @@ Index: xen-4.0.1-testing/xen/common/softirq.c
open_softirq(TASKLET_SOFTIRQ, tasklet_action);
}
Index: xen-4.0.1-testing/xen/common/sysctl.c
Index: xen-4.0.0-testing/xen/common/sysctl.c
===================================================================
--- xen-4.0.1-testing.orig/xen/common/sysctl.c
+++ xen-4.0.1-testing/xen/common/sysctl.c
--- xen-4.0.0-testing.orig/xen/common/sysctl.c
+++ xen-4.0.0-testing/xen/common/sysctl.c
@@ -314,6 +314,14 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
}
break;
@ -3054,11 +3032,11 @@ Index: xen-4.0.1-testing/xen/common/sysctl.c
default:
ret = arch_do_sysctl(op, u_sysctl);
break;
Index: xen-4.0.1-testing/xen/include/asm-x86/domain.h
Index: xen-4.0.0-testing/xen/include/asm-x86/domain.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/asm-x86/domain.h
+++ xen-4.0.1-testing/xen/include/asm-x86/domain.h
@@ -458,7 +458,8 @@ struct arch_vcpu
--- xen-4.0.0-testing.orig/xen/include/asm-x86/domain.h
+++ xen-4.0.0-testing/xen/include/asm-x86/domain.h
@@ -451,7 +451,8 @@ struct arch_vcpu
#define hvm_svm hvm_vcpu.u.svm
/* Continue the current hypercall via func(data) on specified cpu. */
@ -3068,10 +3046,10 @@ Index: xen-4.0.1-testing/xen/include/asm-x86/domain.h
void vcpu_show_execution_state(struct vcpu *);
void vcpu_show_registers(const struct vcpu *);
Index: xen-4.0.1-testing/xen/include/asm-x86/smp.h
Index: xen-4.0.0-testing/xen/include/asm-x86/smp.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/asm-x86/smp.h
+++ xen-4.0.1-testing/xen/include/asm-x86/smp.h
--- xen-4.0.0-testing.orig/xen/include/asm-x86/smp.h
+++ xen-4.0.0-testing/xen/include/asm-x86/smp.h
@@ -56,7 +56,6 @@ extern u32 cpu_2_logical_apicid[];
#define CPU_ONLINE 0x0002 /* CPU is up */
#define CPU_DEAD 0x0004 /* CPU is dead */
@ -3080,10 +3058,10 @@ Index: xen-4.0.1-testing/xen/include/asm-x86/smp.h
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
extern int cpu_down(unsigned int cpu);
Index: xen-4.0.1-testing/xen/include/public/domctl.h
Index: xen-4.0.0-testing/xen/include/public/domctl.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/public/domctl.h
+++ xen-4.0.1-testing/xen/include/public/domctl.h
--- xen-4.0.0-testing.orig/xen/include/public/domctl.h
+++ xen-4.0.0-testing/xen/include/public/domctl.h
@@ -60,10 +60,10 @@ struct xen_domctl_createdomain {
/* Should domain memory integrity be verifed by tboot during Sx? */
#define _XEN_DOMCTL_CDF_s3_integrity 2
@ -3112,10 +3090,10 @@ Index: xen-4.0.1-testing/xen/include/public/domctl.h
struct xen_domctl {
uint32_t cmd;
#define XEN_DOMCTL_createdomain 1
Index: xen-4.0.1-testing/xen/include/public/sysctl.h
Index: xen-4.0.0-testing/xen/include/public/sysctl.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/public/sysctl.h
+++ xen-4.0.1-testing/xen/include/public/sysctl.h
--- xen-4.0.0-testing.orig/xen/include/public/sysctl.h
+++ xen-4.0.0-testing/xen/include/public/sysctl.h
@@ -491,6 +491,28 @@ struct xen_sysctl_lockprof_op {
typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
@ -3153,10 +3131,10 @@ Index: xen-4.0.1-testing/xen/include/public/sysctl.h
uint8_t pad[128];
} u;
};
Index: xen-4.0.1-testing/xen/include/xen/sched-if.h
Index: xen-4.0.0-testing/xen/include/xen/sched-if.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/sched-if.h
+++ xen-4.0.1-testing/xen/include/xen/sched-if.h
--- xen-4.0.0-testing.orig/xen/include/xen/sched-if.h
+++ xen-4.0.0-testing/xen/include/xen/sched-if.h
@@ -10,16 +10,29 @@
#include <xen/percpu.h>
@ -3251,10 +3229,10 @@ Index: xen-4.0.1-testing/xen/include/xen/sched-if.h
+struct scheduler *scheduler_get_by_id(unsigned int id);
+
#endif /* __XEN_SCHED_IF_H__ */
Index: xen-4.0.1-testing/xen/include/xen/sched.h
Index: xen-4.0.0-testing/xen/include/xen/sched.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/sched.h
+++ xen-4.0.1-testing/xen/include/xen/sched.h
--- xen-4.0.0-testing.orig/xen/include/xen/sched.h
+++ xen-4.0.0-testing/xen/include/xen/sched.h
@@ -9,6 +9,7 @@
#include <xen/shared.h>
#include <public/xen.h>
@ -3272,7 +3250,7 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
/*
* > 0: a single port is being polled;
@@ -209,6 +208,7 @@ struct domain
@@ -211,6 +210,7 @@ struct domain
/* Scheduling. */
void *sched_priv; /* scheduler-specific data */
@ -3280,7 +3258,7 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
struct domain *next_in_list;
struct domain *next_in_hashbucket;
@@ -381,7 +381,7 @@ static inline struct domain *get_current
@@ -383,7 +383,7 @@ static inline struct domain *get_current
}
struct domain *domain_create(
@ -3289,7 +3267,7 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
/* DOMCRF_hvm: Create an HVM domain, as opposed to a PV domain. */
#define _DOMCRF_hvm 0
#define DOMCRF_hvm (1U<<_DOMCRF_hvm)
@@ -469,6 +469,7 @@ int sched_init_vcpu(struct vcpu *v, uns
@@ -471,6 +471,7 @@ int sched_init_vcpu(struct vcpu *v, uns
void sched_destroy_vcpu(struct vcpu *v);
int sched_init_domain(struct domain *d);
void sched_destroy_domain(struct domain *d);
@ -3297,7 +3275,7 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
int sched_id(void);
void sched_tick_suspend(void);
@@ -576,12 +577,14 @@ void domain_pause_by_systemcontroller(st
@@ -578,12 +579,14 @@ void domain_pause_by_systemcontroller(st
void domain_unpause_by_systemcontroller(struct domain *d);
void cpu_init(void);
@ -3316,7 +3294,7 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
uint64_t get_cpu_idle_time(unsigned int cpu);
@@ -604,6 +607,18 @@ extern enum cpufreq_controller {
@@ -606,6 +609,18 @@ extern enum cpufreq_controller {
FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen
} cpufreq_controller;
@ -3335,10 +3313,10 @@ Index: xen-4.0.1-testing/xen/include/xen/sched.h
#endif /* __SCHED_H__ */
/*
Index: xen-4.0.1-testing/xen/include/xen/softirq.h
Index: xen-4.0.0-testing/xen/include/xen/softirq.h
===================================================================
--- xen-4.0.1-testing.orig/xen/include/xen/softirq.h
+++ xen-4.0.1-testing/xen/include/xen/softirq.h
--- xen-4.0.0-testing.orig/xen/include/xen/softirq.h
+++ xen-4.0.0-testing/xen/include/xen/softirq.h
@@ -58,6 +58,7 @@ struct tasklet
struct tasklet name = { LIST_HEAD_INIT(name.list), 0, 0, 0, func, data }

View File

@ -1,8 +1,8 @@
Index: xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-4.0.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1313,8 +1313,15 @@ class XendDomainInfo:
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1310,8 +1310,15 @@ class XendDomainInfo:
frontpath = self.getDeviceController(deviceClass).frontendPath(dev)
backpath = xstransact.Read(frontpath, "backend")
thread.start_new_thread(self.getDeviceController(deviceClass).finishDeviceCleanup, (backpath, path))

View File

@ -1,7 +1,7 @@
Index: xen-4.0.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
===================================================================
--- xen-4.0.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.0.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -401,6 +401,11 @@ static int __devinit platform_pci_init(s
platform_mmio = mmio_addr;
platform_mmiolen = mmio_len;

View File

@ -1,8 +1,6 @@
Index: xen-4.0.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-4.0.1-testing.orig/xen/arch/x86/domain.c
+++ xen-4.0.1-testing/xen/arch/x86/domain.c
@@ -144,15 +144,30 @@ void dump_pageframe_info(struct domain *
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -144,14 +144,29 @@ void dump_pageframe_info(struct domain *
printk("Memory pages belonging to domain %u:\n", d->domain_id);
@ -16,7 +14,6 @@ Index: xen-4.0.1-testing/xen/arch/x86/domain.c
+ unsigned long total[PGT_type_mask
+ / (PGT_type_mask & -PGT_type_mask) + 1] = {};
+
spin_lock(&d->page_alloc_lock);
page_list_for_each ( page, &d->page_list )
{
+ unsigned int index = (page->u.inuse.type_info & PGT_type_mask)

Some files were not shown because too many files have changed in this diff Show More