Accepting request 29774 from Virtualization

Copy from Virtualization/xen based on submit request 29774 from user charlesa

OBS-URL: https://build.opensuse.org/request/show/29774
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=83
This commit is contained in:
OBS User autobuild 2010-01-18 14:23:14 +00:00 committed by Git OBS Bridge
commit 060638e85e
117 changed files with 1903 additions and 3566 deletions

View File

@ -1,106 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250693891 -3600
# Node ID bea861fb0f20671d41e467557bfdffb67b42f5e7
# Parent aa9f0b39c021f9c6e2c5cdb225564dd554a727f5
x86_emulate: Emulate LLDT and LTR instructions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 19614:e421fd04e150
xen-unstable date: Tue May 19 02:09:36 2009 +0100
Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -172,7 +172,7 @@ static uint8_t opcode_table[256] = {
static uint8_t twobyte_table[256] = {
/* 0x00 - 0x07 */
- 0, ImplicitOps|ModRM, 0, 0, 0, 0, ImplicitOps, 0,
+ SrcMem16|ModRM, ImplicitOps|ModRM, 0, 0, 0, 0, ImplicitOps, 0,
/* 0x08 - 0x0F */
ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps|ModRM, 0, 0,
/* 0x10 - 0x17 */
@@ -971,8 +971,8 @@ protmode_load_seg(
struct { uint32_t a, b; } desc;
unsigned long val;
uint8_t dpl, rpl, cpl;
- uint32_t new_desc_b;
- int rc, fault_type = EXC_TS;
+ uint32_t new_desc_b, a_flag = 0x100;
+ int rc, fault_type = EXC_GP;
/* NULL selector? */
if ( (sel & 0xfffc) == 0 )
@@ -983,8 +983,8 @@ protmode_load_seg(
return ops->write_segment(seg, &segr, ctxt);
}
- /* LDT descriptor must be in the GDT. */
- if ( (seg == x86_seg_ldtr) && (sel & 4) )
+ /* System segment descriptors must reside in the GDT. */
+ if ( !is_x86_user_segment(seg) && (sel & 4) )
goto raise_exn;
if ( (rc = ops->read_segment(x86_seg_ss, &ss, ctxt)) ||
@@ -1013,8 +1013,8 @@ protmode_load_seg(
goto raise_exn;
}
- /* LDT descriptor is a system segment. All others are code/data. */
- if ( (desc.b & (1u<<12)) == ((seg == x86_seg_ldtr) << 12) )
+ /* System segments must have the system flag (S) set. */
+ if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) )
goto raise_exn;
dpl = (desc.b >> 13) & 3;
@@ -1043,6 +1043,12 @@ protmode_load_seg(
if ( (desc.b & (15u<<8)) != (2u<<8) )
goto raise_exn;
goto skip_accessed_flag;
+ case x86_seg_tr:
+ /* Available TSS system segment? */
+ if ( (desc.b & (15u<<8)) != (9u<<8) )
+ goto raise_exn;
+ a_flag = 0x200; /* busy flag */
+ break;
default:
/* Readable code or data segment? */
if ( (desc.b & (5u<<9)) == (4u<<9) )
@@ -1055,8 +1061,8 @@ protmode_load_seg(
}
/* Ensure Accessed flag is set. */
- new_desc_b = desc.b | 0x100;
- rc = ((desc.b & 0x100) ? X86EMUL_OKAY :
+ new_desc_b = desc.b | a_flag;
+ rc = ((desc.b & a_flag) ? X86EMUL_OKAY :
ops->cmpxchg(
x86_seg_none, desctab.base + (sel & 0xfff8) + 4,
&desc.b, &new_desc_b, 4, ctxt));
@@ -1066,7 +1072,7 @@ protmode_load_seg(
return rc;
/* Force the Accessed flag in our local copy. */
- desc.b |= 0x100;
+ desc.b |= a_flag;
skip_accessed_flag:
segr.base = (((desc.b << 0) & 0xff000000u) |
@@ -3440,6 +3446,15 @@ x86_emulate(
twobyte_insn:
switch ( b )
{
+ case 0x00: /* Grp6 */
+ fail_if((modrm_reg & 6) != 2);
+ generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
+ generate_exception_if(!mode_ring0(), EXC_GP, 0);
+ if ( (rc = load_seg((modrm_reg & 1) ? x86_seg_tr : x86_seg_ldtr,
+ src.val, ctxt, ops)) != 0 )
+ goto done;
+ break;
+
case 0x01: /* Grp7 */ {
struct segment_register reg;
unsigned long base, limit, cr0, cr0w;

View File

@ -1,39 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1249470279 -3600
# Node ID e41d42ef4cd2968cd480063a3c82d91c38cb8c7d
# Parent 3242351f9c6766fe4fbc27d969b1b84a9926cbda
xend: fix memory leak resulting in long garbage collector runs
In the method xen.xend.XendStateStore.XendStateStore.load_state and
xen.xend.XendStateStore.XendStateStore.save_state the minidom objects
used to load/save the current state of a device type, can't be freed
by the python garbage collector after all references to the top node
are cleared, because of cyclic references between the DOM nodes. So
memory usage of xend increases after calling these methods. To solve
this problem, the unlink() method must be called for a minidom object
before the last reference to the top node is cleared (see python
docs). This breaks the cyclic references, so the garbage collector can
free these objects.
Signed-off-by: juergen.gross@ts.fujitsu.com
Index: xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendStateStore.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py
@@ -147,6 +147,7 @@ class XendStateStore:
cls_dict[val_name] = bool(int(val_text))
state[uuid] = cls_dict
+ dom.unlink()
return state
def save_state(self, cls, state):
@@ -226,5 +227,5 @@ class XendStateStore:
node.appendChild(val_node)
open(xml_path, 'w').write(doc.toprettyxml())
-
+ doc.unlink()

View File

@ -1,161 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250693923 -3600
# Node ID 44d852862374dff2e734070ac60399f6875f6cd5
# Parent bea861fb0f20671d41e467557bfdffb67b42f5e7
x86_emulate: Remove cmpxchg retry loop from protmode_load_seg().
It is safer to retry in a loop via the caller.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 20031:34bdb5a29963
xen-unstable date: Thu Aug 06 09:54:22 2009 +0100
Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -996,79 +996,75 @@ protmode_load_seg(
if ( ((sel & 0xfff8) + 7) > desctab.limit )
goto raise_exn;
- do {
- if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8),
- &val, 4, ctxt, ops)) )
- return rc;
- desc.a = val;
- if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8) + 4,
- &val, 4, ctxt, ops)) )
- return rc;
- desc.b = val;
+ if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8),
+ &val, 4, ctxt, ops)) )
+ return rc;
+ desc.a = val;
+ if ( (rc = read_ulong(x86_seg_none, desctab.base + (sel & 0xfff8) + 4,
+ &val, 4, ctxt, ops)) )
+ return rc;
+ desc.b = val;
- /* Segment present in memory? */
- if ( !(desc.b & (1u<<15)) )
- {
- fault_type = EXC_NP;
- goto raise_exn;
- }
+ /* Segment present in memory? */
+ if ( !(desc.b & (1u<<15)) )
+ {
+ fault_type = EXC_NP;
+ goto raise_exn;
+ }
- /* System segments must have the system flag (S) set. */
- if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) )
- goto raise_exn;
+ /* System segments must have the system flag (S) set. */
+ if ( (desc.b & (1u<<12)) == (!is_x86_user_segment(seg) << 12) )
+ goto raise_exn;
- dpl = (desc.b >> 13) & 3;
- rpl = sel & 3;
- cpl = ss.attr.fields.dpl;
-
- switch ( seg )
- {
- case x86_seg_cs:
- /* Code segment? */
- if ( !(desc.b & (1u<<11)) )
- goto raise_exn;
- /* Non-conforming segment: check DPL against RPL. */
- if ( ((desc.b & (6u<<9)) != (6u<<9)) && (dpl != rpl) )
- goto raise_exn;
- break;
- case x86_seg_ss:
- /* Writable data segment? */
- if ( (desc.b & (5u<<9)) != (1u<<9) )
- goto raise_exn;
- if ( (dpl != cpl) || (dpl != rpl) )
- goto raise_exn;
- break;
- case x86_seg_ldtr:
- /* LDT system segment? */
- if ( (desc.b & (15u<<8)) != (2u<<8) )
- goto raise_exn;
- goto skip_accessed_flag;
- case x86_seg_tr:
- /* Available TSS system segment? */
- if ( (desc.b & (15u<<8)) != (9u<<8) )
- goto raise_exn;
- a_flag = 0x200; /* busy flag */
- break;
- default:
- /* Readable code or data segment? */
- if ( (desc.b & (5u<<9)) == (4u<<9) )
- goto raise_exn;
- /* Non-conforming segment: check DPL against RPL and CPL. */
- if ( ((desc.b & (6u<<9)) != (6u<<9)) &&
- ((dpl < cpl) || (dpl < rpl)) )
- goto raise_exn;
- break;
- }
+ dpl = (desc.b >> 13) & 3;
+ rpl = sel & 3;
+ cpl = ss.attr.fields.dpl;
- /* Ensure Accessed flag is set. */
- new_desc_b = desc.b | a_flag;
- rc = ((desc.b & a_flag) ? X86EMUL_OKAY :
- ops->cmpxchg(
- x86_seg_none, desctab.base + (sel & 0xfff8) + 4,
- &desc.b, &new_desc_b, 4, ctxt));
- } while ( rc == X86EMUL_CMPXCHG_FAILED );
+ switch ( seg )
+ {
+ case x86_seg_cs:
+ /* Code segment? */
+ if ( !(desc.b & (1u<<11)) )
+ goto raise_exn;
+ /* Non-conforming segment: check DPL against RPL. */
+ if ( ((desc.b & (6u<<9)) != (6u<<9)) && (dpl != rpl) )
+ goto raise_exn;
+ break;
+ case x86_seg_ss:
+ /* Writable data segment? */
+ if ( (desc.b & (5u<<9)) != (1u<<9) )
+ goto raise_exn;
+ if ( (dpl != cpl) || (dpl != rpl) )
+ goto raise_exn;
+ break;
+ case x86_seg_ldtr:
+ /* LDT system segment? */
+ if ( (desc.b & (15u<<8)) != (2u<<8) )
+ goto raise_exn;
+ goto skip_accessed_flag;
+ case x86_seg_tr:
+ /* Available TSS system segment? */
+ if ( (desc.b & (15u<<8)) != (9u<<8) )
+ goto raise_exn;
+ a_flag = 0x200; /* busy flag */
+ break;
+ default:
+ /* Readable code or data segment? */
+ if ( (desc.b & (5u<<9)) == (4u<<9) )
+ goto raise_exn;
+ /* Non-conforming segment: check DPL against RPL and CPL. */
+ if ( ((desc.b & (6u<<9)) != (6u<<9)) &&
+ ((dpl < cpl) || (dpl < rpl)) )
+ goto raise_exn;
+ break;
+ }
- if ( rc )
+ /* Ensure Accessed flag is set. */
+ new_desc_b = desc.b | a_flag;
+ if ( !(desc.b & a_flag) &&
+ ((rc = ops->cmpxchg(
+ x86_seg_none, desctab.base + (sel & 0xfff8) + 4,
+ &desc.b, &new_desc_b, 4, ctxt)) != 0) )
return rc;
/* Force the Accessed flag in our local copy. */

View File

@ -1,35 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250694095 -3600
# Node ID 090e394202d0bb0089abc5e5276ed7fda283567d
# Parent daf1ff2c7dbd59b2ab31e6427be58ffdc14e10fd
x86_emulate: Fixes for 'mov rm16,sreg'
1. Memory reads should be 16 bits only
2. Attempt to load %cs should result in #UD
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 20035:3fe64f43944f
xen-unstable date: Fri Aug 07 10:53:22 2009 +0100
Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -113,7 +113,7 @@ static uint8_t opcode_table[256] = {
ByteOp|DstMem|SrcReg|ModRM|Mov, DstMem|SrcReg|ModRM|Mov,
ByteOp|DstReg|SrcMem|ModRM|Mov, DstReg|SrcMem|ModRM|Mov,
DstMem|SrcReg|ModRM|Mov, DstReg|SrcNone|ModRM,
- DstReg|SrcMem|ModRM|Mov, DstMem|SrcNone|ModRM|Mov,
+ DstReg|SrcMem16|ModRM|Mov, DstMem|SrcNone|ModRM|Mov,
/* 0x90 - 0x97 */
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -2008,6 +2008,7 @@ x86_emulate(
case 0x8e: /* mov r/m,Sreg */ {
enum x86_segment seg = decode_segment(modrm_reg);
generate_exception_if(seg == decode_segment_failed, EXC_UD, -1);
+ generate_exception_if(seg == x86_seg_cs, EXC_UD, -1);
if ( (rc = load_seg(seg, (uint16_t)src.val, ctxt, ops)) != 0 )
goto done;
if ( seg == x86_seg_ss )

View File

@ -1,77 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250696034 -3600
# Node ID 4af92eee8be497964912cda863c956691b3a3f89
# Parent 2d6c4cc6a2a9e48218fe31d443f8937a3a88bf3f
VMX: issue an NMI rather than just calling the NMI handler
when the VMEXIT code indicates that an NMI has been raised.
Otherwise we might hit a real NMI while in the handler.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 20059:76a65bf2aa4d
xen-unstable date: Fri Aug 14 10:58:32 2009 +0100
Index: xen-3.4.1-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -936,8 +936,6 @@ static void vmx_set_tsc_offset(struct vc
vmx_vmcs_exit(v);
}
-void do_nmi(struct cpu_user_regs *);
-
static void vmx_init_hypercall_page(struct domain *d, void *hypercall_page)
{
char *p;
@@ -2416,7 +2414,7 @@ asmlinkage void vmx_vmexit_handler(struc
(X86_EVENTTYPE_NMI << 8) )
goto exit_and_crash;
HVMTRACE_0D(NMI);
- do_nmi(regs); /* Real NMI, vector 2: normal processing. */
+ self_nmi(); /* Real NMI, vector 2: normal processing. */
break;
case TRAP_machine_check:
HVMTRACE_0D(MCE);
Index: xen-3.4.1-testing/xen/arch/x86/nmi.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/nmi.c
+++ xen-3.4.1-testing/xen/arch/x86/nmi.c
@@ -441,18 +441,21 @@ void nmi_watchdog_tick(struct cpu_user_r
* 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
* our own APIC ID explicitly which is valid.
*/
-static void do_nmi_trigger(unsigned char key)
+void self_nmi(void)
{
u32 id = get_apic_id();
-
- printk("Triggering NMI on APIC ID %x\n", id);
-
local_irq_disable();
apic_wait_icr_idle();
apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
local_irq_enable();
}
+static void do_nmi_trigger(unsigned char key)
+{
+ printk("Triggering NMI on APIC ID %x\n", get_apic_id());
+ self_nmi();
+}
+
static void do_nmi_stats(unsigned char key)
{
int i;
Index: xen-3.4.1-testing/xen/include/asm-x86/apic.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/apic.h
+++ xen-3.4.1-testing/xen/include/asm-x86/apic.h
@@ -196,6 +196,7 @@ extern void setup_secondary_APIC_clock (
extern void setup_apic_nmi_watchdog (void);
extern int reserve_lapic_nmi(void);
extern void release_lapic_nmi(void);
+extern void self_nmi(void);
extern void disable_timer_nmi_watchdog(void);
extern void enable_timer_nmi_watchdog(void);
extern void nmi_watchdog_tick (struct cpu_user_regs *regs);

View File

@ -1,95 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250683301 -3600
# Node ID 456b4ec002443227f6d97f79b213dc4b2d281f9e
# Parent 2b8b6ee95c939089a0a7182286c9a21f0acce8fe
x86: extend runstate area updates
In order to give guests a hint at whether their vCPU-s are currently
scheduled (so they can e.g. adapt their behavior in spin loops),
update
the run state area (if registered) also when de-scheduling a vCPU.
Also fix an oversight in the compat mode implementation of
VCPUOP_register_runstate_memory_area.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-3.4.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/domain.c
+++ xen-3.4.1-testing/xen/arch/x86/domain.c
@@ -1219,6 +1219,26 @@ static void paravirt_ctxt_switch_to(stru
}
}
+/* Update per-VCPU guest runstate shared memory area (if registered). */
+static void update_runstate_area(struct vcpu *v)
+{
+ if ( guest_handle_is_null(runstate_guest(v)) )
+ return;
+
+#ifdef CONFIG_COMPAT
+ if ( is_pv_32on64_domain(v->domain) )
+ {
+ struct compat_vcpu_runstate_info info;
+
+ XLAT_vcpu_runstate_info(&info, &v->runstate);
+ __copy_to_guest(v->runstate_guest.compat, &info, 1);
+ return;
+ }
+#endif
+
+ __copy_to_guest(runstate_guest(v), &v->runstate, 1);
+}
+
static inline int need_full_gdt(struct vcpu *v)
{
return (!is_hvm_vcpu(v) && !is_idle_vcpu(v));
@@ -1311,6 +1331,9 @@ void context_switch(struct vcpu *prev, s
flush_tlb_mask(dirty_mask);
}
+ if (prev != next)
+ update_runstate_area(prev);
+
if ( is_hvm_vcpu(prev) && !list_empty(&prev->arch.hvm_vcpu.tm_list) )
pt_save_timer(prev);
@@ -1350,21 +1373,8 @@ void context_switch(struct vcpu *prev, s
context_saved(prev);
- /* Update per-VCPU guest runstate shared memory area (if registered). */
- if ( !guest_handle_is_null(runstate_guest(next)) )
- {
- if ( !is_pv_32on64_domain(next->domain) )
- __copy_to_guest(runstate_guest(next), &next->runstate, 1);
-#ifdef CONFIG_COMPAT
- else
- {
- struct compat_vcpu_runstate_info info;
-
- XLAT_vcpu_runstate_info(&info, &next->runstate);
- __copy_to_guest(next->runstate_guest.compat, &info, 1);
- }
-#endif
- }
+ if (prev != next)
+ update_runstate_area(next);
schedule_tail(next);
BUG();
Index: xen-3.4.1-testing/xen/arch/x86/x86_64/domain.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/domain.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_64/domain.c
@@ -56,7 +56,7 @@ arch_compat_vcpu_op(
struct vcpu_runstate_info runstate;
vcpu_runstate_get(v, &runstate);
- XLAT_vcpu_runstate_info(&info, &v->runstate);
+ XLAT_vcpu_runstate_info(&info, &runstate);
}
__copy_to_guest(v->runstate_guest.compat, &info, 1);

View File

@ -1,137 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250696281 -3600
# Node ID 68ea3be8b6c14d6de5d7c87fc00e27a596d2a00d
# Parent ca4db4ff9101f51d89a3de9e756b8a2f90a2baf2
x86-64: adjust emulation of control transfers
While Intel and AMD implementations differ in various respects when
it comes to non-default operand sizes of control transfer instructions
and segment register loads (lfs, lgs, lss), it seems to make senss to
(a) match their behavior if they agree and (b) prefer the more
permissive behavior if they don't agree:
- honor operand size overrides on near brances (AMD does, Intel
doesn't)
- honor operand size overrides on far branches (both Intel and AMD do)
- honor REX.W on far branches (Intel does, AMD doesn't except on far
returns)
- honor REX.W on lfs, lgs, and lss (Intel does, AMD doesn't)
Also, do not permit emulation of pushing/popping segment registers
other than fs and gs as well as that of les and lds (the latter are
particularly important due to the re-use of the respective opcodes as
VEX prefixes in AVX).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 20078:429ef4f4fe37
xen-unstable date: Wed Aug 19 13:02:04 2009 +0100
Index: xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_emulate/x86_emulate.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -561,9 +561,10 @@ do {
do { \
int _rel = (int)(rel); \
_regs.eip += _rel; \
- if ( !mode_64bit() ) \
- _regs.eip = ((op_bytes == 2) \
- ? (uint16_t)_regs.eip : (uint32_t)_regs.eip); \
+ if ( op_bytes == 2 ) \
+ _regs.eip = (uint16_t)_regs.eip; \
+ else if ( !mode_64bit() ) \
+ _regs.eip = (uint32_t)_regs.eip; \
} while (0)
struct fpu_insn_ctxt {
@@ -1614,6 +1615,7 @@ x86_emulate(
struct segment_register reg;
src.val = x86_seg_es;
push_seg:
+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1);
fail_if(ops->read_segment == NULL);
if ( (rc = ops->read_segment(src.val, &reg, ctxt)) != 0 )
return rc;
@@ -1629,6 +1631,7 @@ x86_emulate(
case 0x07: /* pop %%es */
src.val = x86_seg_es;
pop_seg:
+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1);
fail_if(ops->write_segment == NULL);
/* 64-bit mode: POP defaults to a 64-bit operand. */
if ( mode_64bit() && (op_bytes == 4) )
@@ -2074,8 +2077,8 @@ x86_emulate(
uint16_t sel;
uint32_t eip;
- fail_if(ops->read_segment == NULL);
generate_exception_if(mode_64bit(), EXC_UD, -1);
+ fail_if(ops->read_segment == NULL);
eip = insn_fetch_bytes(op_bytes);
sel = insn_fetch_type(uint16_t);
@@ -2293,7 +2296,7 @@ x86_emulate(
case 0xc2: /* ret imm16 (near) */
case 0xc3: /* ret (near) */ {
int offset = (b == 0xc2) ? insn_fetch_type(uint16_t) : 0;
- op_bytes = mode_64bit() ? 8 : op_bytes;
+ op_bytes = ((op_bytes == 4) && mode_64bit()) ? 8 : op_bytes;
if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes + offset),
&dst.val, op_bytes, ctxt, ops)) != 0 )
goto done;
@@ -2305,6 +2308,7 @@ x86_emulate(
unsigned long sel;
dst.val = x86_seg_es;
les: /* dst.val identifies the segment */
+ generate_exception_if(mode_64bit() && !twobyte, EXC_UD, -1);
generate_exception_if(src.type != OP_MEM, EXC_UD, -1);
if ( (rc = read_ulong(src.mem.seg, src.mem.off + src.bytes,
&sel, 2, ctxt, ops)) != 0 )
@@ -2379,7 +2383,6 @@ x86_emulate(
case 0xca: /* ret imm16 (far) */
case 0xcb: /* ret (far) */ {
int offset = (b == 0xca) ? insn_fetch_type(uint16_t) : 0;
- op_bytes = mode_64bit() ? 8 : op_bytes;
if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
&dst.val, op_bytes, ctxt, ops)) ||
(rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes + offset),
@@ -3032,17 +3035,17 @@ x86_emulate(
}
case 0xe8: /* call (near) */ {
- int rel = (((op_bytes == 2) && !mode_64bit())
+ int rel = ((op_bytes == 2)
? (int32_t)insn_fetch_type(int16_t)
: insn_fetch_type(int32_t));
- op_bytes = mode_64bit() ? 8 : op_bytes;
+ op_bytes = ((op_bytes == 4) && mode_64bit()) ? 8 : op_bytes;
src.val = _regs.eip;
jmp_rel(rel);
goto push;
}
case 0xe9: /* jmp (near) */ {
- int rel = (((op_bytes == 2) && !mode_64bit())
+ int rel = ((op_bytes == 2)
? (int32_t)insn_fetch_type(int16_t)
: insn_fetch_type(int32_t));
jmp_rel(rel);
@@ -3330,7 +3333,7 @@ x86_emulate(
break;
case 2: /* call (near) */
case 4: /* jmp (near) */
- if ( (dst.bytes != 8) && mode_64bit() )
+ if ( (dst.bytes == 4) && mode_64bit() )
{
dst.bytes = op_bytes = 8;
if ( dst.type == OP_REG )
@@ -3683,7 +3686,7 @@ x86_emulate(
}
case 0x80 ... 0x8f: /* jcc (near) */ {
- int rel = (((op_bytes == 2) && !mode_64bit())
+ int rel = ((op_bytes == 2)
? (int32_t)insn_fetch_type(int16_t)
: insn_fetch_type(int32_t));
if ( test_cc(b, _regs.eflags) )

View File

@ -1,142 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250781436 -3600
# Node ID 8f783adc0ee34808cdd296cccd92f99018f76017
# Parent 4b30cfb855299922244938fde4f88f4e5bb5df34
pygrub: Add password support
It basically checks for the presence of password line in grub.conf
of the guest image and if this line is present, it supports both clear
text and md5 versions of the password. Editing the grub entries and
command-line are disabled when some password is set in domain's
grub.conf file but the password was not entered yet. Also, new option
to press 'p' in interactive pygrub has been added to allow entering
the grub password. It's been tested on x86_64 with PV guests and was
working fine. Also, the countdown has been stopped after key was
pressed, ie. the user is probably editing the boot configuration.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py
+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
@@ -157,6 +157,7 @@ class GrubConfigFile(object):
self.images = []
self.timeout = -1
self._default = 0
+ self.passwordAccess = True
if fn is not None:
self.parse()
@@ -196,6 +197,7 @@ class GrubConfigFile(object):
if self.commands.has_key(com):
if self.commands[com] is not None:
setattr(self, self.commands[com], arg.strip())
+ #print "%s = %s => %s" % (com, self.commands[com], arg.strip() )
else:
logging.info("Ignored directive %s" %(com,))
else:
@@ -204,6 +206,37 @@ class GrubConfigFile(object):
if len(img) > 0:
self.add_image(GrubImage(img))
+ if self.hasPassword():
+ self.setPasswordAccess(False)
+
+ def hasPasswordAccess(self):
+ return self.passwordAccess
+
+ def setPasswordAccess(self, val):
+ self.passwordAccess = val
+
+ def hasPassword(self):
+ try:
+ getattr(self, self.commands['password'])
+ return True
+ except KeyError, e:
+ return False
+
+ def checkPassword(self, password):
+ try:
+ pwd = getattr(self, self.commands['password']).split()
+ if pwd[0] == '--md5':
+ import crypt
+ if crypt.crypt(password, pwd[1]) == pwd[1]:
+ return True
+
+ if pwd[0] == password:
+ return True
+
+ return False
+ except:
+ return True
+
def set(self, line):
(com, arg) = grub_exact_split(line, 2)
if self.commands.has_key(com):
Index: xen-3.4.1-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub
+++ xen-3.4.1-testing/tools/pygrub/src/pygrub
@@ -418,7 +418,14 @@ class Grub:
self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.")
self.text_win.addstr(1, 0, "Press enter to boot the selected OS. 'e' to edit the")
self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ")
- self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.")
+
+ # if grub has password defined we allow option to enter password
+ if not self.cf.hasPassword():
+ self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.")
+ else:
+ self.text_win.addstr(3, 0, "before booting, or 'c' for a command line. You can also")
+ self.text_win.addstr(4, 0, "press 'p' to enter password for modifications...")
+
self.text_win.addch(0, 8, curses.ACS_UARROW)
self.text_win.addch(0, 14, curses.ACS_DARROW)
(y, x) = self.text_win.getmaxyx()
@@ -457,9 +464,19 @@ class Grub:
# handle keypresses
if c == ord('c'):
+ # we disallow access without password specified
+ if not self.cf.hasPasswordAccess():
+ self.text_win.addstr(6, 8, "You have to enter GRUB password first")
+ break
+
self.command_line_mode()
break
elif c == ord('a'):
+ # we disallow access without password specified
+ if not self.cf.hasPasswordAccess():
+ self.text_win.addstr(6, 8, "You have to enter GRUB password first")
+ break
+
# find the kernel line, edit it and then boot
img = self.cf.images[self.selected_image]
for line in img.lines:
@@ -471,9 +488,24 @@ class Grub:
break
break
elif c == ord('e'):
+ # we disallow access without password specified
+ if not self.cf.hasPasswordAccess():
+ self.text_win.addstr(6, 8, "You have to enter GRUB password first")
+ break
+
img = self.cf.images[self.selected_image]
self.edit_entry(img)
break
+ elif c == ord('p') and self.cf.hasPassword():
+ self.text_win.addstr(6, 8, "Enter password: ")
+ pwd = self.text_win.getstr(6, 8)
+ if not self.cf.checkPassword(pwd):
+ self.text_win.addstr(6, 8, "Incorrect password!")
+ self.cf.setPasswordAccess( False )
+ else:
+ self.text_win.addstr(6, 8, "Access granted ")
+ self.cf.setPasswordAccess( True )
+ break
elif c in (curses.KEY_ENTER, ord('\n'), ord('\r')):
self.isdone = True
break

View File

@ -1,26 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250789251 -3600
# Node ID 100699877583818a54bc16360dfd5cf80daa5dc7
# Parent 280fff79f7371981bb0bbda34205414fff14737e
x86_64 hvm: Adjust COMPAT_VIRT_START for 32-bit HVM guests.
The PV limit should not apply as there is no M2P table mapped into an
HVM guest's virtual address space.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.4.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/domain.c
+++ xen-3.4.1-testing/xen/arch/x86/domain.c
@@ -428,7 +428,8 @@ int arch_domain_create(struct domain *d,
#endif /* __x86_64__ */
#ifdef CONFIG_COMPAT
- HYPERVISOR_COMPAT_VIRT_START(d) = __HYPERVISOR_COMPAT_VIRT_START;
+ HYPERVISOR_COMPAT_VIRT_START(d) =
+ is_hvm_domain(d) ? ~0u : __HYPERVISOR_COMPAT_VIRT_START;
#endif
if ( (rc = paging_domain_init(d)) != 0 )

View File

@ -1,39 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1250871100 -3600
# Node ID 168f0cfeded0ad64e03d821efe5dcbe2eb5806a3
# Parent 4207d83fc78ef63016a4163b09f30aa471e4bdb8
pygrub: Fix elilo handling after password patch.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py
+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
@@ -219,7 +219,7 @@ class GrubConfigFile(object):
try:
getattr(self, self.commands['password'])
return True
- except KeyError, e:
+ except:
return False
def checkPassword(self, password):
Index: xen-3.4.1-testing/tools/pygrub/src/LiloConf.py
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/LiloConf.py
+++ xen-3.4.1-testing/tools/pygrub/src/LiloConf.py
@@ -138,6 +138,12 @@ class LiloConfigFile(object):
if len(img) > 0:
self.add_image(LiloImage(img, path))
+ def hasPassword(self):
+ return False
+
+ def hasPasswordAccess(self):
+ return True
+
def add_image(self, image):
self.images.append(image)

View File

@ -1,47 +0,0 @@
References: bnc#491081
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1251097328 -3600
# Node ID 7e194320394244bc5028881b498d2e01574086cd
# Parent 9189afa1f1e6939fcda5525e225843cfd2325c42
x86: run timers when populating Dom0's P2M table
When booting Dom0 with huge amounts of memory, and/or memory accesses
being sufficiently slow (due to NUMA effects), and the ACPI PM timer
or a high frequency HPET being used, the time it takes to populate the
M2P table may significantly exceed the overflow time of the platform
timer, screwing up time management to the point where Dom0 boot fails.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-3.4.1-testing/xen/arch/x86/domain_build.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/domain_build.c
+++ xen-3.4.1-testing/xen/arch/x86/domain_build.c
@@ -877,6 +877,8 @@ int __init construct_dom0(
else
((unsigned int *)vphysmap_start)[pfn] = mfn;
set_gpfn_from_mfn(mfn, pfn);
+ if (!(pfn & 0xfffff))
+ process_pending_timers();
}
si->first_p2m_pfn = pfn;
si->nr_p2m_frames = d->tot_pages - count;
@@ -895,6 +897,8 @@ int __init construct_dom0(
#ifndef NDEBUG
++alloc_epfn;
#endif
+ if (!(pfn & 0xfffff))
+ process_pending_timers();
}
}
BUG_ON(pfn != d->tot_pages);
@@ -915,6 +919,8 @@ int __init construct_dom0(
set_gpfn_from_mfn(mfn, pfn);
#undef pfn
page++; pfn++;
+ if (!(pfn & 0xfffff))
+ process_pending_timers();
}
}

View File

@ -1,46 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1251297719 -3600
# Node ID ed672a604cc7d0acb9418b29cdc3d65ea84543e8
# Parent 71389988f5d4e6417f7da1d86da984acd5118efc
xend: Do not pass pointer to a 16-bit domid_t to PyArg_ParseTuple()
when it expects a full integer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -650,10 +650,9 @@ static PyObject *pyxc_deassign_device(Xc
static PyObject *pyxc_get_device_group(XcObject *self,
PyObject *args)
{
- domid_t domid;
uint32_t bdf = 0;
uint32_t max_sdevs, num_sdevs;
- int seg, bus, dev, func, rc, i;
+ int domid, seg, bus, dev, func, rc, i;
PyObject *Pystr;
char *group_str;
char dev_str[9];
@@ -808,7 +807,7 @@ static PyObject *pyxc_dom_check_cpuid(Xc
static PyObject *pyxc_dom_set_policy_cpuid(XcObject *self,
PyObject *args)
{
- domid_t domid;
+ int domid;
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
@@ -824,9 +823,8 @@ static PyObject *pyxc_dom_set_policy_cpu
static PyObject *pyxc_dom_set_cpuid(XcObject *self,
PyObject *args)
{
- domid_t domid;
PyObject *sub_input, *config;
- unsigned int input[2];
+ unsigned int domid, input[2];
char *regs[4], *regs_transform[4];
if ( !PyArg_ParseTuple(args, "IIOO", &domid,

View File

@ -1,95 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1251887904 -3600
# Node ID e513d565c8f1298d26bc614eabd1b7111693a940
# Parent 8fc92779847680fe40a1ee9c2a01b3effc7cd056
pygrub: Match bare-metal GRUB behavior for passwords
The password support patch already merged didn't match the bare-metal
GRUB behavior so I created a patch to match it. If password is entered
in grub.conf file, pressing `p` is required exactly like when using
"real" (bare-metal) GRUB. New options are available after the correct
password is entered.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Index: xen-3.4.1-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub
+++ xen-3.4.1-testing/tools/pygrub/src/pygrub
@@ -415,16 +415,17 @@ class Grub:
def draw():
# set up the screen
self.draw_main_windows()
- self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.")
- self.text_win.addstr(1, 0, "Press enter to boot the selected OS. 'e' to edit the")
- self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ")
- # if grub has password defined we allow option to enter password
- if not self.cf.hasPassword():
+ if not self.cf.hasPassword() or self.cf.hasPasswordAccess():
+ self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.")
+ self.text_win.addstr(1, 0, "Press enter to boot the selected OS, 'e' to edit the")
+ self.text_win.addstr(2, 0, "commands before booting, 'a' to modify the kernel arguments ")
self.text_win.addstr(3, 0, "before booting, or 'c' for a command line.")
+
else:
- self.text_win.addstr(3, 0, "before booting, or 'c' for a command line. You can also")
- self.text_win.addstr(4, 0, "press 'p' to enter password for modifications...")
+ self.text_win.addstr(0, 0, "Use the U and D keys to select which entry is highlighted.")
+ self.text_win.addstr(1, 0, "Press enter to boot the selected OS or `p` to enter a")
+ self.text_win.addstr(2, 0, "password to unlock the next set of features.")
self.text_win.addch(0, 8, curses.ACS_UARROW)
self.text_win.addch(0, 14, curses.ACS_DARROW)
@@ -463,20 +464,10 @@ class Grub:
self.screen.timeout(-1)
# handle keypresses
- if c == ord('c'):
- # we disallow access without password specified
- if not self.cf.hasPasswordAccess():
- self.text_win.addstr(6, 8, "You have to enter GRUB password first")
- break
-
+ if c == ord('c') and self.cf.hasPasswordAccess():
self.command_line_mode()
break
- elif c == ord('a'):
- # we disallow access without password specified
- if not self.cf.hasPasswordAccess():
- self.text_win.addstr(6, 8, "You have to enter GRUB password first")
- break
-
+ elif c == ord('a') and self.cf.hasPasswordAccess():
# find the kernel line, edit it and then boot
img = self.cf.images[self.selected_image]
for line in img.lines:
@@ -487,23 +478,18 @@ class Grub:
self.isdone = True
break
break
- elif c == ord('e'):
- # we disallow access without password specified
- if not self.cf.hasPasswordAccess():
- self.text_win.addstr(6, 8, "You have to enter GRUB password first")
- break
-
+ elif c == ord('e') and self.cf.hasPasswordAccess():
img = self.cf.images[self.selected_image]
self.edit_entry(img)
break
elif c == ord('p') and self.cf.hasPassword():
- self.text_win.addstr(6, 8, "Enter password: ")
+ self.text_win.addstr(6, 1, "Password: ")
pwd = self.text_win.getstr(6, 8)
if not self.cf.checkPassword(pwd):
- self.text_win.addstr(6, 8, "Incorrect password!")
+ self.text_win.addstr(6, 1, "Password: ")
+ self.text_win.addstr(7, 0, "Failed!")
self.cf.setPasswordAccess( False )
else:
- self.text_win.addstr(6, 8, "Access granted ")
self.cf.setPasswordAccess( True )
break
elif c in (curses.KEY_ENTER, ord('\n'), ord('\r')):

View File

@ -1,95 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1252327855 -3600
# Node ID a28c9c2fa8de05ebd0284f578289e96d2d15d574
# Parent b81e375e03922cd72d6e1404bc62a05059a4fe61
pygrub: trap exception when python module import fails
Fix the issue when importing 'crypt' module or crypt.crypt fails in
pygrub. The exception is written on the same line like "Failed!"
message but only if there is an exception. If there is no exception,
we don't bother users with details (probably the password they entered
was wrong) so we just display "Failed!" message. Also, the code for
hasPassword() was rewritten not to have try/except block here.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py
+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
@@ -158,6 +158,7 @@ class GrubConfigFile(object):
self.timeout = -1
self._default = 0
self.passwordAccess = True
+ self.passExc = None
if fn is not None:
self.parse()
@@ -197,7 +198,6 @@ class GrubConfigFile(object):
if self.commands.has_key(com):
if self.commands[com] is not None:
setattr(self, self.commands[com], arg.strip())
- #print "%s = %s => %s" % (com, self.commands[com], arg.strip() )
else:
logging.info("Ignored directive %s" %(com,))
else:
@@ -216,25 +216,28 @@ class GrubConfigFile(object):
self.passwordAccess = val
def hasPassword(self):
- try:
- getattr(self, self.commands['password'])
- return True
- except:
- return False
+ return hasattr(self, 'password')
def checkPassword(self, password):
- try:
- pwd = getattr(self, self.commands['password']).split()
- if pwd[0] == '--md5':
+ # Always allow if no password defined in grub.conf
+ if not self.hasPassword:
+ return True
+
+ # If we're here, we're having 'password' attribute set
+ pwd = getattr(self, 'password').split()
+
+ # We check whether password is in MD5 hash for comparison
+ if pwd[0] == '--md5':
+ try:
import crypt
if crypt.crypt(password, pwd[1]) == pwd[1]:
return True
+ except Exception, e:
+ self.passExc = "Can't verify password: %s" % str(e)
+ return False
- if pwd[0] == password:
- return True
-
- return False
- except:
+ # ... and if not, we compare it as a plain text
+ if pwd[0] == password:
return True
def set(self, line):
Index: xen-3.4.1-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/pygrub
+++ xen-3.4.1-testing/tools/pygrub/src/pygrub
@@ -487,7 +487,11 @@ class Grub:
pwd = self.text_win.getstr(6, 8)
if not self.cf.checkPassword(pwd):
self.text_win.addstr(6, 1, "Password: ")
- self.text_win.addstr(7, 0, "Failed!")
+ if self.cf.passExc is not None:
+ self.text_win.addstr(7, 0, "Exception: %s"
+ % self.cf.passExc)
+ else:
+ self.text_win.addstr(7, 0, "Failed!")
self.cf.setPasswordAccess( False )
else:
self.cf.setPasswordAccess( True )

View File

@ -1,42 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1253002894 -3600
# Node ID 67f1b8b3258591b979c441c6013af3c442063cc1
# Parent 045b2b8b522708093b91f883f1b7e7c1805f71e3
pygrub: Correct pygrub return value
This is the patch to correct pygrub return value for checkPassword()
function. It didn't return False at the end of the function. It
returned None so it was working fine and it's most likely just a
cosmetic issue.
Also, the missing () were added to checkPassword() function when
calling hasPassword and the unnecessary comment was removed.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Index: xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/src/GrubConf.py
+++ xen-3.4.1-testing/tools/pygrub/src/GrubConf.py
@@ -220,10 +220,9 @@ class GrubConfigFile(object):
def checkPassword(self, password):
# Always allow if no password defined in grub.conf
- if not self.hasPassword:
+ if not self.hasPassword():
return True
- # If we're here, we're having 'password' attribute set
pwd = getattr(self, 'password').split()
# We check whether password is in MD5 hash for comparison
@@ -240,6 +239,8 @@ class GrubConfigFile(object):
if pwd[0] == password:
return True
+ return False
+
def set(self, line):
(com, arg) = grub_exact_split(line, 2)
if self.commands.has_key(com):

View File

@ -1,10 +1,10 @@
Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2560,7 +2560,7 @@ class XendDomainInfo:
vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2863,7 +2863,7 @@ class XendDomainInfo:
self.guest_bitsize = self.image.getBitSize()
# Make sure there's enough RAM available for the domain
- balloon.free(memory + shadow + vtd_mem, self)
+ balloon.free(memory + shadow + vtd_mem + 512, self)

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/block.c
Index: xen-4.0.0-testing/tools/ioemu-remote/block.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/block.c
+++ xen-3.4.1-testing/tools/ioemu-remote/block.c
@@ -347,7 +347,7 @@ int bdrv_file_open(BlockDriverState **pb
--- 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)
{
@ -11,7 +11,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/block.c
}
int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
@@ -416,12 +416,13 @@ int bdrv_open2(BlockDriverState *bs, con
@@ -419,12 +419,13 @@ int bdrv_open2(BlockDriverState *bs, con
}
bs->drv = drv;
bs->opaque = qemu_mallocz(drv->instance_size);
@ -28,10 +28,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/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-3.4.1-testing/tools/ioemu-remote/hw/usb-msd.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/usb-msd.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/usb-msd.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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-3.4.1-testing/tools/ioemu-remote/hw/usb-msd.c
goto fail;
s->bs = bdrv;
*pbs = bdrv;
Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-img.c
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-img.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-img.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -227,6 +227,7 @@ static int open_disk(struct td_state *s,
--- 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
@@ -225,6 +225,7 @@ static int open_disk(struct td_state *s,
BlockDriver* drv;
char* devname;
static int devnumber = 0;
@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
int i;
DPRINTF("Opening %s as blktap%d\n", path, devnumber);
@@ -249,7 +250,7 @@ static int open_disk(struct td_state *s,
@@ -247,7 +248,7 @@ static int open_disk(struct td_state *s,
DPRINTF("%s driver specified\n", drv ? drv->format_name : "No");
/* Open the image */
@ -19,33 +19,33 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
fprintf(stderr, "Could not open image file %s\n", path);
return -ENOMEM;
}
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -64,7 +64,8 @@ static void insert_media(void *opaque)
for (i = 0; i < MAX_DRIVES + 1; i++) {
bs = drives_table[i].bdrv;
if (media_filename[i] && bs && bs->filename[0] == '\0') {
- bdrv_open2(bs, media_filename[i], 0, &bdrv_raw);
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -133,7 +133,8 @@ static void insert_media(void *opaque)
else
format = &bdrv_raw;
- bdrv_open2(bs, media_filename[i], 0, format);
+ /* Temporary BDRV_O_RDWR */
+ bdrv_open2(bs, media_filename[i], BDRV_O_RDWR, &bdrv_raw);
pstrcpy(bs->filename, sizeof(bs->filename), media_filename[i]);
free(media_filename[i]);
media_filename[i] = NULL;
@@ -314,9 +315,9 @@ void xenstore_parse_domain_config(int hv
+ bdrv_open2(bs, media_filename[i], BDRV_O_RDWR, format);
#ifdef CONFIG_STUBDOM
{
char *buf, *backend, *params_path, *params;
@@ -397,9 +398,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, any_hdN = 0, ret, is_tap;
+ int i, j, any_hdN = 0, ret, is_tap, flags;
- 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;
@@ -378,7 +379,8 @@ void xenstore_parse_domain_config(int hv
@@ -461,7 +462,8 @@ void xenstore_parse_domain_config(int hv
}
for (i = 0; i < num; i++) {
@ -55,8 +55,8 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
/* read the backend path */
xenstore_get_backend_path(&bpath, "vbd", danger_path, hvm_domid, e_danger[i]);
if (bpath == NULL)
@@ -464,6 +466,17 @@ void xenstore_parse_domain_config(int hv
format = &bdrv_raw;
@@ -560,6 +562,17 @@ void xenstore_parse_domain_config(int hv
}
}
+ /* read the mode of the device */
@ -73,21 +73,21 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
#if 0
/* Phantom VBDs are disabled because the use of paths
* from guest-controlled areas in xenstore is unsafe.
@@ -509,7 +522,7 @@ void xenstore_parse_domain_config(int hv
@@ -612,7 +625,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;
- if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
+ if (bdrv_open2(bs, danger_buf, flags|BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
pstrcpy(bs->filename, sizeof(bs->filename), params);
} else
#endif
@@ -535,7 +548,7 @@ void xenstore_parse_domain_config(int hv
}
#else
@@ -641,7 +654,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) {
- 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");
} else {
char* snapshot = get_snapshot_name(atoi(e_danger[i]));
}

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c
Index: xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c
@@ -0,0 +1,536 @@
+++ xen-4.0.0-testing/tools/blktap/drivers/block-cdrom.c
@@ -0,0 +1,535 @@
+/* block-cdrom.c
+ *
+ * simple slow synchronous cdrom disk implementation. Based off
@ -42,7 +42,6 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <linux/cdrom.h>
+#include <sys/statvfs.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
@ -539,11 +538,11 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/block-cdrom.c
+ .td_get_parent_id = tdcdrom_get_parent_id,
+ .td_validate_parent = tdcdrom_validate_parent
+};
Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h
Index: xen-4.0.0-testing/xen/include/public/io/cdromif.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/include/public/io/cdromif.h
@@ -0,0 +1,120 @@
+++ xen-4.0.0-testing/xen/include/public/io/cdromif.h
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * cdromif.h
+ *
@ -574,6 +573,8 @@ Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h
+#ifndef __XEN_PUBLIC_IO_CDROMIF_H__
+#define __XEN_PUBLIC_IO_CDROMIF_H__
+
+#include <linux/cdrom.h>
+
+/*
+ * Queries backend for CDROM support
+ */
@ -664,23 +665,23 @@ Index: xen-3.4.1-testing/xen/include/public/io/cdromif.h
+ sizeof(struct vcd_generic_command) - sizeof(struct request_sense))
+
+#endif
Index: xen-3.4.1-testing/tools/blktap/drivers/Makefile
Index: xen-4.0.0-testing/tools/blktap/drivers/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/drivers/Makefile
+++ xen-3.4.1-testing/tools/blktap/drivers/Makefile
@@ -20,8 +20,9 @@ CRYPT_LIB := -lcrypto
$(warning === libgcrypt not installed: falling back to libcrypto ===)
--- 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
-LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap
-LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm
-LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz
+LDFLAGS_xen := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore)
+LDFLAGS_blktapctrl := $(LDFLAGS_xen) -L../lib -lblktap
+LDFLAGS_blktapctrl := $(LDFLAGS_xen) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm
+LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz $(LDFLAGS_xen)
BLK-OBJS-y := block-aio.o
BLK-OBJS-y += block-sync.o
@@ -29,6 +30,7 @@ BLK-OBJS-y += block-vmdk.o
@@ -37,6 +38,7 @@ BLK-OBJS-y += block-vmdk.o
BLK-OBJS-y += block-ram.o
BLK-OBJS-y += block-qcow.o
BLK-OBJS-y += block-qcow2.o
@ -688,10 +689,10 @@ Index: xen-3.4.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-3.4.1-testing/tools/blktap/drivers/tapdisk.h
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-3.4.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,
@ -736,11 +737,11 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h
};
typedef struct driver_list_entry {
Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h
Index: xen-4.0.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.4.1-testing/tools/blktap/lib/blktaplib.h
@@ -220,6 +220,7 @@ typedef struct msg_pid {
--- xen-4.0.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-4.0.0-testing/tools/blktap/lib/blktaplib.h
@@ -219,6 +219,7 @@ typedef struct msg_pid {
#define DISK_TYPE_RAM 3
#define DISK_TYPE_QCOW 4
#define DISK_TYPE_QCOW2 5
@ -748,10 +749,10 @@ Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h
/* xenstore/xenbus: */
#define DOMNAME "Domain-0"
Index: xen-3.4.1-testing/xen/include/public/io/blkif.h
Index: xen-4.0.0-testing/xen/include/public/io/blkif.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/public/io/blkif.h
+++ xen-3.4.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!
*/
@ -763,10 +764,10 @@ Index: xen-3.4.1-testing/xen/include/public/io/blkif.h
/*
* Maximum scatter/gather segments per request.
Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.c
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.c
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.c
+++ xen-3.4.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;
}
@ -790,15 +791,15 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.c
default:
DPRINTF("Unknown block operation\n");
break;
Index: xen-3.4.1-testing/tools/python/xen/xend/server/BlktapController.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/BlktapController.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/BlktapController.py
+++ xen-3.4.1-testing/tools/python/xen/xend/server/BlktapController.py
@@ -14,6 +14,7 @@ blktap_disk_types = [
--- 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',
'qcow2',
+ 'cdrom',
'ioemu',
'tapdisk',
]

View File

@ -1,11 +1,11 @@
bug #239173
bug #242953
Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2940,7 +2940,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
@@ -3262,7 +3262,7 @@ class XendDomainInfo:
(fn, BOOTLOADER_LOOPBACK_DEVICE))
vbd = {
@ -14,23 +14,23 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
'device': BOOTLOADER_LOOPBACK_DEVICE,
}
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -311,9 +311,9 @@ void xenstore_parse_domain_config(int hv
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -396,9 +396,9 @@ void xenstore_parse_domain_config(int hv
{
char **e_danger = NULL;
char *buf = NULL;
- char *fpath = NULL, *bpath = NULL,
+ char *fpath = NULL, *bpath = NULL, *btype = NULL,
*dev = NULL, *params = NULL, *drv = NULL;
- int i, any_hdN = 0, ret;
+ int i, any_hdN = 0, ret, is_tap;
- int i, ret;
+ int i, ret, is_tap;
unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs;
BlockDriver *format;
@@ -353,6 +353,14 @@ void xenstore_parse_domain_config(int hv
@@ -438,6 +438,14 @@ void xenstore_parse_domain_config(int hv
e_danger[i]);
if (bpath == NULL)
continue;
@ -45,7 +45,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
/* read the name of the device */
if (pasprintf(&buf, "%s/dev", bpath) == -1)
continue;
@@ -662,6 +670,7 @@ void xenstore_parse_domain_config(int hv
@@ -712,6 +720,7 @@ void xenstore_parse_domain_config(int hv
free(danger_type);
free(params);
free(dev);

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/blktap/drivers/tapdisk.h
Index: xen-4.0.0-testing/tools/blktap/drivers/tapdisk.h
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-3.4.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",

255
block-dmmd Normal file
View File

@ -0,0 +1,255 @@
#! /bin/bash
# Usage: block-dmmd [add args | remove args]
#
# the xm config file should have something like:
# dmmd:md;/dev/md0;md;/dev/md1;lvm;/dev/vg1/lv1
# or
# dmmd:lvm;/dev/vg1/lv1;lvm;/dev/vg1/lv2;md;/dev/md0
# note the last device will be used for VM
# History:
# 2009-06-09, mh@novell.com:
# Emit debugging messages into a temporary file; if no longer needed,
# just comment the exec I/O redirection below
# Make variables used in functions local to avoid global overridings
# Use vgscan and vgchange where required
# Use the C locale to avoid dealing with localized messages
# Assign output from assembling an MD device to a variable to aid debugging
# We do not want to deal with localized messages:
LANG=C
LC_MESSAGES=C
export LANG LC_MESSAGES
dir=$(dirname "$0")
. "$dir/block-common.sh"
#exec >> /tmp/block-dmmd-`date +%F_%T.%N`.log 2>&1
echo ""
date
set -x
echo shell-flags: $-
command=$1
# We check for errors ourselves:
set +e
function run_mdadm()
{
local mdadm_cmd=$1
local msg
local rc
msg="`/sbin/mdadm $mdadm_cmd 2>&1`"
rc=$?
case "$msg" in
*"has been started"* | *"already active"* )
return 0
;;
*"is already in use"* )
: hmm, might be used by another device in this domU
: leave it to upper layers to detect a real error
return 2
;;
* )
return $rc
;;
esac
return 1
}
function activate_md()
{
local par=$1
local already_active=0 cfg dev rc t
if [ ${par} = ${par%%(*} ]; then
# No configuration file specified:
dev=$par
cfd=
else
dev=${par%%(*}
t=${par#*(}
cfg="-c ${t%%)*}"
fi
if /sbin/mdadm -Q -D $dev; then
already_active=1
fi
run_mdadm "-A $dev $cfg"
rc=$?
if [ $already_active -eq 1 ] && [ $rc -eq 2 ]; then
return 0
fi
return $rc
}
function deactivate_md ()
{
local par=$1 # Make it explicitly local
## We need the device name only while deactivating
/sbin/mdadm -S ${par%%(*}
return $?
}
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/lvchange -ay $1
return $?
}
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%/*} || :
# Maybe we need to cleanup the LVM cache:
/sbin/vgscan --mknodes || :
return 0
fi
return 1
}
BP=100
SP=$BP
VBD=
declare -a stack
function push ()
{
if [ -z "$1" ]; then
return
fi
let "SP -= 1"
stack[$SP]="${1}"
return
}
function pop ()
{
VBD=
if [ "$SP" -eq "$BP" ]; then
return
fi
VBD=${stack[$SP]}
let "SP += 1"
return
}
function activate_dmmd ()
{
# echo $1 $2
case $1 in
md)
activate_md $2
return
;;
lvm)
activate_lvm $2
return
;;
esac
}
function deactivate_dmmd()
{
case "$1" in
md)
deactivate_md $2
return
;;
lvm)
deactivate_lvm $2
return
;;
esac
}
function cleanup_stack ()
{
while [ 1 ]; do
pop
if [ -z "$VBD" ]; then
break
fi
deactivate_dmmd $VBD
done
return
}
function parse_par ()
{
local ac par rc s t # Make these explicitly local vars
ac=$1
par="$2"
echo "parse_paring $1, $2"
par="$par;"
while [ 1 ]; do
t=${par%%;*}
if [ -z "$t" ]; then
return 0
fi
par=${par#*;}
s=${par%%;*}
if [ -z "$s" ]; then
return 1
fi
par=${par#*;}
echo "type is $t, dev is $s"
if [ "$ac" = "activate" ]; then
activate_dmmd $t $s
rc=$?
if [ $rc -ne 0 ]; then
return 1
fi
fi
echo "push $t $s"
push "$t $s"
done
}
echo $command
case "$command" in
add)
p=`xenstore-read $XENBUS_PATH/params` || true
claim_lock "dmmd"
dmmd=$p
echo "before parse_par $dmmd"
parse_par activate "$dmmd"
rc=$?
echo "reach here with rc: $rc"
if [ $rc -ne 0 ]; then
cleanup_stack
release_lock "dmmd"
exit 1
fi
claim_lock "block"
xenstore-write $XENBUS_PATH/node ${dmmd##*;}
write_dev ${dmmd##*;}
release_lock "block"
release_lock "dmmd"
exit 0
;;
remove)
p=`xenstore-read $XENBUS_PATH/params` || true
claim_lock "dmmd"
dmmd=$p
parse_par noactivate "$dmmd"
cleanup_stack
release_lock "dmmd"
exit 0
;;
esac

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/block
Index: xen-3.5.0-testing/tools/hotplug/Linux/block
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/block
+++ xen-3.4.1-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
;;

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/block
Index: xen-3.5.0-testing/tools/hotplug/Linux/block
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/block
+++ xen-3.4.1-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

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.4.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
@@ -241,6 +241,9 @@ op_start () {
return
fi

View File

@ -1,82 +0,0 @@
Add support for "hostonly" xen bridges.
Add support for "hostonly" networking, i.e. create a bridge without a
physical network device linked in. The virtual machines can see each
other and the host, but can't (directly) talk to the outside. Pass
"netdev=none" to the network-bridge script to activate this.
I'm using this on a laptop which has different network connections at
different times (wired / wireless), so it is inconvinient to add the
physical device into the bridge. In case the laptop is offline the
virtual network still works just fine. It also avoids the problem that
bridging doesn't work with wireless due to being limited to one mac
address then.
dom0 on that laptop also runs a dhcp server for the virtual network.
Guests can talk to the internet via apache configured as http proxy.
Another possible approach for guest internet access is NATing the
virtual network.
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
---
tools/examples/network-bridge | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
Index: xen-3.4.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-3.4.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.4.0-testing/tools/hotplug/Linux/network-bridge
@@ -316,6 +316,31 @@ op_stop () {
for vlan in $vlans ; do ifup $vlan ; done
}
+op_start_hostonly () {
+ if [ "${bridge}" = "null" ] ; then
+ return
+ fi
+ if link_exists "${bridge}"; then
+ return
+ fi
+
+ create_bridge ${bridge}
+ setup_bridge_port ${vif0}
+ add_to_bridge ${bridge} ${vif0}
+}
+
+op_stop_hostonly () {
+ if [ "${bridge}" = "null" ]; then
+ return
+ fi
+ if ! link_exists "$bridge"; then
+ return
+ fi
+
+ brctl delbr ${bridge}
+}
+
+
# adds $dev to $bridge but waits for $dev to be in running state first
add_to_bridge2() {
local bridge=$1
@@ -341,11 +366,19 @@ add_to_bridge2() {
case "$command" in
start)
- op_start
+ if test "$netdev" = "none"; then
+ op_start_hostonly
+ else
+ op_start
+ fi
;;
stop)
- op_stop
+ if test "$netdev" = "none"; then
+ op_stop_hostonly
+ else
+ op_stop
+ fi
;;
status)

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.4.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
@@ -262,18 +262,18 @@ op_stop () {
transfer_addrs ${bridge} ${pdev}
if ! ifdown ${bridge}; then

View File

@ -1,15 +1,15 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-3.5.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
--- xen-3.5.0-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.5.0-testing/tools/hotplug/Linux/network-bridge
@@ -249,6 +249,11 @@ op_start () {
create_bridge ${tdev}
+ # Record creation of bridge in /dev/shm/sysconfig/xenbridges so other
+ # Record creation of bridge in /dev/.sysconfig/network/xenbridges so other
+ # tools, e.g. yast2 lan, know that Xen bridging is active.
+ [ -d /dev/shm/sysconfig/xenbridges ] || mkdir /dev/shm/sysconfig/xenbridges
+ touch /dev/shm/sysconfig/xenbridges/${bridge}
+ [ -d /dev/.sysconfig/network/xenbridges ] || mkdir /dev/.sysconfig/network/xenbridges
+ touch /dev/.sysconfig/network/xenbridges/${bridge}
+
preiftransfer ${netdev}
transfer_addrs ${netdev} ${tdev}
@ -18,11 +18,11 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}
+ # Remove record of bridge from /dev/shm/sysconfig/xenbridges ...
+ rm -f /dev/shm/sysconfig/xenbridges/${bridge}
+ # Remove record of bridge from /dev/.sysconfig/network/xenbridges ...
+ rm -f /dev/.sysconfig/network/xenbridges/${bridge}
+ # ... and directory itself if empty
+ if [ -z "$(ls -A /dev/shm/sysconfig/xenbridges 2>/dev/null)" ]; then
+ rmdir /dev/shm/sysconfig/xenbridges
+ if [ -z "$(ls -A /dev/.sysconfig/network/xenbridges 2>/dev/null)" ]; then
+ rmdir /dev/.sysconfig/network/xenbridges
+ fi
+
for vlan in $vlans ; do ifup $vlan ; done

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-bridge
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-bridge
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-bridge
+++ xen-3.4.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
@@ -191,6 +191,28 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT
}

View File

@ -15,25 +15,26 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
tapdisk-ioemu.c | 17 -----------------
4 files changed, 17 insertions(+), 26 deletions(-)
Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile
Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile
+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile
@@ -46,13 +46,6 @@ $(filter %-user,$(SUBDIR_RULES)): libqem
--- 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)
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include
-CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
-CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
-CPPFLAGS += -I$(XEN_ROOT)/tools/include
-
-tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
- $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
-
#######################################################################
# BLOCK_OBJS is code used by both qemu system emulation and qemu-img
@@ -71,6 +64,21 @@ endif
@@ -72,6 +64,21 @@ endif
BLOCK_OBJS += block-raw-posix.o
endif
@ -55,10 +56,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/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-3.4.1-testing/tools/ioemu-remote/configure
Index: xen-4.0.0-testing/tools/ioemu-remote/configure
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/configure
+++ xen-3.4.1-testing/tools/ioemu-remote/configure
--- xen-4.0.0-testing.orig/tools/ioemu-remote/configure
+++ xen-4.0.0-testing/tools/ioemu-remote/configure
@@ -1508,7 +1508,7 @@ bsd)
;;
esac
@ -68,10 +69,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/configure
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
tools="qemu-img\$(EXESUF) $tools"
if [ "$linux" = "yes" ] ; then
Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-tool.c
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-tool.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-tool.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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);
}
@ -81,10 +82,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-tool.c
IOCanRWHandler *fd_read_poll,
IOHandler *fd_read,
IOHandler *fd_write,
Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c
Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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,7 +1,7 @@
Index: xen-3.4.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-3.4.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-3.4.1-testing/tools/python/xen/xend/server/HalDaemon.py
+ print 'Falling off end'
+
+
Index: xen-3.4.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-3.4.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-3.4.1-testing/tools/python/xen/xend/server/Hald.py
+ watcher.run()
+ time.sleep(10)
+ watcher.shutdown()
Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvServer.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvServer.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-3.4.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,13 +397,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvServer.py
def create():
root = SrvDir()
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -503,6 +503,19 @@ void xenstore_parse_domain_config(int hv
if (bdrv_open2(bs, params, 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");
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -513,6 +513,19 @@ void xenstore_parse_domain_config(int hv
params = newparams;
format = &bdrv_raw;
}
+ /* if cdrom pyhsical put a watch on media-present */
+ if (bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM) {
@ -419,9 +419,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
+ }
+ }
drives_table[nb_drives].bdrv = bs;
drives_table[nb_drives].used = 1;
@@ -920,6 +933,50 @@ void xenstore_record_dm_state(const char
#if 0
/* Phantom VBDs are disabled because the use of paths
@@ -938,6 +951,50 @@ void xenstore_record_dm_state(const char
xenstore_record_dm("state", state);
}
@ -472,9 +472,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
void xenstore_process_event(void *opaque)
{
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
@@ -939,6 +996,11 @@ void xenstore_process_event(void *opaque
goto out;
}
@@ -968,6 +1025,11 @@ void xenstore_process_event(void *opaque
xenstore_watch_callbacks[i].cb(vec[XS_WATCH_TOKEN],
xenstore_watch_callbacks[i].opaque);
+ if (!strcmp(vec[XS_WATCH_TOKEN], "media-present")) {
+ xenstore_process_media_change_event(vec);

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -151,7 +151,7 @@ def save(fd, dominfo, network, live, dst
--- 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()
try:

View File

@ -1,8 +1,8 @@
Index: xen-3.4.0-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-3.4.0-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-3.4.0-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -301,6 +301,11 @@ static int __devinit platform_pci_init(s
--- 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
@@ -363,6 +363,11 @@ static int __devinit platform_pci_init(s
platform_mmio = mmio_addr;
platform_mmiolen = mmio_len;

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/xen/arch/x86/domain.c
Index: xen-4.0.0-testing/xen/arch/x86/domain.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/domain.c
+++ xen-3.4.1-testing/xen/arch/x86/domain.c
--- xen-4.0.0-testing.orig/xen/arch/x86/domain.c
+++ xen-4.0.0-testing/xen/arch/x86/domain.c
@@ -143,7 +143,7 @@ void dump_pageframe_info(struct domain *
printk("Memory pages belonging to domain %u:\n", d->domain_id);

View File

@ -87,6 +87,7 @@ class Wholedisk:
self.mapped = 0
self.partitions = []
self.pcount = 0
self.lvm = False
# Finish initialization; may raise:
self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE]))
self.pcount = self.scanpartitions()
@ -104,6 +105,8 @@ class Wholedisk:
for part in self.partitions:
if vdev == part.vdev:
return part
if len(self.partitions):
return self.partitions[0]
return None
def loopsetup(self):
@ -153,12 +156,38 @@ class Wholedisk:
time.sleep(0.1)
retries -= 1
def scanlvmpartitions(self):
pcount = 0
verbose_print("vgchange -ay '%s'" % (self.vdev))
ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8
if not ret:
self.lvm = True
verbose_print("lvscan | grep '/dev/%s'" % (self.vdev))
fd = os.popen("lvscan | grep '/dev/%s'" % (self.vdev))
for line in fd.readlines():
line = line.strip()
(t1, lvname, t2) = line.split('\'')
pname = lvname[lvname.rfind('/')+1:]
pname = pname.strip()
pname = "/dev/mapper/" + self.vdev + "-" + pname
verbose_print("Found partition: vdev %s, pdev %s" % (self.vdev, pname))
self.partitions.append(Partition(self, self.vdev, pname))
pcount += 1
fd.close()
verbose_print("vgchange -an '%s'" % (self.vdev))
os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev))
else:
verbose_print("vgchange -ay %s ... failed: -%d" % (self.vdev, ret))
return pcount
def scanpartitions(self):
"""Scan device for partitions (kpartx -l) and set up data structures,
Returns number of partitions found."""
self.loopsetup()
# TODO: We could use fdisk -l instead and look at the type of
# partitions; this way we could also detect LVM and support it.
verbose_print("kpartx %s -l '%s'" % (kpartx_args, self.physdev()))
fd = os.popen("kpartx %s -l '%s'" % (kpartx_args, self.physdev()))
pcount = 0
for line in fd.readlines():
@ -175,6 +204,12 @@ class Wholedisk:
self.partitions.append(Partition(self, '%s%i' % (self.vdev, pno), pname))
pcount += 1
fd.close()
# Try lvm
if not pcount:
pcount = self.scanlvmpartitions()
# Add self to partition table
if not pcount:
if self.ldev:
ref = self
@ -185,12 +220,19 @@ class Wholedisk:
def activatepartitions(self):
"Set up loop mapping and device-mapper mappings"
verbose_print("activatepartitions")
if not self.mapped:
self.loopsetup()
if self.pcount:
verbose_print("kpartx %s -a '%s'" % (kpartx_args, self.physdev()))
fd = os.popen("kpartx %s -a '%s'" % (kpartx_args, self.physdev()))
fd.close()
if self.pcount and self.lvm:
verbose_print("vgchange -ay '%s'" % (self.vdev))
ret = os.system("vgchange -ay '%s' > /dev/null 2>&1" % (self.vdev)) >> 8
if not ret:
verbose_print("lvchange -ay '%s'" % (self.vdev))
os.system("lvchange -ay '%s' > /dev/null 2>&1" % (self.vdev))
self.mapped += 1
def deactivatepartitions(self):
@ -198,6 +240,7 @@ class Wholedisk:
Will never raise.
"""
verbose_print("deactivatepartitions")
if not self.mapped:
return
self.mapped -= 1
@ -206,6 +249,17 @@ class Wholedisk:
verbose_print("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
fd = os.popen("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
fd.close()
if self.pcount and self.lvm:
verbose_print("lvchange -an '%s'" % (self.vdev))
ret = os.system("lvchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8
if ret:
time.sleep(0.3)
os.system("lvchange -an '/dev/%s' > /dev/null 2>&1" % (self.vdev))
verbose_print("vgchange -an '%s'" % (self.vdev))
ret = os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8
if ret:
time.sleep(0.3)
os.system("vgchange -an '%s' > /dev/null 2>&1" % (self.vdev))
self.loopclean()
def __del__(self):
@ -375,7 +429,9 @@ def main(argv):
"Help output (usage info)"
global verbose, quiet, dryrun
print >> sys.stderr, "domUloader usage: domUloader [--output=fd] [--quiet] [--dryrun] [--verbose]\n" +\
"[--args] [--help] --entry=dev:kernel[,ramdisk] physdisk [virtdisk]\n"
"[--args] [--help] --entry=dev:kernel[,ramdisk] physdisk [virtdisk]\n" +\
"\n" +\
"dev format: hd[a-p][0-9]*, xvd[a-p][0-9]*, LVM-vgname-lvname\n"
print >> sys.stderr, __doc__
try:
@ -432,6 +488,8 @@ def main(argv):
os.chmod(tmpdir, 0750)
vdev, kernel, ramdisk = parseEntry(entry)
if vdev[:vdev.find('-')] == "LVM":
vdev = vdev.split('-')[1]
if not vdisk:
vdisk = getWholedisk(vdev)
verbose_print("vdisk not specified; guessing '%s' based on '%s'" % (vdisk, vdev))

View File

@ -1,8 +1,6 @@
Index: xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/ia64/linux-xen/smp.c
+++ xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c
@@ -190,7 +190,7 @@ handle_IPI (int irq, void *dev_id, struc
--- 2010-01-06.orig/xen/arch/ia64/linux-xen/smp.c 2009-05-27 13:54:05.000000000 +0200
+++ 2010-01-06/xen/arch/ia64/linux-xen/smp.c 2010-01-06 11:22:12.000000000 +0100
@@ -189,7 +189,7 @@ handle_IPI (int irq, void *dev_id, struc
* At this point the structure may be gone unless
* wait is true.
*/
@ -11,35 +9,31 @@ Index: xen-3.4.1-testing/xen/arch/ia64/linux-xen/smp.c
/* Notify the sending CPU that the task is done. */
mb();
Index: xen-3.4.1-testing/xen/arch/x86/smp.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/smp.c
+++ xen-3.4.1-testing/xen/arch/x86/smp.c
@@ -356,7 +356,7 @@ fastcall void smp_call_function_interrup
--- 2010-01-06.orig/xen/arch/x86/smp.c 2009-08-19 17:01:49.000000000 +0200
+++ 2010-01-06/xen/arch/x86/smp.c 2010-01-06 11:22:12.000000000 +0100
@@ -394,7 +394,7 @@ static void __smp_call_function_interrup
if ( call_data->wait )
if ( call_data.wait )
{
- (*func)(info);
+ (*func)(info ?: regs);
+ (*func)(info ?: get_irq_regs());
mb();
atomic_inc(&call_data->finished);
atomic_inc(&call_data.finished);
}
@@ -364,7 +364,7 @@ fastcall void smp_call_function_interrup
@@ -402,7 +402,7 @@ static void __smp_call_function_interrup
{
mb();
atomic_inc(&call_data->started);
atomic_inc(&call_data.started);
- (*func)(info);
+ (*func)(info ?: regs);
+ (*func)(info ?: get_irq_regs());
}
irq_exit();
Index: xen-3.4.1-testing/xen/common/keyhandler.c
===================================================================
--- xen-3.4.1-testing.orig/xen/common/keyhandler.c
+++ xen-3.4.1-testing/xen/common/keyhandler.c
@@ -91,14 +91,25 @@ static void show_handlers(unsigned char
key_table[i].desc);
}
--- 2010-01-06.orig/xen/common/keyhandler.c 2009-12-16 09:14:13.000000000 +0100
+++ 2010-01-06/xen/common/keyhandler.c 2010-01-06 11:22:12.000000000 +0100
@@ -72,14 +72,25 @@ static struct keyhandler show_handlers_k
.desc = "show this message"
};
-static void __dump_execstate(void *unused)
+static void __dump_execstate(void *_regs)
@ -67,7 +61,7 @@ Index: xen-3.4.1-testing/xen/common/keyhandler.c
}
static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
@@ -111,14 +122,12 @@ static void dump_registers(unsigned char
@@ -93,14 +104,12 @@ static void dump_registers(unsigned char
printk("'%c' pressed -> dumping registers\n", key);
/* Get local execution state out immediately, in case we get stuck. */
@ -80,13 +74,11 @@ Index: xen-3.4.1-testing/xen/common/keyhandler.c
if ( cpu == smp_processor_id() )
continue;
- printk("\n*** Dumping CPU%d host state: ***\n", cpu);
on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1);
on_selected_cpus(cpumask_of(cpu), __dump_execstate, NULL, 1);
}
Index: xen-3.4.1-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h
+++ xen-3.4.1-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
--- 2010-01-06.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h 2009-05-20 08:46:00.000000000 +0200
+++ 2010-01-06/xen/include/asm-ia64/linux-xen/asm/ptrace.h 2010-01-06 11:22:12.000000000 +0100
@@ -278,7 +278,7 @@ struct switch_stack {
# define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
# define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr)

View File

@ -1,27 +1,29 @@
Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c
Index: xen-4.0.0-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -888,14 +888,14 @@ static PyObject *pyxc_hvm_build(XcObject
--- 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
@@ -914,15 +914,15 @@ static PyObject *pyxc_hvm_build(XcObject
int i;
#endif
char *image;
- int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
+ int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, extid = 0;
uint64_t vcpu_avail = 1;
static char *kwd_list[] = { "domid",
- "memsize", "image", "target", "vcpus", "acpi",
+ "memsize", "image", "target", "vcpus", "extid", "acpi",
"apic", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
- "memsize", "image", "target", "vcpus",
- "vcpu_avail", "acpi", "apic", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iilii", kwd_list,
+ "memsize", "image", "target", "vcpus",
+ "vcpu_avail", "extid", "acpi", "apic", NULL };
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiliii", kwd_list,
&dom, &memsize, &image, &target, &vcpus,
- &acpi, &apic) )
+ &extid, &acpi, &apic) )
- &vcpu_avail, &acpi, &apic) )
+ &vcpu_avail, &extid, &acpi, &apic) )
return NULL;
if ( target == -1 )
@@ -921,6 +921,7 @@ static PyObject *pyxc_hvm_build(XcObject
@@ -950,6 +950,7 @@ static PyObject *pyxc_hvm_build(XcObject
va_hvm->checksum -= sum;
munmap(va_map, XC_PAGE_SIZE);
#endif
@ -29,51 +31,51 @@ Index: xen-3.4.1-testing/tools/python/xen/lowlevel/xc/xc.c
return Py_BuildValue("{}");
}
Index: xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py
@@ -143,6 +143,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'monitor': int,
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
@@ -150,6 +150,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'nographic': int,
'nomigrate': int,
'pae' : int,
+ 'extid': int,
'rtc_timeoffset': int,
'parallel': str,
'serial': str,
'sdl': int,
Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
Index: xen-4.0.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.4.1-testing/tools/python/xen/xend/image.py
@@ -762,6 +762,7 @@ class HVMImageHandler(ImageHandler):
--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.0-testing/tools/python/xen/xend/image.py
@@ -841,6 +841,7 @@ class HVMImageHandler(ImageHandler):
self.apic = int(vmConfig['platform'].get('apic', 0))
self.acpi = int(vmConfig['platform'].get('acpi', 0))
+ self.extid = int(vmConfig['platform'].get('extid', 0))
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
@@ -878,6 +879,7 @@ class HVMImageHandler(ImageHandler):
log.debug("memsize = %d", memmax_mb)
self.memory_sharing = int(vmConfig['memory_sharing'])
xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
@@ -966,6 +967,7 @@ class HVMImageHandler(ImageHandler):
log.debug("target = %d", mem_mb)
log.debug("vcpus = %d", self.vm.getVCpuCount())
log.debug("vcpu_avail = %li", self.vm.getVCpuAvail())
+ log.debug("extid = %d", self.extid)
log.debug("acpi = %d", self.acpi)
log.debug("apic = %d", self.apic)
@@ -886,6 +888,7 @@ class HVMImageHandler(ImageHandler):
memsize = memmax_mb,
@@ -975,6 +977,7 @@ class HVMImageHandler(ImageHandler):
target = mem_mb,
vcpus = self.vm.getVCpuCount(),
vcpu_avail = self.vm.getVCpuAvail(),
+ extid = self.extid,
acpi = self.acpi,
apic = self.apic)
rc['notes'] = { 'SUSPEND_CANCEL': 1 }
Index: xen-3.4.1-testing/tools/python/xen/xm/create.py
Index: xen-4.0.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.4.1-testing/tools/python/xen/xm/create.py
@@ -229,6 +229,10 @@ gopts.var('viridian', val='VIRIDIAN',
--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-4.0.0-testing/tools/python/xen/xm/create.py
@@ -242,6 +242,10 @@ gopts.var('viridian', val='VIRIDIAN',
use="""Expose Viridian interface to x86 HVM guest?
(Default is 0).""")
@ -84,12 +86,12 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/create.py
gopts.var('acpi', val='ACPI',
fn=set_int, default=1,
use="Disable or enable ACPI of HVM domain.")
@@ -925,7 +929,7 @@ def configure_vifs(config_devs, vals):
def configure_hvm(config_image, vals):
"""Create the config for HVM devices.
"""
- args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb', 'timer_mode',
+ args = [ 'device_model', 'pae', 'extid', 'vcpus', 'boot', 'fda', 'fdb', 'timer_mode',
'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
@@ -1077,7 +1081,7 @@ def configure_hvm(config_image, vals):
'timer_mode',
'usb', 'usbdevice',
'vcpus', 'vnc', 'vncconsole', 'vncdisplay', 'vnclisten',
- 'vncunused', 'viridian', 'vpt_align',
+ 'vncunused', 'viridian', 'extid', 'vpt_align',
'xauthority', 'xen_extended_power_mgmt', 'xen_platform_pci',
'memory_sharing' ]

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hyperv/hv_intercept.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hyperv/hv_intercept.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
@@ -33,6 +33,7 @@
#include <asm/config.h>
@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/apicdef.h>
@@ -987,8 +988,15 @@ hyperv_do_wr_msr(uint32_t idx, struct cp
@@ -988,8 +989,15 @@ hyperv_do_wr_msr(uint32_t idx, struct cp
break;
case HV_MSR_APIC_ASSIST_PAGE:
/*

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h
Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/domain.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/hvm/domain.h
+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h
@@ -89,6 +89,7 @@ struct hvm_domain {
--- 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
@@ -98,6 +98,7 @@ struct hvm_domain {
struct vmx_domain vmx;
struct svm_domain svm;
};
@ -10,22 +10,22 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/domain.h
};
#endif /* __ASM_X86_HVM_DOMAIN_H__ */
Index: xen-3.4.1-testing/xen/arch/x86/hvm/Makefile
Index: xen-4.0.0-testing/xen/arch/x86/hvm/Makefile
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/Makefile
+++ xen-3.4.1-testing/xen/arch/x86/hvm/Makefile
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/Makefile
+++ xen-4.0.0-testing/xen/arch/x86/hvm/Makefile
@@ -1,5 +1,6 @@
subdir-y += svm
subdir-y += vmx
+subdir-$(x86_64) += hyperv
obj-y += asid.o
obj-y += emulate.o
obj-y += hvm.o
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
@@ -46,6 +46,7 @@
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
@@ -48,6 +48,7 @@
#include <asm/mc146818rtc.h>
#include <asm/spinlock.h>
#include <asm/hvm/hvm.h>
@ -33,7 +33,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
#include <asm/hvm/vpt.h>
#include <asm/hvm/support.h>
#include <asm/hvm/cacheattr.h>
@@ -377,6 +378,7 @@ void hvm_domain_relinquish_resources(str
@@ -461,6 +462,7 @@ void hvm_domain_relinquish_resources(str
void hvm_domain_destroy(struct domain *d)
{
@ -41,9 +41,9 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
hvm_funcs.domain_destroy(d);
rtc_deinit(d);
stdvga_deinit(d);
@@ -680,8 +682,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
{
int rc;
@@ -782,8 +784,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
v->arch.hvm_vcpu.xfeature_mask = XSTATE_FP_SSE;
}
+ if ((rc = hyperx_intercept_vcpu_initialize(v)) != 0)
+ goto fail1;
@ -56,7 +56,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
goto fail2;
@@ -732,12 +740,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
@@ -834,12 +842,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
hvm_funcs.vcpu_destroy(v);
fail2:
vlapic_destroy(v);
@ -71,43 +71,43 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
hvm_vcpu_cacheattr_destroy(v);
vlapic_destroy(v);
@@ -1690,7 +1700,7 @@ void hvm_cpuid(unsigned int input, unsig
@@ -1897,7 +1907,7 @@ void hvm_cpuid(unsigned int input, unsig
return;
if ( cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx) )
if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) )
- return;
+ goto hvm_cpuid_done;
domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx);
@@ -1702,6 +1712,8 @@ void hvm_cpuid(unsigned int input, unsig
if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
__clear_bit(X86_FEATURE_APIC & 31, edx);
@@ -1964,6 +1974,8 @@ void hvm_cpuid(unsigned int input, unsig
*edx &= ~bitmaskof(X86_FEATURE_RDTSCP);
break;
}
+hvm_cpuid_done:
+ hyperx_intercept_do_cpuid(input, eax, ebx, ecx, edx);
}
void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
@@ -1801,6 +1813,8 @@ int hvm_msr_read_intercept(struct cpu_us
@@ -2064,6 +2076,8 @@ int hvm_msr_read_intercept(struct cpu_us
break;
default:
/* ret == 0, This is not an MCE MSR, see other MSRs */
else if (!ret)
+ if (hyperx_intercept_do_msr_read(ecx, regs))
+ return X86EMUL_OKAY;
return hvm_funcs.msr_read_intercept(regs);
}
@@ -1889,6 +1903,8 @@ int hvm_msr_write_intercept(struct cpu_u
@@ -2162,6 +2176,8 @@ int hvm_msr_write_intercept(struct cpu_u
else if ( ret )
break;
default:
else if (!ret)
+ if (hyperx_intercept_do_msr_write(ecx, regs))
+ return X86EMUL_OKAY;
return hvm_funcs.msr_write_intercept(regs);
}
@@ -2056,6 +2072,10 @@ int hvm_do_hypercall(struct cpu_user_reg
@@ -2354,6 +2370,10 @@ int hvm_do_hypercall(struct cpu_user_reg
case 0:
break;
}
@ -118,7 +118,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
if ( (eax & 0x80000000) && is_viridian_domain(curr->domain) )
return viridian_hypercall(regs);
@@ -2572,6 +2592,18 @@ long do_hvm_op(unsigned long op, XEN_GUE
@@ -2888,6 +2908,18 @@ long do_hvm_op(unsigned long op, XEN_GUE
rc = -EINVAL;
break;
@ -137,11 +137,11 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
}
if ( rc == 0 )
Index: xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h
Index: xen-4.0.0-testing/xen/include/public/arch-x86/hvm/save.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/public/arch-x86/hvm/save.h
+++ xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h
@@ -432,9 +432,24 @@ struct hvm_viridian_context {
--- xen-4.0.0-testing.orig/xen/include/public/arch-x86/hvm/save.h
+++ xen-4.0.0-testing/xen/include/public/arch-x86/hvm/save.h
@@ -431,9 +431,24 @@ struct hvm_viridian_context {
DECLARE_HVM_SAVE_TYPE(VIRIDIAN, 15, struct hvm_viridian_context);
@ -167,10 +167,10 @@ Index: xen-3.4.1-testing/xen/include/public/arch-x86/hvm/save.h
+#define HVM_SAVE_CODE_MAX 17
#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/vlapic.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/vlapic.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/vlapic.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/vlapic.c
@@ -34,6 +34,7 @@
#include <asm/hvm/hvm.h>
#include <asm/hvm/io.h>
@ -179,7 +179,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c
#include <asm/hvm/vmx/vmx.h>
#include <public/hvm/ioreq.h>
#include <public/hvm/params.h>
@@ -307,6 +308,7 @@ static int vlapic_accept_sipi(struct vcp
@@ -291,6 +292,7 @@ static int vlapic_accept_sipi(struct vcp
hvm_vcpu_reset_state(v, trampoline_vector << 8, 0);
vcpu_unpause(v);
@ -187,10 +187,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/vlapic.c
return X86EMUL_OKAY;
}
Index: xen-3.4.1-testing/xen/include/public/hvm/params.h
Index: xen-4.0.0-testing/xen/include/public/hvm/params.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/public/hvm/params.h
+++ xen-3.4.1-testing/xen/include/public/hvm/params.h
--- xen-4.0.0-testing.orig/xen/include/public/hvm/params.h
+++ xen-4.0.0-testing/xen/include/public/hvm/params.h
@@ -106,6 +106,8 @@
/* Boolean: Enable aligning all periodic vpts to reduce interrupts */
#define HVM_PARAM_VPT_ALIGN 16

View File

@ -1,8 +1,8 @@
%patch
Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm_extensions.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
+++ xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm_extensions.h
@@ -0,0 +1,183 @@
+/****************************************************************************
+ |
@ -187,17 +187,17 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
+int hyperx_initialize(struct domain *d);
+
+#endif
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/Makefile
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/Makefile
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/Makefile
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/Makefile
@@ -0,0 +1,2 @@
+obj-y += hv_intercept.o
+obj-y += hv_hypercall.o
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_errno.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_errno.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+ |
@ -261,10 +261,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_errno.h
+#define HV_STATUS_NO_MEMORY_256PAGES 0x0103
+#define HV_STATUS_NO_MEMORY_1024PAGES 0x0104
+#endif
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
@@ -0,0 +1,153 @@
+/****************************************************************************
+ |
@ -419,10 +419,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
+ return;
+ }
+}
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ |
@ -470,11 +470,11 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.h
+#define HV_NOTIFY_LONG_SPIN_WAIT 0x0008
+
+#endif /* HV_HYPERCALL_H */
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
@@ -0,0 +1,1008 @@
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
@@ -0,0 +1,1009 @@
+/****************************************************************************
+ |
+ | Copyright (c) [2007, 2008] Novell, Inc.
@ -1087,6 +1087,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
+{
+ struct domain *d = current->domain;
+ int extid = d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR];
+ unsigned int count = *ecx;
+
+ if (extid == 1) {
+ /*
@ -1107,7 +1108,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
+ {
+ /* Get rid of the offset and let xen handle it */
+ input -= 0x1000;
+ cpuid_hypervisor_leaves(input, eax, ebx, ecx, edx);
+ cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx);
+ /* Setup hypercall MSR value - add the offset*/
+ if (input == 0x40000002)
+ *ebx |= 0x1000;
@ -1452,7 +1453,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
+ /*
+ * Establish the hypercall page for PV drivers.
+ */
+ wrmsr_hypervisor_regs(0x40000000, regs->eax, regs->edx);
+ wrmsr_hypervisor_regs(0x40000000, msr_content);
+ break;
+ case HV_MSR_SYSTEM_RESET:
+ /*
@ -1483,10 +1484,10 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_intercept.c
+ hvm_inject_exception(TRAP_gp_fault, 0, 0);
+ return (1);
+}
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
@@ -0,0 +1,285 @@
+/****************************************************************************
+ |

View File

@ -91,6 +91,7 @@ case "$1" in
modprobe blkbk 2>/dev/null || true
modprobe xenblk 2>/dev/null || true
modprobe netbk 2>/dev/null || true
modprobe gntdev 2>/dev/null || true
xend start
await_daemons_up
;;

View File

@ -17,10 +17,10 @@ qcow2 image (the header is gone after three loop iterations):
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Index: xen-3.4.1-testing/tools/ioemu-remote/block-qcow2.c
Index: xen-4.0.0-testing/tools/ioemu-remote/block-qcow2.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/block-qcow2.c
+++ xen-3.4.1-testing/tools/ioemu-remote/block-qcow2.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/block-qcow2.c
+++ xen-4.0.0-testing/tools/ioemu-remote/block-qcow2.c
@@ -916,7 +916,7 @@ static int alloc_cluster_link_l2(BlockDr
goto err;

View File

@ -1,6 +1,8 @@
--- xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c 2009-09-21 13:26:03.000000000 +0800
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c 2009-09-28 16:30:13.000000000 +0800
@@ -249,8 +249,11 @@ static int open_disk(struct td_state *s,
Index: xen-4.0.0-testing/tools/ioemu-remote/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
@@ -247,8 +247,11 @@ static int open_disk(struct td_state *s,
drv = blktap_drivers[i].drv;
DPRINTF("%s driver specified\n", drv ? drv->format_name : "No");

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -362,6 +362,15 @@ static void qemu_send_responses(void* op
--- 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
@@ -360,6 +360,15 @@ static void qemu_send_responses(void* op
}
/**
@ -18,7 +18,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
* Callback function for the IO message pipe. Reads requests from the ring
* and processes them (call qemu read/write functions).
*
@@ -380,6 +389,7 @@ static void handle_blktap_iomsg(void* pr
@@ -378,6 +387,7 @@ static void handle_blktap_iomsg(void* pr
blkif_t *blkif = s->blkif;
tapdev_info_t *info = s->ring_info;
int page_size = getpagesize();
@ -26,7 +26,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
struct aiocb_info *aiocb_info;
@@ -412,7 +422,7 @@ static void handle_blktap_iomsg(void* pr
@@ -410,7 +420,7 @@ static void handle_blktap_iomsg(void* pr
/* Don't allow writes on readonly devices */
if ((s->flags & TD_RDONLY) &&
@ -35,7 +35,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
blkif->pending_list[idx].status = BLKIF_RSP_ERROR;
goto send_response;
}
@@ -433,7 +443,7 @@ static void handle_blktap_iomsg(void* pr
@@ -431,7 +441,7 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("Sector request failed:\n");
DPRINTF("%s request, idx [%d,%d] size [%llu], "
"sector [%llu,%llu]\n",
@ -44,7 +44,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
"WRITE" : "READ"),
idx,i,
(long long unsigned)
@@ -446,8 +456,14 @@ static void handle_blktap_iomsg(void* pr
@@ -444,8 +454,14 @@ static void handle_blktap_iomsg(void* pr
blkif->pending_list[idx].secs_pending += nsects;
@ -60,7 +60,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
case BLKIF_OP_WRITE:
aiocb_info = malloc(sizeof(*aiocb_info));
@@ -467,6 +483,10 @@ static void handle_blktap_iomsg(void* pr
@@ -465,6 +481,10 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("ERROR: bdrv_write() == NULL\n");
goto send_response;
}

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_machine_fv.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_machine_fv.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c
@@ -266,6 +266,7 @@ void qemu_invalidate_entry(uint8_t *buff
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_machine_fv.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_machine_fv.c
@@ -268,6 +268,7 @@ void qemu_invalidate_entry(uint8_t *buff
#endif /* defined(MAPCACHE) */
@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_machine_fv.c
static void xen_init_fv(ram_addr_t ram_size, int vga_ram_size,
const char *boot_device,
@@ -291,6 +292,11 @@ static void xen_init_fv(ram_addr_t ram_s
@@ -293,6 +294,11 @@ static void xen_init_fv(ram_addr_t ram_s
}
#endif

View File

@ -15,11 +15,11 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
hw/xen_blktap.h | 14 ++++++++++++++
2 files changed, 33 insertions(+), 3 deletions(-)
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -220,9 +220,10 @@ static int map_new_dev(struct td_state *
--- 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
@@ -218,9 +218,10 @@ static int map_new_dev(struct td_state *
return -1;
}
@ -31,7 +31,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
char* devname;
static int devnumber = 0;
int i;
@@ -232,7 +233,22 @@ static int open_disk(struct td_state *s,
@@ -230,7 +231,22 @@ static int open_disk(struct td_state *s,
bs = bdrv_new(devname);
free(devname);
@ -55,7 +55,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
fprintf(stderr, "Could not open image file %s\n", path);
return -ENOMEM;
}
@@ -527,7 +543,7 @@ static void handle_blktap_ctrlmsg(void*
@@ -521,7 +537,7 @@ static void handle_blktap_ctrlmsg(void*
s = state_init();
/*Open file*/
@ -64,10 +64,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
msglen = sizeof(msg_hdr_t);
msg->type = CTLMSG_IMG_FAIL;
msg->len = msglen;
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.h
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.h
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.h
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_blktap.h
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.h
@@ -52,4 +52,18 @@ typedef struct fd_list_entry {
int init_blktap(void);

View File

@ -12,11 +12,11 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
hw/xen_blktap.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
@@ -258,6 +258,12 @@ static int open_disk(struct td_state *s,
--- 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
@@ -256,6 +256,12 @@ static int open_disk(struct td_state *s,
s->size = bs->total_sectors;
s->sector_size = 512;
@ -29,10 +29,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0);
#ifndef QEMU_TOOL
Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py
@@ -155,7 +155,7 @@ class DevController:
(devid, self.deviceClass))

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile
Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile
+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile
@@ -242,7 +242,7 @@ endif
--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile
+++ xen-4.0.0-testing/tools/ioemu-remote/Makefile
@@ -243,7 +243,7 @@ endif
install: all $(if $(BUILD_DOCS),install-doc)
mkdir -p "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
@ -11,10 +11,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile
endif
ifneq ($(BLOBS),)
mkdir -p "$(DESTDIR)$(datadir)"
Index: xen-3.4.1-testing/tools/ioemu-remote/Makefile.target
Index: xen-4.0.0-testing/tools/ioemu-remote/Makefile.target
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/Makefile.target
+++ xen-3.4.1-testing/tools/ioemu-remote/Makefile.target
--- xen-4.0.0-testing.orig/tools/ioemu-remote/Makefile.target
+++ xen-4.0.0-testing/tools/ioemu-remote/Makefile.target
@@ -754,7 +754,7 @@ clean:
install: all install-hook

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/vnc.c
Index: xen-4.0.0-testing/tools/ioemu-remote/vnc.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/vnc.c
+++ xen-3.4.1-testing/tools/ioemu-remote/vnc.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/vnc.c
+++ xen-4.0.0-testing/tools/ioemu-remote/vnc.c
@@ -1713,6 +1713,31 @@ static int protocol_client_msg(VncState
}

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/libxen/src/xen_common.c
Index: xen-4.0.0-testing/tools/libxen/src/xen_common.c
===================================================================
--- xen-3.4.1-testing.orig/tools/libxen/src/xen_common.c
+++ xen-3.4.1-testing/tools/libxen/src/xen_common.c
--- xen-4.0.0-testing.orig/tools/libxen/src/xen_common.c
+++ xen-4.0.0-testing/tools/libxen/src/xen_common.c
@@ -904,8 +904,15 @@ static void parse_into(xen_session *s, x
0 != strcmp((char *)value_node->children->name, "struct") ||
value_node->children->children == NULL)

20
magic_ioport_compat.patch Normal file
View File

@ -0,0 +1,20 @@
Make our PV drivers work with older hosts that do not recognize the new PV driver protocol.
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Index: xen-4.0.0-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
@@ -289,7 +289,10 @@ static int check_platform_magic(struct d
if (magic != XEN_IOPORT_MAGIC_VAL) {
dev_err(dev, "invalid magic %#x", magic);
- return -ENODEV;
+ /*
+ * Older backend; just return 0 to be compatible.
+ */
+ return 0;
}
protocol = inb(XEN_IOPORT_PROTOVER);

View File

@ -1,33 +0,0 @@
Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/mkbuildtree
===================================================================
--- xen-3.4.1-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree
+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/mkbuildtree
@@ -33,7 +33,11 @@ for d in $(find ${XL}/drivers/xen/ -mind
done
ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
-ln -sf ${XL}/drivers/xen/core/features.c platform-pci
+if [ -f ${XL}/drivers/xen/core/features.c ]; then
+ ln -sf ${XL}/drivers/xen/core/features.c platform-pci
+else
+ ln -sf ${XL}/drivers/xen/features.c platform-pci
+fi
ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
@@ -47,7 +51,14 @@ ln -nsf ${XEN}/include/public include/xe
# be native and not xenolinux).
case "$uname" in
i[34567]86|x86_64)
- if [ -d ${XL}/include/asm-x86 ]; then
+ if [ -d ${XL}/arch/x86/include/mach-xen ]; then
+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypervisor.h include/asm
+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypercall*.h include/asm
+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/synch_bitops*.h include/asm
+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/maddr*.h include/asm
+ ln -sf ${XL}/arch/x86/include/mach-xen/asm/gnttab_dma.h include/asm
+ ln -sf ${XL}/arch/x86/lib/scrub.c balloon
+ elif [ -d ${XL}/include/asm-x86 ]; then
ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm

View File

@ -1,13 +0,0 @@
Index: xen-3.3.1-testing/xen/arch/x86/io_apic.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/io_apic.c
+++ xen-3.3.1-testing/xen/arch/x86/io_apic.c
@@ -45,7 +45,7 @@
int (*ioapic_renumber_irq)(int ioapic, int irq);
atomic_t irq_mis_count;
-int msi_enable = 0;
+int msi_enable = 1;
boolean_param("msi", msi_enable);
/* Where if anywhere is the i8259 connect in external int mode */

View File

@ -1,10 +1,10 @@
Open SuSEfirewall2 FORWARD rule when use xen nat
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-nat
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-nat
+++ xen-3.4.1-testing/tools/hotplug/Linux/network-nat
@@ -82,6 +82,7 @@ function dhcp_stop()
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-nat
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-nat
@@ -83,6 +83,7 @@ function dhcp_stop()
op_start() {
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ${netdev} -j MASQUERADE
@ -12,7 +12,7 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat
[ "$dhcp" != 'no' ] && dhcp_start
}
@@ -89,6 +90,7 @@ op_start() {
@@ -90,6 +91,7 @@ op_start() {
op_stop() {
[ "$dhcp" != 'no' ] && dhcp_stop
iptables -t nat -D POSTROUTING -o ${netdev} -j MASQUERADE

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-nat
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-nat
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-nat
+++ xen-3.4.1-testing/tools/hotplug/Linux/network-nat
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-nat
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-nat
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/network-route
Index: xen-4.0.0-testing/tools/hotplug/Linux/network-route
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/network-route
+++ xen-3.4.1-testing/tools/hotplug/Linux/network-route
@@ -21,7 +21,7 @@ dir=$(dirname "$0")
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/network-route
+++ xen-4.0.0-testing/tools/hotplug/Linux/network-route
@@ -22,7 +22,7 @@ dir=$(dirname "$0")
evalVariables "$@"

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild
Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild
===================================================================
--- xen-3.4.1-testing.orig/unmodified_drivers/linux-2.6/blkfront/Kbuild
+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild
--- xen-4.0.0-testing.orig/unmodified_drivers/linux-2.6/blkfront/Kbuild
+++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/blkfront/Kbuild
@@ -3,3 +3,4 @@ include $(M)/overrides.mk
obj-m += xen-vbd.o

View File

@ -0,0 +1,56 @@
--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2008-10-14 19:44:11.000000000 +0200
+++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2009-11-24 17:38:08.000000000 +0100
@@ -40,7 +40,9 @@
#include <xen/platform-compat.h>
#endif
+#ifndef shared_info_area
void *shared_info_area;
+#endif
#define is_valid_evtchn(x) ((x) != 0)
#define evtchn_from_irq(x) (irq_evtchn[irq].evtchn)
--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c 2009-02-24 20:09:53.000000000 +0100
+++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c 2009-11-24 17:45:02.000000000 +0100
@@ -70,7 +70,6 @@ static uint64_t callback_via;
static int __devinit init_xen_info(void)
{
struct xen_add_to_physmap xatp;
- extern void *shared_info_area;
#ifdef __ia64__
xencomm_initialize();
@@ -78,6 +77,7 @@ static int __devinit init_xen_info(void)
setup_xen_features();
+#ifndef shared_info_area
shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT;
xatp.domid = DOMID_SELF;
xatp.idx = 0;
@@ -90,6 +90,11 @@ static int __devinit init_xen_info(void)
ioremap(shared_info_frame << PAGE_SHIFT, PAGE_SIZE);
if (shared_info_area == NULL)
panic("can't map shared info\n");
+#else
+ shared_info_frame = __pa(shared_info_area) >> PAGE_SHIFT;
+ printk(KERN_INFO "Using kernel provided shared info (pfn=%lx)\n",
+ shared_info_frame);
+#endif
return 0;
}
--- 2009-11-09.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h 2008-10-14 19:44:11.000000000 +0200
+++ 2009-11-09/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h 2009-11-24 17:40:08.000000000 +0100
@@ -27,6 +27,11 @@
unsigned long alloc_xen_mmio(unsigned long len);
void platform_pci_resume(void);
+#ifdef CONFIG_ENLIGHTEN_SPINLOCKS
+#define shared_info_area xen_shared_info
+#endif
+extern void *shared_info_area;
+
extern struct pci_dev *xen_platform_pdev;
#endif /* _XEN_PLATFORM_PCI_H */

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c
@@ -361,6 +361,19 @@ static void platform_ioport_write(void *
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c
@@ -365,6 +365,19 @@ static void platform_ioport_write(void *
net_tap_shutdown_all();
fprintf(logfile, "Done.\n");
break;

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/ide.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/ide.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
@@ -934,8 +934,9 @@ static inline void ide_dma_submit_check(
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/ide.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/ide.c
@@ -935,8 +935,9 @@ static inline void ide_dma_submit_check(
static inline void ide_set_irq(IDEState *s)
{
@ -14,7 +14,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) {
if (bm) {
bm->status |= BM_STATUS_INT;
@@ -1223,14 +1224,14 @@ static void ide_read_dma_cb(void *opaque
@@ -1224,14 +1225,14 @@ static void ide_read_dma_cb(void *opaque
int n;
int64_t sector_num;
@ -31,7 +31,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
n = s->io_buffer_size >> 9;
sector_num = ide_get_sector(s);
if (n > 0) {
@@ -1334,6 +1335,8 @@ static void ide_write_flush_cb(void *opa
@@ -1335,6 +1336,8 @@ static void ide_write_flush_cb(void *opa
BMDMAState *bm = opaque;
IDEState *s = bm->ide_if;
@ -40,7 +40,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
if (ret != 0) {
ide_dma_error(s);
return;
@@ -1365,13 +1368,13 @@ static void ide_write_dma_cb(void *opaqu
@@ -1366,13 +1369,13 @@ static void ide_write_dma_cb(void *opaqu
int n;
int64_t sector_num;
@ -56,7 +56,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
n = s->io_buffer_size >> 9;
sector_num = ide_get_sector(s);
if (n > 0) {
@@ -1428,7 +1431,7 @@ static void ide_flush_cb(void *opaque, i
@@ -1429,7 +1432,7 @@ static void ide_flush_cb(void *opaque, i
{
IDEState *s = opaque;
@ -65,7 +65,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
if (ret) {
/* We are completely doomed. The IDE spec does not permit us
@@ -1685,7 +1688,7 @@ static void ide_atapi_cmd_read_dma_cb(vo
@@ -1686,7 +1689,7 @@ static void ide_atapi_cmd_read_dma_cb(vo
IDEState *s = bm->ide_if;
int data_offset, n;
@ -74,7 +74,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ide.c
if (ret < 0) {
ide_atapi_io_error(s, ret);
@@ -2363,7 +2366,7 @@ static void cdrom_change_cb(void *opaque
@@ -2365,7 +2368,7 @@ static void cdrom_change_cb(void *opaque
IDEState *s = opaque;
uint64_t nb_sectors;

View File

@ -1,40 +0,0 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_backend.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_backend.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_backend.c
@@ -377,8 +377,12 @@ static int xen_be_try_init(struct XenDev
int rc = 0;
if (!xendev->online) {
- xen_be_printf(xendev, 1, "not online\n");
- return -1;
+ sleep(3);
+ xenstore_read_be_int(xendev, "online", &xendev->online);
+ if (!xendev->online) {
+ xen_be_printf(xendev, 1, "not online\n");
+ return -1;
+ }
}
if (xendev->ops->init)
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_console.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_console.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_console.c
@@ -196,9 +196,14 @@ static int con_init(struct XenDevice *xe
type = xenstore_read_str(con->console, "type");
if (!type || 0 != strcmp(type, "ioemu")) {
- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
- return -1;
+ sleep(3);
+ type = xenstore_read_str(con->console, "type");
+ if (!type || 0 != strcmp(type, "ioemu")) {
+ xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+ return -1;
+ }
}
+ qemu_free(type);
if (!serial_hds[con->xendev.dev])
xen_be_printf(xendev, 1, "WARNING: serial line %d not configured\n",

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/ne2000.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/ne2000.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/ne2000.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/ne2000.c
@@ -218,7 +218,7 @@ static int ne2000_can_receive(void *opaq
NE2000State *s = opaque;
@ -11,10 +11,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/ne2000.c
return !ne2000_buffer_full(s);
}
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/pc.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/pc.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/pc.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/pc.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/pc.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/pc.c
@@ -409,7 +409,8 @@ static void bochs_bios_write(void *opaqu
case 0x400:
case 0x401:

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/misc/serial-split/Makefile
Index: xen-4.0.0-testing/tools/misc/serial-split/Makefile
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/misc/serial-split/Makefile
+++ xen-4.0.0-testing/tools/misc/serial-split/Makefile
@@ -0,0 +1,20 @@
+CC ?= gcc
+CFLAGS ?= -Wall -Os
@ -23,10 +23,10 @@ Index: xen-3.4.1-testing/tools/misc/serial-split/Makefile
+
+%.o: %.c Makefile
+ $(CC) $(CFLAGS) -c -o $@ $<
Index: xen-3.4.1-testing/tools/misc/serial-split/serial-split.c
Index: xen-4.0.0-testing/tools/misc/serial-split/serial-split.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/misc/serial-split/serial-split.c
+++ xen-4.0.0-testing/tools/misc/serial-split/serial-split.c
@@ -0,0 +1,422 @@
+/*
+ * serial-split.c

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -919,6 +919,18 @@ static void xenstore_process_dm_command_
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -865,6 +865,18 @@ static void xenstore_process_dm_command_
}
snapshot_name = xs_read(xsh, XBT_NULL, path, &len);
@ -21,10 +21,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
xen_pause_requested = 0;
Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c
Index: xen-4.0.0-testing/tools/ioemu-remote/savevm.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/savevm.c
+++ xen-3.4.1-testing/tools/ioemu-remote/savevm.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/savevm.c
+++ xen-4.0.0-testing/tools/ioemu-remote/savevm.c
@@ -1096,6 +1096,35 @@ the_end:
return ret;
}
@ -61,10 +61,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c
#ifndef CONFIG_DM
void do_savevm(const char *name)
Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h
--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h
@@ -42,6 +42,7 @@ enum {
/* xen-vl-extra.c */

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c
Index: xen-4.0.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c
@@ -346,6 +346,7 @@ static int write_msg(int fd, int msgtype
--- xen-4.0.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-4.0.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -347,6 +347,7 @@ static int write_msg(int fd, int msgtype
msg_dev = (msg_newdev_t *)(buf + sizeof(msg_hdr_t));
msg_dev->devnum = blkif->minor;
msg_dev->domid = blkif->domid;
@ -10,10 +10,10 @@ Index: xen-3.4.1-testing/tools/blktap/drivers/blktapctrl.c
break;
Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h
Index: xen-4.0.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.4.1-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.4.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
@@ -189,6 +189,7 @@ typedef struct msg_hdr {
typedef struct msg_newdev {
uint8_t devnum;
@ -22,10 +22,10 @@ Index: xen-3.4.1-testing/tools/blktap/lib/blktaplib.h
} msg_newdev_t;
typedef struct msg_pid {
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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
@@ -67,6 +67,8 @@ int write_fd;
static pid_t process;
fd_list_entry_t *fd_start = NULL;
@ -87,20 +87,20 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
memset(buf, 0x00, MSG_SIZE);
msglen = sizeof(msg_hdr_t);
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -38,6 +38,8 @@ static QEMUTimer *insert_timer = NULL;
#define UWAIT_MAX (30*1000000) /* thirty seconds */
#define UWAIT (100000) /* 1/10th second */
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -102,6 +102,8 @@ int xenstore_watch_new_callback(const ch
}
+char* get_snapshot_name(int devid);
+
static int pasprintf(char **buf, const char *fmt, ...)
{
va_list ap;
@@ -533,8 +535,33 @@ void xenstore_parse_domain_config(int hv
@@ -641,8 +643,33 @@ void xenstore_parse_domain_config(int hv
}
}
pstrcpy(bs->filename, sizeof(bs->filename), params);
@ -133,9 +133,9 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
+ }
+ }
}
/* if cdrom pyhsical put a watch on media-present */
if (bdrv_get_type_hint(bs) == BDRV_TYPE_CDROM) {
@@ -726,6 +753,23 @@ int xenstore_parse_disable_pf_config ()
#endif
@@ -776,6 +803,23 @@ int xenstore_parse_disable_pf_config ()
return disable_pf;
}

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c
Index: xen-4.0.0-testing/tools/ioemu-remote/savevm.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/savevm.c
+++ xen-3.4.1-testing/tools/ioemu-remote/savevm.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/savevm.c
+++ xen-4.0.0-testing/tools/ioemu-remote/savevm.c
@@ -28,6 +28,7 @@
#include "sysemu.h"
#include "qemu-timer.h"
@ -97,13 +97,13 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/savevm.c
#ifndef CONFIG_DM
void do_savevm(const char *name)
Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c
Index: xen-4.0.0-testing/tools/ioemu-remote/i386-dm/helper2.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/i386-dm/helper2.c
+++ xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/i386-dm/helper2.c
+++ xen-4.0.0-testing/tools/ioemu-remote/i386-dm/helper2.c
@@ -109,6 +109,9 @@ int send_vcpu = 0;
#define NR_CPUS 32
evtchn_port_t ioreq_local_port[NR_CPUS];
//the evtchn port for polling the notification,
evtchn_port_t *ioreq_local_port;
+/** Name of the snapshot which should be saved */
+char* snapshot_name;
@ -111,7 +111,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c
CPUX86State *cpu_x86_init(const char *cpu_model)
{
CPUX86State *env;
@@ -551,6 +554,7 @@ int main_loop(void)
@@ -553,6 +556,7 @@ int main_loop(void)
int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
char *qemu_file;
fd_set fds;
@ -119,7 +119,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c
main_loop_prepare();
@@ -578,11 +582,43 @@ int main_loop(void)
@@ -580,11 +584,43 @@ int main_loop(void)
main_loop_wait(1); /* For the select() on events */
/* Save the device state */
@ -167,10 +167,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/helper2.c
/* Wait to be allowed to continue */
while (xen_pause_requested) {
Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h
Index: xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h
--- xen-4.0.0-testing.orig/tools/ioemu-remote/qemu-xen.h
+++ xen-4.0.0-testing/tools/ioemu-remote/qemu-xen.h
@@ -34,6 +34,15 @@ void qemu_invalidate_map_cache(void)
#define mapcache_lock() ((void)0)
#define mapcache_unlock() ((void)0)
@ -195,11 +195,11 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/qemu-xen.h
void xenstore_check_new_media_present(int timeout);
void xenstore_write_vncport(int vnc_display);
void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen);
Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
Index: xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
@@ -24,6 +24,7 @@
--- xen-4.0.0-testing.orig/tools/ioemu-remote/xenstore.c
+++ xen-4.0.0-testing/tools/ioemu-remote/xenstore.c
@@ -17,6 +17,7 @@
#include "exec-all.h"
#include "sysemu.h"
@ -207,7 +207,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
#include "hw.h"
#include "pci.h"
@@ -849,6 +850,7 @@ static void xenstore_process_dm_command_
@@ -836,6 +837,7 @@ static void xenstore_process_dm_command_
{
char *path = NULL, *command = NULL, *par = NULL;
unsigned int len;
@ -215,7 +215,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
if (pasprintf(&path,
"/local/domain/0/device-model/%u/command", domid) == -1) {
@@ -861,7 +863,18 @@ static void xenstore_process_dm_command_
@@ -851,7 +853,18 @@ static void xenstore_process_dm_command_
if (!strncmp(command, "save", len)) {
fprintf(logfile, "dm-command: pause and save state\n");
@ -235,7 +235,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/xenstore.c
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
xen_pause_requested = 0;
@@ -966,6 +979,13 @@ void xenstore_record_dm_state(const char
@@ -984,6 +997,13 @@ void xenstore_record_dm_state(const char
xenstore_record_dm("state", state);
}

View File

@ -1,17 +1,17 @@
Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
Index: xen-4.0.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.4.1-testing/tools/python/xen/xend/image.py
@@ -445,7 +445,7 @@ class ImageHandler:
# have a callback but sadly we don't have Twisted in xend
self.sentinel_thread = thread.start_new_thread(self._sentinel_watch,())
--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.0-testing/tools/python/xen/xend/image.py
@@ -492,7 +492,7 @@ class ImageHandler:
domains.domains_lock.acquire()
- def signalDeviceModel(self, cmd, ret, par = None):
+ def signalDeviceModel(self, cmd, ret, par = None, timeout = True):
if self.device_model is None:
return
# Signal the device model to for action
@@ -468,10 +468,17 @@ class ImageHandler:
@@ -529,10 +529,17 @@ class ImageHandler:
while state != ret:
state = xstransact.Read("/local/domain/0/device-model/%i/state"
% self.vm.getDomid())
@ -32,7 +32,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
#resotre orig state
xstransact.Store("/local/domain/0/device-model/%i"
@@ -496,6 +503,10 @@ class ImageHandler:
@@ -557,6 +564,10 @@ class ImageHandler:
except:
pass
@ -43,10 +43,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
def recreate(self):
if self.device_model is None:
return
Index: xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/blkif.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/blkif.py
+++ xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/blkif.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/blkif.py
@@ -88,6 +88,9 @@ class BlkifController(DevController):
if bootable != None:
back['bootable'] = str(bootable)
@ -57,10 +57,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/blkif.py
if security.on() == xsconstants.XS_POLICY_USE:
self.do_access_control(config, uname)
Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-3.4.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
@@ -95,6 +95,31 @@ class SrvDomain(SrvDir):
def do_save(self, _, req):
return self.xd.domain_save(self.dom.domid, req.args['file'][0])
@ -93,7 +93,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py
def op_dump(self, op, req):
self.acceptCommand(req)
return req.threadRequest(self.do_dump, op, req)
@@ -231,7 +256,7 @@ class SrvDomain(SrvDir):
@@ -245,7 +270,7 @@ class SrvDomain(SrvDir):
def render_GET(self, req):
op = req.args.get('op')
@ -102,20 +102,20 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py
return self.perform(req)
#
Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-3.4.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
@@ -65,7 +65,7 @@ def insert_after(list, pred, value):
return
-def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1, name=None, diskonly=False):
from xen.xend import XendDomain
try:
if not os.path.isdir("/var/lib/xen"):
os.makedirs("/var/lib/xen")
@@ -98,52 +98,61 @@ def save(fd, dominfo, network, live, dst
@@ -112,52 +112,61 @@ def save(fd, dominfo, network, live, dst
image_cfg = dominfo.info.get('image', {})
hvm = dominfo.info.is_hvm()
@ -223,7 +223,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
if checkpoint:
dominfo.resumeDomain()
@@ -207,6 +216,71 @@ def restore(xd, fd, dominfo = None, paus
@@ -221,6 +230,71 @@ def restore(xd, fd, dominfo = None, paus
if othervm is not None and othervm.domid is not None:
raise VmError("Domain '%s' already exists with ID '%d'" % (domconfig["name_label"], othervm.domid))
@ -295,7 +295,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
if dominfo:
dominfo.resume()
else:
@@ -322,26 +396,7 @@ def restore(xd, fd, dominfo = None, paus
@@ -329,26 +403,7 @@ def restore(xd, fd, dominfo = None, paus
dominfo.completeRestore(handler.store_mfn, handler.console_mfn)
@ -323,23 +323,23 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendCheckpoint.py
if not paused:
dominfo.unpause()
Index: xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendConfig.py
@@ -220,6 +220,7 @@ XENAPI_CFG_TYPES = {
'machine_address_size': int,
'suppress_spurious_page_faults': bool0,
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendConfig.py
@@ -233,6 +233,7 @@ XENAPI_CFG_TYPES = {
's3_integrity' : int,
'superpages' : int,
'memory_sharing': int,
+ 'snapshotname': str,
}
# List of legacy configuration keys that have no equivalent in the
Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py
@@ -52,6 +52,7 @@ from xen.xend.xenstore.xstransact import
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomain.py
@@ -53,6 +53,7 @@ from xen.xend.xenstore.xstransact import
from xen.xend.xenstore.xswatch import xswatch
from xen.util import mkdir, rwlock
from xen.xend import uuid
@ -347,9 +347,9 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py
xc = xen.lowlevel.xc.xc()
xoptions = XendOptions.instance()
@@ -1421,6 +1422,187 @@ class XendDomain:
raise XendError("can't write guest state file %s: %s" %
(dst, ex[1]))
@@ -1564,6 +1565,187 @@ class XendDomain:
else:
log.debug("error: Domain is not running!")
+ def domain_snapshot_create(self, domid, name, diskonly=False):
+ """Snapshot a running domain.
@ -535,11 +535,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomain.py
def domain_pincpu(self, domid, vcpu, cpumap):
"""Set which cpus vcpu can use
Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
Index: xen-4.0.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xm/main.py
+++ xen-3.4.1-testing/tools/python/xen/xm/main.py
@@ -120,6 +120,14 @@ SUBCOMMAND_HELP = {
--- xen-4.0.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.0.0-testing/tools/python/xen/xm/main.py
@@ -122,6 +122,14 @@ SUBCOMMAND_HELP = {
'Restore a domain from a saved state.'),
'save' : ('[-c|-f] <Domain> <CheckpointFile>',
'Save a domain state to restore later.'),
@ -554,7 +554,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
'shutdown' : ('<Domain> [-waRH]', 'Shutdown a domain.'),
'top' : ('', 'Monitor a host and the domains in real time.'),
'unpause' : ('<Domain>', 'Unpause a paused domain.'),
@@ -277,6 +285,9 @@ SUBCOMMAND_OPTIONS = {
@@ -316,6 +324,9 @@ SUBCOMMAND_OPTIONS = {
('-c', '--checkpoint', 'Leave domain running after creating snapshot'),
('-f', '--force', 'Force to overwrite exist file'),
),
@ -564,7 +564,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
'restore': (
('-p', '--paused', 'Do not unpause domain after restoring it'),
),
@@ -303,6 +314,10 @@ common_commands = [
@@ -362,6 +373,10 @@ common_commands = [
"restore",
"resume",
"save",
@ -575,7 +575,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
"shell",
"shutdown",
"start",
@@ -334,6 +349,10 @@ domain_commands = [
@@ -395,6 +410,10 @@ domain_commands = [
"restore",
"resume",
"save",
@ -586,7 +586,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
"shutdown",
"start",
"suspend",
@@ -725,6 +744,62 @@ def xm_event_monitor(args):
@@ -815,6 +834,62 @@ def xm_event_monitor(args):
#
#########################################################################
@ -649,7 +649,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xm/main.py
def xm_save(args):
arg_check(args, "save", 2, 4)
@@ -2857,6 +2932,10 @@ commands = {
@@ -3467,6 +3542,10 @@ commands = {
"restore": xm_restore,
"resume": xm_resume,
"save": xm_save,

View File

@ -2,10 +2,10 @@ Make our PV drivers "Novell supported modules"
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Index: xen-3.4.1-testing/unmodified_drivers/linux-2.6/Module.supported
Index: xen-4.0.0-testing/unmodified_drivers/linux-2.6/Module.supported
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/unmodified_drivers/linux-2.6/Module.supported
+++ xen-4.0.0-testing/unmodified_drivers/linux-2.6/Module.supported
@@ -0,0 +1,5 @@
+xen-vbd
+xen-platform-pci

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/hvm.c
@@ -543,11 +543,12 @@ static int hvm_load_cpu_ctxt(struct doma
--- xen-4.0.0-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-4.0.0-testing/xen/arch/x86/hvm/hvm.c
@@ -629,11 +629,12 @@ static int hvm_load_cpu_ctxt(struct doma
return -EINVAL;
}
@ -16,7 +16,7 @@ Index: xen-3.4.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) )
{
@@ -830,10 +831,11 @@ int hvm_set_efer(uint64_t value)
@@ -984,10 +985,11 @@ int hvm_set_efer(uint64_t value)
value &= ~EFER_LMA;
@ -29,11 +29,11 @@ Index: xen-3.4.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-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c
Index: xen-4.0.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c
@@ -53,6 +53,11 @@
--- 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
@@ -56,6 +56,11 @@
u32 svm_feature_flags;
@ -45,7 +45,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c
#define set_segment_register(name, value) \
asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
@@ -869,6 +874,22 @@ static int svm_cpu_up(struct cpuinfo_x86
@@ -840,6 +845,29 @@ static int svm_cpu_up(struct cpuinfo_x86
/* Initialize core's ASID handling. */
svm_asid_init(c);
@ -60,19 +60,26 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/svm/svm.c
+ rdmsr(MSR_EFER, eax, edx);
+ if ( eax & EFER_LMSLE )
+ {
+ if ( c == &boot_cpu_data )
+ cpu_has_lmsl = 1;
+ wrmsr(MSR_EFER, eax ^ EFER_LMSLE, edx);
+ }
+ else
+ {
+ if ( cpu_has_lmsl )
+ printk(XENLOG_WARNING "Inconsistent LMLSE support across CPUs!\n");
+ cpu_has_lmsl = 0;
+ }
+#endif
+
return 1;
}
Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm.h
Index: xen-4.0.0-testing/xen/include/asm-x86/hvm/hvm.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm.h
@@ -134,6 +134,12 @@ struct hvm_function_table {
--- 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
@@ -131,6 +131,12 @@ struct hvm_function_table {
extern struct hvm_function_table hvm_funcs;
extern int hvm_enabled;

View File

@ -11,10 +11,10 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
tapdisk-ioemu.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
Index: xen-3.4.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
===================================================================
--- xen-3.4.0-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c
+++ xen-3.4.0-testing/tools/ioemu-remote/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
@@ -78,15 +78,22 @@ int main(void)
struct timeval tv;
void *old_fd_start = NULL;

View File

@ -16,10 +16,10 @@ Signed-off-by: Kevin Wolf <kwolf@suse.de>
tapdisk-ioemu.c | 13 ++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_blktap.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_blktap.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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
@@ -65,6 +65,7 @@ int read_fd;
int write_fd;
@ -27,8 +27,8 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
+int connected_disks = 0;
fd_list_entry_t *fd_start = NULL;
extern char* get_snapshot_name(int devid);
@@ -547,6 +548,7 @@ static void handle_blktap_ctrlmsg(void*
static void handle_blktap_iomsg(void* private);
@@ -541,6 +542,7 @@ static void handle_blktap_ctrlmsg(void*
/* Allocate the disk structs */
s = state_init();
@ -36,7 +36,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
/*Open file*/
if (s == NULL || open_disk(s, path, msg->drivertype, msg->readonly)) {
@@ -629,7 +631,8 @@ static void handle_blktap_ctrlmsg(void*
@@ -591,7 +593,8 @@ static void handle_blktap_ctrlmsg(void*
case CTLMSG_CLOSE:
s = get_state(msg->cookie);
if (s) unmap_disk(s);
@ -46,10 +46,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_blktap.c
case CTLMSG_PID:
memset(buf, 0x00, MSG_SIZE);
Index: xen-3.4.1-testing/tools/ioemu-remote/tapdisk-ioemu.c
Index: xen-4.0.0-testing/tools/ioemu-remote/tapdisk-ioemu.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/tapdisk-ioemu.c
+++ xen-3.4.1-testing/tools/ioemu-remote/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
@@ -14,6 +14,7 @@ extern void qemu_aio_init(void);
extern void qemu_aio_poll(void);

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/xenstore/Makefile
Index: xen-4.0.0-testing/tools/xenstore/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/xenstore/Makefile
+++ xen-3.4.1-testing/tools/xenstore/Makefile
@@ -56,6 +56,7 @@ $(CLIENTS_DOMU): xenstore
--- xen-4.0.0-testing.orig/tools/xenstore/Makefile
+++ xen-4.0.0-testing/tools/xenstore/Makefile
@@ -61,6 +61,7 @@ $(CLIENTS_DOMU): xenstore
xenstore: xenstore_client.o $(LIBXENSTORE)
$(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
xenstore-control: xenstore_control.o $(LIBXENSTORE)
$(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
@@ -104,10 +105,11 @@ install: all
@@ -111,10 +112,11 @@ endif
$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
$(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
set -e ; for c in $(CLIENTS) ; do \

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
Index: xen-4.0.0-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
===================================================================
--- xen-3.4.1-testing.orig/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
+++ xen-3.4.1-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
--- xen-4.0.0-testing.orig/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
+++ xen-4.0.0-testing/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
@@ -90,7 +90,7 @@ INCLUDE_CFLAGS = -I. -I${srcdir} -I$(src
GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
#PROFILE_CFLAGS = -pg

View File

@ -13,10 +13,10 @@ Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
tools/kboot/select-kernel | 59 +
9 files changed, 2111 insertions(+)
Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32
Index: xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_32
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32
+++ xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_32
@@ -0,0 +1,874 @@
+#
+# Automatically generated make config: don't edit
@ -892,10 +892,10 @@ Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_32
+CONFIG_X86_NO_TSS=y
+CONFIG_X86_NO_IDT=y
+CONFIG_KTIME_SCALAR=y
Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64
Index: xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_64
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64
+++ xen-4.0.0-testing/buildconfigs/linux-defconfig_xenUboot_x86_64
@@ -0,0 +1,653 @@
+#
+# Automatically generated make config: don't edit
@ -1550,17 +1550,17 @@ Index: xen-3.4.1-testing/buildconfigs/linux-defconfig_xenUboot_x86_64
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
Index: xen-3.4.1-testing/buildconfigs/mk.linux-2.6-xenUboot
Index: xen-4.0.0-testing/buildconfigs/mk.linux-2.6-xenUboot
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/buildconfigs/mk.linux-2.6-xenUboot
+++ xen-4.0.0-testing/buildconfigs/mk.linux-2.6-xenUboot
@@ -0,0 +1,2 @@
+EXTRAVERSION = xenUboot
+include buildconfigs/mk.linux-2.6-xen
Index: xen-3.4.1-testing/tools/kboot/Makefile
Index: xen-4.0.0-testing/tools/kboot/Makefile
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/kboot/Makefile
+++ xen-4.0.0-testing/tools/kboot/Makefile
@@ -0,0 +1,23 @@
+#
+# tools/kboot/Makefile
@ -1585,10 +1585,10 @@ Index: xen-3.4.1-testing/tools/kboot/Makefile
+kboot.initramfs: mkinitramfs init select-kernel ../xcutils/xc_kexec
+ sh ./mkinitramfs | tee $@
+
Index: xen-3.4.1-testing/tools/kboot/README
Index: xen-4.0.0-testing/tools/kboot/README
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/kboot/README
+++ xen-4.0.0-testing/tools/kboot/README
@@ -0,0 +1,43 @@
+
+This is a simple kexec-based boot loader
@ -1633,10 +1633,10 @@ Index: xen-3.4.1-testing/tools/kboot/README
+
+--
+Gerd Hoffmann <kraxel@suse.de>
Index: xen-3.4.1-testing/tools/kboot/init
Index: xen-4.0.0-testing/tools/kboot/init
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/kboot/init
+++ xen-4.0.0-testing/tools/kboot/init
@@ -0,0 +1,309 @@
+#!/bin/sh
+
@ -1947,10 +1947,10 @@ Index: xen-3.4.1-testing/tools/kboot/init
+msg "bye ..."
+banner "boot $guestos"
+xc_kexec -e
Index: xen-3.4.1-testing/tools/kboot/mkinitramfs
Index: xen-4.0.0-testing/tools/kboot/mkinitramfs
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/kboot/mkinitramfs
+++ xen-4.0.0-testing/tools/kboot/mkinitramfs
@@ -0,0 +1,111 @@
+#!/bin/sh
+
@ -2063,10 +2063,10 @@ Index: xen-3.4.1-testing/tools/kboot/mkinitramfs
+ echo "file $LIB/$(basename $lib) $lib 0755 0 0"
+done
+echo
Index: xen-3.4.1-testing/tools/kboot/select-kernel
Index: xen-4.0.0-testing/tools/kboot/select-kernel
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/kboot/select-kernel
+++ xen-4.0.0-testing/tools/kboot/select-kernel
@@ -0,0 +1,59 @@
+#!/bin/sh
+
@ -2127,10 +2127,10 @@ Index: xen-3.4.1-testing/tools/kboot/select-kernel
+msg "using $kernelname"
+echo "$kernelname"
+
Index: xen-3.4.1-testing/make-kboot
Index: xen-4.0.0-testing/make-kboot
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/make-kboot
+++ xen-4.0.0-testing/make-kboot
@@ -0,0 +1,37 @@
+#!/bin/sh
+

View File

@ -23,10 +23,10 @@ Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
tools/xcutils/xc_kexec.c | 503 +++++++++++++++
19 files changed, 4988 insertions(+), 2 deletions(-)
Index: xen-3.4.1-testing/tools/xcutils/Makefile
Index: xen-4.0.0-testing/tools/xcutils/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/xcutils/Makefile
+++ xen-3.4.1-testing/tools/xcutils/Makefile
--- xen-4.0.0-testing.orig/tools/xcutils/Makefile
+++ xen-4.0.0-testing/tools/xcutils/Makefile
@@ -14,7 +14,7 @@ include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -Werror
CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore)
@ -55,10 +55,10 @@ Index: xen-3.4.1-testing/tools/xcutils/Makefile
+ make -C helper clean
-include $(DEPS)
Index: xen-3.4.1-testing/tools/xcutils/helper/Makefile
Index: xen-4.0.0-testing/tools/xcutils/helper/Makefile
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/Makefile
+++ xen-4.0.0-testing/tools/xcutils/helper/Makefile
@@ -0,0 +1,39 @@
+
+XEN_ROOT = ../../..
@ -99,10 +99,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/Makefile
+# dependencies
+
+$(XEN_TARGET_ARCH)/entry.o: $(XEN_TARGET_ARCH)/entry.S $(XEN_TARGET_ARCH)/offsets.h
Index: xen-3.4.1-testing/tools/xcutils/helper/console.c
Index: xen-4.0.0-testing/tools/xcutils/helper/console.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/console.c
+++ xen-4.0.0-testing/tools/xcutils/helper/console.c
@@ -0,0 +1,69 @@
+#include <inttypes.h>
+
@ -173,10 +173,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/console.c
+
+ return printed_len;
+}
Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.c
Index: xen-4.0.0-testing/tools/xcutils/helper/ctype.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/ctype.c
+++ xen-4.0.0-testing/tools/xcutils/helper/ctype.c
@@ -0,0 +1,35 @@
+/*
+ * linux/lib/ctype.c
@ -213,10 +213,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.c
+_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
+
+EXPORT_SYMBOL(_ctype);
Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.h
Index: xen-4.0.0-testing/tools/xcutils/helper/ctype.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/ctype.h
+++ xen-4.0.0-testing/tools/xcutils/helper/ctype.h
@@ -0,0 +1,54 @@
+#ifndef _LINUX_CTYPE_H
+#define _LINUX_CTYPE_H
@ -272,10 +272,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/ctype.h
+#define toupper(c) __toupper(c)
+
+#endif
Index: xen-3.4.1-testing/tools/xcutils/helper/helper.h
Index: xen-4.0.0-testing/tools/xcutils/helper/helper.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/helper.h
+++ xen-4.0.0-testing/tools/xcutils/helper/helper.h
@@ -0,0 +1,107 @@
+#include <stdarg.h>
+#include <stddef.h>
@ -384,10 +384,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/helper.h
+int sprintf(char * buf, const char *fmt, ...);
+int vsscanf(const char * buf, const char * fmt, va_list args);
+int sscanf(const char * buf, const char * fmt, ...);
Index: xen-3.4.1-testing/tools/xcutils/helper/main.c
Index: xen-4.0.0-testing/tools/xcutils/helper/main.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/main.c
+++ xen-4.0.0-testing/tools/xcutils/helper/main.c
@@ -0,0 +1,651 @@
+#include <xenctrl.h>
+#include "hypercall.h"
@ -1040,10 +1040,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/main.c
+ printk("\r\n");
+ start_kernel();
+}
Index: xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c
Index: xen-4.0.0-testing/tools/xcutils/helper/make-offsets.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c
+++ xen-4.0.0-testing/tools/xcutils/helper/make-offsets.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <xenctrl.h>
@ -1073,10 +1073,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/make-offsets.c
+ vcpu_off("cr3", ctrlreg[3]);
+ return 0;
+}
Index: xen-3.4.1-testing/tools/xcutils/helper/printk.c
Index: xen-4.0.0-testing/tools/xcutils/helper/printk.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/printk.c
+++ xen-4.0.0-testing/tools/xcutils/helper/printk.c
@@ -0,0 +1,1051 @@
+/*
+ * linux/kernel/printk.c
@ -2129,10 +2129,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/printk.c
+ printk_ratelimit_burst);
+}
+EXPORT_SYMBOL(printk_ratelimit);
Index: xen-3.4.1-testing/tools/xcutils/helper/string.c
Index: xen-4.0.0-testing/tools/xcutils/helper/string.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/string.c
+++ xen-4.0.0-testing/tools/xcutils/helper/string.c
@@ -0,0 +1,601 @@
+/*
+ * linux/lib/string.c
@ -2735,10 +2735,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/string.c
+}
+EXPORT_SYMBOL(memchr);
+#endif
Index: xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c
Index: xen-4.0.0-testing/tools/xcutils/helper/vsprintf.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c
+++ xen-4.0.0-testing/tools/xcutils/helper/vsprintf.c
@@ -0,0 +1,842 @@
+/*
+ * linux/lib/vsprintf.c
@ -3582,10 +3582,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/vsprintf.c
+}
+
+EXPORT_SYMBOL(sscanf);
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/div64.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/div64.h
@@ -0,0 +1,48 @@
+#ifndef __I386_DIV64
+#define __I386_DIV64
@ -3635,10 +3635,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/div64.h
+
+}
+#endif
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/entry.S
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/entry.S
@@ -0,0 +1,49 @@
+#include "offsets.h"
+
@ -3689,10 +3689,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/entry.S
+ nop
+ .align 4096
+hypercall_end:
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_32/hypercall.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_32/hypercall.h
@@ -0,0 +1,359 @@
+/******************************************************************************
+ * hypercall.h
@ -4053,10 +4053,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_32/hypercall.h
+
+
+#endif /* __HYPERCALL_H__ */
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/div64.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/div64.h
@@ -0,0 +1,57 @@
+#ifndef _ASM_GENERIC_DIV64_H
+#define _ASM_GENERIC_DIV64_H
@ -4115,10 +4115,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/div64.h
+#endif /* BITS_PER_LONG */
+
+#endif /* _ASM_GENERIC_DIV64_H */
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/entry.S
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/entry.S
@@ -0,0 +1,50 @@
+#include "offsets.h"
+
@ -4170,10 +4170,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/entry.S
+ nop
+ .align 4096
+hypercall_end:
Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h
Index: xen-4.0.0-testing/tools/xcutils/helper/x86_64/hypercall.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h
+++ xen-4.0.0-testing/tools/xcutils/helper/x86_64/hypercall.h
@@ -0,0 +1,354 @@
+/******************************************************************************
+ * hypercall.h
@ -4529,10 +4529,10 @@ Index: xen-3.4.1-testing/tools/xcutils/helper/x86_64/hypercall.h
+}
+
+#endif /* __HYPERCALL_H__ */
Index: xen-3.4.1-testing/tools/xcutils/kexec-syscall.h
Index: xen-4.0.0-testing/tools/xcutils/kexec-syscall.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/kexec-syscall.h
+++ xen-4.0.0-testing/tools/xcutils/kexec-syscall.h
@@ -0,0 +1,80 @@
+#ifndef KEXEC_SYSCALL_H
+#define KEXEC_SYSCALL_H
@ -4614,10 +4614,10 @@ Index: xen-3.4.1-testing/tools/xcutils/kexec-syscall.h
+#define KEXEC_MAX_SEGMENTS 16
+
+#endif /* KEXEC_SYSCALL_H */
Index: xen-3.4.1-testing/tools/xcutils/xc_kexec.c
Index: xen-4.0.0-testing/tools/xcutils/xc_kexec.c
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/tools/xcutils/xc_kexec.c
+++ xen-4.0.0-testing/tools/xcutils/xc_kexec.c
@@ -0,0 +1,503 @@
+#include <stdio.h>
+#include <stdlib.h>

View File

@ -1,9 +1,9 @@
Index: xen-3.4.1-testing/tools/hotplug/Linux/xen-backend.rules
Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-backend.rules
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/xen-backend.rules
+++ xen-3.4.1-testing/tools/hotplug/Linux/xen-backend.rules
@@ -7,3 +7,4 @@ SUBSYSTEM=="xen-backend", KERNEL=="vscsi
SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/etc/xen/scripts/xen-hotplug-cleanup"
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-backend.rules
+++ xen-4.0.0-testing/tools/hotplug/Linux/xen-backend.rules
@@ -9,3 +9,4 @@ SUBSYSTEM=="xen-backend", ACTION=="remov
KERNEL=="evtchn", NAME="xen/%k"
KERNEL=="blktap[0-9]*", NAME="xen/%k"
KERNEL=="pci_iomul", NAME="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

83
vif-route-ifup.patch Normal file
View File

@ -0,0 +1,83 @@
Index: xen-4.0.0-testing/tools/hotplug/Linux/vif-route-ifup
===================================================================
--- /dev/null
+++ xen-4.0.0-testing/tools/hotplug/Linux/vif-route-ifup
@@ -0,0 +1,34 @@
+#!/bin/bash
+#============================================================================
+# /etc/xen/vif-route-ifup
+#
+# Script for configuring a vif in routed mode.
+# The hotplugging system will call this script if it is specified either in
+# the device configuration given to Xend, or the default Xend configuration
+# in /etc/xen/xend-config.sxp. If the script is specified in neither of those
+# places, then vif-bridge is the default.
+#
+# Usage:
+# vif-route-ifup (add|remove|online|offline)
+#
+# Environment vars:
+# vif vif interface name (required).
+#============================================================================
+
+dir=$(dirname "$0")
+. "$dir/vif-common.sh"
+
+case "$command" in
+ online)
+ ifup ${vif}
+ ;;
+ offline)
+ do_without_error ifdown ${vif}
+ ;;
+esac
+
+log debug "Successful vif-route-ifup $command for $vif."
+if [ "$command" = "online" ]
+then
+ success
+fi
Index: xen-4.0.0-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
@@ -184,6 +184,26 @@
#(network-script network-route)
#(vif-script vif-route)
+# SuSE users note:
+# If using a routed network configuration it is advised to NOT use
+# network-route and vif-route scripts but instead use sysconfig scripts
+# in dom0 and vif-route-ifup script to "connect" the domU vif to dom0.
+# Since this configuration requires a vif sysconfig script in dom0, a static
+# vif name must be used. E.g. in dom0 the vif sysconfig script
+# (/etc/sysconfig/network/ifcfg-xen1.0) may contain
+#
+# NAME='XEN vm 1 virtual interface 0'
+# BOOTPROTO='static'
+# STARTMODE='hotplug'
+# ...
+#
+# The corresponding domain vif configuration would contain e.g.
+# vif=[ 'mac=00:16:3e:aa:bb:cc,script=vif-route-ifup,vifname=xen1.0', ]
+#
+# If the vif-route-ifup script will be used for all domains, it can be
+# set here as the default vif script, alleviating the need for
+# 'script=' in domain vif configuration.
+#(vif-script vif-route-ifup)
## Use the following if network traffic is routed with NAT, as an alternative
# to the settings for bridged networking given above.
Index: xen-4.0.0-testing/tools/hotplug/Linux/Makefile
===================================================================
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/Makefile
+++ xen-4.0.0-testing/tools/hotplug/Linux/Makefile
@@ -9,7 +9,7 @@ XENDOMAINS_SYSCONFIG = init.d/sysconfig.
# Xen script dir and scripts to go there.
XEN_SCRIPTS = network-bridge vif-bridge
-XEN_SCRIPTS += network-route vif-route
+XEN_SCRIPTS += network-route vif-route vif-route-ifup
XEN_SCRIPTS += network-nat vif-nat
XEN_SCRIPTS += vif2
XEN_SCRIPTS += block

View File

@ -1,403 +0,0 @@
Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/cpufreq.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -44,7 +44,7 @@
#include <acpi/acpi.h>
#include <acpi/cpufreq/cpufreq.h>
-struct processor_pminfo processor_pminfo[NR_CPUS];
+struct processor_pminfo *__read_mostly processor_pminfo[NR_CPUS];
struct cpufreq_policy xen_px_policy[NR_CPUS];
static cpumask_t *cpufreq_dom_pt;
@@ -430,7 +430,7 @@ acpi_cpufreq_cpu_init(struct cpufreq_pol
drv_data[cpu] = data;
- data->acpi_data = &processor_pminfo[cpu].perf;
+ data->acpi_data = &processor_pminfo[cpu]->perf;
perf = data->acpi_data;
policy->shared_type = perf->shared_type;
@@ -569,8 +569,8 @@ int cpufreq_dom_init(void)
cpufreq_dom_max = 0;
for_each_online_cpu(i) {
- if (cpufreq_dom_max < processor_pminfo[i].perf.domain_info.domain)
- cpufreq_dom_max = processor_pminfo[i].perf.domain_info.domain;
+ if (cpufreq_dom_max < processor_pminfo[i]->perf.domain_info.domain)
+ cpufreq_dom_max = processor_pminfo[i]->perf.domain_info.domain;
}
cpufreq_dom_max++;
@@ -586,13 +586,13 @@ int cpufreq_dom_init(void)
memset(cpufreq_dom_pt, 0, cpufreq_dom_max * sizeof(cpumask_t));
for_each_online_cpu(i) {
- __set_bit(processor_pminfo[i].perf.domain_info.domain, cpufreq_dom_mask);
- cpu_set(i, cpufreq_dom_pt[processor_pminfo[i].perf.domain_info.domain]);
+ __set_bit(processor_pminfo[i]->perf.domain_info.domain, cpufreq_dom_mask);
+ cpu_set(i, cpufreq_dom_pt[processor_pminfo[i]->perf.domain_info.domain]);
}
for_each_online_cpu(i)
- processor_pminfo[i].perf.shared_cpu_map =
- cpufreq_dom_pt[processor_pminfo[i].perf.domain_info.domain];
+ processor_pminfo[i]->perf.shared_cpu_map =
+ cpufreq_dom_pt[processor_pminfo[i]->perf.domain_info.domain];
return 0;
}
Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/powernow.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpufreq/powernow.c
+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -49,9 +49,6 @@
#define MSR_PSTATE_CTRL 0xc0010062 /* Pstate control MSR */
#define MSR_PSTATE_CUR_LIMIT 0xc0010061 /* pstate current limit MSR */
-extern struct processor_pminfo processor_pminfo[NR_CPUS];
-extern struct cpufreq_policy xen_px_policy[NR_CPUS];
-
struct powernow_cpufreq_data {
struct processor_performance *acpi_data;
struct cpufreq_frequency_table *freq_table;
@@ -149,7 +146,7 @@ static int powernow_cpufreq_cpu_init(str
drv_data[cpu] = data;
- data->acpi_data = &processor_pminfo[cpu].perf;
+ data->acpi_data = &processor_pminfo[cpu]->perf;
perf = data->acpi_data;
policy->shared_type = perf->shared_type;
@@ -271,8 +268,8 @@ int powernow_cpufreq_init(void)
}
if (ret)
return ret;
- if (max_dom < processor_pminfo[i].perf.domain_info.domain)
- max_dom = processor_pminfo[i].perf.domain_info.domain;
+ if (max_dom < processor_pminfo[i]->perf.domain_info.domain)
+ max_dom = processor_pminfo[i]->perf.domain_info.domain;
}
max_dom++;
@@ -288,13 +285,13 @@ int powernow_cpufreq_init(void)
/* get cpumask of each psd domain */
for_each_online_cpu(i) {
- __set_bit(processor_pminfo[i].perf.domain_info.domain, dom_mask);
- cpu_set(i, pt[processor_pminfo[i].perf.domain_info.domain]);
+ __set_bit(processor_pminfo[i]->perf.domain_info.domain, dom_mask);
+ cpu_set(i, pt[processor_pminfo[i]->perf.domain_info.domain]);
}
for_each_online_cpu(i)
- processor_pminfo[i].perf.shared_cpu_map =
- pt[processor_pminfo[i].perf.domain_info.domain];
+ processor_pminfo[i]->perf.shared_cpu_map =
+ pt[processor_pminfo[i]->perf.domain_info.domain];
cpufreq_driver = &powernow_cpufreq_driver;
Index: xen-3.3.1-testing/xen/drivers/cpufreq/utility.c
===================================================================
--- xen-3.3.1-testing.orig/xen/drivers/cpufreq/utility.c
+++ xen-3.3.1-testing/xen/xen/drivers/cpufreq/utility.c
@@ -45,10 +45,12 @@ void px_statistic_suspend(void)
now = NOW();
for_each_online_cpu(cpu) {
- struct pm_px *pxpt = &px_statistic_data[cpu];
+ struct pm_px *pxpt = px_statistic_data[cpu];
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
+ if ( !pxpt || !pxpt->u.pt )
+ continue;
total_idle_ns = get_cpu_idle_time(cpu);
tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall;
@@ -66,7 +68,10 @@ void px_statistic_resume(void)
now = NOW();
for_each_online_cpu(cpu) {
- struct pm_px *pxpt = &px_statistic_data[cpu];
+ struct pm_px *pxpt = px_statistic_data[cpu];
+
+ if ( !pxpt )
+ continue;
pxpt->prev_state_wall = now;
pxpt->prev_idle_wall = get_cpu_idle_time(cpu);
}
@@ -80,11 +85,14 @@ void px_statistic_update(cpumask_t cpuma
now = NOW();
for_each_cpu_mask(i, cpumask) {
- struct pm_px *pxpt = &px_statistic_data[i];
- uint32_t statnum = processor_pminfo[i].perf.state_count;
+ struct pm_px *pxpt = px_statistic_data[i];
+ struct processor_pminfo *pmpt = processor_pminfo[i];
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
+ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt )
+ continue;
+
total_idle_ns = get_cpu_idle_time(i);
tmp_idle_ns = total_idle_ns - pxpt->prev_idle_wall;
@@ -94,7 +102,7 @@ void px_statistic_update(cpumask_t cpuma
pxpt->u.pt[from].residency += now - pxpt->prev_state_wall;
pxpt->u.pt[from].residency -= tmp_idle_ns;
- (*(pxpt->u.trans_pt + from*statnum + to))++;
+ (*(pxpt->u.trans_pt + from * pmpt->perf.state_count + to))++;
pxpt->prev_state_wall = now;
pxpt->prev_idle_wall = total_idle_ns;
@@ -104,11 +112,23 @@ void px_statistic_update(cpumask_t cpuma
int px_statistic_init(int cpuid)
{
uint32_t i, count;
- struct pm_px *pxpt = &px_statistic_data[cpuid];
- struct processor_pminfo *pmpt = &processor_pminfo[cpuid];
+ struct pm_px *pxpt = px_statistic_data[cpuid];
+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid];
+
+ if ( !pmpt )
+ return -EINVAL;
count = pmpt->perf.state_count;
+ if ( !pxpt )
+ {
+ pxpt = xmalloc(struct pm_px);
+ if ( !pxpt )
+ return -ENOMEM;
+ memset(pxpt, 0, sizeof(*pxpt));
+ px_statistic_data[cpuid] = pxpt;
+ }
+
pxpt->u.trans_pt = xmalloc_array(uint64_t, count * count);
if (!pxpt->u.trans_pt)
return -ENOMEM;
@@ -137,9 +157,13 @@ int px_statistic_init(int cpuid)
void px_statistic_reset(int cpuid)
{
uint32_t i, j, count;
- struct pm_px *pxpt = &px_statistic_data[cpuid];
+ struct pm_px *pxpt = px_statistic_data[cpuid];
+ const struct processor_pminfo *pmpt = processor_pminfo[cpuid];
- count = processor_pminfo[cpuid].perf.state_count;
+ if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt || !pmpt )
+ return;
+
+ count = pmpt->perf.state_count;
for (i=0; i < count; i++) {
pxpt->u.pt[i].residency = 0;
@@ -298,9 +322,9 @@ void cpufreq_suspend(void)
/* to protect the case when Px was not controlled by xen */
for_each_online_cpu(cpu) {
- struct processor_performance *perf = &processor_pminfo[cpu].perf;
+ const struct processor_pminfo *pmpt = processor_pminfo[cpu];
- if (!(perf->init & XEN_PX_INIT))
+ if (!pmpt || !(pmpt->perf.init & XEN_PX_INIT))
return;
}
@@ -318,10 +342,11 @@ int cpufreq_resume(void)
/* 1. to protect the case when Px was not controlled by xen */
/* 2. set state and resume flag to sync cpu to right state and freq */
for_each_online_cpu(cpu) {
- struct processor_performance *perf = &processor_pminfo[cpu].perf;
+ struct processor_pminfo *pmpt = processor_pminfo[cpu];
+ struct processor_performance *perf = &pmpt->perf;
struct cpufreq_policy *policy = &xen_px_policy[cpu];
- if (!(perf->init & XEN_PX_INIT))
+ if (!pmpt || !(perf->init & XEN_PX_INIT))
goto err;
perf->state = 0;
policy->resume = 1;
Index: xen-3.3.1-testing/xen/arch/x86/acpi/cpu_idle.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/acpi/cpu_idle.c
+++ xen-3.3.1-testing/xen/arch/x86/acpi/cpu_idle.c
@@ -128,7 +128,7 @@ struct acpi_processor_power
struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
};
-static struct acpi_processor_power processor_powers[NR_CPUS];
+static struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
static void print_acpi_power(uint32_t cpu, struct acpi_processor_power *power)
{
@@ -162,8 +162,11 @@ static void print_acpi_power(uint32_t cp
static void dump_cx(unsigned char key)
{
- for( int i = 0; i < num_online_cpus(); i++ )
- print_acpi_power(i, &processor_powers[i]);
+ unsigned int cpu;
+
+ for_each_online_cpu ( cpu )
+ if (processor_powers[cpu])
+ print_acpi_power(cpu, processor_powers[cpu]);
}
static int __init cpu_idle_key_init(void)
@@ -272,14 +275,12 @@ static struct {
static void acpi_processor_idle(void)
{
- struct acpi_processor_power *power = NULL;
+ struct acpi_processor_power *power = processor_powers[smp_processor_id()];
struct acpi_processor_cx *cx = NULL;
struct acpi_processor_cx *next_state = NULL;
int sleep_ticks = 0;
u32 t1, t2 = 0;
- power = &processor_powers[smp_processor_id()];
-
/*
* Interrupts must be disabled during bus mastering calculations and
* for C2/C3 transitions.
@@ -292,7 +293,7 @@ static void acpi_processor_idle(void)
return;
}
- cx = power->state;
+ cx = power ? power->state : NULL;
if ( !cx )
{
if ( pm_idle_save )
@@ -947,7 +948,15 @@ long set_cx_pminfo(uint32_t cpu, struct
return -EFAULT;
}
- acpi_power = &processor_powers[cpu_id];
+ acpi_power = processor_powers[cpu_id];
+ if ( !acpi_power )
+ {
+ acpi_power = xmalloc(struct acpi_processor_power);
+ if ( !acpi_power )
+ return -ENOMEM;
+ memset(acpi_power, 0, sizeof(*acpi_power));
+ processor_powers[cpu_id] = acpi_power;
+ }
init_cx_pminfo(acpi_power);
@@ -983,18 +992,25 @@ long set_cx_pminfo(uint32_t cpu, struct
uint32_t pmstat_get_cx_nr(uint32_t cpuid)
{
- return processor_powers[cpuid].count;
+ return processor_powers[cpuid] ? processor_powers[cpuid]->count : 0;
}
int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat)
{
- struct acpi_processor_power *power = &processor_powers[cpuid];
+ const struct acpi_processor_power *power = processor_powers[cpuid];
struct vcpu *v = idle_vcpu[cpuid];
uint64_t usage;
int i;
+ if ( unlikely(!power) )
+ {
+ stat->last = 0;
+ stat->nr = 0;
+ stat->idle_time = 0;
+ return 0;
+ }
stat->last = (power->state) ? power->state->type : 0;
- stat->nr = processor_powers[cpuid].count;
+ stat->nr = power->count;
stat->idle_time = v->runstate.time[RUNSTATE_running];
if ( v->is_running )
stat->idle_time += NOW() - v->runstate.state_entry_time;
Index: xen-3.3.1-testing/xen/drivers/acpi/pmstat.c
===================================================================
--- xen-3.3.1-testing.orig/xen/drivers/acpi/pmstat.c
+++ xen-3.3.1-testing/xen/drivers/acpi/pmstat.c
@@ -41,7 +41,7 @@
#include <public/sysctl.h>
#include <acpi/cpufreq/cpufreq.h>
-struct pm_px px_statistic_data[NR_CPUS];
+struct pm_px *__read_mostly px_statistic_data[NR_CPUS];
extern uint32_t pmstat_get_cx_nr(uint32_t cpuid);
extern int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat);
@@ -55,7 +55,7 @@ int do_get_pm_info(struct xen_sysctl_get
if ( !op || (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
return -EINVAL;
- pmpt = &processor_pminfo[op->cpuid];
+ pmpt = processor_pminfo[op->cpuid];
switch ( op->type & PMSTAT_CATEGORY_MASK )
{
@@ -86,7 +86,7 @@ int do_get_pm_info(struct xen_sysctl_get
uint64_t now, ct;
uint64_t total_idle_ns;
uint64_t tmp_idle_ns;
- struct pm_px *pxpt = &px_statistic_data[op->cpuid];
+ struct pm_px *pxpt = px_statistic_data[op->cpuid];
if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt )
return -ENODATA;
Index: xen-3.3.1-testing/xen/arch/x86/platform_hypercall.c
===================================================================
--- xen-3.3.1-testing.orig/xen/arch/x86/platform_hypercall.c
+++ xen-3.3.1-testing/xen/arch/x86/platform_hypercall.c
@@ -364,8 +364,19 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
ret = -EINVAL;
break;
}
- pmpt = &processor_pminfo[cpuid];
- pxpt = &processor_pminfo[cpuid].perf;
+ pmpt = processor_pminfo[cpuid];
+ if ( !pmpt )
+ {
+ pmpt = xmalloc(struct processor_pminfo);
+ if ( !pmpt )
+ {
+ ret = -ENOMEM;
+ break;
+ }
+ memset(pmpt, 0, sizeof(*pmpt));
+ processor_pminfo[cpuid] = pmpt;
+ }
+ pxpt = &pmpt->perf;
pmpt->acpi_id = xenpmpt->id;
pmpt->id = cpuid;
Index: xen-3.3.1-testing/xen/include/acpi/cpufreq/processor_perf.h
===================================================================
--- xen-3.3.1-testing.orig/xen/include/acpi/cpufreq/processor_perf.h
+++ xen-3.3.1-testing/xen/include/acpi/cpufreq/processor_perf.h
@@ -44,7 +44,7 @@ struct processor_pminfo {
struct processor_performance perf;
};
-extern struct processor_pminfo processor_pminfo[NR_CPUS];
+extern struct processor_pminfo *processor_pminfo[NR_CPUS];
struct px_stat {
uint8_t total; /* total Px states */
@@ -61,6 +61,6 @@ struct pm_px {
uint64_t prev_idle_wall;
};
-extern struct pm_px px_statistic_data[NR_CPUS];
+extern struct pm_px *px_statistic_data[NR_CPUS];
#endif /* __XEN_PROCESSOR_PM_H__ */

View File

@ -1,7 +1,5 @@
Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/platform_hypercall.c
+++ xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c
--- 2010-01-06.orig/xen/arch/x86/platform_hypercall.c 2009-12-14 08:34:19.000000000 +0100
+++ 2010-01-06/xen/arch/x86/platform_hypercall.c 2010-01-06 11:19:05.000000000 +0100
@@ -21,7 +21,7 @@
#include <xen/acpi.h>
#include <asm/current.h>
@ -11,7 +9,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c
#include <asm/edd.h>
#include <asm/mtrr.h>
#include "cpu/mtrr/mtrr.h"
@@ -56,6 +56,7 @@ static long cpu_frequency_change_helper(
@@ -62,6 +62,7 @@ static long cpu_down_helper(void *data)
ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
{
ret_t ret = 0;
@ -19,47 +17,36 @@ Index: xen-3.4.1-testing/xen/arch/x86/platform_hypercall.c
struct xen_platform_op curop, *op = &curop;
if ( !IS_PRIV(current->domain) )
@@ -385,6 +386,20 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
break;
}
@@ -474,6 +475,24 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
op->u.mem_add.epfn,
op->u.mem_add.pxm);
break;
+
+ case XENPF_get_cpu_freq:
+ if ( op->u.get_cpu_freq.vcpu >= MAX_VIRT_CPUS ||
+ if ( op->u.get_cpu_freq.vcpu >= current->domain->max_vcpus ||
+ !(v = current->domain->vcpu[op->u.get_cpu_freq.vcpu]) )
+ {
+ ret = -EINVAL;
+ break;
+ }
+
+ op->u.get_cpu_freq.freq = cpufreq_cpu_policy[v->processor] ?
+ cpufreq_cpu_policy[v->processor]->cur : 0;
+ op->u.get_cpu_freq.freq = cpufreq_cpu_policy[v->processor]
+ ? cpufreq_driver->get
+ ? cpufreq_driver->get(v->processor)
+ : cpufreq_cpu_policy[v->processor]->cur
+ : 0;
+ if ( copy_field_to_guest(u_xenpf_op, op, u.get_cpu_freq.freq) )
+ ret = -EFAULT;
+ break;
+
default:
ret = -ENOSYS;
Index: xen-3.4.1-testing/xen/arch/x86/x86_64/platform_hypercall.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/platform_hypercall.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_64/platform_hypercall.c
@@ -23,6 +23,8 @@ DEFINE_XEN_GUEST_HANDLE(compat_platform_
#define xen_processor_power_t compat_processor_power_t
#define set_cx_pminfo compat_set_cx_pminfo
+#define xenpf_get_cpu_freq compat_pf_get_cpu_freq
+
#define xenpf_enter_acpi_sleep compat_pf_enter_acpi_sleep
#define COMPAT
Index: xen-3.4.1-testing/xen/include/public/platform.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/public/platform.h
+++ xen-3.4.1-testing/xen/include/public/platform.h
@@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo {
typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t);
break;
--- 2010-01-06.orig/xen/include/public/platform.h 2009-12-14 08:34:19.000000000 +0100
+++ 2010-01-06/xen/include/public/platform.h 2010-01-06 11:22:06.000000000 +0100
@@ -355,6 +355,14 @@ struct xenpf_mem_hotadd
uint32_t flags;
};
+#define XENPF_get_cpu_freq ('N' << 24)
+struct xenpf_get_cpu_freq {
@ -68,16 +55,14 @@ Index: xen-3.4.1-testing/xen/include/public/platform.h
+ /* OUT variables */
+ uint32_t freq; /* in kHz */
+};
+typedef struct xenpf_get_cpu_freq xenpf_get_cpu_freq_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_get_cpu_freq_t);
+
struct xen_platform_op {
uint32_t cmd;
uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -327,6 +337,7 @@ struct xen_platform_op {
struct xenpf_change_freq change_freq;
struct xenpf_getidletime getidletime;
struct xenpf_set_processor_pminfo set_pminfo;
@@ -374,6 +382,7 @@ struct xen_platform_op {
struct xenpf_cpu_ol cpu_ol;
struct xenpf_cpu_hotadd cpu_add;
struct xenpf_mem_hotadd mem_add;
+ struct xenpf_get_cpu_freq get_cpu_freq;
uint8_t pad[128];
} u;

View File

@ -1,8 +1,6 @@
Index: xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/entry.S
+++ xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S
@@ -401,21 +401,33 @@ ring1: /* obtain ss/esp from oldss/olde
--- 2010-01-06.orig/xen/arch/x86/x86_32/entry.S 2009-12-02 10:02:49.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_32/entry.S 2010-01-06 11:23:45.000000000 +0100
@@ -403,21 +403,33 @@ ring1: /* obtain ss/esp from oldss/olde
movl %eax,UREGS_eip+4(%esp)
ret
.section __ex_table,"a"
@ -46,11 +44,9 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/entry.S
domain_crash_synchronous:
pushl $domain_crash_synchronous_string
call printk
Index: xen-3.4.1-testing/xen/arch/x86/x86_64/entry.S
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/entry.S
+++ xen-3.4.1-testing/xen/arch/x86/x86_64/entry.S
@@ -419,17 +419,30 @@ create_bounce_frame:
--- 2010-01-06.orig/xen/arch/x86/x86_64/entry.S 2009-12-02 10:02:49.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_64/entry.S 2010-01-06 11:23:45.000000000 +0100
@@ -421,17 +421,30 @@ create_bounce_frame:
movq %rax,UREGS_rip+8(%rsp)
ret
.section __ex_table,"a"

View File

@ -1,20 +1,17 @@
Change default IO-APIC ack mode for single IO-APIC systems to old-style. Jan
Change default IO-APIC ack mode for single IO-APIC systems to old-style.
Index: xen-3.4.1-testing/xen/arch/x86/io_apic.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/io_apic.c
+++ xen-3.4.1-testing/xen/arch/x86/io_apic.c
@@ -1298,7 +1298,7 @@ static unsigned int startup_level_ioapic
--- 2010-01-06.orig/xen/arch/x86/io_apic.c 2009-12-17 12:20:22.000000000 +0100
+++ 2010-01-06/xen/arch/x86/io_apic.c 2010-01-06 11:17:14.000000000 +0100
@@ -1442,7 +1442,7 @@ static unsigned int startup_level_ioapic
return 0; /* don't check for pending */
}
-int ioapic_ack_new = 1;
+int ioapic_ack_new = -1;
-int __read_mostly ioapic_ack_new = 1;
+int __read_mostly ioapic_ack_new = -1;
static void setup_ioapic_ack(char *s)
{
if ( !strcmp(s, "old") )
@@ -1802,6 +1802,8 @@ void __init setup_IO_APIC(void)
@@ -1954,6 +1954,8 @@ void __init setup_IO_APIC(void)
else
io_apic_irqs = ~PIC_IRQS;

View File

@ -1,8 +1,17 @@
Index: xen-3.4.1-testing/xen/arch/x86/traps.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.4.1-testing/xen/arch/x86/traps.c
@@ -1293,6 +1293,7 @@ asmlinkage void do_early_page_fault(stru
--- 2010-01-06.orig/xen/arch/x86/mm.c 2010-01-05 13:29:13.000000000 +0100
+++ 2010-01-06/xen/arch/x86/mm.c 2010-01-06 11:22:26.000000000 +0100
@@ -154,6 +154,8 @@ unsigned long __read_mostly pdx_group_va
int opt_allow_hugepage;
boolean_param("allowhugepage", opt_allow_hugepage);
+bool_t __read_mostly mpt_valid;
+
#define l1_disallow_mask(d) \
((d != dom_io) && \
(rangeset_is_empty((d)->iomem_caps) && \
--- 2010-01-06.orig/xen/arch/x86/traps.c 2009-12-17 12:20:22.000000000 +0100
+++ 2010-01-06/xen/arch/x86/traps.c 2010-01-06 11:22:26.000000000 +0100
@@ -1349,6 +1349,7 @@ asmlinkage void do_early_page_fault(stru
unsigned long *stk = (unsigned long *)regs;
printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n",
regs->cs, _p(regs->eip), _p(cr2), regs->error_code);
@ -10,32 +19,20 @@ Index: xen-3.4.1-testing/xen/arch/x86/traps.c
printk("Stack dump: ");
while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
printk("%p ", _p(*stk++));
Index: xen-3.4.1-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_32/mm.c
@@ -38,6 +38,7 @@ extern l1_pgentry_t l1_identmap[L1_PAGET
unsigned int PAGE_HYPERVISOR = __PAGE_HYPERVISOR;
unsigned int PAGE_HYPERVISOR_NOCACHE = __PAGE_HYPERVISOR_NOCACHE;
+int mpt_valid;
static unsigned long mpt_size;
void *alloc_xen_pagetable(void)
@@ -103,6 +104,8 @@ void __init paging_init(void)
pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW));
}
--- 2010-01-06.orig/xen/arch/x86/x86_32/mm.c 2009-10-29 12:24:48.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_32/mm.c 2010-01-06 11:22:26.000000000 +0100
@@ -122,6 +122,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ mpt_valid = 1;
+
/* Fill with an obvious debug pattern. */
for ( i = 0; i < (mpt_size / BYTES_PER_LONG); i++)
set_gpfn_from_mfn(i, 0x55555555);
Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c
@@ -160,7 +160,8 @@ void show_page_walk(unsigned long addr)
/* Create page tables for ioremap()/map_domain_page_global(). */
for ( i = 0; i < (IOREMAP_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
{
--- 2010-01-06.orig/xen/arch/x86/x86_32/traps.c 2009-12-02 10:02:49.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_32/traps.c 2010-01-06 11:22:26.000000000 +0100
@@ -161,7 +161,8 @@ void show_page_walk(unsigned long addr)
l3t += (cr3 & 0xFE0UL) >> 3;
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
@ -45,7 +42,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
unmap_domain_page(l3t);
@@ -170,7 +171,8 @@ void show_page_walk(unsigned long addr)
@@ -172,7 +173,8 @@ void show_page_walk(unsigned long addr)
l2t = map_domain_page(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
@ -55,7 +52,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -182,7 +184,8 @@ void show_page_walk(unsigned long addr)
@@ -185,7 +187,8 @@ void show_page_walk(unsigned long addr)
l1t = map_domain_page(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
@ -65,31 +62,19 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_32/traps.c
printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
unmap_domain_page(l1t);
Index: xen-3.4.1-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_64/mm.c
@@ -33,6 +33,7 @@
#include <asm/msr.h>
#include <public/memory.h>
+int mpt_valid;
#ifdef CONFIG_COMPAT
unsigned int m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
#endif
@@ -181,6 +182,8 @@ void __init paging_init(void)
l2_ro_mpt++;
}
--- 2010-01-06.orig/xen/arch/x86/x86_64/mm.c 2010-01-05 13:29:13.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_64/mm.c 2010-01-06 11:22:26.000000000 +0100
@@ -725,6 +725,8 @@ void __init paging_init(void)
#undef CNT
#undef MFN
+ mpt_valid = 1;
+
/* Create user-accessible L2 directory to map the MPT for compat guests. */
BUILD_BUG_ON(l4_table_offset(RDWR_MPT_VIRT_START) !=
l4_table_offset(HIRO_COMPAT_MPT_VIRT_START));
Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
--- 2010-01-06.orig/xen/arch/x86/x86_64/traps.c 2009-12-02 10:02:49.000000000 +0100
+++ 2010-01-06/xen/arch/x86/x86_64/traps.c 2010-01-06 11:22:26.000000000 +0100
@@ -176,7 +176,8 @@ void show_page_walk(unsigned long addr)
l4t = mfn_to_virt(mfn);
l4e = l4t[l4_table_offset(addr)];
@ -99,8 +84,8 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L4[0x%03lx] = %"PRIpte" %016lx\n",
l4_table_offset(addr), l4e_get_intpte(l4e), pfn);
if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) )
@@ -185,7 +186,8 @@ void show_page_walk(unsigned long addr)
if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ||
@@ -186,7 +187,8 @@ void show_page_walk(unsigned long addr)
l3t = mfn_to_virt(mfn);
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
@ -110,7 +95,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L3[0x%03lx] = %"PRIpte" %016lx%s\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn,
(l3e_get_flags(l3e) & _PAGE_PSE) ? " (PSE)" : "");
@@ -196,7 +198,8 @@ void show_page_walk(unsigned long addr)
@@ -198,7 +200,8 @@ void show_page_walk(unsigned long addr)
l2t = mfn_to_virt(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
@ -120,7 +105,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -207,7 +210,8 @@ void show_page_walk(unsigned long addr)
@@ -210,7 +213,8 @@ void show_page_walk(unsigned long addr)
l1t = mfn_to_virt(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
@ -130,15 +115,14 @@ Index: xen-3.4.1-testing/xen/arch/x86/x86_64/traps.c
printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}
Index: xen-3.4.1-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.4.1-testing/xen/include/asm-x86/mm.h
@@ -412,6 +412,7 @@ TYPE_SAFE(unsigned long,mfn);
#define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
#define INVALID_M2P_ENTRY (~0UL)
#define VALID_M2P(_e) (!((_e) & (1UL<<(BITS_PER_LONG-1))))
+extern int mpt_valid;
--- 2010-01-06.orig/xen/include/asm-x86/mm.h 2009-12-17 12:20:22.000000000 +0100
+++ 2010-01-06/xen/include/asm-x86/mm.h 2010-01-06 11:23:39.000000000 +0100
@@ -443,6 +443,8 @@ TYPE_SAFE(unsigned long,mfn);
#define SHARED_M2P_ENTRY (~0UL - 1UL)
#define SHARED_M2P(_e) ((_e) == SHARED_M2P_ENTRY)
+extern bool_t mpt_valid;
+
#ifdef CONFIG_COMPAT
#define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
#define set_gpfn_from_mfn(mfn, pfn) ({ \

View File

@ -1,153 +0,0 @@
Index: xen-3.4.1-testing/xen/arch/x86/boot/head.S
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/boot/head.S
+++ xen-3.4.1-testing/xen/arch/x86/boot/head.S
@@ -33,7 +33,7 @@ ENTRY(start)
/* Checksum: must be the negated sum of the first two fields. */
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
- .section .init.text
+ .section .init.text, "ax"
.Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!"
.Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!"
@@ -128,13 +128,13 @@ __start:
loop 1b
/* Initialise L3 xen-map page directory entry. */
mov $(sym_phys(l2_xenmap)+7),%eax
- mov %eax,sym_phys(l3_xenmap) + (50*8)
+ mov %eax,sym_phys(l3_xenmap) + l3_table_offset(XEN_VIRT_START)*8
/* Hook identity-map and xen-map L3 tables into PML4. */
mov $(sym_phys(l3_identmap)+7),%eax
mov %eax,sym_phys(idle_pg_table) + ( 0*8) /* PML4[ 0]: 1:1 map */
- mov %eax,sym_phys(idle_pg_table) + (262*8) /* PML4[262]: 1:1 map */
+ mov %eax,sym_phys(idle_pg_table) + l4_table_offset(DIRECTMAP_VIRT_START)*8
mov $(sym_phys(l3_xenmap)+7),%eax
- mov %eax,sym_phys(idle_pg_table) + (261*8) /* PML4[261]: xen map */
+ mov %eax,sym_phys(idle_pg_table) + l4_table_offset(XEN_VIRT_START)*8
#else
/* Initialize low and high mappings of memory with 2MB pages */
mov $sym_phys(idle_pg_table_l2),%edi
Index: xen-3.4.1-testing/xen/arch/x86/e820.c
===================================================================
--- xen-3.4.1-testing.orig/xen/arch/x86/e820.c
+++ xen-3.4.1-testing/xen/arch/x86/e820.c
@@ -467,15 +467,19 @@ static void __init machine_specific_memo
"can be accessed by Xen in 32-bit mode.");
#else
{
- unsigned long limit, mpt_limit, pft_limit;
+ unsigned long limit, mpt_limit, ro_mpt_limit, pft_limit;
limit = DIRECTMAP_VIRT_END - DIRECTMAP_VIRT_START;
mpt_limit = ((RDWR_MPT_VIRT_END - RDWR_MPT_VIRT_START)
/ sizeof(unsigned long)) << PAGE_SHIFT;
+ ro_mpt_limit = ((RO_MPT_VIRT_END - RO_MPT_VIRT_START)
+ / sizeof(unsigned long)) << PAGE_SHIFT;
pft_limit = ((FRAMETABLE_VIRT_END - FRAMETABLE_VIRT_START)
/ sizeof(struct page_info)) << PAGE_SHIFT;
if ( limit > mpt_limit )
limit = mpt_limit;
+ if ( limit > ro_mpt_limit )
+ limit = ro_mpt_limit;
if ( limit > pft_limit )
limit = pft_limit;
clip_to_limit(limit,
Index: xen-3.4.1-testing/xen/include/asm-x86/config.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/config.h
+++ xen-3.4.1-testing/xen/include/asm-x86/config.h
@@ -124,10 +124,12 @@ extern unsigned int video_mode, video_fl
#define PML4_ADDR(_slot) \
((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
(_slot ## UL << PML4_ENTRY_BITS))
+#define GB(_gb) (_gb ## UL << 30)
#else
#define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)
#define PML4_ADDR(_slot) \
(((_slot >> 8) * 0xffff000000000000) | (_slot << PML4_ENTRY_BITS))
+#define GB(_gb) (_gb << 30)
#endif
/*
@@ -151,21 +153,19 @@ extern unsigned int video_mode, video_fl
* 0xffff828000000000 - 0xffff8283ffffffff [16GB, 2^34 bytes, PML4:261]
* Machine-to-phys translation table.
* 0xffff828400000000 - 0xffff8287ffffffff [16GB, 2^34 bytes, PML4:261]
- * Page-frame information array.
- * 0xffff828800000000 - 0xffff828bffffffff [16GB, 2^34 bytes, PML4:261]
* ioremap()/fixmap area.
- * 0xffff828c00000000 - 0xffff828c3fffffff [1GB, 2^30 bytes, PML4:261]
+ * 0xffff828800000000 - 0xffff82883fffffff [1GB, 2^30 bytes, PML4:261]
* Compatibility machine-to-phys translation table.
- * 0xffff828c40000000 - 0xffff828c7fffffff [1GB, 2^30 bytes, PML4:261]
+ * 0xffff828840000000 - 0xffff82887fffffff [1GB, 2^30 bytes, PML4:261]
* High read-only compatibility machine-to-phys translation table.
- * 0xffff828c80000000 - 0xffff828cbfffffff [1GB, 2^30 bytes, PML4:261]
+ * 0xffff828880000000 - 0xffff8288bfffffff [1GB, 2^30 bytes, PML4:261]
* Xen text, static data, bss.
- * 0xffff828cc0000000 - 0xffff82ffffffffff [461GB, PML4:261]
+ * 0xffff8288c0000000 - 0xffff82ffffffffff [221GB, PML4:261]
* Reserved for future use.
- * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263]
+ * 0xffff82c000000000 - 0xffff82ffffffffff [256GB, 2^38 bytes, PML4:261]
+ * Page-frame information array.
+ * 0xffff830000000000 - 0xffff87ffffffffff [5TB, 5*2^40 bytes, PML4:262-271]
* 1:1 direct mapping of all physical memory.
- * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271]
- * Reserved for future use.
* 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511]
* Guest-defined use.
*
@@ -206,25 +206,25 @@ extern unsigned int video_mode, video_fl
#define PERDOMAIN_MBYTES ((unsigned long)GDT_LDT_MBYTES)
/* Slot 261: machine-to-phys conversion table (16GB). */
#define RDWR_MPT_VIRT_START (PML4_ADDR(261))
-#define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (16UL<<30))
-/* Slot 261: page-frame information array (16GB). */
-#define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
-#define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (16UL<<30))
+#define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + GB(16))
/* Slot 261: ioremap()/fixmap area (16GB). */
-#define IOREMAP_VIRT_START (FRAMETABLE_VIRT_END)
-#define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (16UL<<30))
+#define IOREMAP_VIRT_START RDWR_MPT_VIRT_END
+#define IOREMAP_VIRT_END (IOREMAP_VIRT_START + GB(16))
/* Slot 261: compatibility machine-to-phys conversion table (1GB). */
#define RDWR_COMPAT_MPT_VIRT_START IOREMAP_VIRT_END
-#define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + (1UL << 30))
+#define RDWR_COMPAT_MPT_VIRT_END (RDWR_COMPAT_MPT_VIRT_START + GB(1))
/* Slot 261: high read-only compat machine-to-phys conversion table (1GB). */
#define HIRO_COMPAT_MPT_VIRT_START RDWR_COMPAT_MPT_VIRT_END
-#define HIRO_COMPAT_MPT_VIRT_END (HIRO_COMPAT_MPT_VIRT_START + (1UL << 30))
+#define HIRO_COMPAT_MPT_VIRT_END (HIRO_COMPAT_MPT_VIRT_START + GB(1))
/* Slot 261: xen text, static data and bss (1GB). */
#define XEN_VIRT_START (HIRO_COMPAT_MPT_VIRT_END)
-#define XEN_VIRT_END (XEN_VIRT_START + (1UL << 30))
-/* Slot 262-263: A direct 1:1 mapping of all of physical memory. */
+#define XEN_VIRT_END (XEN_VIRT_START + GB(1))
+/* Slot 261: page-frame information array (256GB). */
+#define FRAMETABLE_VIRT_END DIRECTMAP_VIRT_START
+#define FRAMETABLE_VIRT_START (FRAMETABLE_VIRT_END - GB(256))
+/* Slot 262-271: A direct 1:1 mapping of all of physical memory. */
#define DIRECTMAP_VIRT_START (PML4_ADDR(262))
-#define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2)
+#define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*10)
#ifndef __ASSEMBLY__
Index: xen-3.4.1-testing/xen/include/asm-x86/x86_64/page.h
===================================================================
--- xen-3.4.1-testing.orig/xen/include/asm-x86/x86_64/page.h
+++ xen-3.4.1-testing/xen/include/asm-x86/x86_64/page.h
@@ -16,8 +16,8 @@
#define L4_PAGETABLE_ENTRIES (1<<PAGETABLE_ORDER)
#define ROOT_PAGETABLE_ENTRIES L4_PAGETABLE_ENTRIES
-#define __PAGE_OFFSET (0xFFFF830000000000)
-#define __XEN_VIRT_START (0xFFFF828C80000000)
+#define __PAGE_OFFSET DIRECTMAP_VIRT_START
+#define __XEN_VIRT_START XEN_VIRT_START
/* These are architectural limits. Current CPUs support only 40-bit phys. */
#define PADDR_BITS 52

View File

@ -1,338 +0,0 @@
--- 2009-01-08.orig/tools/include/xen-foreign/reference.size 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/tools/include/xen-foreign/reference.size 2009-01-08 10:56:30.000000000 +0100
@@ -1,7 +1,7 @@
structs | x86_32 x86_64 ia64
-start_info | 1104 1152 1152
+start_info | 1112 1168 1168
trap_info | 8 16 -
pt_fpreg | - - 16
cpu_user_regs | 68 200 -
--- 2009-01-08.orig/xen/arch/x86/domain_build.c 2009-01-08 10:56:13.000000000 +0100
+++ 2009-01-08/xen/arch/x86/domain_build.c 2009-01-08 11:44:42.000000000 +0100
@@ -341,6 +341,12 @@ int __init construct_dom0(
#endif
}
+ if ( (parms.p2m_base != UNSET_ADDR) && elf_32bit(&elf) )
+ {
+ printk(XENLOG_WARNING "P2M table base ignored\n");
+ parms.p2m_base = UNSET_ADDR;
+ }
+
domain_set_alloc_bitsize(d);
/*
@@ -359,6 +365,8 @@ int __init construct_dom0(
vphysmap_end = vphysmap_start + (nr_pages * (!is_pv_32on64_domain(d) ?
sizeof(unsigned long) :
sizeof(unsigned int)));
+ if ( parms.p2m_base != UNSET_ADDR )
+ vphysmap_end = vphysmap_start;
vstartinfo_start = round_pgup(vphysmap_end);
vstartinfo_end = (vstartinfo_start +
sizeof(struct start_info) +
@@ -400,6 +408,11 @@ int __init construct_dom0(
/* Ensure that our low-memory 1:1 mapping covers the allocation. */
page = alloc_domheap_pages(d, order, MEMF_bits(30));
#else
+ if ( parms.p2m_base != UNSET_ADDR )
+ {
+ vphysmap_start = parms.p2m_base;
+ vphysmap_end = vphysmap_start + nr_pages * sizeof(unsigned long);
+ }
page = alloc_domheap_pages(d, order, 0);
#endif
if ( page == NULL )
@@ -740,8 +753,109 @@ int __init construct_dom0(
snprintf(si->magic, sizeof(si->magic), "xen-3.0-x86_%d%s",
elf_64bit(&elf) ? 64 : 32, parms.pae ? "p" : "");
+ count = d->tot_pages;
+#ifdef __x86_64__
+ /* Set up the phys->machine table if not part of the initial mapping. */
+ if ( parms.p2m_base != UNSET_ADDR )
+ {
+ unsigned long va = vphysmap_start;
+
+ if ( v_start <= vphysmap_end && vphysmap_start <= v_end )
+ panic("DOM0 P->M table overlaps initial mapping");
+
+ while ( va < vphysmap_end )
+ {
+ if ( d->tot_pages + ((round_pgup(vphysmap_end) - va)
+ >> PAGE_SHIFT) + 3 > nr_pages )
+ panic("Dom0 allocation too small for initial P->M table.\n");
+
+ l4tab = l4start + l4_table_offset(va);
+ if ( !l4e_get_intpte(*l4tab) )
+ {
+ page = alloc_domheap_pages(d, 0, 0);
+ if ( !page )
+ break;
+ /* No mapping, PGC_allocated + page-table page. */
+ page->count_info = PGC_allocated | 2;
+ page->u.inuse.type_info =
+ PGT_l3_page_table | PGT_validated | 1;
+ clear_page(page_to_virt(page));
+ *l4tab = l4e_from_page(page, L4_PROT);
+ }
+ l3tab = page_to_virt(l4e_get_page(*l4tab));
+ l3tab += l3_table_offset(va);
+ if ( !l3e_get_intpte(*l3tab) )
+ {
+ if ( cpu_has_page1gb &&
+ !(va & ((1UL << L3_PAGETABLE_SHIFT) - 1)) &&
+ vphysmap_end >= va + (1UL << L3_PAGETABLE_SHIFT) &&
+ (page = alloc_domheap_pages(d,
+ L3_PAGETABLE_SHIFT -
+ PAGE_SHIFT,
+ 0)) != NULL )
+ {
+ *l3tab = l3e_from_page(page,
+ L1_PROT|_PAGE_DIRTY|_PAGE_PSE);
+ va += 1UL << L3_PAGETABLE_SHIFT;
+ continue;
+ }
+ else if ( (page = alloc_domheap_pages(d, 0, 0)) == NULL )
+ break;
+ else
+ {
+ /* No mapping, PGC_allocated + page-table page. */
+ page->count_info = PGC_allocated | 2;
+ page->u.inuse.type_info =
+ PGT_l2_page_table | PGT_validated | 1;
+ clear_page(page_to_virt(page));
+ *l3tab = l3e_from_page(page, L3_PROT);
+ }
+ }
+ l2tab = page_to_virt(l3e_get_page(*l3tab));
+ l2tab += l2_table_offset(va);
+ if ( !l2e_get_intpte(*l2tab) )
+ {
+ if ( !(va & ((1UL << L2_PAGETABLE_SHIFT) - 1)) &&
+ vphysmap_end >= va + (1UL << L2_PAGETABLE_SHIFT) &&
+ (page = alloc_domheap_pages(d,
+ L2_PAGETABLE_SHIFT -
+ PAGE_SHIFT,
+ 0)) != NULL )
+ {
+ *l2tab = l2e_from_page(page,
+ L1_PROT|_PAGE_DIRTY|_PAGE_PSE);
+ va += 1UL << L2_PAGETABLE_SHIFT;
+ continue;
+ }
+ else if ( (page = alloc_domheap_pages(d, 0, 0)) == NULL )
+ break;
+ else
+ {
+ /* No mapping, PGC_allocated + page-table page. */
+ page->count_info = PGC_allocated | 2;
+ page->u.inuse.type_info =
+ PGT_l1_page_table | PGT_validated | 1;
+ clear_page(page_to_virt(page));
+ *l2tab = l2e_from_page(page, L2_PROT);
+ }
+ }
+ l1tab = page_to_virt(l2e_get_page(*l2tab));
+ l1tab += l1_table_offset(va);
+ BUG_ON(l1e_get_intpte(*l1tab));
+ page = alloc_domheap_pages(d, 0, 0);
+ if ( !page )
+ break;
+ *l1tab = l1e_from_page(page, L1_PROT|_PAGE_DIRTY);
+ va += PAGE_SIZE;
+ va &= PAGE_MASK;
+ }
+ if ( !page )
+ panic("Not enough RAM for DOM0 P->M table.\n");
+ }
+#endif
+
/* Write the phys->machine and machine->phys table entries. */
- for ( pfn = 0; pfn < d->tot_pages; pfn++ )
+ for ( pfn = 0; pfn < count; pfn++ )
{
mfn = pfn + alloc_spfn;
#ifndef NDEBUG
@@ -755,6 +869,26 @@ int __init construct_dom0(
((unsigned int *)vphysmap_start)[pfn] = mfn;
set_gpfn_from_mfn(mfn, pfn);
}
+ si->first_p2m_pfn = pfn;
+ si->nr_p2m_frames = d->tot_pages - count;
+ list_for_each_entry ( page, &d->page_list, list )
+ {
+ mfn = page_to_mfn(page);
+ if ( get_gpfn_from_mfn(mfn) >= count )
+ {
+ BUG_ON(is_pv_32bit_domain(d));
+ if ( !page->u.inuse.type_info &&
+ !get_page_and_type(page, d, PGT_writable_page) )
+ BUG();
+ ((unsigned long *)vphysmap_start)[pfn] = mfn;
+ set_gpfn_from_mfn(mfn, pfn);
+ ++pfn;
+#ifndef NDEBUG
+ ++alloc_epfn;
+#endif
+ }
+ }
+ BUG_ON(pfn != d->tot_pages);
while ( pfn < nr_pages )
{
if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL )
--- 2009-01-08.orig/xen/arch/x86/mm.c 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/xen/arch/x86/mm.c 2009-01-08 10:56:30.000000000 +0100
@@ -1013,7 +1013,8 @@ static int put_page_from_l2e(l2_pgentry_
{
unsigned long mfn = l2e_get_pfn(l2e), m = mfn;
int writeable = l2e_get_flags(l2e) & _PAGE_RW;
- ASSERT(opt_allow_hugepage && !(mfn & (L1_PAGETABLE_ENTRIES-1)));
+
+ ASSERT(!(mfn & (L1_PAGETABLE_ENTRIES-1)));
do {
put_data_page(mfn_to_page(m), writeable);
} while ( m++ < (mfn + (L1_PAGETABLE_ENTRIES-1)) );
@@ -1031,14 +1032,28 @@ static int __put_page_type(struct page_i
static int put_page_from_l3e(l3_pgentry_t l3e, unsigned long pfn,
int partial, int preemptible)
{
- if ( (l3e_get_flags(l3e) & _PAGE_PRESENT) &&
- (l3e_get_pfn(l3e) != pfn) )
+ if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_pfn(l3e) == pfn) )
+ return 1;
+
+#ifdef __x86_64__
+ if ( unlikely(l3e_get_flags(l3e) & _PAGE_PSE) )
{
- if ( unlikely(partial > 0) )
- return __put_page_type(l3e_get_page(l3e), preemptible);
- return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
+ unsigned long mfn = l3e_get_pfn(l3e);
+ int writeable = l3e_get_flags(l3e) & _PAGE_RW;
+
+ ASSERT(!(mfn & ((1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT)) - 1)));
+ do {
+ put_data_page(mfn_to_page(mfn), writeable);
+ } while ( ++mfn & ((1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT)) - 1) );
+
+ return 0;
}
- return 1;
+#endif
+
+ if ( unlikely(partial > 0) )
+ return __put_page_type(l3e_get_page(l3e), preemptible);
+
+ return put_page_and_type_preemptible(l3e_get_page(l3e), preemptible);
}
#if CONFIG_PAGING_LEVELS >= 4
--- 2009-01-08.orig/xen/common/libelf/libelf-dominfo.c 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/xen/common/libelf/libelf-dominfo.c 2009-01-08 10:56:30.000000000 +0100
@@ -90,6 +90,7 @@ int elf_xen_parse_note(struct elf_binary
[XEN_ELFNOTE_ENTRY] = { "ENTRY", 0},
[XEN_ELFNOTE_HYPERCALL_PAGE] = { "HYPERCALL_PAGE", 0},
[XEN_ELFNOTE_VIRT_BASE] = { "VIRT_BASE", 0},
+ [XEN_ELFNOTE_INIT_P2M] = { "INIT_P2M", 0},
[XEN_ELFNOTE_PADDR_OFFSET] = { "PADDR_OFFSET", 0},
[XEN_ELFNOTE_HV_START_LOW] = { "HV_START_LOW", 0},
[XEN_ELFNOTE_XEN_VERSION] = { "XEN_VERSION", 1},
@@ -164,6 +165,9 @@ int elf_xen_parse_note(struct elf_binary
case XEN_ELFNOTE_ENTRY:
parms->virt_entry = val;
break;
+ case XEN_ELFNOTE_INIT_P2M:
+ parms->p2m_base = val;
+ break;
case XEN_ELFNOTE_PADDR_OFFSET:
parms->elf_paddr_offset = val;
break;
@@ -392,6 +396,7 @@ static int elf_xen_addr_calc_check(struc
elf_msg(elf, " virt_kstart = 0x%" PRIx64 "\n", parms->virt_kstart);
elf_msg(elf, " virt_kend = 0x%" PRIx64 "\n", parms->virt_kend);
elf_msg(elf, " virt_entry = 0x%" PRIx64 "\n", parms->virt_entry);
+ elf_msg(elf, " p2m_base = 0x%" PRIx64 "\n", parms->p2m_base);
if ( (parms->virt_kstart > parms->virt_kend) ||
(parms->virt_entry < parms->virt_kstart) ||
@@ -403,6 +408,15 @@ static int elf_xen_addr_calc_check(struc
return -1;
}
+ if ( (parms->p2m_base != UNSET_ADDR) &&
+ (parms->p2m_base >= parms->virt_kstart) &&
+ (parms->p2m_base < parms->virt_kend) )
+ {
+ elf_err(elf, "%s: ERROR: P->M table base is out of bounds.\n",
+ __FUNCTION__);
+ return -1;
+ }
+
return 0;
}
@@ -422,6 +436,7 @@ int elf_xen_parse(struct elf_binary *elf
parms->virt_entry = UNSET_ADDR;
parms->virt_hypercall = UNSET_ADDR;
parms->virt_hv_start_low = UNSET_ADDR;
+ parms->p2m_base = UNSET_ADDR;
parms->elf_paddr_offset = UNSET_ADDR;
/* Find and parse elf notes. */
--- 2009-01-08.orig/xen/include/public/elfnote.h 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/xen/include/public/elfnote.h 2009-01-08 10:56:30.000000000 +0100
@@ -162,9 +162,20 @@
#define XEN_ELFNOTE_SUSPEND_CANCEL 14
/*
+ * The (non-default) location the initial phys-to-machine map should be
+ * placed at by the hypervisor (Dom0) or the tools (DomU).
+ * The kernel must be prepared for this mapping to be established using
+ * large pages, despite such otherwise not being available to guests.
+ * The kernel must also be able to handle the page table pages used for
+ * this mapping not being accessible through the initial mapping.
+ * (Only x86-64 supports this at present.)
+ */
+#define XEN_ELFNOTE_INIT_P2M 15
+
+/*
* The number of the highest elfnote defined.
*/
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M
/*
* System information exported through crash notes.
--- 2009-01-08.orig/xen/include/public/libelf.h 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/xen/include/public/libelf.h 2009-01-08 10:56:30.000000000 +0100
@@ -232,6 +232,7 @@ struct elf_dom_parms {
uint64_t virt_entry;
uint64_t virt_hypercall;
uint64_t virt_hv_start_low;
+ uint64_t p2m_base;
uint64_t elf_paddr_offset;
uint32_t f_supported[XENFEAT_NR_SUBMAPS];
uint32_t f_required[XENFEAT_NR_SUBMAPS];
--- 2009-01-08.orig/xen/include/public/xen.h 2009-01-08 11:44:11.000000000 +0100
+++ 2009-01-08/xen/include/public/xen.h 2009-01-08 10:56:30.000000000 +0100
@@ -513,6 +513,7 @@ typedef struct shared_info shared_info_t
* a. relocated kernel image
* b. initial ram disk [mod_start, mod_len]
* c. list of allocated page frames [mfn_list, nr_pages]
+ * (unless relocated due to XEN_ELFNOTE_INIT_P2M)
* d. start_info_t structure [register ESI (x86)]
* e. bootstrap page tables [pt_base, CR3 (x86)]
* f. bootstrap stack [register ESP (x86)]
@@ -554,6 +555,9 @@ struct start_info {
unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
unsigned long mod_len; /* Size (bytes) of pre-loaded module. */
int8_t cmd_line[MAX_GUEST_CMDLINE];
+ /* The pfn range here covers both page table and p->m table frames. */
+ unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table. */
+ unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table. */
};
typedef struct start_info start_info_t;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cfe5b96404bdcaa218a6b1beb21e59cf203fa3a5b3d96c46ec5406e4ca0853e0
size 22567950

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e09d164603872500120d70e947b329525b920f45ce924c3661057cdff3fb97bd
size 23209042

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/python/xen/xend/XendAuthSessions.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendAuthSessions.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendAuthSessions.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendAuthSessions.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendAuthSessions.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendAuthSessions.py
@@ -84,7 +84,7 @@ class XendAuthSessions:
# if PAM doesn't exist, let's ignore it
return False

View File

@ -1,12 +1,12 @@
Index: xen-3.4.1-testing/xen/Makefile
Index: xen-4.0.0-testing/xen/Makefile
===================================================================
--- xen-3.4.1-testing.orig/xen/Makefile
+++ xen-3.4.1-testing/xen/Makefile
--- xen-4.0.0-testing.orig/xen/Makefile
+++ xen-4.0.0-testing/xen/Makefile
@@ -1,3 +1,4 @@
+export XEN_CHANGESET = unavailable
# This is the correct place to edit the build version.
# All other places this is stored (eg. compile.h) should be autogenerated.
export XEN_VERSION = 3
export XEN_VERSION = 4
@@ -82,7 +83,7 @@ delete-unfresh-files:
@rm -f $@1 $@2

View File

@ -1,14 +1,17 @@
Index: xen-3.4.1-testing/Config.mk
Index: xen-4.0.0-testing/Config.mk
===================================================================
--- xen-3.4.1-testing.orig/Config.mk
+++ xen-3.4.1-testing/Config.mk
@@ -124,14 +124,14 @@ QEMU_REMOTE=http://xenbits.xensource.com
--- xen-4.0.0-testing.orig/Config.mk
+++ xen-4.0.0-testing/Config.mk
@@ -148,7 +148,7 @@ QEMU_REMOTE=http://xenbits.xensource.com
# Specify which qemu-dm to use. This may be `ioemu' to use the old
# Mercurial in-tree version, or a local directory, or a git URL.
# CONFIG_QEMU ?= ../qemu-xen.git
-CONFIG_QEMU ?= $(QEMU_REMOTE)
+CONFIG_QEMU ?= ioemu-remote
QEMU_TAG := xen-4.0.0-rc1
#QEMU_TAG ?= 2621a102cd74cd6691bed30f638581639fcb141d
@@ -164,9 +164,9 @@ CONFIG_OCAML_XENSTORED ?= n
# Optional components
XENSTAT_XENTOP ?= y
VTPM_TOOLS ?= n
@ -20,3 +23,21 @@ Index: xen-3.4.1-testing/Config.mk
--include $(XEN_ROOT)/.config
+#-include $(XEN_ROOT)/.config
Index: xen-4.0.0-testing/tools/libxc/Makefile
===================================================================
--- xen-4.0.0-testing.orig/tools/libxc/Makefile
+++ xen-4.0.0-testing/tools/libxc/Makefile
@@ -169,10 +169,10 @@ zlib-options = $(shell \
fi) | grep $(1))
endif
-xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
-xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
+#xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
+#xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
-libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
+#libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS)

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/docs/Makefile
Index: xen-4.0.0-testing/docs/Makefile
===================================================================
--- xen-3.4.1-testing.orig/docs/Makefile
+++ xen-3.4.1-testing/docs/Makefile
--- xen-4.0.0-testing.orig/docs/Makefile
+++ xen-4.0.0-testing/docs/Makefile
@@ -90,7 +90,8 @@ install: all
$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
cp -dR man1 $(DESTDIR)$(MANDIR)
@ -22,10 +22,10 @@ Index: xen-3.4.1-testing/docs/Makefile
+ ln -sf $*.html html.done/$*/index.html
+ rm -rf html/
+
Index: xen-3.4.1-testing/tools/security/Makefile
Index: xen-4.0.0-testing/tools/security/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/security/Makefile
+++ xen-3.4.1-testing/tools/security/Makefile
--- xen-4.0.0-testing.orig/tools/security/Makefile
+++ xen-4.0.0-testing/tools/security/Makefile
@@ -60,8 +60,8 @@ install: all $(ACM_CONFIG_FILE)
$(INSTALL_DATA) $(ACM_INST_HTML) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
@ -37,24 +37,24 @@ Index: xen-3.4.1-testing/tools/security/Makefile
else
.PHONY: all
all:
Index: xen-3.4.1-testing/tools/pygrub/Makefile
Index: xen-4.0.0-testing/tools/pygrub/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/pygrub/Makefile
+++ xen-3.4.1-testing/tools/pygrub/Makefile
--- xen-4.0.0-testing.orig/tools/pygrub/Makefile
+++ xen-4.0.0-testing/tools/pygrub/Makefile
@@ -11,7 +11,7 @@ build:
.PHONY: install
install: all
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
- $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
+ --prefix="/usr" --root="$(DESTDIR)" --force
$(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub
$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
.PHONY: clean
Index: xen-3.4.1-testing/tools/python/Makefile
Index: xen-4.0.0-testing/tools/python/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/python/Makefile
+++ xen-3.4.1-testing/tools/python/Makefile
@@ -56,7 +56,7 @@ refresh-po: $(POTFILE)
--- xen-4.0.0-testing.orig/tools/python/Makefile
+++ xen-4.0.0-testing/tools/python/Makefile
@@ -60,7 +60,7 @@ refresh-po: $(POTFILE)
.PHONY: install
install: install-messages install-dtd
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
@ -62,11 +62,11 @@ Index: xen-3.4.1-testing/tools/python/Makefile
+ --prefix="/usr" --root="$(DESTDIR)" --force
install-dtd: all
$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
Index: xen-3.4.1-testing/tools/xenstore/Makefile
$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)
Index: xen-4.0.0-testing/tools/xenstore/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/xenstore/Makefile
+++ xen-3.4.1-testing/tools/xenstore/Makefile
--- xen-4.0.0-testing.orig/tools/xenstore/Makefile
+++ xen-4.0.0-testing/tools/xenstore/Makefile
@@ -10,6 +10,7 @@ CFLAGS += $(CFLAGS_libxenctrl)
CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
@ -75,8 +75,8 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
@@ -30,7 +31,7 @@ endif
all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump
@@ -35,7 +36,7 @@ endif
all: $(ALL_TARGETS)
.PHONY: clients
-clients: xenstore $(CLIENTS) xenstore-control
@ -84,7 +84,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
ifeq ($(CONFIG_SunOS),y)
xenstored_probes.h: xenstored_probes.d
@@ -50,6 +51,9 @@ xenstored: $(XENSTORED_OBJS)
@@ -55,6 +56,9 @@ xenstored: $(XENSTORED_OBJS)
$(CLIENTS): xenstore
ln -f xenstore $@
@ -94,7 +94,7 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
xenstore: xenstore_client.o $(LIBXENSTORE)
$(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
@@ -77,7 +81,7 @@ clean:
@@ -82,7 +86,7 @@ clean:
rm -f *.a *.o *.opic *.so* xenstored_probes.h
rm -f xenstored xs_random xs_stress xs_crashme
rm -f xs_tdb_dump xenstore-control
@ -103,15 +103,15 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
$(RM) $(DEPS)
.PHONY: TAGS
@@ -92,6 +96,7 @@ tarball: clean
install: all
$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
@@ -100,6 +104,7 @@ ifneq ($(CONFIG_OCAML_XENSTORED),y)
$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
endif
+ $(INSTALL_DIR) $(DESTDIR)/bin
$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
@@ -101,6 +106,9 @@ install: all
@@ -108,6 +113,9 @@ endif
set -e ; for c in $(CLIENTS) ; do \
ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \
done
@ -121,12 +121,12 @@ Index: xen-3.4.1-testing/tools/xenstore/Makefile
$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile
Index: xen-4.0.0-testing/tools/hotplug/Linux/Makefile
===================================================================
--- xen-3.4.1-testing.orig/tools/hotplug/Linux/Makefile
+++ xen-3.4.1-testing/tools/hotplug/Linux/Makefile
@@ -40,18 +40,6 @@ endif
UDEV_RULES_DIR = /etc/udev
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/Makefile
+++ xen-4.0.0-testing/tools/hotplug/Linux/Makefile
@@ -38,18 +38,6 @@ endif
UDEV_RULES_DIR = $(CONFIG_DIR)/udev
UDEV_RULES = xen-backend.rules xend.rules
-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
@ -144,7 +144,7 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile
.PHONY: all
all:
@@ -59,15 +47,15 @@ all:
@@ -57,16 +45,16 @@ all:
build:
.PHONY: install
@ -153,17 +153,19 @@ Index: xen-3.4.1-testing/tools/hotplug/Linux/Makefile
.PHONY: install-initd
install-initd:
[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
- [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig
[ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d
- [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig
+ [ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
- $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
- $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend
+ $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)/var/adm/fillup-templates/
$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
- $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains
+ $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/var/adm/fillup-templates/
.PHONY: install-scripts
install-scripts:
@@ -97,8 +85,7 @@ install-udev:
@@ -96,8 +84,7 @@ install-udev:
$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
set -e; for i in $(UDEV_RULES); \
do \

13
xen-disable-libxl.diff Normal file
View File

@ -0,0 +1,13 @@
Index: xen-4.0.0-testing/tools/Makefile
===================================================================
--- xen-4.0.0-testing.orig/tools/Makefile
+++ xen-4.0.0-testing/tools/Makefile
@@ -33,7 +33,7 @@ SUBDIRS-$(CONFIG_Linux) += fs-back
SUBDIRS-$(CONFIG_NetBSD) += fs-back
SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
SUBDIRS-y += xenpmd
-SUBDIRS-y += libxl
+#SUBDIRS-y += libxl
SUBDIRS-y += remus
SUBDIRS-$(CONFIG_X86) += xenpaging

View File

@ -5,11 +5,11 @@ the "sendkey" command, among other useful things), remove all console
commands that can read/write dom0's state.
Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
Index: xen-4.0.0-testing/tools/ioemu-remote/monitor.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/monitor.c
+++ xen-3.4.1-testing/tools/ioemu-remote/monitor.c
@@ -1481,6 +1481,7 @@ static const term_cmd_t term_cmds[] = {
--- xen-4.0.0-testing.orig/tools/ioemu-remote/monitor.c
+++ xen-4.0.0-testing/tools/ioemu-remote/monitor.c
@@ -1497,6 +1497,7 @@ static const term_cmd_t term_cmds[] = {
"device|all", "commit changes to the disk images (if -snapshot is used) or backing files" },
{ "info", "s?", do_info,
"subcommand", "show various information about the system state" },
@ -17,7 +17,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
{ "q|quit", "", do_quit,
"", "quit the emulator" },
{ "eject", "-fB", do_eject,
@@ -1493,6 +1494,7 @@ static const term_cmd_t term_cmds[] = {
@@ -1509,6 +1510,7 @@ static const term_cmd_t term_cmds[] = {
"filename", "output logs to 'filename'" },
{ "log", "s", do_log,
"item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
@ -25,22 +25,18 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
{ "savevm", "s?", do_savevm,
"tag|id", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" },
{ "loadvm", "s", do_loadvm,
@@ -1522,12 +1524,14 @@ static const term_cmd_t term_cmds[] = {
@@ -1538,8 +1540,10 @@ static const term_cmd_t term_cmds[] = {
"", "reset the system" },
{ "system_powerdown", "", do_system_powerdown,
"", "send system power down event" },
+#ifdef CONFIG_TRUSTED_CLIENT
{ "sum", "ii", do_sum,
"addr size", "compute the checksum of a memory region" },
+#endif
{ "usb_add", "s", do_usb_add,
"device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" },
{ "usb_del", "s", do_usb_del,
"device", "remove USB device 'bus.addr'" },
+#endif
#ifdef CONFIG_PHP_DEBUG
{ "pci_add", "s", do_pci_add,
"device", "insert PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" },
@@ -1542,6 +1546,7 @@ static const term_cmd_t term_cmds[] = {
@@ -1558,6 +1562,7 @@ static const term_cmd_t term_cmds[] = {
"state", "change mouse button state (1=L, 2=M, 4=R)" },
{ "mouse_set", "i", do_mouse_set,
"index", "set which mouse device receives events" },
@ -48,7 +44,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
#ifdef HAS_AUDIO
{ "wavcapture", "si?i?i?", do_wav_capture,
"path [frequency bits channels]",
@@ -1549,6 +1554,7 @@ static const term_cmd_t term_cmds[] = {
@@ -1565,6 +1570,7 @@ static const term_cmd_t term_cmds[] = {
#endif
{ "stopcapture", "i", do_stop_capture,
"capture index", "stop capture" },
@ -56,7 +52,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
{ "memsave", "lis", do_memory_save,
"addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", },
{ "pmemsave", "lis", do_physical_memory_save,
@@ -1628,6 +1634,7 @@ static const term_cmd_t info_cmds[] = {
@@ -1646,6 +1652,7 @@ static const term_cmd_t info_cmds[] = {
"", "show KVM information", },
{ "usb", "", usb_info,
"", "show guest USB devices", },
@ -64,7 +60,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/monitor.c
{ "usbhost", "", usb_host_info,
"", "show host USB devices", },
{ "profile", "", do_info_profile,
@@ -1659,6 +1666,7 @@ static const term_cmd_t info_cmds[] = {
@@ -1677,6 +1684,7 @@ static const term_cmd_t info_cmds[] = {
{ "migrate", "", do_info_migrate, "", "show migration status" },
{ "balloon", "", do_info_balloon,
"", "show balloon information" },

View File

@ -0,0 +1,13 @@
Index: xen-4.0.0-testing/tools/Makefile
===================================================================
--- xen-4.0.0-testing.orig/tools/Makefile
+++ xen-4.0.0-testing/tools/Makefile
@@ -35,7 +35,7 @@ SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
SUBDIRS-y += xenpmd
#SUBDIRS-y += libxl
SUBDIRS-y += remus
-SUBDIRS-$(CONFIG_X86) += xenpaging
+#SUBDIRS-$(CONFIG_X86) += xenpaging
# These don't cross-compile
ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py
Index: xen-4.0.0-testing/tools/python/xen/util/blkif.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/util/blkif.py
+++ xen-3.4.1-testing/tools/python/xen/util/blkif.py
@@ -71,23 +71,24 @@ def blkdev_segment(name):
--- xen-4.0.0-testing.orig/tools/python/xen/util/blkif.py
+++ xen-4.0.0-testing/tools/python/xen/util/blkif.py
@@ -71,8 +71,8 @@ def blkdev_segment(name):
'type' : 'Disk' }
return val
@ -12,8 +12,9 @@ Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py
+ fn = typ = taptype = None
if uname.find(":") != -1:
(typ, fn) = uname.split(":", 1)
if typ in ("phy", "drbd") and not fn.startswith("/"):
fn = "/dev/%s" %(fn,)
@@ -88,15 +88,16 @@ def _parse_uname(uname):
if typ == "tap":
(taptype, fn) = fn.split(":", 1)
- return (fn, taptype)
@ -28,15 +29,15 @@ Index: xen-3.4.1-testing/tools/python/xen/util/blkif.py
def blkdev_uname_to_taptype(uname):
"""Take a blkdev uname and return the blktap type."""
- return _parse_uname(uname)[1]
+ return parse_uname(uname)[1][0]
+ return parse_uname(uname)[1]
def mount_mode(name):
mode = None
Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py
@@ -593,6 +593,31 @@ class DevController:
--- xen-4.0.0-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-4.0.0-testing/tools/python/xen/xend/server/DevController.py
@@ -592,6 +592,31 @@ class DevController:
return (Missing, None)
@ -68,10 +69,10 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/server/DevController.py
def backendPath(self, backdom, devid):
"""Construct backend path given the backend domain and device id.
Index: xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendBootloader.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendBootloader.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendBootloader.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendBootloader.py
@@ -12,7 +12,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
@ -109,20 +110,20 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendBootloader.py
log.error(msg)
raise VmError(msg)
Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -35,7 +35,7 @@ from types import StringTypes
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -37,7 +37,7 @@ from types import StringTypes
import xen.lowlevel.xc
from xen.util import asserts
from xen.util import asserts, auxbin
-from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype
+from xen.util.blkif import parse_uname
import xen.util.xsm.xsm as security
from xen.util import xsconstants
@@ -2135,6 +2135,10 @@ class XendDomainInfo:
from xen.util import mkdir
@@ -2320,6 +2320,10 @@ class XendDomainInfo:
deviceClass, config = self.info['devices'].get(dev_uuid)
self._waitForDevice(deviceClass, config['devid'])
@ -133,19 +134,25 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
def _waitForDevice_destroy(self, deviceClass, devid, backpath):
return self.getDeviceController(deviceClass).waitForDevice_destroy(
devid, backpath)
@@ -2893,9 +2897,19 @@ class XendDomainInfo:
@@ -3206,7 +3210,7 @@ class XendDomainInfo:
devtype = devinfo[0]
disk = devinfo[1]['uname']
- fn = blkdev_uname_to_file(disk)
- taptype = blkdev_uname_to_taptype(disk)
- mounted = devtype == 'tap' and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
+ (fn, types) = parse_uname(disk)
+
# If this is a drbd volume, check if we need to activate it
if disk.find(":") != -1:
@@ -3217,8 +3221,17 @@ class XendDomainInfo:
if state == 'Secondary':
os.system('/sbin/drbdadm primary ' + diskname)
- taptype = blkdev_uname_to_taptype(disk)
- mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
+ def _shouldMount(types):
+ if types[0] in ('file', 'phy'):
+ return False
+ if types[0] == 'tap':
+ if types[0] == 'tap' or types[0] == 'tap2':
+ if types[1] in ('aio', 'sync'):
+ return False
+ else:
@ -156,27 +163,26 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
if mounted:
# This is a file, not a device. pygrub can cope with a
# file if it's raw, but if it's QCOW or other such formats
@@ -2911,7 +2925,9 @@ class XendDomainInfo:
@@ -3234,7 +3247,8 @@ class XendDomainInfo:
from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain()
- dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk))
+ vbd_uuid = dom0.create_vbd(vbd, disk)
+ dom0._waitForDeviceUUID(vbd_uuid)
+ dom0._waitForDeviceFrontUUID(vbd_uuid)
fn = BOOTLOADER_LOOPBACK_DEVICE
try:
@@ -2921,8 +2937,10 @@ class XendDomainInfo:
@@ -3244,8 +3258,10 @@ class XendDomainInfo:
if mounted:
log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))
-
- dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+ if devtype == 'tap':
+ dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+ if devtype in ['tap', 'tap2']:
+ dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True)
+ else:
+ dom0.destroyDevice('vbd', BOOTLOADER_LOOPBACK_DEVICE)
+ dom0.destroyDevice('vbd', BOOTLOADER_LOOPBACK_DEVICE, rm_cfg = True)
if blcfg is None:
msg = "Had a bootloader specified, but can't find disk"

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5
Index: xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5
===================================================================
--- xen-3.4.1-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5
--- xen-4.0.0-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-4.0.0-testing/docs/man/xmdomain.cfg.pod.5
@@ -335,16 +335,10 @@ at hda1, which is the root filesystem.
=item I<NFS Root>
@ -19,10 +19,10 @@ Index: xen-3.4.1-testing/docs/man/xmdomain.cfg.pod.5
=back
=head1 SEE ALSO
Index: xen-3.4.1-testing/docs/man/xm.pod.1
Index: xen-4.0.0-testing/docs/man/xm.pod.1
===================================================================
--- xen-3.4.1-testing.orig/docs/man/xm.pod.1
+++ xen-3.4.1-testing/docs/man/xm.pod.1
--- xen-4.0.0-testing.orig/docs/man/xm.pod.1
+++ xen-4.0.0-testing/docs/man/xm.pod.1
@@ -297,7 +297,8 @@ scheduling by the Xen hypervisor.
=item B<s - shutdown>

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/net.h
Index: xen-4.0.0-testing/tools/ioemu-remote/net.h
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/net.h
+++ xen-3.4.1-testing/tools/ioemu-remote/net.h
--- xen-4.0.0-testing.orig/tools/ioemu-remote/net.h
+++ xen-4.0.0-testing/tools/ioemu-remote/net.h
@@ -107,8 +107,8 @@ void net_host_device_add(const char *dev
void net_host_device_remove(int vlan_id, const char *device);
@ -13,10 +13,10 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/net.h
#endif
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
Index: xen-3.4.1-testing/tools/ioemu-remote/net.c
Index: xen-4.0.0-testing/tools/ioemu-remote/net.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/net.c
+++ xen-3.4.1-testing/tools/ioemu-remote/net.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/net.c
+++ xen-4.0.0-testing/tools/ioemu-remote/net.c
@@ -1759,9 +1759,10 @@ int net_client_init(const char *device,
}
if (get_param_value(script_arg, sizeof(script_arg), "scriptarg", p) == 0 &&
@ -30,11 +30,11 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/net.c
}
} else
#endif
Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
Index: xen-4.0.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.4.1-testing/tools/python/xen/xend/image.py
@@ -830,14 +830,16 @@ class HVMImageHandler(ImageHandler):
--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.0-testing/tools/python/xen/xend/image.py
@@ -912,11 +912,13 @@ class HVMImageHandler(ImageHandler):
mac = devinfo.get('mac')
if mac is None:
raise VmError("MAC address not specified or generated.")
@ -42,22 +42,19 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
+ bridge = devinfo.get('bridge', None)
model = devinfo.get('model', 'rtl8139')
ret.append("-net")
ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
(nics, mac, model))
ret.append("-net")
- ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" %
- (nics, self.vm.getDomid(), nics-1, bridge))
+ net = "tap,vlan=%d,ifname=tap%d.%d" % (nics, self.vm.getDomid(), nics-1)
- ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
- (nics, mac, model))
+ net = "nic,vlan=%d,macaddr=%s,model=%s" % (nics, mac, model)
+ if bridge:
+ net += ",bridge=%s" % bridge
+ ret.append(net)
if nics == 0:
ret.append("-net")
Index: xen-3.4.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup
vifname = devinfo.get('vifname')
if vifname:
vifname = "tap-" + vifname
Index: xen-4.0.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup-Linux
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup
+++ xen-3.4.1-testing/tools/ioemu-remote/i386-dm/qemu-ifup
--- xen-4.0.0-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup-Linux
+++ xen-4.0.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup-Linux
@@ -1,36 +1,22 @@
#!/bin/sh

View File

@ -1,10 +1,10 @@
PAE must be on for 64-on-64 to work at all.
Index: xen-3.4.1-testing/tools/python/xen/xend/image.py
Index: xen-4.0.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.4.1-testing/tools/python/xen/xend/image.py
@@ -941,7 +941,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
--- xen-4.0.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-4.0.0-testing/tools/python/xen/xend/image.py
@@ -1030,7 +1030,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
def configure(self, vmConfig):
HVMImageHandler.configure(self, vmConfig)

View File

@ -1,7 +1,7 @@
Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c
Index: xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c
===================================================================
--- xen-3.4.1-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c
--- xen-4.0.0-testing.orig/tools/ioemu-remote/hw/xen_platform.c
+++ xen-4.0.0-testing/tools/ioemu-remote/hw/xen_platform.c
@@ -30,6 +30,8 @@
#include "qemu-xen.h"
#include "net.h"
@ -11,7 +11,7 @@ Index: xen-3.4.1-testing/tools/ioemu-remote/hw/xen_platform.c
#include <assert.h>
#include <xenguest.h>
@@ -331,11 +333,51 @@ static void xen_platform_ioport_writeb(v
@@ -335,11 +337,51 @@ static void xen_platform_ioport_writeb(v
}
}

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
@@ -809,11 +809,35 @@ class XendNode:
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendNode.py
@@ -907,15 +907,39 @@ class XendNode:
info['cpu_mhz'] = info['cpu_khz'] / 1000
@ -10,7 +10,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
- info['total_memory'] = info['total_memory'] / 1024
- info['free_memory'] = info['free_memory'] / 1024
- info['node_to_cpu'] = self.format_node_to_cpu(info)
- info['node_to_memory'] = self.format_node_to_memory(info)
- info['node_to_memory'] = \
+ configured_floor = xendoptions().get_dom0_min_mem() * 1024
+ from xen.xend import balloon
+ try:
@ -30,8 +30,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
+ info['free_memory'] = info['free_memory'] / 1024
+ info['max_free_memory'] = info['max_free_memory'] / 1024
+ info['node_to_cpu'] = self.format_node_to_cpu(info)
+ info['node_to_memory'] = self.format_node_to_memory(info)
+
+ info['node_to_memory'] = \
self.format_node_to_memory(info, 'node_to_memory')
info['node_to_dma32_mem'] = \
self.format_node_to_memory(info, 'node_to_dma32_mem')
+ # FIXME: These are hard-coded to be the inverse of the getXenMemory
+ # functions in image.py. Find a cleaner way.
+ info['max_para_memory'] = info['max_free_memory'] - 4
@ -40,10 +43,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
+ info['max_hvm_memory'] = int((info['max_free_memory']-12) * (1-2.4/1024))
+ if info['max_hvm_memory'] < 0:
+ info['max_hvm_memory'] = 0
+
ITEM_ORDER = ['nr_cpus',
'nr_nodes',
@@ -824,6 +848,9 @@ class XendNode:
'cores_per_socket',
@@ -925,6 +949,9 @@ class XendNode:
'virt_caps',
'total_memory',
'free_memory',
@ -51,13 +55,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendNode.py
+ 'max_para_memory',
+ 'max_hvm_memory',
'node_to_cpu',
'node_to_memory'
]
Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py
'node_to_memory',
'node_to_dma32_mem'
Index: xen-4.0.0-testing/tools/python/xen/xend/balloon.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/balloon.py
+++ xen-3.4.1-testing/tools/python/xen/xend/balloon.py
@@ -41,6 +41,8 @@ SLEEP_TIME_GROWTH = 0.1
--- xen-4.0.0-testing.orig/tools/python/xen/xend/balloon.py
+++ xen-4.0.0-testing/tools/python/xen/xend/balloon.py
@@ -43,6 +43,8 @@ SLEEP_TIME_GROWTH = 0.1
# label actually shown in the PROC_XEN_BALLOON file.
#labels = { 'current' : 'Current allocation',
# 'target' : 'Requested target',
@ -66,7 +70,7 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py
# 'low-balloon' : 'Low-mem balloon',
# 'high-balloon' : 'High-mem balloon',
# 'limit' : 'Xen hard limit' }
@@ -67,6 +69,23 @@ def get_dom0_target_alloc():
@@ -69,6 +71,23 @@ def get_dom0_target_alloc():
raise VmError('Failed to query target memory allocation of dom0.')
return kb
@ -90,13 +94,13 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/balloon.py
def free(need_mem, dominfo):
"""Balloon out memory from the privileged domain so that there is the
specified required amount (in KiB) free.
Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1295,6 +1295,27 @@ class XendDomainInfo:
dev_str_list = dev_str_list + [dev_str]
return dev_str_list
--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1452,6 +1452,27 @@ class XendDomainInfo:
pci_conf = self.info['devices'][dev_uuid][1]
return map(pci_dict_to_bdf_str, pci_conf['devs'])
+ def capAndSetMemoryTarget(self, target):
+ """Potentially lowers the requested target to the largest possible
@ -122,11 +126,11 @@ Index: xen-3.4.1-testing/tools/python/xen/xend/XendDomainInfo.py
def setMemoryTarget(self, target):
"""Set the memory target of this domain.
@param target: In MiB.
Index: xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py
Index: xen-4.0.0-testing/tools/python/xen/xend/server/SrvDomain.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-3.4.1-testing/tools/python/xen/xend/server/SrvDomain.py
@@ -172,7 +172,7 @@ class SrvDomain(SrvDir):
--- 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
@@ -173,7 +173,7 @@ class SrvDomain(SrvDir):
def op_mem_target_set(self, _, req):

View File

@ -1,8 +1,8 @@
Index: xen-3.4.1-testing/tools/python/xen/xm/create.py
Index: xen-4.0.0-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.4.1-testing/tools/python/xen/xm/create.py
@@ -1160,9 +1160,8 @@ def preprocess_access_control(vals):
--- xen-4.0.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-4.0.0-testing/tools/python/xen/xm/create.py
@@ -1321,9 +1321,8 @@ def preprocess_access_control(vals):
def preprocess_ip(vals):
if vals.ip or vals.dhcp != 'off':

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