Hello community,
here is the log from the commit of package xen
checked in at Sat Apr 26 11:41:44 CEST 2008.
--------
--- arch/i386/xen/xen.changes 2008-04-11 16:40:39.000000000 +0200
+++ /mounts/work_src_done/STABLE/xen/xen.changes 2008-04-25 21:25:00.000000000 +0200
@@ -1,0 +2,10 @@
+Fri Apr 25 13:24:39 MDT 2008 - carnold@novell.com
+
+- bnc#383513 - Unknown unit 'K' in Xen's logrotate config file.
+
+-------------------------------------------------------------------
+Tue Apr 25 08:23:37 MDT 2008 - carnold@novell.com
+
+- Update to Xen 3.2.1 FCS changeset 16881.
+
+-------------------------------------------------------------------
New:
----
17233-hap-check.patch
key-altgr.patch
svm-lmsl.patch
x86-hvm-load-diags.patch
x86-pgtable-no-biglock.patch
x86-show-page-walk-early.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:47.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:47.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package xen (Version 3.2.1_16864_01)
+# spec file for package xen (Version 3.2.1_16881_01)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -14,7 +14,7 @@
Name: xen
%define xvers 3.2
%define xvermaj 3
-%define changeset 16864
+%define changeset 16881
%define xen_build_dir xen-3.2.1-testing
%if %sles_version
%define with_kmp 1
@@ -33,7 +33,7 @@
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
-Version: 3.2.1_16864_01
+Version: 3.2.1_16881_01
Release: 1
License: GPL v2 only
Group: System/Kernel
@@ -87,9 +87,10 @@
Patch24: 17210-xenapi-defaults.patch
Patch25: 17211-xenapi-defaults.patch
Patch26: 17212-xenapi-defaults.patch
-Patch27: 17246-numa-node-selection-fix.patch
-Patch28: 17248-hvm-ignore-USB-RMRR.patch
-Patch29: 17315-windows-bug-check-0x101-fix.patch
+Patch27: 17233-hap-check.patch
+Patch28: 17246-numa-node-selection-fix.patch
+Patch29: 17248-hvm-ignore-USB-RMRR.patch
+Patch30: 17315-windows-bug-check-0x101-fix.patch
# Our patches
Patch100: xen-config.diff
Patch101: xend-config.diff
@@ -130,24 +131,30 @@
Patch152: bridge-bonding.diff
Patch153: bridge-hostonly.diff
Patch154: bridge-record-creation.patch
-Patch155: keymap_nl-be.patch
-Patch156: xen-fbback-resize.patch
-Patch157: xend-core-dump-loc.diff
-Patch158: blktap.patch
-Patch159: xen-api-auth.patch
-Patch160: pv_32_16_color_trans.patch
-Patch161: hvm-ide-flush-o_direct.patch
-Patch162: keymap-vm.patch
-Patch163: xen-qemu-iscsi-fix.patch
-Patch164: key-shift-escape.patch
+Patch155: xen-fbback-resize.patch
+Patch156: xend-core-dump-loc.diff
+Patch157: blktap.patch
+Patch158: xen-api-auth.patch
+Patch159: pv_32_16_color_trans.patch
+Patch160: xen-qemu-iscsi-fix.patch
+Patch161: keymap-vm.patch
+Patch162: keymap_nl-be.patch
+Patch163: key-shift-escape.patch
+Patch164: key-altgr.patch
+# Maybe later
+Patch200: hvm-ide-flush-o_direct.patch
# Patches from Jan
Patch240: xenctx.patch
Patch241: const-callback-arg.patch
Patch242: const-set-trap-table-arg.patch
Patch243: pv-drv-mkbuildtree.patch
-Patch244: x86_emulate.patch
-Patch245: x86-extra-trap-info.patch
-Patch246: 32on64-extra-mem.patch
+Patch244: x86-show-page-walk-early.patch
+Patch245: svm-lmsl.patch
+Patch246: x86_emulate.patch
+Patch247: x86-hvm-load-diags.patch
+Patch248: x86-pgtable-no-biglock.patch
+Patch249: x86-extra-trap-info.patch
+Patch250: 32on64-extra-mem.patch
# PV Driver Patches
Patch350: pv-driver-build.patch
Patch351: xen-ioemu-hvm-pv-support.diff
@@ -527,6 +534,7 @@
%patch27 -p1
%patch28 -p1
%patch29 -p1
+%patch30 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
@@ -572,10 +580,11 @@
%patch158 -p1
%patch159 -p1
%patch160 -p1
-#%patch161 -p1
+%patch161 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
+#%patch200 -p1
%patch240 -p1
%patch241 -p1
%patch242 -p1
@@ -583,6 +592,10 @@
%patch244 -p1
%patch245 -p1
%patch246 -p1
+%patch247 -p1
+%patch248 -p1
+%patch249 -p1
+%patch250 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
@@ -905,6 +918,10 @@
/sbin/ldconfig
%changelog
+* Fri Apr 25 2008 carnold@novell.com
+- bnc#383513 - Unknown unit 'K' in Xen's logrotate config file.
+* Fri Apr 25 2008 carnold@novell.com
+- Update to Xen 3.2.1 FCS changeset 16881.
* Fri Apr 11 2008 carnold@novell.com
- Update to Xen 3.2.1 RC5 changeset 16864.
* Thu Apr 10 2008 jfehlig@novell.com
++++++ 17233-hap-check.patch ++++++
# HG changeset patch
# User Keir Fraser
# Date 1205852623 0
# Node ID 64b19db801b6ab63588e8fc767aa9c57bfc5a4aa
# Parent c978ecfc4f41a1dced268ff31f377156d392aaf2
p2m: hap enabled/supported fix
Check for per domain hap_enabled rather than hvm_funcs hap_supported,
in case hap has been disabled.
Alleviates problem booting >=4Gig shadow HVM guests on PAE hypervisor
on AMD-V platforms.
Signed-off-by: Tom Woller
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
@@ -229,7 +229,7 @@ set_p2m_entry(struct domain *d, unsigned
if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn,
L3_PAGETABLE_SHIFT - PAGE_SHIFT,
((CONFIG_PAGING_LEVELS == 3)
- ? (hvm_funcs.hap_supported ? 4 : 8)
+ ? (d->arch.hvm_domain.hap_enabled ? 4 : 8)
: L3_PAGETABLE_ENTRIES),
PGT_l2_page_table) )
goto out;
++++++ domUloader.py ++++++
--- arch/i386/xen/domUloader.py 2007-11-02 18:17:01.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/domUloader.py 2008-04-22 23:26:44.000000000 +0200
@@ -376,7 +376,7 @@
try:
(optlist, args) = getopt.gnu_getopt(argv, 'qvh', \
- ('entry=', 'output=', 'tmpdir=', 'args=', 'help', 'quiet', 'dryrun', 'verbose'))
+ ('entry=', 'output=', 'tmpdir=', 'args=', 'kernel=', 'ramdisk=', 'help', 'quiet', 'dryrun', 'verbose'))
except:
usage()
sys.exit(1)
++++++ ept-2m-x64.patch ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:53.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:53.000000000 +0200
@@ -2,7 +2,7 @@
===================================================================
--- xen-3.2.1-testing.orig/tools/libxc/xc_hvm_build.c
+++ xen-3.2.1-testing/tools/libxc/xc_hvm_build.c
-@@ -208,10 +208,10 @@ static int setup_guest(int xc_handle,
+@@ -208,26 +208,47 @@ static int setup_guest(int xc_handle,
for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
@@ -17,17 +17,21 @@
*/
rc = xc_domain_memory_populate_physmap(
xc_handle, dom, 0xa0, 0, 0, &page_array[0x00]);
-@@ -222,12 +222,32 @@ static int setup_guest(int xc_handle,
+ cur_pages = 0xc0;
+- while ( (rc == 0) && (nr_pages > cur_pages) )
++ while ( (rc == 0) && (0x200 > cur_pages) )
+ {
+- unsigned long count = nr_pages - cur_pages;
++ unsigned long count = 0x200 - cur_pages;
if ( count > 2048 )
count = 2048;
rc = xc_domain_memory_populate_physmap(
-- xc_handle, dom, count, 0, 0, &page_array[cur_pages]);
-+ xc_handle, dom, 0x200 - cur_pages, 0, 0, &page_array[cur_pages]);
+ xc_handle, dom, count, 0, 0, &page_array[cur_pages]);
cur_pages += count;
}
- if ( rc != 0 )
- {
-- PERROR("Could not allocate memory for HVM guest.\n");
++
++ if ( rc != 0 )
++ {
+ PERROR("Cannot allocate memory for HVM guest 1.\n");
+ goto error_out;
+ }
@@ -46,8 +50,9 @@
+ if ( i < nr_pages )
+ rc = xc_domain_memory_populate_physmap(
+ xc_handle, dom, nr_pages - i, 0, 0, &page_array[i]);
-+ if ( rc != 0 )
-+ {
+ if ( rc != 0 )
+ {
+- PERROR("Could not allocate memory for HVM guest.\n");
+ PERROR("Cannot allocate memory for HVM guest 2.\n");
goto error_out;
}
@@ -113,7 +118,7 @@
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
-@@ -3286,7 +3286,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
+@@ -3370,7 +3370,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
{
if ( is_xen_heap_mfn(prev_mfn) )
/* Xen heap frames are simply unhooked from this phys slot. */
@@ -122,7 +127,7 @@
else
/* Normal domain memory is freed, to avoid leaking memory. */
guest_remove_page(d, xatp.gpfn);
-@@ -3295,10 +3295,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
+@@ -3379,10 +3379,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
/* Unmap from old location, if any. */
gpfn = get_gpfn_from_mfn(mfn);
if ( gpfn != INVALID_M2P_ENTRY )
++++++ ept-novell-x64.patch ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:53.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:53.000000000 +0200
@@ -41,7 +41,7 @@
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
-@@ -2011,6 +2011,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
+@@ -2014,6 +2014,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
}
d->arch.hvm_domain.params[a.index] = a.value;
rc = 0;
@@ -710,9 +710,9 @@
/*
* Initialise/destroy HVM domain/vcpu resources
*/
-@@ -127,6 +130,12 @@ struct hvm_function_table {
- extern struct hvm_function_table hvm_funcs;
- extern int hvm_enabled;
+@@ -133,6 +136,12 @@ extern int hvm_enabled;
+ extern unsigned char cpu_has_lmsl;
+ #endif
+static inline void hvm_p2m_init(struct domain *d)
+{
++++++ key-altgr.patch ++++++
Index: xen-3.2-testing/tools/ioemu/vnc.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc.c 2008-04-17 11:43:50.000000000 -0600
+++ xen-3.2-testing/tools/ioemu/vnc.c 2008-04-17 11:46:34.000000000 -0600
@@ -1133,6 +1133,8 @@
case 0x9d: /* Right CTRL */
case 0x38: /* Left ALT */
case 0xb8: /* Right ALT */
+ if (keycode & 0x80)
+ kbd_put_keycode(0xe0);
if (down) {
vs->modifiers_state[keycode] = 1;
kbd_put_keycode(keycode & 0x7f);
++++++ logrotate.conf ++++++
--- arch/i386/xen/logrotate.conf 2007-11-02 18:16:55.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/logrotate.conf 2008-04-25 21:23:55.000000000 +0200
@@ -10,7 +10,7 @@
/var/log/xen/domain-builder-ng.log /var/log/xen/xen-hotplug.log {
rotate 2
- size 100K
+ size 100k
notifempty
copytruncate
}
++++++ ns_xen_base.patch ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:54.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:54.000000000 +0200
@@ -11,7 +11,7 @@
u32 svm_feature_flags;
-@@ -73,6 +74,7 @@ static void *hsa[NR_CPUS] __read_mostly;
+@@ -78,6 +79,7 @@ static void *hsa[NR_CPUS] __read_mostly;
/* vmcb used for extended host state */
static void *root_vmcb[NR_CPUS] __read_mostly;
@@ -19,7 +19,7 @@
static void inline __update_guest_eip(
struct cpu_user_regs *regs, unsigned int inst_len)
{
-@@ -883,7 +885,7 @@ static struct hvm_function_table svm_fun
+@@ -888,7 +890,7 @@ static struct hvm_function_table svm_fun
.set_tsc_offset = svm_set_tsc_offset,
.inject_exception = svm_inject_exception,
.init_hypercall_page = svm_init_hypercall_page,
@@ -28,7 +28,7 @@
};
int start_svm(struct cpuinfo_x86 *c)
-@@ -1034,6 +1036,7 @@ static void svm_vmexit_do_cpuid(struct v
+@@ -1055,6 +1057,7 @@ static void svm_vmexit_do_cpuid(struct v
HVMTRACE_3D(CPUID, v, input,
((uint64_t)eax << 32) | ebx, ((uint64_t)ecx << 32) | edx);
@@ -36,7 +36,7 @@
inst_len = __get_instruction_length(v, INSTR_CPUID, NULL);
__update_guest_eip(regs, inst_len);
}
-@@ -1736,6 +1739,11 @@ static void svm_do_msr_access(
+@@ -1757,6 +1760,11 @@ static void svm_do_msr_access(
/* is it a read? */
if (vmcb->exitinfo1 == 0)
{
@@ -48,7 +48,7 @@
switch (ecx) {
case MSR_IA32_TSC:
msr_content = hvm_get_guest_time(v);
-@@ -1826,6 +1834,11 @@ static void svm_do_msr_access(
+@@ -1847,6 +1855,11 @@ static void svm_do_msr_access(
}
else
{
@@ -60,7 +60,7 @@
msr_content = (u32)regs->eax | ((u64)regs->edx << 32);
hvmtrace_msr_write(v, ecx, msr_content);
-@@ -1886,6 +1899,7 @@ static void svm_do_msr_access(
+@@ -1907,6 +1920,7 @@ static void svm_do_msr_access(
}
break;
}
@@ -272,7 +272,7 @@
if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
goto fail2;
-@@ -483,12 +492,14 @@ int hvm_vcpu_initialise(struct vcpu *v)
+@@ -483,6 +492,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
hvm_funcs.vcpu_destroy(v);
fail2:
vlapic_destroy(v);
@@ -280,14 +280,15 @@
fail1:
return rc;
}
-
- void hvm_vcpu_destroy(struct vcpu *v)
+@@ -491,6 +501,7 @@ void hvm_vcpu_destroy(struct vcpu *v)
{
+ xfree(v->arch.hvm_vcpu.mtrr.var_ranges);
+
+ ext_intercept_vcpu_destroy(v);
vlapic_destroy(v);
hvm_funcs.vcpu_destroy(v);
-@@ -1598,6 +1609,10 @@ int hvm_do_hypercall(struct cpu_user_reg
+@@ -1601,6 +1612,10 @@ int hvm_do_hypercall(struct cpu_user_reg
case 0:
break;
}
@@ -298,7 +299,7 @@
if ( (eax >= NR_hypercalls) || !hvm_hypercall32_table[eax] )
{
-@@ -1752,6 +1767,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
+@@ -1755,6 +1770,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
vcpu_wake(v);
gdprintk(XENLOG_INFO, "AP %d bringup succeeded.\n", vcpuid);
@@ -306,7 +307,7 @@
return 0;
}
-@@ -1989,6 +2005,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
+@@ -1992,6 +2008,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
if ( a.value > HVMPTM_one_missed_tick_pending )
goto param_fail;
break;
++++++ ns_xen_extension.patch ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:54.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:54.000000000 +0200
@@ -2,7 +2,7 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/Makefile 2008-02-26 14:01:28.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/Makefile 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,3 @@
+subdir-y += novell
+
@@ -10,7 +10,7 @@
Index: xen-3.2-testing/xen/include/asm-x86/hvm/hvm_extensions.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/include/asm-x86/hvm/hvm_extensions.h 2008-02-26 18:57:43.000000000 -0500
++++ xen-3.2-testing/xen/include/asm-x86/hvm/hvm_extensions.h 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,252 @@
+/****************************************************************************
+ |
@@ -267,7 +267,7 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/hvm_ext.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/hvm_ext.c 2008-02-26 14:01:28.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/hvm_ext.c 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,350 @@
+/****************************************************************************
+ |
@@ -622,14 +622,14 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/Makefile 2008-02-26 14:01:28.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/Makefile 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,2 @@
+obj-y += nsintercept.o
+obj-y += nshypercall.o
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_errno.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_errno.h 2008-02-26 14:01:28.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_errno.h 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,62 @@
+/****************************************************************************
+ |
@@ -696,8 +696,8 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_shim.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_shim.h 2008-02-26 14:01:28.000000000 -0500
-@@ -0,0 +1,480 @@
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/ns_shim.h 2008-04-15 11:19:15.000000000 -0400
+@@ -0,0 +1,481 @@
+/****************************************************************************
+ |
+ | Copyright (c) [2007, 2008] Novell, Inc.
@@ -964,6 +964,7 @@
+ * State maintained on a per guest basis to implement
+ * the Novell shim.
+ */
++ s_time_t nsDomainBootTime;
+ nsSpinLock_t nsLock;
+ atomic_t nsNumVcpusActive;
+ u64 nsGuestIdMsr;
@@ -1181,7 +1182,7 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.c 2008-02-28 13:17:22.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.c 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,1232 @@
+/****************************************************************************
+ |
@@ -2418,7 +2419,7 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.h 2008-02-26 14:01:28.000000000 -0500
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nshypercall.h 2008-04-15 11:09:10.000000000 -0400
@@ -0,0 +1,125 @@
+/****************************************************************************
+ |
@@ -2548,8 +2549,8 @@
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nsintercept.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nsintercept.c 2008-02-28 13:18:54.000000000 -0500
-@@ -0,0 +1,2093 @@
++++ xen-3.2-testing/xen/arch/x86/hvm/hvm_ext/novell/nsintercept.c 2008-04-15 11:25:52.000000000 -0400
+@@ -0,0 +1,2088 @@
+/****************************************************************************
+ |
+ | Copyright (c) [2007, 2008] Novell, Inc.
@@ -2879,13 +2880,8 @@
+}
+
+/*
-+ * Time this domain booted.
-+ */
-+s_time_t nsDomainBootTime;
-+
-+/*
+ * static inline u64
-+ * nsGetTimeSinceDomainBoot(void)
++ * nsGetTimeSinceDomainBoot(nsPartition_t *curp)
+ * Retrieve the time since boot in 100ns units.
+ *
+ * Calling/Exit State:
@@ -2893,10 +2889,10 @@
+ */
+
+static inline u64
-+nsGetTimeSinceDomainBoot(void)
++nsGetTimeSinceDomainBoot(nsPartition_t *curp)
+{
+ u64 curTime = nsXenVector.extGetTimeSinceBoot();
-+ return ((curTime - nsDomainBootTime)/100) ;
++ return ((curTime - curp->nsDomainBootTime)/100) ;
+}
+
+/*
@@ -3417,7 +3413,7 @@
+ */
+ return (0);
+ }
-+ *msrContent = nsGetTimeSinceDomainBoot();
++ *msrContent = nsGetTimeSinceDomainBoot(curp);
+ return (1);
+}
+
@@ -3559,7 +3555,7 @@
+ * Stash away pointer to our state in the hvm domain structure.
+ */
+ d->arch.hvm_domain.ext_handle = nspp;
-+ nsDomainBootTime = nsXenVector.extGetTimeSinceBoot();
++ nspp->nsDomainBootTime = nsXenVector.extGetTimeSinceBoot();
+ return (0);
+}
+
++++++ svm-lmsl.patch ++++++
Index: xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
@@ -595,10 +595,11 @@ int hvm_set_efer(uint64_t value)
value &= ~EFER_LMA;
- if ( (value & ~(EFER_FFXSE | EFER_LME | EFER_NX | EFER_SCE)) ||
+ if ( (value & ~(EFER_FFXSE | EFER_LMSLE | EFER_LME | EFER_NX | EFER_SCE)) ||
((sizeof(long) != 8) && (value & EFER_LME)) ||
(!cpu_has_nx && (value & EFER_NX)) ||
(!cpu_has_syscall && (value & EFER_SCE)) ||
+ (!cpu_has_lmsl && (value & EFER_LMSLE)) ||
(!cpu_has_ffxsr && (value & EFER_FFXSE)) )
{
gdprintk(XENLOG_WARNING, "Trying to set reserved bit in "
Index: xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/svm/svm.c
@@ -53,6 +53,11 @@
u32 svm_feature_flags;
+#ifdef __x86_64__
+/* indicate whether guest may use EFER.LMSLE */
+unsigned char cpu_has_lmsl = 0;
+#endif
+
#define set_segment_register(name, value) \
asm volatile ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
@@ -923,6 +928,22 @@ int start_svm(struct cpuinfo_x86 *c)
/* Initialize core's ASID handling. */
svm_asid_init(c);
+#ifdef __x86_64__
+ /*
+ * Check whether EFER.LMSLE can be written.
+ * Unfortunately there's no feature bit defined for this.
+ */
+ eax = read_efer();
+ edx = read_efer() >> 32;
+ if ( wrmsr_safe(MSR_EFER, eax | EFER_LMSLE, edx) == 0 )
+ rdmsr(MSR_EFER, eax, edx);
+ if ( eax & EFER_LMSLE )
+ {
+ cpu_has_lmsl = 1;
+ wrmsr(MSR_EFER, eax ^ EFER_LMSLE, edx);
+ }
+#endif
+
if ( cpu != 0 )
return 1;
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/hvm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/hvm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/hvm.h
@@ -127,6 +127,12 @@ struct hvm_function_table {
extern struct hvm_function_table hvm_funcs;
extern int hvm_enabled;
+#ifdef __i386__
+# define cpu_has_lmsl 0
+#else
+extern unsigned char cpu_has_lmsl;
+#endif
+
int hvm_domain_initialise(struct domain *d);
void hvm_domain_relinquish_resources(struct domain *d);
void hvm_domain_destroy(struct domain *d);
++++++ x86_emulate.patch ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:40:55.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:40:55.000000000 +0200
@@ -144,7 +144,7 @@
#endif
#include
-@@ -3321,60 +3324,64 @@ x86_emulate(
+@@ -3330,60 +3333,64 @@ x86_emulate(
src.val = x86_seg_gs;
goto pop_seg;
@@ -226,7 +226,8 @@
+ &old_lo, sizeof(old_lo), ctxt)) ||
+ (rc = ops->read(ea.mem.seg, ea.mem.off+sizeof(old_lo),
+ &old_hi, sizeof(old_lo), ctxt)) )
-+ goto done;
+ goto done;
+- _regs.eflags |= EFLG_ZF;
+ if ( (old_lo != _regs.eax) || (old_hi != _regs.edx) )
+ {
+ _regs.eax = old_lo;
@@ -236,8 +237,7 @@
+ else if ( ops->cmpxchg2 == NULL )
+ {
+ rc = X86EMUL_UNHANDLEABLE;
- goto done;
-- _regs.eflags |= EFLG_ZF;
++ goto done;
+ }
+ else
+ {
@@ -253,7 +253,7 @@
case 0xc8 ... 0xcf: /* bswap */
dst.type = OP_REG;
-@@ -3384,7 +3391,7 @@ x86_emulate(
+@@ -3393,7 +3400,7 @@ x86_emulate(
{
default: /* case 2: */
/* Undefined behaviour. Writes zero on all tested CPUs. */
++++++ x86-hvm-load-diags.patch ++++++
Index: xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
@@ -358,14 +358,14 @@ static int hvm_load_cpu_ctxt(struct doma
((ctxt.cr0 & (X86_CR0_PE|X86_CR0_PG)) == X86_CR0_PG) )
{
gdprintk(XENLOG_ERR, "HVM restore: bad CR0 0x%"PRIx64"\n",
- ctxt.msr_efer);
+ ctxt.cr0);
return -EINVAL;
}
if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS )
{
gdprintk(XENLOG_ERR, "HVM restore: bad CR4 0x%"PRIx64"\n",
- ctxt.msr_efer);
+ ctxt.cr4);
return -EINVAL;
}
++++++ x86-pgtable-no-biglock.patch ++++++
The use of the domain lock in do_mmuext_op() and do_set_gdt() still needs
looking at, as do the assertions of the lock being held in
create_grant_{pte,va}_mapping().
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -1335,6 +1335,37 @@ static void free_l4_table(struct page_in
#endif
+static void lock_page(struct page_info *page)
+{
+ unsigned long x, y;
+
+ y = page->u.inuse.type_info;
+ do {
+ for ( ; ; )
+ {
+ ASSERT(y & PGT_count_mask);
+ if (likely(y & PGT_validated) && likely(!(y & PGT_locked)))
+ break;
+ cpu_relax();
+ y = page->u.inuse.type_info;
+ }
+ x = y;
+ }
+ while ( (y = cmpxchg(&page->u.inuse.type_info, x, x | PGT_locked)) != x );
+}
+
+static void unlock_page(struct page_info *page)
+{
+ unsigned long x, y;
+
+ y = page->u.inuse.type_info;
+ do {
+ ASSERT(y & PGT_locked);
+ ASSERT(y & PGT_count_mask);
+ x = y;
+ }
+ while ( (y = cmpxchg(&page->u.inuse.type_info, x, x & ~PGT_locked)) != x );
+}
/* How to write an entry to the guest pagetables.
* Returns 0 for failure (pointer not valid), 1 for success. */
@@ -1396,24 +1427,33 @@ static int mod_l1_entry(l1_pgentry_t *pl
struct vcpu *curr = current;
struct domain *d = curr->domain;
unsigned long mfn;
+ struct page_info *l1pg = mfn_to_page(gl1mfn);
+ int rc = 1;
+
+ lock_page(l1pg);
if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) )
- return 0;
+ return unlock_page(l1pg), 0;
if ( unlikely(paging_mode_refcounts(d)) )
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr, preserve_ad);
+ {
+ rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr, preserve_ad);
+ unlock_page(l1pg);
+ return rc;
+ }
if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
{
/* Translate foreign guest addresses. */
mfn = gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e));
if ( unlikely(mfn == INVALID_MFN) )
- return 0;
+ return unlock_page(l1pg), 0;
ASSERT((mfn & ~(PADDR_MASK >> PAGE_SHIFT)) == 0);
nl1e = l1e_from_pfn(mfn, l1e_get_flags(nl1e));
if ( unlikely(l1e_get_flags(nl1e) & l1_disallow_mask(d)) )
{
+ unlock_page(l1pg);
MEM_LOG("Bad L1 flags %x",
l1e_get_flags(nl1e) & l1_disallow_mask(d));
return 0;
@@ -1423,30 +1463,33 @@ static int mod_l1_entry(l1_pgentry_t *pl
if ( !l1e_has_changed(ol1e, nl1e, _PAGE_RW | _PAGE_PRESENT) )
{
adjust_guest_l1e(nl1e, d);
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
- preserve_ad);
+ rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad);
+ unlock_page(l1pg);
+ return rc;
}
if ( unlikely(!get_page_from_l1e(nl1e, FOREIGNDOM)) )
- return 0;
+ return unlock_page(l1pg), 0;
adjust_guest_l1e(nl1e, d);
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
preserve_ad)) )
{
- put_page_from_l1e(nl1e, d);
- return 0;
+ ol1e = nl1e;
+ rc = 0;
}
}
- else
+ else if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad)) )
{
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
- preserve_ad)) )
- return 0;
+ unlock_page(l1pg);
+ return 0;
}
+ unlock_page(l1pg);
put_page_from_l1e(ol1e, d);
- return 1;
+ return rc;
}
@@ -1460,6 +1503,8 @@ static int mod_l2_entry(l2_pgentry_t *pl
l2_pgentry_t ol2e;
struct vcpu *curr = current;
struct domain *d = curr->domain;
+ struct page_info *l2pg = mfn_to_page(pfn);
+ int rc = 1;
if ( unlikely(!is_guest_l2_slot(d, type, pgentry_ptr_to_slot(pl2e))) )
{
@@ -1467,13 +1512,16 @@ static int mod_l2_entry(l2_pgentry_t *pl
return 0;
}
+ lock_page(l2pg);
+
if ( unlikely(__copy_from_user(&ol2e, pl2e, sizeof(ol2e)) != 0) )
- return 0;
+ return unlock_page(l2pg), 0;
if ( l2e_get_flags(nl2e) & _PAGE_PRESENT )
{
if ( unlikely(l2e_get_flags(nl2e) & L2_DISALLOW_MASK) )
{
+ unlock_page(l2pg);
MEM_LOG("Bad L2 flags %x",
l2e_get_flags(nl2e) & L2_DISALLOW_MASK);
return 0;
@@ -1483,28 +1531,32 @@ static int mod_l2_entry(l2_pgentry_t *pl
if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
{
adjust_guest_l2e(nl2e, d);
- return UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
+ unlock_page(l2pg);
+ return rc;
}
if ( unlikely(!get_page_from_l2e(nl2e, pfn, d)) )
- return 0;
+ return unlock_page(l2pg), 0;
adjust_guest_l2e(nl2e, d);
if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l2e(nl2e, pfn);
- return 0;
+ ol2e = nl2e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l2pg);
return 0;
}
+ unlock_page(l2pg);
put_page_from_l2e(ol2e, pfn);
- return 1;
+ return rc;
}
#if CONFIG_PAGING_LEVELS >= 3
@@ -1518,7 +1570,8 @@ static int mod_l3_entry(l3_pgentry_t *pl
l3_pgentry_t ol3e;
struct vcpu *curr = current;
struct domain *d = curr->domain;
- int okay;
+ struct page_info *l3pg = mfn_to_page(pfn);
+ int okay, rc = 1;
if ( unlikely(!is_guest_l3_slot(pgentry_ptr_to_slot(pl3e))) )
{
@@ -1535,13 +1588,16 @@ static int mod_l3_entry(l3_pgentry_t *pl
return 0;
#endif
+ lock_page(l3pg);
+
if ( unlikely(__copy_from_user(&ol3e, pl3e, sizeof(ol3e)) != 0) )
- return 0;
+ return unlock_page(l3pg), 0;
if ( l3e_get_flags(nl3e) & _PAGE_PRESENT )
{
if ( unlikely(l3e_get_flags(nl3e) & l3_disallow_mask(d)) )
{
+ unlock_page(l3pg);
MEM_LOG("Bad L3 flags %x",
l3e_get_flags(nl3e) & l3_disallow_mask(d));
return 0;
@@ -1551,23 +1607,26 @@ static int mod_l3_entry(l3_pgentry_t *pl
if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) )
{
adjust_guest_l3e(nl3e, d);
- return UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
+ unlock_page(l3pg);
+ return rc;
}
if ( unlikely(!get_page_from_l3e(nl3e, pfn, d)) )
- return 0;
+ return unlock_page(l3pg), 0;
adjust_guest_l3e(nl3e, d);
if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l3e(nl3e, pfn);
- return 0;
+ ol3e = nl3e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l3pg);
return 0;
}
@@ -1576,8 +1635,9 @@ static int mod_l3_entry(l3_pgentry_t *pl
pae_flush_pgd(pfn, pgentry_ptr_to_slot(pl3e), nl3e);
+ unlock_page(l3pg);
put_page_from_l3e(ol3e, pfn);
- return 1;
+ return rc;
}
#endif
@@ -1593,6 +1653,8 @@ static int mod_l4_entry(l4_pgentry_t *pl
struct vcpu *curr = current;
struct domain *d = curr->domain;
l4_pgentry_t ol4e;
+ struct page_info *l4pg = mfn_to_page(pfn);
+ int rc = 1;
if ( unlikely(!is_guest_l4_slot(d, pgentry_ptr_to_slot(pl4e))) )
{
@@ -1600,13 +1662,16 @@ static int mod_l4_entry(l4_pgentry_t *pl
return 0;
}
+ lock_page(l4pg);
+
if ( unlikely(__copy_from_user(&ol4e, pl4e, sizeof(ol4e)) != 0) )
- return 0;
+ return unlock_page(l4pg), 0;
if ( l4e_get_flags(nl4e) & _PAGE_PRESENT )
{
if ( unlikely(l4e_get_flags(nl4e) & L4_DISALLOW_MASK) )
{
+ unlock_page(l4pg);
MEM_LOG("Bad L4 flags %x",
l4e_get_flags(nl4e) & L4_DISALLOW_MASK);
return 0;
@@ -1616,28 +1681,32 @@ static int mod_l4_entry(l4_pgentry_t *pl
if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) )
{
adjust_guest_l4e(nl4e, d);
- return UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
+ rc = UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
+ unlock_page(l4pg);
+ return rc;
}
if ( unlikely(!get_page_from_l4e(nl4e, pfn, d)) )
- return 0;
+ return unlock_page(l4pg), 0;
adjust_guest_l4e(nl4e, d);
if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
preserve_ad)) )
{
- put_page_from_l4e(nl4e, pfn);
- return 0;
+ ol4e = nl4e;
+ rc = 0;
}
}
else if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
preserve_ad)) )
{
+ unlock_page(l4pg);
return 0;
}
+ unlock_page(l4pg);
put_page_from_l4e(ol4e, pfn);
- return 1;
+ return rc;
}
#endif
@@ -2460,8 +2529,6 @@ int do_mmu_update(
domain_mmap_cache_init(&mapcache);
- LOCK_BIGLOCK(d);
-
for ( i = 0; i < count; i++ )
{
if ( hypercall_preempt_check() )
@@ -2632,8 +2699,6 @@ int do_mmu_update(
process_deferred_ops();
- UNLOCK_BIGLOCK(d);
-
domain_mmap_cache_destroy(&mapcache);
perfc_add(num_page_updates, i);
@@ -2686,14 +2751,19 @@ static int create_grant_pte_mapping(
goto failed;
}
+ lock_page(page);
+
ol1e = *(l1_pgentry_t *)va;
if ( !UPDATE_ENTRY(l1, (l1_pgentry_t *)va, ol1e, nl1e, mfn, v, 0) )
{
+ unlock_page(page);
put_page_type(page);
rc = GNTST_general_error;
goto failed;
}
+ unlock_page(page);
+
if ( !paging_mode_refcounts(d) )
put_page_from_l1e(ol1e, d);
@@ -2737,16 +2807,14 @@ static int destroy_grant_pte_mapping(
goto failed;
}
- if ( __copy_from_user(&ol1e, (l1_pgentry_t *)va, sizeof(ol1e)) )
- {
- put_page_type(page);
- rc = GNTST_general_error;
- goto failed;
- }
+ lock_page(page);
+
+ ol1e = *(l1_pgentry_t *)va;
/* Check that the virtual address supplied is actually mapped to frame. */
if ( unlikely((l1e_get_intpte(ol1e) >> PAGE_SHIFT) != frame) )
{
+ unlock_page(page);
MEM_LOG("PTE entry %lx for address %"PRIx64" doesn't match frame %lx",
(unsigned long)l1e_get_intpte(ol1e), addr, frame);
put_page_type(page);
@@ -2761,12 +2829,14 @@ static int destroy_grant_pte_mapping(
d->vcpu[0] /* Change if we go to per-vcpu shadows. */,
0)) )
{
+ unlock_page(page);
MEM_LOG("Cannot delete PTE entry at %p", va);
put_page_type(page);
rc = GNTST_general_error;
goto failed;
}
+ unlock_page(page);
put_page_type(page);
failed:
@@ -2782,6 +2852,7 @@ static int create_grant_va_mapping(
l1_pgentry_t *pl1e, ol1e;
struct domain *d = v->domain;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int okay;
ASSERT(spin_is_locked(&d->big_lock));
@@ -2794,8 +2865,11 @@ static int create_grant_va_mapping(
MEM_LOG("Could not find L1 PTE for address %lx", va);
return GNTST_general_error;
}
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
okay = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0);
+ unlock_page(l1pg);
guest_unmap_l1e(v, pl1e);
pl1e = NULL;
@@ -2813,6 +2887,7 @@ static int replace_grant_va_mapping(
{
l1_pgentry_t *pl1e, ol1e;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int rc = 0;
pl1e = guest_map_l1e(v, addr, &gl1mfn);
@@ -2821,11 +2896,15 @@ static int replace_grant_va_mapping(
MEM_LOG("Could not find L1 PTE for address %lx", addr);
return GNTST_general_error;
}
+
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
/* Check that the virtual address supplied is actually mapped to frame. */
if ( unlikely(l1e_get_pfn(ol1e) != frame) )
{
+ unlock_page(l1pg);
MEM_LOG("PTE entry %lx for address %lx doesn't match frame %lx",
l1e_get_pfn(ol1e), addr, frame);
rc = GNTST_general_error;
@@ -2835,11 +2914,14 @@ static int replace_grant_va_mapping(
/* Delete pagetable entry. */
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0)) )
{
+ unlock_page(l1pg);
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
rc = GNTST_general_error;
goto out;
}
+ unlock_page(l1pg);
+
out:
guest_unmap_l1e(v, pl1e);
return rc;
@@ -2874,6 +2956,7 @@ int replace_grant_host_mapping(
struct vcpu *curr = current;
l1_pgentry_t *pl1e, ol1e;
unsigned long gl1mfn;
+ struct page_info *l1pg;
int rc;
if ( flags & GNTMAP_contains_pte )
@@ -2895,16 +2978,21 @@ int replace_grant_host_mapping(
(unsigned long)new_addr);
return GNTST_general_error;
}
+
+ l1pg = mfn_to_page(gl1mfn);
+ lock_page(l1pg);
ol1e = *pl1e;
if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, l1e_empty(),
gl1mfn, curr, 0)) )
{
+ unlock_page(l1pg);
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
guest_unmap_l1e(curr, pl1e);
return GNTST_general_error;
}
+ unlock_page(l1pg);
guest_unmap_l1e(curr, pl1e);
rc = replace_grant_va_mapping(addr, frame, ol1e, curr);
@@ -2982,8 +3070,6 @@ int do_update_va_mapping(unsigned long v
if ( rc )
return rc;
- LOCK_BIGLOCK(d);
-
pl1e = guest_map_l1e(v, va, &gl1mfn);
if ( unlikely(!pl1e || !mod_l1_entry(pl1e, val, gl1mfn, 0)) )
@@ -2995,8 +3081,6 @@ int do_update_va_mapping(unsigned long v
process_deferred_ops();
- UNLOCK_BIGLOCK(d);
-
switch ( flags & UVMF_FLUSHTYPE_MASK )
{
case UVMF_TLB_FLUSH:
@@ -3632,8 +3716,6 @@ int ptwr_do_page_fault(struct vcpu *v, u
struct ptwr_emulate_ctxt ptwr_ctxt;
int rc;
- LOCK_BIGLOCK(d);
-
/* Attempt to read the PTE that maps the VA being accessed. */
guest_get_eff_l1e(v, addr, &pte);
page = l1e_get_page(pte);
@@ -3652,16 +3734,16 @@ int ptwr_do_page_fault(struct vcpu *v, u
ptwr_ctxt.cr2 = addr;
ptwr_ctxt.pte = pte;
+ lock_page(page);
rc = x86_emulate(&ptwr_ctxt.ctxt, &ptwr_emulate_ops);
+ unlock_page(page);
if ( rc == X86EMUL_UNHANDLEABLE )
goto bail;
- UNLOCK_BIGLOCK(d);
perfc_incr(ptwr_emulations);
return EXCRET_fault_fixed;
bail:
- UNLOCK_BIGLOCK(d);
return 0;
}
Index: xen-3.2.1-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/mm.h
@@ -83,9 +83,12 @@ struct page_info
/* PAE only: is this an L2 page directory containing Xen-private mappings? */
#define _PGT_pae_xen_l2 26
#define PGT_pae_xen_l2 (1U<<_PGT_pae_xen_l2)
+ /* The page is currently locked for modification. */
+#define _PGT_locked 25
+#define PGT_locked (1U<<_PGT_locked)
- /* 26-bit count of uses of this frame as its current type. */
-#define PGT_count_mask ((1U<<26)-1)
+ /* 25-bit count of uses of this frame as its current type. */
+#define PGT_count_mask ((1U<<25)-1)
/* Cleared when the owning guest 'frees' this page. */
#define _PGC_allocated 31
++++++ x86-show-page-walk-early.patch ++++++
Index: xen-3.2.1-testing/xen/arch/x86/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/traps.c
@@ -1187,6 +1187,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);
+ show_page_walk(cr2);
printk("Stack dump: ");
while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
printk("%p ", _p(*stk++));
Index: xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/mm.c
@@ -41,6 +41,7 @@ l2_pgentry_t __attribute__ ((__section__
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)
@@ -112,6 +113,8 @@ void __init paging_init(void)
pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW));
}
+ 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.2.1-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
@@ -132,7 +132,8 @@ void show_page_walk(unsigned long addr)
l3t += (cr3 & 0xFE0UL) >> 3;
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
unmap_domain_page(l3t);
@@ -143,7 +144,8 @@ void show_page_walk(unsigned long addr)
l2t = map_domain_page(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -155,7 +157,8 @@ void show_page_walk(unsigned long addr)
l1t = map_domain_page(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
unmap_domain_page(l1t);
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/mm.c
@@ -32,6 +32,7 @@
#include
#include
+int mpt_valid;
#ifdef CONFIG_COMPAT
unsigned int m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
#endif
@@ -144,6 +145,8 @@ void __init paging_init(void)
l2_ro_mpt++;
}
+ 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.2.1-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
@@ -136,7 +136,8 @@ void show_page_walk(unsigned long addr)
l4t = mfn_to_virt(mfn);
l4e = l4t[l4_table_offset(addr)];
mfn = l4e_get_pfn(l4e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ 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) )
@@ -145,7 +146,8 @@ void show_page_walk(unsigned long addr)
l3t = mfn_to_virt(mfn);
l3e = l3t[l3_table_offset(addr)];
mfn = l3e_get_pfn(l3e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L3[0x%03lx] = %"PRIpte" %016lx\n",
l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
@@ -154,7 +156,8 @@ void show_page_walk(unsigned long addr)
l2t = mfn_to_virt(mfn);
l2e = l2t[l2_table_offset(addr)];
mfn = l2e_get_pfn(l2e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
(l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
@@ -165,7 +168,8 @@ void show_page_walk(unsigned long addr)
l1t = mfn_to_virt(mfn);
l1e = l1t[l1_table_offset(addr)];
mfn = l1e_get_pfn(l1e);
- pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
+ pfn = mfn_valid(mfn) && mpt_valid ?
+ get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
}
Index: xen-3.2.1-testing/xen/include/asm-x86/mm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/mm.h
+++ xen-3.2.1-testing/xen/include/asm-x86/mm.h
@@ -267,6 +267,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;
#ifdef CONFIG_COMPAT
#define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
++++++ xen-3.2.1-testing-src.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/Makefile new/xen-3.2.1-testing/Makefile
--- old/xen-3.2.1-testing/Makefile 2008-04-11 16:33:12.000000000 +0200
+++ new/xen-3.2.1-testing/Makefile 2008-04-25 16:12:54.000000000 +0200
@@ -122,6 +122,13 @@
.PHONY: mrproper
mrproper: distclean
+# Prepare for source tarball
+.PHONY: src-tarball
+src-tarball: distclean
+ $(MAKE) -C xen .banner
+ rm -rf xen/tools/figlet .[a-z]*
+ $(MAKE) -C xen distclean
+
.PHONY: help
help:
@echo 'Installation targets:'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/tools/ioemu/osdep.c new/xen-3.2.1-testing/tools/ioemu/osdep.c
--- old/xen-3.2.1-testing/tools/ioemu/osdep.c 2008-04-11 16:33:13.000000000 +0200
+++ new/xen-3.2.1-testing/tools/ioemu/osdep.c 2008-04-25 16:12:54.000000000 +0200
@@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
+#include "config-host.h"
#include
#include
#include
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/tools/libxc/xg_private.c new/xen-3.2.1-testing/tools/libxc/xg_private.c
--- old/xen-3.2.1-testing/tools/libxc/xg_private.c 2008-04-11 16:33:13.000000000 +0200
+++ new/xen-3.2.1-testing/tools/libxc/xg_private.c 2008-04-25 16:12:55.000000000 +0200
@@ -8,7 +8,6 @@
#include
#include
#include
-#include
#include
#include "xg_private.h"
@@ -209,7 +208,7 @@
if (ret != 0)
return NULL;
return ptr;
-#elif defined(_BSD)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
return valloc(size);
#else
return memalign(alignment, size);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/arch/x86/bitops.c new/xen-3.2.1-testing/xen/arch/x86/bitops.c
--- old/xen-3.2.1-testing/xen/arch/x86/bitops.c 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/arch/x86/bitops.c 2008-04-25 16:12:58.000000000 +0200
@@ -8,17 +8,18 @@
unsigned long d0, d1, res;
asm volatile (
- " xor %%eax,%%eax\n\t" /* also ensures ZF==1 if size==0 */
+ "1: xor %%eax,%%eax\n\t" /* also ensures ZF==1 if size==0 */
" repe; scas"__OS"\n\t"
- " je 1f\n\t"
+ " je 2f\n\t"
+ " bsf -"STR(BITS_PER_LONG/8)"(%2),%0\n\t"
+ " jz 1b\n\t"
" lea -"STR(BITS_PER_LONG/8)"(%2),%2\n\t"
- " bsf (%2),%0\n"
- "1: sub %%ebx,%%edi\n\t"
+ "2: sub %%ebx,%%edi\n\t"
" shl $3,%%edi\n\t"
" add %%edi,%%eax"
: "=&a" (res), "=&c" (d0), "=&D" (d1)
- : "1" ((size + BITS_PER_LONG - 1) / BITS_PER_LONG),
- "2" (addr), "b" ((int)(long)addr) : "memory" );
+ : "1" (BITS_TO_LONGS(size)), "2" (addr), "b" ((int)(long)addr)
+ : "memory" );
return res;
}
@@ -34,8 +35,7 @@
if ( bit != 0 )
{
/* Look for a bit in the first word. */
- asm ( "bsf %1,%%"__OP"ax"
- : "=a" (set) : "r" (*p >> bit), "0" (BITS_PER_LONG) );
+ set = __scanbit(*p >> bit, BITS_PER_LONG - bit);
if ( set < (BITS_PER_LONG - bit) )
return (offset + set);
offset += BITS_PER_LONG - bit;
@@ -56,18 +56,20 @@
unsigned long d0, d1, d2, res;
asm volatile (
+ "1: xor %%eax,%%eax ; not %3\n\t" /* rAX == ~0ul */
" xor %%edx,%%edx\n\t" /* also ensures ZF==1 if size==0 */
" repe; scas"__OS"\n\t"
- " je 1f\n\t"
+ " je 2f\n\t"
+ " xor -"STR(BITS_PER_LONG/8)"(%2),%3\n\t"
+ " jz 1b\n\t"
+ " bsf %3,%0\n\t"
" lea -"STR(BITS_PER_LONG/8)"(%2),%2\n\t"
- " xor (%2),%3\n\t"
- " bsf %3,%0\n"
- "1: sub %%ebx,%%edi\n\t"
+ "2: sub %%ebx,%%edi\n\t"
" shl $3,%%edi\n\t"
" add %%edi,%%edx"
: "=&d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
- : "1" ((size + BITS_PER_LONG - 1) / BITS_PER_LONG),
- "2" (addr), "b" ((int)(long)addr), "3" (-1L) : "memory" );
+ : "1" (BITS_TO_LONGS(size)), "2" (addr), "b" ((int)(long)addr)
+ : "memory" );
return res;
}
@@ -83,7 +85,7 @@
if ( bit != 0 )
{
/* Look for zero in the first word. */
- asm ( "bsf %1,%%"__OP"ax" : "=a" (set) : "r" (~(*p >> bit)) );
+ set = __scanbit(~(*p >> bit), BITS_PER_LONG - bit);
if ( set < (BITS_PER_LONG - bit) )
return (offset + set);
offset += BITS_PER_LONG - bit;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c new/xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
--- old/xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c 2008-04-25 16:12:58.000000000 +0200
@@ -502,6 +502,8 @@
void hvm_vcpu_destroy(struct vcpu *v)
{
+ xfree(v->arch.hvm_vcpu.mtrr.var_ranges);
+
vlapic_destroy(v);
hvm_funcs.vcpu_destroy(v);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c new/xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c
--- old/xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/arch/x86/mm/shadow/common.c 2008-04-25 16:12:58.000000000 +0200
@@ -801,7 +801,6 @@
struct vcpu *v, *v2;
struct list_head *l, *t;
struct shadow_page_info *sp;
- cpumask_t flushmask = CPU_MASK_NONE;
mfn_t smfn;
int i;
@@ -839,12 +838,11 @@
{
shadow_unhook_mappings(v,
pagetable_get_mfn(v2->arch.shadow_table[i]));
- cpus_or(flushmask, v2->vcpu_dirty_cpumask, flushmask);
/* See if that freed up enough space */
if ( space_is_available(d, order, count) )
{
- flush_tlb_mask(flushmask);
+ flush_tlb_mask(d->domain_dirty_cpumask);
return;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/arch/x86/smp.c new/xen-3.2.1-testing/xen/arch/x86/smp.c
--- old/xen-3.2.1-testing/xen/arch/x86/smp.c 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/arch/x86/smp.c 2008-04-25 16:12:58.000000000 +0200
@@ -75,20 +75,10 @@
return SET_APIC_DEST_FIELD(mask);
}
-static inline void check_IPI_mask(cpumask_t cpumask)
-{
- /*
- * Sanity, and necessary. An IPI with no target generates a send accept
- * error with Pentium and P6 APICs.
- */
- ASSERT(cpus_subset(cpumask, cpu_online_map));
- ASSERT(!cpus_empty(cpumask));
-}
-
void apic_wait_icr_idle(void)
{
- while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY )
- cpu_relax();
+ while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY )
+ cpu_relax();
}
void send_IPI_mask_flat(cpumask_t cpumask, int vector)
@@ -97,7 +87,8 @@
unsigned long cfg;
unsigned long flags;
- check_IPI_mask(cpumask);
+ /* An IPI with no target generates a send accept error from P5/P6 APICs. */
+ WARN_ON(mask == 0);
local_irq_save(flags);
@@ -130,17 +121,9 @@
unsigned long cfg, flags;
unsigned int query_cpu;
- check_IPI_mask(mask);
-
- /*
- * Hack. The clustered APIC addressing mode doesn't allow us to send
- * to an arbitrary mask, so I do a unicasts to each CPU instead. This
- * should be modified to do 1 message per cluster ID - mbligh
- */
-
local_irq_save(flags);
- for_each_cpu_mask( query_cpu, mask )
+ for_each_cpu_mask ( query_cpu, mask )
{
/*
* Wait for idle.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/arch/x86/x86_emulate.c new/xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
--- old/xen-3.2.1-testing/xen/arch/x86/x86_emulate.c 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/arch/x86/x86_emulate.c 2008-04-25 16:12:58.000000000 +0200
@@ -2968,6 +2968,7 @@
case 0xa3: bt: /* bt */
emulate_2op_SrcV_nobyte("bt", src, dst, _regs.eflags);
+ dst.type = OP_NONE;
break;
case 0xa4: /* shld imm8,r,r/m */
@@ -3060,7 +3061,11 @@
: "=r" (dst.val), "=q" (zf)
: "r" (src.val), "1" (0) );
_regs.eflags &= ~EFLG_ZF;
- _regs.eflags |= zf ? EFLG_ZF : 0;
+ if ( zf )
+ {
+ _regs.eflags |= EFLG_ZF;
+ dst.type = OP_NONE;
+ }
break;
}
@@ -3070,7 +3075,11 @@
: "=r" (dst.val), "=q" (zf)
: "r" (src.val), "1" (0) );
_regs.eflags &= ~EFLG_ZF;
- _regs.eflags |= zf ? EFLG_ZF : 0;
+ if ( zf )
+ {
+ _regs.eflags |= EFLG_ZF;
+ dst.type = OP_NONE;
+ }
break;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/include/asm-x86/bitops.h new/xen-3.2.1-testing/xen/include/asm-x86/bitops.h
--- old/xen-3.2.1-testing/xen/include/asm-x86/bitops.h 2008-04-11 16:33:16.000000000 +0200
+++ new/xen-3.2.1-testing/xen/include/asm-x86/bitops.h 2008-04-25 16:12:58.000000000 +0200
@@ -272,10 +272,9 @@
extern unsigned int __find_next_zero_bit(
const unsigned long *addr, unsigned int size, unsigned int offset);
-/* return index of first bit set in val or BITS_PER_LONG when no bit is set */
-static inline unsigned int __scanbit(unsigned long val)
+static inline unsigned int __scanbit(unsigned long val, unsigned long max)
{
- __asm__ ( "bsf %1,%0" : "=r" (val) : "r" (val), "0" (BITS_PER_LONG) );
+ asm ( "bsf %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max) );
return (unsigned int)val;
}
@@ -287,9 +286,9 @@
* Returns the bit-number of the first set bit, not the number of the byte
* containing a bit.
*/
-#define find_first_bit(addr,size) \
-((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
- (__scanbit(*(const unsigned long *)addr)) : \
+#define find_first_bit(addr,size) \
+((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
+ (__scanbit(*(const unsigned long *)addr, size)) : \
__find_first_bit(addr,size)))
/**
@@ -298,9 +297,9 @@
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-#define find_next_bit(addr,size,off) \
-((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
- ((off) + (__scanbit((*(const unsigned long *)addr) >> (off)))) : \
+#define find_next_bit(addr,size,off) \
+((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
+ ((off) + (__scanbit((*(const unsigned long *)addr) >> (off), size))) : \
__find_next_bit(addr,size,off)))
/**
@@ -311,9 +310,9 @@
* Returns the bit-number of the first zero bit, not the number of the byte
* containing a bit.
*/
-#define find_first_zero_bit(addr,size) \
-((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
- (__scanbit(~*(const unsigned long *)addr)) : \
+#define find_first_zero_bit(addr,size) \
+((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
+ (__scanbit(~*(const unsigned long *)addr, size)) : \
__find_first_zero_bit(addr,size)))
/**
@@ -322,9 +321,9 @@
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-#define find_next_zero_bit(addr,size,off) \
-((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
- ((off)+(__scanbit(~(((*(const unsigned long *)addr)) >> (off))))) : \
+#define find_next_zero_bit(addr,size,off) \
+((__builtin_constant_p(size) && (size) <= BITS_PER_LONG ? \
+ ((off)+(__scanbit(~(((*(const unsigned long *)addr)) >> (off)), size))) : \
__find_next_zero_bit(addr,size,off)))
@@ -332,8 +331,7 @@
* find_first_set_bit - find the first set bit in @word
* @word: the word to search
*
- * Returns the bit-number of the first set bit. If no bits are set then the
- * result is undefined.
+ * Returns the bit-number of the first set bit. The input must *not* be zero.
*/
static __inline__ unsigned int find_first_set_bit(unsigned long word)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/Makefile new/xen-3.2.1-testing/xen/Makefile
--- old/xen-3.2.1-testing/xen/Makefile 2008-04-11 16:33:15.000000000 +0200
+++ new/xen-3.2.1-testing/xen/Makefile 2008-04-25 16:12:57.000000000 +0200
@@ -2,7 +2,7 @@
# All other places this is stored (eg. compile.h) should be autogenerated.
export XEN_VERSION = 3
export XEN_SUBVERSION = 2
-export XEN_EXTRAVERSION ?= .1-rc5$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
-include xen-version
@@ -62,6 +62,7 @@
$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
rm -f include/asm *.o $(TARGET)* *~ core
rm -f include/asm-*/asm-offsets.h
+ [ -d tools/figlet ] && rm -f .banner*
.PHONY: _distclean
_distclean: clean
@@ -88,8 +89,14 @@
rm -f include/xen/compile.h; \
fi
+.banner: Makefile
+ $(MAKE) -C tools
+ @tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
+ @cat $@1 $@2 >$@
+ @rm -f $@1 $@2
+
# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
-include/xen/compile.h: include/xen/compile.h.in
+include/xen/compile.h: include/xen/compile.h.in .banner
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
-e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
-e 's/@@whoami@@/$(USER)/g' \
@@ -101,7 +108,8 @@
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
-e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
< include/xen/compile.h.in > $@.new
- tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
+ @grep \" .banner >> $@.new
+ @grep -v \" .banner
@mv -f $@.new $@
include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/tools/figlet/figlet.c new/xen-3.2.1-testing/xen/tools/figlet/figlet.c
--- old/xen-3.2.1-testing/xen/tools/figlet/figlet.c 2008-04-11 16:33:17.000000000 +0200
+++ new/xen-3.2.1-testing/xen/tools/figlet/figlet.c 2008-04-25 16:12:59.000000000 +0200
@@ -1488,7 +1488,16 @@
putc(c, stderr);
- if ( nr_chars == 0 )
+ if ( nr_chars == 18 )
+ {
+ nr_chars = 0;
+ putchar('"');
+ putchar(' ');
+ putchar('\\');
+ putchar('\n');
+ }
+
+ if ( nr_chars++ == 0 )
putchar('"');
putchar('\\');
@@ -1498,15 +1507,6 @@
if ( c == '\n' )
startline = 1;
-
- if ( ++nr_chars == 18 )
- {
- nr_chars = 0;
- putchar('"');
- putchar(' ');
- putchar('\\');
- putchar('\n');
- }
}
void putstring(string)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/xen-3.2.1-testing/xen/tools/Makefile new/xen-3.2.1-testing/xen/tools/Makefile
--- old/xen-3.2.1-testing/xen/tools/Makefile 2008-04-11 16:33:17.000000000 +0200
+++ new/xen-3.2.1-testing/xen/tools/Makefile 2008-04-25 16:12:59.000000000 +0200
@@ -4,12 +4,12 @@
.PHONY: default
default:
- $(MAKE) -C figlet
+ [ -d figlet ] && $(MAKE) -C figlet
$(MAKE) symbols
.PHONY: clean
clean:
- $(MAKE) -C figlet clean
+ [ -d figlet ] && $(MAKE) -C figlet clean
rm -f *.o symbols
symbols: symbols.c
++++++ xen-changeset.diff ++++++
--- /var/tmp/diff_new_pack.m23152/_old 2008-04-26 11:41:01.000000000 +0200
+++ /var/tmp/diff_new_pack.m23152/_new 2008-04-26 11:41:01.000000000 +0200
@@ -1,18 +1,31 @@
-Index: xen-3.2-testing/xen/Makefile
+Index: xen-3.2.1-testing/xen/Makefile
===================================================================
---- xen-3.2-testing.orig/xen/Makefile
-+++ xen-3.2-testing/xen/Makefile
+--- xen-3.2.1-testing.orig/xen/Makefile
++++ xen-3.2.1-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
-@@ -99,7 +100,7 @@ include/xen/compile.h: include/xen/compi
+@@ -96,7 +97,7 @@ delete-unfresh-files:
+ @rm -f $@1 $@2
+
+ # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
+-include/xen/compile.h: include/xen/compile.h.in .banner
++include/xen/compile.h: include/xen/compile.h.in
+ @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
+ -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
+ -e 's/@@whoami@@/$(USER)/g' \
+@@ -106,10 +107,9 @@ include/xen/compile.h: include/xen/compi
-e 's/@@version@@/$(XEN_VERSION)/g' \
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
- -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
+ -e 's!@@changeset@@!$(XEN_CHANGESET)!g' \
< include/xen/compile.h.in > $@.new
- tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
+- @grep \" .banner >> $@.new
+- @grep -v \" .banner
++ tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
@mv -f $@.new $@
+
+ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org