Hello community,
here is the log from the commit of package xen
checked in at Fri Jun 2 02:10:12 CEST 2006.
--------
--- arch/i386/xen/xen.changes 2006-05-26 23:59:59.000000000 +0200
+++ xen/xen.changes 2006-06-01 18:53:42.000000000 +0200
@@ -1,0 +2,17 @@
+Wed May 31 14:53:43 MDT 2006 - ccoffing@novell.com
+
+- Jan's backport of xen-unstable changesets 9517, 9518, and 9529.
+ This allows Xen to boot on 4-node configurations without
+ crashing. (#150114)
+- Include patch from Jun Nakajima at Intel to fix inability to
+ start XWindows after creating HVM guest. (#159001)
+- Include select patches from xen-3.0-testing:
+ + 9697: Fix infinite recursion loop in get_page_type() error path
+- Include xen-unstable changeset 9967, to improve Summagraphics
+ tablet emulation, to help mouse tracking in HVM. (#167187)
+- Include 3 patches from AMD to fix SMP support in HVM. (#176171)
+- Add CPUID masking patches from AMD and Intel for HVM. This
+ prevents the OS from seeing (and trying to use) various hardware
+ features that are not supported within the VM. (#180879)
+
+-------------------------------------------------------------------
New:
----
xen-159001.diff
xen-8-way-bios.patch
xen-amd-smp.diff
xen-cpuid-amd.diff
xen-cpuid.diff
xen-genapic.diff
xen-get-page-type.diff
xen-hvm-xchg.diff
xen-unstable-9967-summa.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.3iU1l2/_old 2006-06-02 02:09:47.000000000 +0200
+++ /var/tmp/diff_new_pack.3iU1l2/_new 2006-06-02 02:09:47.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package xen (Version 3.0.2_09668)
+# spec file for package xen (Version 3.0.2_09697)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -14,12 +14,12 @@
BuildRequires: LibVNCServer SDL-devel autoconf automake bin86 dev86 glibc-devel-32bit latex2html libjpeg-devel libreiserfs-devel python-devel te_ams te_latex tetex transfig
%define xvers 3.0
%define xvermaj 3
-%define changeset 09668
+%define changeset 09697
%define build_xmtest 0
%define with_pygrub 1
%define xen_build_dir xen-3.0-testing
-Version: 3.0.2_09668
-Release: 6
+Version: 3.0.2_09697
+Release: 1
License: GPL
Group: System/Kernel
Autoreqprov: on
@@ -78,9 +78,14 @@
Patch40: xen-console.diff
Patch41: xen-removable.diff
Patch42: xen-fatal-trap-halt.diff
-Patch49: xen-enable-hvm-debug.diff
-Patch50: xen-enable-debug
-Patch99: xen-poweroff.diff
+Patch43: xen-amd-smp.diff
+Patch44: xen-hvm-xchg.diff
+Patch45: xen-8-way-bios.patch
+Patch46: xen-cpuid.diff
+Patch47: xen-cpuid-amd.diff
+Patch48: xen-159001.diff
+Patch49: xen-get-page-type.diff
+Patch50: xen-genapic.diff
Patch100: xen-9657-get-mfn-from-gpfn.diff
Patch101: xen-9658-pirq-mask-into-bitmap.diff
Patch102: xen-9659-intr-ack-routine.diff
@@ -100,6 +105,10 @@
Patch116: xen-9688-rm-broken-string-func.diff
Patch117: xen-9695-signed.diff
Patch118: xen-9696-rm-broken-string-func.diff
+Patch119: xen-unstable-9967-summa.diff
+Patch200: xen-enable-hvm-debug.diff
+Patch201: xen-enable-debug
+Patch202: xen-poweroff.diff
URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
Prefix: /usr
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -462,6 +471,7 @@
%patch116 -p1
%patch117 -p1
%patch118 -p1
+%patch119 -p1
# Now our patches...
%patch1 -p1
%patch2 -p1
@@ -505,12 +515,20 @@
%patch40 -p1
%patch41 -p1
%patch42 -p1
-#%patch49 -p1
+%patch43 -p1
+%patch44 -p1
+%patch45 -p1
+%patch46 -p1
+%patch47 -p1
+%patch48 -p1
+%patch49 -p1
+%patch50 -p1
+#%patch200 -p1
XEN_EXTRAVERSION=%version-%release
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
sed -i "s/XEN_EXTRAVERSION[ ]*=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile
sed -i "s/XEN_CHANGESET[ ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile
-%patch50 -p1
+%patch201 -p1
%build
test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
@@ -553,7 +571,7 @@
rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz; ln -s xen-dbg-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen-dbg-%{xvers}.gz
rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz; ln -s xen-dbg-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen-dbg-%{xvermaj}.gz
mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms-dbg-%{version}-%{release}
-patch -p1 -R <%PATCH50
+patch -p1 -R <%PATCH201
%ifarch %ix86
# Build PAE, non-debug version
make -C xen clean
@@ -811,6 +829,20 @@
%{insserv_cleanup}
%changelog -n xen
+* Wed May 31 2006 - ccoffing@novell.com
+- Jan's backport of xen-unstable changesets 9517, 9518, and 9529.
+ This allows Xen to boot on 4-node configurations without
+ crashing. (#150114)
+- Include patch from Jun Nakajima at Intel to fix inability to
+ start XWindows after creating HVM guest. (#159001)
+- Include select patches from xen-3.0-testing:
+ + 9697: Fix infinite recursion loop in get_page_type() error path
+- Include xen-unstable changeset 9967, to improve Summagraphics
+ tablet emulation, to help mouse tracking in HVM. (#167187)
+- Include 3 patches from AMD to fix SMP support in HVM. (#176171)
+- Add CPUID masking patches from AMD and Intel for HVM. This
+ prevents the OS from seeing (and trying to use) various hardware
+ features that are not supported within the VM. (#180879)
* Fri May 26 2006 - ccoffing@novell.com
- Fix deadlock between xm and qemu. Qemu should not call xm;
issue xc commands directly. This deadlock was exposed when
++++++ xen-159001.diff ++++++
Bugzilla #159001
Comment #19 From Donald Dugger 2006-05-31 10:20 MST [reply]
Actually, there is good news. Jun Nakajima found the root cause for the bug
and has created the attached patch to fix it. I've tested this patch and it
cures the problem.
Index: xen-3.0-testing/xen/arch/x86/shadow.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/shadow.c
+++ xen-3.0-testing/xen/arch/x86/shadow.c
@@ -1689,7 +1689,8 @@ static int resync_all(struct domain *d,
unshadow_l1 = 1;
else {
need_flush |= error;
- set_guest_back_ptr(d, *sl1e_p, smfn, i);
+ if ( l1e_get_flags(*sl1e_p) & _PAGE_PRESENT )
+ set_guest_back_ptr(d, *sl1e_p, smfn, i);
}
// can't update snapshots of linear page tables -- they
// are used multiple times...
Index: xen-3.0-testing/xen/arch/x86/shadow32.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/shadow32.c
+++ xen-3.0-testing/xen/arch/x86/shadow32.c
@@ -2684,7 +2684,8 @@ static int resync_all(struct domain *d,
unshadow_l1 = 1;
else {
need_flush |= error;
- set_guest_back_ptr(d, shadow1[i], smfn, i);
+ if ( l1e_get_flags(shadow1[i]) & _PAGE_PRESENT )
+ set_guest_back_ptr(d, shadow1[i], smfn, i);
}
// can't update snapshots of linear page tables -- they
Index: xen-3.0-testing/xen/include/asm-x86/shadow.h
===================================================================
--- xen-3.0-testing.orig/xen/include/asm-x86/shadow.h
+++ xen-3.0-testing/xen/include/asm-x86/shadow.h
@@ -762,10 +762,16 @@ static inline void set_guest_back_ptr(
unsigned long gmfn;
ASSERT(shadow_lock_is_acquired(d));
+ ASSERT( smfn );
gmfn = l1e_get_pfn(spte);
- mfn_to_page(gmfn)->tlbflush_timestamp = smfn;
- mfn_to_page(gmfn)->u.inuse.type_info &= ~PGT_va_mask;
- mfn_to_page(gmfn)->u.inuse.type_info |= (unsigned long) index << PGT_va_shift;
+ ASSERT( gmfn );
+ if ( l1e_get_flags(spte) & _PAGE_RW )
+ {
+ mfn_to_page(gmfn)->tlbflush_timestamp = smfn;
+ mfn_to_page(gmfn)->u.inuse.type_info &= ~PGT_va_mask;
+ mfn_to_page(gmfn)->u.inuse.type_info |=
+ (unsigned long) index << PGT_va_shift;
+ }
}
}
++++++ xen-8-way-bios.patch ++++++
Index: xen-3.0-testing/tools/firmware/hvmloader/Makefile
===================================================================
--- xen-3.0-testing.orig/tools/firmware/hvmloader/Makefile
+++ xen-3.0-testing/tools/firmware/hvmloader/Makefile
@@ -42,6 +42,7 @@ OBJCOPY = objcopy
# Optimizations cause problems on 64 bit. Investigate.
CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O0 -msoft-float
LDFLAGS = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
+ROMBIOS = 8-processors
all: hvmloader
@@ -51,8 +52,8 @@ hvmloader: roms.h hvmloader.c acpi_madt.
$(OBJCOPY) hvmloader.tmp hvmloader
rm -f hvmloader.tmp
-roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin
- ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
+roms.h: ../rombios/BIOS-bochs-$(ROMBIOS) ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin
+ ./mkhex rombios ../rombios/BIOS-bochs-$(ROMBIOS) > roms.h
./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
./mkhex vmxassist ../vmxassist/vmxassist.bin >> roms.h
Index: xen-3.0-testing/tools/firmware/rombios/Makefile
===================================================================
--- xen-3.0-testing.orig/tools/firmware/rombios/Makefile
+++ xen-3.0-testing/tools/firmware/rombios/Makefile
@@ -1,7 +1,7 @@
-BIOS_BUILDS = BIOS-bochs-latest
+#BIOS_BUILDS = BIOS-bochs-latest
#BIOS_BUILDS += BIOS-bochs-2-processors
#BIOS_BUILDS += BIOS-bochs-4-processors
-#BIOS_BUILDS += BIOS-bochs-8-processors
+BIOS_BUILDS += BIOS-bochs-8-processors
all: bios
++++++ xen-amd-smp.diff ++++++
Index: xen-3.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.0-testing/xen/arch/x86/hvm/svm/svm.c
@@ -81,6 +81,9 @@
void svm_dump_regs(const char *from, struct cpu_user_regs *regs);
static void svm_relinquish_guest_resources(struct domain *d);
+static int svm_do_vmmcall_reset_to_realmode(struct vcpu *v,
+ struct cpu_user_regs *regs);
+
extern void set_hsa_to_guest( struct arch_svm_struct *arch_svm );
@@ -445,6 +448,42 @@
return 0; /* dummy */
}
+
+/* SVM-specific intitialization code for VCPU application processors */
+void svm_init_ap_context(struct vcpu_guest_context *ctxt,
+ int vcpuid, int trampoline_vector)
+{
+ int i;
+ struct vcpu *v, *bsp = current;
+ struct domain *d = bsp->domain;
+ cpu_user_regs_t *regs;;
+
+
+ if ((v = d->vcpu[vcpuid]) == NULL)
+ {
+ printk("vcpuid %d is invalid! good-bye.\n", vcpuid);
+ domain_crash_synchronous();
+ }
+ regs = &v->arch.guest_context.user_regs;
+
+ memset(ctxt, 0, sizeof(*ctxt));
+ for (i = 0; i < 256; ++i)
+ {
+ ctxt->trap_ctxt[i].vector = i;
+ ctxt->trap_ctxt[i].cs = FLAT_KERNEL_CS;
+ }
+
+
+ /*
+ * We execute the trampoline code in real mode. The trampoline vector
+ * passed to us is page alligned and is the physicall frame number for
+ * the code. We will execute this code in real mode.
+ */
+ ctxt->user_regs.eip = 0x0;
+ ctxt->user_regs.cs = (trampoline_vector << 8);
+ ctxt->flags = VGCF_HVM_GUEST;
+}
+
int start_svm(void)
{
u32 eax, ecx, edx;
@@ -491,6 +530,7 @@
hvm_funcs.paging_enabled = svm_paging_enabled;
hvm_funcs.instruction_length = svm_instruction_length;
hvm_funcs.get_guest_ctrl_reg = svm_get_ctrl_reg;
+ hvm_funcs.init_ap_context = svm_init_ap_context;
hvm_enabled = 1;
@@ -667,6 +707,20 @@
if (svm_dbg_on)
svm_dump_host_regs(__func__);
#endif
+ if (v->vcpu_id != 0)
+ {
+ u16 cs_sel = regs->cs;
+ /*
+ * This is the launch of an AP; set state so that we begin executing
+ * the trampoline code in real-mode.
+ */
+ svm_do_vmmcall_reset_to_realmode(v, regs);
+ /* Adjust the state to execute the trampoline code.*/
+ v->arch.hvm_svm.vmcb->rip = 0;
+ v->arch.hvm_svm.vmcb->cs.sel= cs_sel;
+ v->arch.hvm_svm.vmcb->cs.base = (cs_sel << 4);
+ }
+
reset_stack_and_jump(svm_asm_do_launch);
}
++++++ xen-cpuid-amd.diff ++++++
# HG changeset patch
# User root@linux-163181004016.amd.com
# Node ID c5e41fb7e3d1e5bbe396d0094e73c8c016011d72
# Parent 9b503fd17fda09055d476423bc049350eb61779e
Clean up the code pat of CPUID_80000001 code path of svm_vmexit_do_cpuid(). Fix NX bit bug and change multiple-processor bits (HTT, NC and CmpLegacy) to reflect MP semantics.
Index: xen-3.0-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.0-testing/xen/arch/x86/hvm/svm/svm.c
@@ -964,8 +964,10 @@ static void svm_do_general_protection_fa
svm_inject_exception(v, TRAP_gp_fault, 1, error_code);
}
-/* Reserved bits: [31:14], [12:1] */
-#define SVM_VCPU_CPUID_L1_RESERVED 0xffffdffe
+/* Reserved bits ECX: [31:14], [12:4], [2:1]*/
+#define SVM_VCPU_CPUID_L1_ECX_RESERVED 0xffffdff6
+/* Reserved bits EDX: [31:29], [27], [22:20], [18], [10] */
+#define SVM_VCPU_CPUID_L1_EDX_RESERVED 0xe8740400
static void svm_vmexit_do_cpuid(struct vmcb_struct *vmcb, unsigned long input,
struct cpu_user_regs *regs)
@@ -988,20 +990,17 @@ static void svm_vmexit_do_cpuid(struct v
cpuid(input, &eax, &ebx, &ecx, &edx);
- if (input == 1)
+ if (input == 0x00000001)
{
if ( !hvm_apic_support(v->domain) ||
!vlapic_global_enabled((VLAPIC(v))) )
{
- clear_bit(X86_FEATURE_APIC, &edx);
- /* Since the apic is disabled, avoid any confusion about SMP cpus being available */
- clear_bit(X86_FEATURE_HT, &edx); /* clear the hyperthread bit */
- ebx &= 0xFF00FFFF; /* set the logical processor count to 1 */
- ebx |= 0x00010000;
+ /* Since the apic is disabled, avoid any confusion
+ about SMP cpus being available */
+ clear_bit(X86_FEATURE_APIC, &edx);
}
-
+
#if CONFIG_PAGING_LEVELS < 3
- clear_bit(X86_FEATURE_NX, &edx);
clear_bit(X86_FEATURE_PAE, &edx);
clear_bit(X86_FEATURE_PSE, &edx);
clear_bit(X86_FEATURE_PSE36, &edx);
@@ -1010,25 +1009,91 @@ static void svm_vmexit_do_cpuid(struct v
{
if ( !v->domain->arch.hvm_domain.pae_enabled )
{
- clear_bit(X86_FEATURE_PAE, &edx);
- clear_bit(X86_FEATURE_NX, &edx);
+ clear_bit(X86_FEATURE_PAE, &edx);
}
clear_bit(X86_FEATURE_PSE, &edx);
clear_bit(X86_FEATURE_PSE36, &edx);
}
#endif
/* Clear out reserved bits. */
- ecx &= ~SVM_VCPU_CPUID_L1_RESERVED; /* mask off reserved bits */
+ ecx &= ~SVM_VCPU_CPUID_L1_ECX_RESERVED;
+ edx &= ~SVM_VCPU_CPUID_L1_EDX_RESERVED;
+
clear_bit(X86_FEATURE_MWAIT & 31, &ecx);
+
+ /* Guest should only see one logical processor per VCPU.
+ * See details on page 23 of AMD CPUID Specification.
+ */
+ clear_bit(X86_FEATURE_HT, &edx); /* clear the hyperthread bit */
+ ebx &= 0xFF00FFFF; /* set the logical processor count to 1 */
+ ebx |= 0x00010000;
+ }
+ else if ( ( input > 0x00000005 ) && ( input < 0x80000000 ) )
+ {
+ eax = ebx = ecx = edx = 0x0;
}
-#ifdef __i386__
else if ( input == 0x80000001 )
{
+ /* We duplicate some CPUID_00000001 code because many bits of
+ CPUID_80000001_EDX overlaps with CPUID_00000001_EDX. */
+
+ if ( !hvm_apic_support(v->domain) ||
+ !vlapic_global_enabled((VLAPIC(v))) )
+ {
+ /* Since the apic is disabled, avoid any confusion
+ about SMP cpus being available */
+ clear_bit(X86_FEATURE_APIC, &edx);
+ }
+
+ /* Clear the Cmp_Legacy bit
+ * Guest should only see one logical processor per VCPU.
+ * See details on page 23 of AMD CPUID Specification.
+ */
+ clear_bit(X86_FEATURE_CMP_LEGACY & 31, &ecx);
+
+#ifdef __i386__
/* Mask feature for Intel ia32e or AMD long mode. */
+ clear_bit(X86_FEATURE_LAHF_LM & 31, &ecx);
+
clear_bit(X86_FEATURE_LM & 31, &edx);
- }
+ clear_bit(X86_FEATURE_SYSCALL & 31, &edx);
#endif
+#if CONFIG_PAGING_LEVELS < 3
+ clear_bit(X86_FEATURE_NX & 31, &edx);
+ clear_bit(X86_FEATURE_PAE, &edx);
+ clear_bit(X86_FEATURE_PSE, &edx);
+ clear_bit(X86_FEATURE_PSE36, &edx);
+#else
+ if ( v->domain->arch.ops->guest_paging_levels == PAGING_L2 )
+ {
+ if ( !v->domain->arch.hvm_domain.pae_enabled )
+ {
+ clear_bit(X86_FEATURE_NX & 31, &edx);
+ clear_bit(X86_FEATURE_PAE, &edx);
+ }
+ clear_bit(X86_FEATURE_PSE, &edx);
+ clear_bit(X86_FEATURE_PSE36, &edx);
+ }
+#endif
+
+ /* Make SVM feature invisible to the guest. */
+ clear_bit(X86_FEATURE_SVME & 31, &ecx);
+
+ /* So far, we do not support 3DNow for the guest. */
+ clear_bit(X86_FEATURE_3DNOW & 31, &edx);
+ clear_bit(X86_FEATURE_3DNOWEXT & 31, &edx);
+ }
+ else if ( ( input == 0x80000007 ) || ( input == 0x8000000A ) )
+ {
+ /* Mask out features of power management and SVM extension. */
+ eax = ebx = ecx = edx = 0;
+ }
+ else if ( input == 0x80000008 )
+ {
+ ecx &= 0xFFFFFF00; /* Make sure Number of CPU core is 1 for one vcpu */
+ }
+
regs->eax = (unsigned long)eax;
regs->ebx = (unsigned long)ebx;
regs->ecx = (unsigned long)ecx;
++++++ xen-cpuid.diff ++++++
Index: xen-3.0-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.0-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -38,6 +38,7 @@
#include