Mailinglist Archive: opensuse-commit (1028 mails)
| < Previous | Next > |
commit xen
- From: root@xxxxxxx (h_root)
- Date: Fri, 2 Jun 2006 02:10:12 +0200 (CEST)
- Message-id: <20060602001012.D0B2191075@xxxxxxxxxxxxxxx>
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@xxxxxxxxxx
+
+- 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@xxxxxxxxxx
+- 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@xxxxxxxxxx
- 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@xxxxxxxxxxxxxxxxxxxxxxxxxx
# 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 <asm/hvm/support.h>
#include <asm/hvm/vmx/vmx.h>
#include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/vmx/cpu.h>
#include <asm/shadow.h>
#if CONFIG_PAGING_LEVELS >= 3
#include <asm/shadow_64.h>
@@ -812,9 +813,6 @@ static void vmx_do_no_device_fault(void)
}
}
-/* Reserved bits: [31:15], [12:11], [9], [6], [2:1] */
-#define VMX_VCPU_CPUID_L1_RESERVED 0xffff9a46
-
static void vmx_vmexit_do_cpuid(struct cpu_user_regs *regs)
{
unsigned int input = (unsigned int)regs->eax;
@@ -831,50 +829,67 @@ static void vmx_vmexit_do_cpuid(struct c
(unsigned long)regs->ecx, (unsigned long)regs->edx,
(unsigned long)regs->esi, (unsigned long)regs->edi);
- if ( input == 4 )
+ if ( input == CPUID_LEAF_4 ) {
cpuid_count(input, count, &eax, &ebx, &ecx, &edx);
- else
+ eax &= NUM_CORES_RESET_MASK;
+ } else {
cpuid(input, &eax, &ebx, &ecx, &edx);
- if ( input == 1 )
- {
- if ( !hvm_apic_support(v->domain) ||
- !vlapic_global_enabled((VLAPIC(v))) )
+ if ( input == CPUID_LEAF_1 )
{
- 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;
- }
+ /* mask off reserved bits */
+ ecx &= ~VMX_VCPU_CPUID_L1_ECX_RESERVED;
+ edx &= ~VMX_VCPU_CPUID_L1_EDX_RESERVED;
+ 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);
+ }
+
#if CONFIG_PAGING_LEVELS < 3
- 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_PAE, &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_PAE, &edx);
+ clear_bit(X86_FEATURE_PSE, &edx);
+ clear_bit(X86_FEATURE_PSE36, &edx);
+ }
#endif
- /* Unsupportable for virtualised CPUs. */
- ecx &= ~VMX_VCPU_CPUID_L1_RESERVED; /* mask off reserved bits */
- clear_bit(X86_FEATURE_VMXE & 31, &ecx);
- clear_bit(X86_FEATURE_MWAIT & 31, &ecx);
- }
+ ebx &= NUM_THREADS_RESET_MASK;
+
+ /* Unsupportable for virtualised CPUs. */
+ ecx &= ~(bitmaskof(X86_FEATURE_VMXE) |
+ bitmaskof(X86_FEATURE_EST) |
+ bitmaskof(X86_FEATURE_TM2) |
+ bitmaskof(X86_FEATURE_CID) |
+ bitmaskof(X86_FEATURE_MWAIT) );
+
+ clear_bit(X86_FEATURE_ACPI, &edx);
+ clear_bit(X86_FEATURE_HT, &edx);
+ }
+ else if (( input >= CPUID_LEAF_5 )
+ && ( input < CPUID_LEAF_80000000 )) {
+ eax = ebx = ecx = edx = 0x0;
+ }
#ifdef __i386__
- else if ( input == 0x80000001 )
- {
- /* Mask feature for Intel ia32e or AMD long mode. */
- clear_bit(X86_FEATURE_LM & 31, &edx);
- }
+ else if ( input == CPUID_LEAF_80000001 )
+ {
+ clear_bit(X86_FEATURE_LAHF_LM & 31, &ecx);
+
+ clear_bit(X86_FEATURE_LM & 31, &edx);
+ clear_bit(X86_FEATURE_SYSCALL & 31, &edx);
+ }
#endif
+ }
regs->eax = (unsigned long) eax;
regs->ebx = (unsigned long) ebx;
Index: xen-3.0-testing/xen/include/asm-x86/cpufeature.h
===================================================================
--- xen-3.0-testing.orig/xen/include/asm-x86/cpufeature.h
+++ xen-3.0-testing/xen/include/asm-x86/cpufeature.h
@@ -79,7 +79,7 @@
#define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */
#define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */
#define X86_FEATURE_CID (4*32+10) /* Context ID */
-#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
+#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
@@ -95,6 +95,7 @@
#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
+#define bitmaskof(bit) (0x1 << ((bit) & 31))
#ifdef __i386__
#define cpu_has_vme boot_cpu_has(X86_FEATURE_VME)
Index: xen-3.0-testing/xen/include/asm-x86/hvm/vmx/cpu.h
===================================================================
--- xen-3.0-testing.orig/xen/include/asm-x86/hvm/vmx/cpu.h
+++ xen-3.0-testing/xen/include/asm-x86/hvm/vmx/cpu.h
@@ -32,4 +32,37 @@ struct arch_state_struct {
#define VMX_MF_32 1
#define VMX_MF_64 2
+#define CPUID_LEAF_1 0x1
+#define CPUID_LEAF_4 0x4
+#define CPUID_LEAF_5 0x5
+#define CPUID_LEAF_80000000 0x80000000
+#define CPUID_LEAF_80000001 0x80000001
+
+#define NUM_CORES_RESET_MASK 0x00003FFF
+#define NUM_THREADS_RESET_MASK 0xFF00FFFF
+
+#define VMX_VCPU_CPUID_L1_ECX_RESERVED_31_15 0xffff8000
+#define VMX_VCPU_CPUID_L1_ECX_RESERVED_12_11 0x00001800
+#define VMX_VCPU_CPUID_L1_ECX_RESERVED_6 0x00000040
+#define VMX_VCPU_CPUID_L1_ECX_RESERVED_2_1 0x00000006
+
+#define VMX_VCPU_CPUID_L1_ECX_RESERVED \
+ ( \
+ VMX_VCPU_CPUID_L1_ECX_RESERVED_31_15 | \
+ VMX_VCPU_CPUID_L1_ECX_RESERVED_12_11 | \
+ VMX_VCPU_CPUID_L1_ECX_RESERVED_6 | \
+ VMX_VCPU_CPUID_L1_ECX_RESERVED_2_1 \
+ )
+
+#define VMX_VCPU_CPUID_L1_EDX_RESERVED_30 0x40000000
+#define VMX_VCPU_CPUID_L1_EDX_RESERVED_20 0x00100000
+#define VMX_VCPU_CPUID_L1_EDX_RESERVED_10 0x00000400
+
+#define VMX_VCPU_CPUID_L1_EDX_RESERVED \
+ ( \
+ VMX_VCPU_CPUID_L1_EDX_RESERVED_30 | \
+ VMX_VCPU_CPUID_L1_EDX_RESERVED_20 | \
+ VMX_VCPU_CPUID_L1_EDX_RESERVED_10 \
+ )
+
#endif /* __ASM_X86_HVM_VMX_CPU_H__ */
++++++ xen-genapic.diff ++++++
++++ 1856 lines (skipped)
++++++ xen-get-page-type.diff ++++++
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Date Tue May 30 18:14:05 2006 +0100
# Node ID 18e8e613deb9050de02eb8ba9138185e33240e7f
# parent: 10602076065759c58d9cc1be0c04241325539c8b
Fix infinite recursion loop in get_page_type() error path.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset: 10183:c43080e63545c2c9ba101fd8864b5aacc5d666e2
xen-unstable date: Tue May 30 18:11:34 2006 +0100
Index: xen-3.0-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/mm.c
+++ xen-3.0-testing/xen/arch/x86/mm.c
@@ -1497,12 +1497,18 @@ int get_page_type(struct page_info *page
{
if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
{
- if ( current->domain == page_get_owner(page) )
+ if ( (current->domain == page_get_owner(page)) &&
+ ((x & PGT_type_mask) == PGT_writable_page) )
{
/*
* This ensures functions like set_gdt() see up-to-date
* type info without needing to clean up writable p.t.
- * state on the fast path.
+ * state on the fast path. We take this path only
+ * when the current type is writable because:
+ * 1. It's the only type that this path can decrement.
+ * 2. If we take this path more liberally then we can
+ * enter a recursive loop via get_page_from_l1e()
+ * during pagetable revalidation.
*/
LOCK_BIGLOCK(current->domain);
cleanup_writable_pagetable(current->domain);
++++++ xen-hvm-xchg.diff ++++++
Index: xen-3.0-testing/xen/arch/x86/hvm/io.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/hvm/io.c
+++ xen-3.0-testing/xen/arch/x86/hvm/io.c
@@ -646,6 +646,16 @@
regs->eflags &= ~X86_EFLAGS_CF;
break;
+
+ case INSTR_XCHG:
+ if (src & REGISTER) {
+ index = operand_index(src);
+ set_reg_value(size, index, 0, regs, p->u.data);
+ } else {
+ index = operand_index(dst);
+ set_reg_value(size, index, 0, regs, p->u.data);
+ }
+ break;
}
hvm_load_cpu_guest_regs(v, regs);
Index: xen-3.0-testing/xen/arch/x86/hvm/platform.c
===================================================================
--- xen-3.0-testing.orig/xen/arch/x86/hvm/platform.c
+++ xen-3.0-testing/xen/arch/x86/hvm/platform.c
@@ -954,10 +954,26 @@
mmio_opp->instr = mmio_inst.instr;
mmio_opp->operand[0] = mmio_inst.operand[0]; /* source */
mmio_opp->operand[1] = mmio_inst.operand[1]; /* destination */
-
- /* send the request and wait for the value */
- send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
- mmio_inst.op_size, 0, IOREQ_WRITE, 0);
+ if (mmio_inst.operand[0] & REGISTER) {
+ long value;
+ unsigned long operand = mmio_inst.operand[0];
+ value = get_reg_value(operand_size(operand),
+ operand_index(operand), 0,
+ mmio_opp->inst_decoder_regs);
+ /* send the request and wait for the value */
+ send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
+ mmio_inst.op_size, value, IOREQ_WRITE, 0);
+ } else {
+ /* the destination is a register */
+ long value;
+ unsigned long operand = mmio_inst.operand[1];
+ value = get_reg_value(operand_size(operand),
+ operand_index(operand), 0,
+ mmio_opp->inst_decoder_regs);
+ /* send the request and wait for the value */
+ send_mmio_req(IOREQ_TYPE_XCHG, gpa, 1,
+ mmio_inst.op_size, value, IOREQ_WRITE, 0);
+ }
break;
default:
++++++ xen-unstable-9967-summa.diff ++++++
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Date Wed May 10 16:06:55 2006 +0100
# Node ID 50989084d4d0bd3ae8005469f129259aa4d74f5c
# parent: 25da74e2f8fbf3664fb793c1fb9cde26a485292a
This patch enhances the Summagraphics emulation by adding 2 features:
1) Move the tablet to the second serial port. This way the tablet will
not interfere with people who want to use a serial console on the guest.
2) Enhance the Summagraphics emulation so that the Windows XP driver
works. Turns out the Windows driver was using capabilities the X driver
didn't care about and it wouldn't recognize the tablet without these
capabilities.
Signed-off-by: donald.d.dugger@xxxxxxxxx
--- a/tools/ioemu/hw/pc.c Wed May 10 16:05:24 2006 +0100
+++ b/tools/ioemu/hw/pc.c Wed May 10 16:06:55 2006 +0100
@@ -381,6 +381,7 @@ void pc_init(uint64_t ram_size, int vga_
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename)
{
+ SerialState *sp;
char buf[1024];
int ret, linux_boot, initrd_size, i, nb_nics1;
PCIBus *pci_bus;
@@ -533,7 +534,9 @@ void pc_init(uint64_t ram_size, int vga_
for(i = 0; i < MAX_SERIAL_PORTS; i++) {
if (serial_hds[i]) {
- serial_init(serial_io[i], serial_irq[i], serial_hds[i]);
+ sp = serial_init(serial_io[i], serial_irq[i], serial_hds[i]);
+ if (i == SUMMA_PORT)
+ summa_init(sp, serial_hds[i]);
}
}
--- a/tools/ioemu/hw/pckbd.c Wed May 10 16:05:24 2006 +0100
+++ b/tools/ioemu/hw/pckbd.c Wed May 10 16:06:55 2006 +0100
@@ -156,10 +156,23 @@ typedef struct KBDState {
int mouse_dz;
uint8_t mouse_buttons;
CharDriverState *chr;
- void *cookie;
+ SerialState *serial;
} KBDState;
KBDState kbd_state;
+
+#define MODE_STREAM_SWITCH 0
+#define MODE_STREAM 1
+#define MODE_REMOTE 2
+#define MODE_POINT 3
+
+#define ORIGIN_LOWER_LEFT 0
+#define ORIGIN_UPPER_LEFT 1
+
+struct SummaState {
+ int report_mode;
+ int origin;
+} SummaState;
int summa_ok; /* Allow Summagraphics emulation if true */
@@ -420,15 +433,19 @@ static int kbd_mouse_send_packet(KBDStat
switch(s->mouse_type) {
case TABLET: /* Summagraphics pen tablet */
- dx1 = s->mouse_x;
- dy1 = s->mouse_y;
- dx1 = ((dx1 * SUMMA_MAXX) / mouse_maxx) + SUMMA_BORDER;
- dy1 = ((dy1 * SUMMA_MAXY) / mouse_maxy) + SUMMA_BORDER;
- ser_queue(s->cookie, 0x80 | (s->mouse_buttons & 7));
- ser_queue(s->cookie, dx1 & 0x7f);
- ser_queue(s->cookie, dx1 >> 7);
- ser_queue(s->cookie, dy1 & 0x7f);
- ser_queue(s->cookie, dy1 >> 7);
+ if (SummaState.report_mode == MODE_STREAM) {
+ dx1 = s->mouse_x;
+ dy1 = s->mouse_y;
+ if (SummaState.origin == ORIGIN_LOWER_LEFT)
+ dy1 = mouse_maxy - dy1;
+ dx1 = ((dx1 * SUMMA_MAXX) / mouse_maxx) + SUMMA_BORDER;
+ dy1 = ((dy1 * SUMMA_MAXY) / mouse_maxy) + SUMMA_BORDER;
+ ser_queue(s->serial, 0x80 | (s->mouse_buttons & 7));
+ ser_queue(s->serial, dx1 & 0x7f);
+ ser_queue(s->serial, dx1 >> 7);
+ ser_queue(s->serial, dy1 & 0x7f);
+ ser_queue(s->serial, dy1 >> 7);
+ }
s->mouse_dx = 0;
s->mouse_dy = 0;
s->mouse_dz = 0;
@@ -509,43 +526,101 @@ static void pc_kbd_mouse_event(void *opa
}
}
-static void summa(KBDState *s, int val)
-{
- static int summa = 0;
-
- if (s->mouse_type == TABLET) {
+static void summa(KBDState *s, uint8_t val)
+{
+ static int zflg = 0;
+
+ if (zflg) {
+ zflg = 0;
switch (val) {
- case '?': /* read firmware ID */
- ser_queue(s->cookie, '0');
+ case 'b': /* binary report mode */
break;
- case 'a': /* read config */
- /*
- * Config looks like a movement packet but, because of scaling
- * issues we can't use `kbd_send_packet' to do this.
- */
- ser_queue(s->cookie, 0);
- ser_queue(s->cookie, (SUMMA_MAXX & 0x7f));
- ser_queue(s->cookie, (SUMMA_MAXX >> 7));
- ser_queue(s->cookie, (SUMMA_MAXY & 0x7f));
- ser_queue(s->cookie, (SUMMA_MAXY >> 7));
- break;
-
- default: /* ignore all others */
+ case 't': /* stylus type - we do 4 button cursor */
+ ser_queue(s->serial, 'C');
+ ser_queue(s->serial, 'S');
+ ser_queue(s->serial, 'R');
+ ser_queue(s->serial, '4');
+ ser_queue(s->serial, '\r');
break;
}
return;
}
- if (val == 'B') {
- summa++;
- return;
- } else if (summa && val == 'z') {
+ zflg = 0;
+
+ switch (val) {
+
+ case 'B': /* point mode */
+ /* This is supposed to be `set to point mode' but the Linux driver
+ * is broken and incorrectly sends a reset command (somebody
+ * needs to learn that the address 0 does not necessarily contain
+ * a zero). This is the first valid command that Linux sends
+ * out so we'll treat it as a reset
+ */
+ case '\0': /* reset */
s->mouse_type = TABLET;
- return;
- }
- summa = 0;
+ s->mouse_status |= MOUSE_STATUS_ENABLED;
+ SummaState.origin = ORIGIN_LOWER_LEFT;
+ SummaState.report_mode = (val == 'B') ? MODE_POINT : MODE_STREAM_SWITCH;
+ break;
+
+ case 'z': /* start of 2 byte command */
+ zflg++;
+ break;
+
+ case 'x': /* code check */
+ /*
+ * Return checksum
+ */
+ ser_queue(s->serial, '.');
+ ser_queue(s->serial, '#');
+ ser_queue(s->serial, '1');
+ ser_queue(s->serial, '2');
+ ser_queue(s->serial, '3');
+ ser_queue(s->serial, '4');
+ break;
+
+ case '?': /* read firmware ID */
+ ser_queue(s->serial, '0');
+ break;
+
+ case 'a': /* read config */
+ /*
+ * Config looks like a movement packet but, because of scaling
+ * issues we can't use `kbd_send_packet' to do this.
+ */
+ ser_queue(s->serial, 0x94);
+ ser_queue(s->serial, (SUMMA_MAXX & 0x7f));
+ ser_queue(s->serial, (SUMMA_MAXX >> 7));
+ ser_queue(s->serial, (SUMMA_MAXY & 0x7f));
+ ser_queue(s->serial, (SUMMA_MAXY >> 7));
+ break;
+
+ case 'b': /* origin at upper left */
+ SummaState.origin = ORIGIN_UPPER_LEFT;
+ break;
+
+ case 'c': /* origin at lower left */
+ SummaState.origin = ORIGIN_LOWER_LEFT;
+ break;
+
+ case '@': /* stream mode */
+ SummaState.report_mode = MODE_STREAM;
+ break;
+
+ case 'D': /* remote request mode */
+ SummaState.report_mode = MODE_REMOTE;
+ break;
+
+ case 'P': /* trigger, e.g. send report now */
+ case 'R': /* report rate = max/2 */
+ default: /* ignore all others */
+ break;
+
+ }
+
return;
}
@@ -560,13 +635,13 @@ int summa_write(CharDriverState *chr, co
return len;
}
-void summa_init(void *cookie, CharDriverState *chr)
+void summa_init(SerialState *serial, CharDriverState *chr)
{
if (summa_ok == 0)
return;
kbd_state.chr = chr;
- kbd_state.cookie = (void *)cookie;
+ kbd_state.serial = serial;
chr->chr_write = summa_write;
chr->opaque = (void *)&kbd_state;
return;
--- a/tools/ioemu/hw/serial.c Wed May 10 16:05:24 2006 +0100
+++ b/tools/ioemu/hw/serial.c Wed May 10 16:06:55 2006 +0100
@@ -310,7 +310,6 @@ SerialState *serial_init(int base, int i
register_ioport_write(base, 8, 1, serial_ioport_write, s);
register_ioport_read(base, 8, 1, serial_ioport_read, s);
s->chr = chr;
- summa_init(s, chr);
qemu_chr_add_read_handler(chr, serial_can_receive1, serial_receive1, s);
qemu_chr_add_event_handler(chr, serial_event);
return s;
--- a/tools/ioemu/vl.c Wed May 10 16:05:24 2006 +0100
+++ b/tools/ioemu/vl.c Wed May 10 16:06:55 2006 +0100
@@ -2707,7 +2707,8 @@ int main(int argc, char **argv)
pstrcpy(monitor_device, sizeof(monitor_device), "vc");
pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
- for(i = 1; i < MAX_SERIAL_PORTS; i++)
+ pstrcpy(serial_devices[1], sizeof(serial_devices[1]), "null");
+ for(i = 2; i < MAX_SERIAL_PORTS; i++)
serial_devices[i][0] = '\0';
serial_device_index = 0;
--- a/tools/ioemu/vl.h Wed May 10 16:05:24 2006 +0100
+++ b/tools/ioemu/vl.h Wed May 10 16:06:55 2006 +0100
@@ -223,6 +223,7 @@ void console_select(unsigned int index);
/* serial ports */
#define MAX_SERIAL_PORTS 4
+#define SUMMA_PORT 1
extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
@@ -618,12 +619,6 @@ extern const char* keyboard_layout;
extern const char* keyboard_layout;
extern int repeat_key;
-/* Mice */
-
-void summa_init(void *cookie, CharDriverState *chr);
-
-extern int summa_ok;
-
/* mc146818rtc.c */
typedef struct RTCState RTCState;
@@ -637,6 +632,12 @@ typedef struct SerialState SerialState;
typedef struct SerialState SerialState;
SerialState *serial_init(int base, int irq, CharDriverState *chr);
void ser_queue(SerialState *s, unsigned char c);
+
+/* Mice */
+
+void summa_init(SerialState *serial, CharDriverState *chr);
+
+extern int summa_ok;
/* i8259.c */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit-help@xxxxxxxxxxxx
| < Previous | Next > |