Re: [patch 2/7] Change how we do nosegneg
by Roland McGrath
> We should really only install ld.so.conf files from packages
> that actually have CONFIG_XEN enabled, but it would be
> slightly messy to have only kernel-PAE.i686 and kernel.x86_64
> include it.
It wouldn't really be so hard to conditionalize it at least for the arch's
that ever need it. (The kernelcap trick might well be used for other
things in the future.)
I think the right direction to head is that upstream kernels supply a .conf
file to match the vDSO they build in. This will probably always be just a
constant file in the source, but in general can be said to be generated by
the kernel build. The contents have to match the magic bits in the vDSO
images built into the kernel, so it really should not be a distro/packaging
responsibility to populate the file.
So let's structure things around that: the kernel build for an arch that
uses vdso might include a kernelcap.conf file (or might not).
For simplicity and consistency in the .spec file, we'll install a file for
all variants even when it's an empty placeholder. For the magic, the diff
below probably covers it (wholly untested). Then it's up to BuildKernel
just to add/remove ldconfig-kernelcap.conf as part of the build (perhaps
eventually done by the upstream makefiles).
The .conf files have to not conflict (reuse same bit with different name)
across all installed kernels (or else ldconfig will complain). So a single
kernel-%{KVERREL}.conf file would be fine. But instead I made it
kernel-%{KVERREL}.variant.conf just to stay consistent with all existing
names like /lib/module/FOO and the fact that no two kernel rpms conflict on
the same file name (even if identical).
Thanks,
Roland
--- kernel.spec 23 Jul 2008 19:51:09 -0000 1.791
+++ kernel.spec 24 Jul 2008 00:21:24 -0000
@@ -1509,21 +1513,13 @@ BuildKernel vmlinux vmlinux kdump vmlinu
cd linux-%{kversion}.%{_target_cpu}
-%if %{includexen}
-%if %{with_xen}
-mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
-rm -f $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf
-cat > $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf <<\EOF
-# This directive teaches ldconfig to search in nosegneg subdirectories
-# and cache the DSOs there with extra bit 0 set in their hwcap match
-# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
-# search in nosegneg subdirectories and to match this extra hwcap bit
-# in the ld.so.cache file.
-hwcap 0 nosegneg
-EOF
-chmod 444 $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf
-%endif
-%endif
+if [ ! -s ldconfig-kernelcap.conf ]; then
+ echo > ldconfig-kernelcap.conf "\
+# Placeholder file, no vDSO hwcap entries used in this kernel."
+fi
+
+%{__install} -D -m 444 ldconfig-kernelcap.conf \
+ $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernel-%{KVERREL}.conf
%if %{with_doc}
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion}/Documentation
@@ -1728,6 +1724,7 @@ fi
/lib/modules/%{KVERREL}%{?2:.%{2}}/weak-updates\
%ifarch %{vdso_arches}\
/lib/modules/%{KVERREL}%{?2:.%{2}}/vdso\
+/etc/ld.so.conf.d/kernelcap-%{KVERREL}%{?2:.%{2}}.conf\
%endif\
/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.block\
/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.networking\
15 years, 9 months
rebase, utrace
by Roland McGrath
I took the liberty of rebasing rawhide to git11. (rebase.sh works great!)
That was necessary for my latest utrace patches to apply, and I turned
those back on. I'm starting a build and will deal if it doesn't compile.
Thanks,
Roland
15 years, 9 months
vanilla-%{kversion}
by Roland McGrath
I find myself doing a lot of make prep lately in the days of frequent
new upstream base patches. The untar still takes a lot longer than
the big patch. So I committed this to speed it up for the repeated
rebase case.
Thanks,
Roland
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.791
diff -u -r1.791 kernel.spec
--- kernel.spec 23 Jul 2008 19:51:09 -0000 1.791
+++ kernel.spec 24 Jul 2008 08:01:48 -0000
@@ -904,10 +904,19 @@
%endif
if [ ! -d kernel-%{kversion}/vanilla-%{vanillaversion} ]; then
- # Ok, first time we do a make prep.
- rm -f pax_global_header
+
+ if [ -d kernel-%{kversion}/vanilla-%{kversion} ]; then
+ cd kernel-%{kversion}
+ else
+ # Ok, first time we do a make prep.
+ rm -f pax_global_header
%setup -q -n kernel-%{kversion} -c
- mv linux-%{kversion} vanilla-%{vanillaversion}
+ mv linux-%{kversion} vanilla-%{kversion}
+ fi
+
+%if "%{kversion}" != "%{vanillaversion}"
+ cp -rl vanilla-%{kversion} vanilla-%{vanillaversion}
+%endif
cd vanilla-%{vanillaversion}
# Update vanilla to the latest upstream.
15 years, 9 months
Re: [patch 0/7] Enable pv_ops Xen; kill the kernel-xen RPM
by Mark McLoughlin
On Wed, 2008-07-23 at 14:20 +0100, Mark McLoughlin wrote:
> I'm still doing a last bit of testing making sure
> that it all works fine, so don't apply yet ... but comments
> are very welcome.
Okay, it seems to be in pretty good shape now.
The only outstanding TODO item is to make kernel-PAE.i686 %post do:
s/DEFAULTKERNEL=kernel-xen/DEFAULTKERNEL=kernel-PAE/
and kernel.x86_64 %post do:
s/DEFAULTKERNEL=kernel-xen/DEFAULTKERNEL=kernel/
But I've had enough spec file pain for one day ... we can add this
later :-)
Cheers,
Mark.
15 years, 9 months
Re: [patch 1/7] Fix kernel_{conflicts,obsoletes,provides}
by Mark McLoughlin
On Wed, 2008-07-23 at 14:20 +0100, Mark McLoughlin wrote:
> If you try and use e.g. kernel_obsoletes, you'll soon find
> that it's actually kernel__obsoletes you currently need :-)
>
> Index: devel/kernel.spec
> ===================================================================
> --- devel.orig/kernel.spec 2008-07-23 14:04:17.000000000 +0100
> +++ devel.orig/kernel.spec 2008-07-23 14:04:17.000000000 +0100
> @@ -440,9 +440,9 @@ Provides: kernel-uname-r = %{KVERREL}%{?
> Requires(pre): %{kernel_prereq}\
> Conflicts: %{kernel_dot_org_conflicts}\
> Conflicts: %{package_conflicts}\
> -%{?1:%{expand:%%{?kernel_%{1}_conflicts:Conflicts: %%{kernel_%{1}_conflicts}}}}\
> -%{?1:%{expand:%%{?kernel_%{1}_obsoletes:Obsoletes: %%{kernel_%{1}_obsoletes}}}}\
> -%{?1:%{expand:%%{?kernel_%{1}_provides:Provides: %%{kernel_%{1}_provides}}}}\
> +%{?1:%{expand:%%{?kernel%{?1:_%{1}}_conflicts:Conflicts: %%{kernel%{?1:_%{1}}_conflicts}}}}\
> +%{?1:%{expand:%%{?kernel%{?1:_%{1}}_obsoletes:Obsoletes: %%{kernel%{?1:_%{1}}_obsoletes}}}}\
> +%{?1:%{expand:%%{?kernel%{?1:_%{1}}_provides:Provides: %%{kernel%{?1:_%{1}}_provides}}}}\
Bah, make that:
+%{expand:%%{?kernel%{?1:_%{1}}_conflicts:Conflicts: %%{kernel%{?1:_%{1}}_conflicts}}}\
+%{expand:%%{?kernel%{?1:_%{1}}_obsoletes:Obsoletes: %%{kernel%{?1:_%{1}}_obsoletes}}}\
+%{expand:%%{?kernel%{?1:_%{1}}_provides:Provides: %%{kernel%{?1:_%{1}}_provides}}}\
Cheers,
Mark.
15 years, 9 months
[patch 7/7] Enable Xen support again
by Mark McLoughlin
Now that i686 PAE and x86_64 Xen DomU support is fully
upstream, re-enable it in the stock kernel.
The only not-upstream patches we require are to support
execshield
Also note the Obsoletes/Provides to make upgrades go
smoothely.
Index: devel/config-x86-generic
===================================================================
--- devel.orig/config-x86-generic 2008-07-23 14:06:22.000000000 +0100
+++ devel.orig/config-x86-generic 2008-07-23 14:06:22.000000000 +0100
@@ -340,10 +340,20 @@ CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
-# CONFIG_XEN is not set
CONFIG_LGUEST_GUEST=y
CONFIG_VMI=y
+CONFIG_XEN=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=8
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_HVC_XEN=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_KBDDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+
CONFIG_MTD_ESB2ROM=m
CONFIG_MTD_CK804XROM=m
CONFIG_MTD_NAND_CAFE=m
Index: devel/config-x86_64-generic
===================================================================
--- devel.orig/config-x86_64-generic 2008-07-23 14:06:22.000000000 +0100
+++ devel.orig/config-x86_64-generic 2008-07-23 14:06:22.000000000 +0100
@@ -258,7 +258,17 @@ CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
-# CONFIG_XEN is not set
+
+CONFIG_XEN=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=32
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_HVC_XEN=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_KBDDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
CONFIG_DMADEVICES=y
CONFIG_INTEL_IOATDMA=m
Index: devel/kernel.spec
===================================================================
--- devel.orig/kernel.spec 2008-07-23 14:06:22.000000000 +0100
+++ devel.orig/kernel.spec 2008-07-23 14:06:22.000000000 +0100
@@ -372,7 +372,13 @@ Summary: The Linux kernel
# upto and including kernel 2.4.9 rpms, the 4Gb+ kernel was called kernel-enterprise
# now that the smp kernel offers this capability, obsolete the old kernel
%define kernel_smp_obsoletes kernel-enterprise < 2.4.10
-%define kernel_PAE_obsoletes kernel-smp < 2.6.17
+%define kernel_PAE_obsoletes kernel-smp < 2.6.17, kernel-xen <= 2.6.27-0.2.rc0.git6.fc10
+%define kernel_PAE_provides kernel-xen = %{rpmversion}-%{pkg_release}
+
+%ifarch x86_64
+%define kernel_obsoletes kernel-xen <= 2.6.27-0.2.rc0.git6.fc10
+%define kernel_provides kernel-xen = %{rpmversion}-%{pkg_release}
+%endif
# We moved the drm include files into kernel-headers, make sure there's
# a recent enough libdrm-devel on the system that doesn't have those.
@@ -548,6 +554,9 @@ Patch147: linux-2.6-imac-transparent-bri
Patch149: linux-2.6-efika-not-chrp.patch
Patch160: linux-2.6-execshield.patch
+Patch161: linux-2.6-xen-execshield-add-xen-specific-load_user_cs_desc.patch
+Patch162: linux-2.6-xen-execshield-fix-endless-gpf-fault-loop.patch
+Patch163: linux-2.6-xen-execshield-only-define-load_user_cs_desc-on-32-bit.patch
Patch250: linux-2.6-debug-sizeof-structs.patch
Patch260: linux-2.6-debug-nmi-timeout.patch
Patch270: linux-2.6-debug-taint-vm.patch
@@ -987,6 +996,9 @@ ApplyPatch linux-2.6-imac-transparent-br
# Exec shield
#
ApplyPatch linux-2.6-execshield.patch
+ApplyPatch linux-2.6-xen-execshield-add-xen-specific-load_user_cs_desc.patch
+ApplyPatch linux-2.6-xen-execshield-fix-endless-gpf-fault-loop.patch
+ApplyPatch linux-2.6-xen-execshield-only-define-load_user_cs_desc-on-32-bit.patch
#
# bugfixes to drivers and filesystems
Index: devel/linux-2.6-xen-execshield-add-xen-specific-load_user_cs_desc.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,126 @@
+From cdff48f3077459f1dfaf243db8e402c8202a2693 Mon Sep 17 00:00:00 2001
+From: Stephen Tweedie <sct(a)redhat.com>
+Date: Tue, 11 Mar 2008 18:05:30 +0000
+Subject: [PATCH] xen execshield: Add xen-specific load_user_cs_desc()
+
+x86 32-bit execshield uses load_user_cs_desc() to setup the user CS
+descriptor, but the Xen version needs to do this via a hypercall.
+
+Add this via a new pv_cpu_ops->load_user_cs_desc pv_ops indirection
+so that it can be selected appropriately at run-time.
+
+Signed-off-by: Stephen Tweedie <sct(a)redhat.com>
+---
+ arch/x86/kernel/paravirt.c | 1 +
+ arch/x86/xen/enlighten.c | 17 +++++++++++++++++
+ include/asm-x86/desc.h | 8 ++++++--
+ include/asm-x86/paravirt.h | 6 ++++++
+ 4 files changed, 30 insertions(+), 2 deletions(-)
+
+diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
+index 94da4d5..f2a678c 100644
+--- a/arch/x86/kernel/paravirt.c
++++ b/arch/x86/kernel/paravirt.c
+@@ -336,6 +336,7 @@ struct pv_cpu_ops pv_cpu_ops = {
+ .read_tscp = native_read_tscp,
+ .load_tr_desc = native_load_tr_desc,
+ .set_ldt = native_set_ldt,
++ .load_user_cs_desc = native_load_user_cs_desc,
+ .load_gdt = native_load_gdt,
+ .load_idt = native_load_idt,
+ .store_gdt = native_store_gdt,
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 9ff6e3c..9b95277 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -340,6 +340,22 @@ static void xen_set_ldt(const void *addr, unsigned entries)
+ xen_mc_issue(PARAVIRT_LAZY_CPU);
+ }
+
++static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
++{
++ void *gdt;
++ xmaddr_t mgdt;
++ u64 descriptor;
++ struct desc_struct user_cs;
++
++ gdt = &get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS];
++ mgdt = virt_to_machine(gdt);
++
++ user_cs = mm->context.user_cs;
++ descriptor = (u64) user_cs.a | ((u64) user_cs.b) << 32;
++
++ HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
++}
++
+ static void xen_load_gdt(const struct desc_ptr *dtr)
+ {
+ unsigned long *frames;
+@@ -1213,6 +1229,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+
+ .load_tr_desc = paravirt_nop,
+ .set_ldt = xen_set_ldt,
++ .load_user_cs_desc = xen_load_user_cs_desc,
+ .load_gdt = xen_load_gdt,
+ .load_idt = xen_load_idt,
+ .load_tls = xen_load_tls,
+diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
+index 3a545b1..713634f 100644
+--- a/include/asm-x86/desc.h
++++ b/include/asm-x86/desc.h
+@@ -6,6 +6,7 @@
+ #include <asm/ldt.h>
+ #include <asm/mmu.h>
+ #include <linux/smp.h>
++#include <linux/mm_types.h>
+
+ static inline void fill_ldt(struct desc_struct *desc,
+ const struct user_desc *info)
+@@ -90,6 +91,7 @@ static inline int desc_empty(const void *ptr)
+
+ #define load_TLS(t, cpu) native_load_tls(t, cpu)
+ #define set_ldt native_set_ldt
++#define load_user_cs_desc native_load_user_cs_desc
+
+ #define write_ldt_entry(dt, entry, desc) \
+ native_write_ldt_entry(dt, entry, desc)
+@@ -380,8 +382,10 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
+ desc->b = (limit & 0xf0000) | 0x00c0fb00;
+ }
+
+-#define load_user_cs_desc(cpu, mm) \
+- get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = (mm)->context.user_cs
++static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
++{
++ get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
++}
+
+ extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
+ extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
+diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
+index fbbde93..151ac7a 100644
+--- a/include/asm-x86/paravirt.h
++++ b/include/asm-x86/paravirt.h
+@@ -113,6 +113,7 @@ struct pv_cpu_ops {
+ void (*store_gdt)(struct desc_ptr *);
+ void (*store_idt)(struct desc_ptr *);
+ void (*set_ldt)(const void *desc, unsigned entries);
++ void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
+ unsigned long (*store_tr)(void);
+ void (*load_tls)(struct thread_struct *t, unsigned int cpu);
+ #ifdef CONFIG_X86_64
+@@ -840,6 +841,11 @@ static inline void set_ldt(const void *addr, unsigned entries)
+ {
+ PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
+ }
++static inline void load_user_cs_desc(unsigned int cpu,
++ struct mm_struct *mm)
++{
++ PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
++}
+ static inline void store_gdt(struct desc_ptr *dtr)
+ {
+ PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
+--
+1.5.4.1
+
Index: devel/linux-2.6-xen-execshield-fix-endless-gpf-fault-loop.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,52 @@
+From ad6f7a1789fdb94b16952f50ed65964dc206d7be Mon Sep 17 00:00:00 2001
+From: Stephen Tweedie <sct(a)redhat.com>
+Date: Tue, 11 Mar 2008 18:07:31 +0000
+Subject: [PATCH] xen execshield: fix endless GPF fault loop
+
+Under Xen, loading the user_cs descriptor does not necessarily load
+the descriptor with the exact same values the kernel requested: some
+of the control bits in the descriptor may be modified by the
+hypervisor.
+
+With execshield, the check_lazy_exec_limit() function is needed to
+test whether a fault has been caused by the existing user_cs
+descriptor being too constrained: if so, it performs a lazy expansion
+of the legal cs segment bounds. But it does so via an exact match on
+the descriptor values against their current expected values, so if
+Xen modifies any control bits in the descriptor, it looks as if the
+user_cs is out-of-sync; so check_lazy_exec_limit() resets the
+descriptor and retakes the fault unnecessarily.
+
+This means that a GPF fault can be retried indefinitely, with the
+kernel always seeing the wrong values in user_cs and continually
+trying to correct them and retake the fault.
+
+Fix it by masking off the xen-sensitive control bits when checking
+that the segment descriptor is up-to-date, and comparing only the
+bits which affect the segment base and limit.
+
+Affects 32-bit only; execshield on 64-bit uses NX for this
+functionality.
+
+Signed-off-by: Stephen Tweedie <sct(a)redhat.com>
+---
+ arch/x86/kernel/traps_32.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
+index d001d55..c932b3e 100644
+--- a/arch/x86/kernel/traps_32.c
++++ b/arch/x86/kernel/traps_32.c
+@@ -621,7 +621,8 @@ check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
+ desc1 = ¤t->mm->context.user_cs;
+ desc2 = get_cpu_gdt_table(cpu) + GDT_ENTRY_DEFAULT_USER_CS;
+
+- if (desc1->a != desc2->a || desc1->b != desc2->b) {
++ if ((desc1->a & 0xff0000ff) != (desc2->a & 0xff0000ff) ||
++ desc1->b != desc2->b) {
+ /*
+ * The CS was not in sync - reload it and retry the
+ * instruction. If the instruction still faults then
+--
+1.5.4.1
+
Index: devel/linux-2.6-xen-execshield-only-define-load_user_cs_desc-on-32-bit.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,122 @@
+From 226bc4b8f13ece618de046f6f8da88eeb4b8f8da Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc(a)redhat.com>
+Date: Tue, 25 Mar 2008 11:56:43 +0000
+Subject: [PATCH] xen execshield: Only define load_user_cs_desc() on 32 bit
+
+load_user_cs_desc() is only used on 32 bit, so only
+define it in that case.
+
+Fixes compile failure in native_load_user_cs_desc()
+since mm_context_t->user_cs is only available on
+32 bit.
+
+Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
+---
+ arch/x86/kernel/paravirt.c | 2 ++
+ arch/x86/xen/enlighten.c | 4 ++++
+ include/asm-x86/desc.h | 4 ++++
+ include/asm-x86/paravirt.h | 4 ++++
+ 4 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
+index f2a678c..4277d1a 100644
+--- a/arch/x86/kernel/paravirt.c
++++ b/arch/x86/kernel/paravirt.c
+@@ -336,7 +336,9 @@ struct pv_cpu_ops pv_cpu_ops = {
+ .read_tscp = native_read_tscp,
+ .load_tr_desc = native_load_tr_desc,
+ .set_ldt = native_set_ldt,
++#ifdef CONFIG_X86_32
+ .load_user_cs_desc = native_load_user_cs_desc,
++#endif
+ .load_gdt = native_load_gdt,
+ .load_idt = native_load_idt,
+ .store_gdt = native_store_gdt,
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 9b95277..c54060c 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -340,6 +340,7 @@ static void xen_set_ldt(const void *addr, unsigned entries)
+ xen_mc_issue(PARAVIRT_LAZY_CPU);
+ }
+
++#ifdef CONFIG_X86_32
+ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
+ {
+ void *gdt;
+@@ -355,6 +356,7 @@ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
+
+ HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
+ }
++#endif
+
+ static void xen_load_gdt(const struct desc_ptr *dtr)
+ {
+@@ -1229,7 +1231,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+
+ .load_tr_desc = paravirt_nop,
+ .set_ldt = xen_set_ldt,
++#ifdef CONFIG_X86_32
+ .load_user_cs_desc = xen_load_user_cs_desc,
++#endif
+ .load_gdt = xen_load_gdt,
+ .load_idt = xen_load_idt,
+ .load_tls = xen_load_tls,
+diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
+index 713634f..54234ac 100644
+--- a/include/asm-x86/desc.h
++++ b/include/asm-x86/desc.h
+@@ -91,7 +91,9 @@ static inline int desc_empty(const void *ptr)
+
+ #define load_TLS(t, cpu) native_load_tls(t, cpu)
+ #define set_ldt native_set_ldt
++#ifdef CONFIG_X86_32
+ #define load_user_cs_desc native_load_user_cs_desc
++#endif
+
+ #define write_ldt_entry(dt, entry, desc) \
+ native_write_ldt_entry(dt, entry, desc)
+@@ -382,10 +384,12 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
+ desc->b = (limit & 0xf0000) | 0x00c0fb00;
+ }
+
++#ifdef CONFIG_X86_32
+ static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
+ {
+ get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
+ }
++#endif
+
+ extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
+ extern void arch_remove_exec_range(struct mm_struct *mm, unsigned long limit);
+diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
+index 151ac7a..f354748 100644
+--- a/include/asm-x86/paravirt.h
++++ b/include/asm-x86/paravirt.h
+@@ -113,7 +113,9 @@ struct pv_cpu_ops {
+ void (*store_gdt)(struct desc_ptr *);
+ void (*store_idt)(struct desc_ptr *);
+ void (*set_ldt)(const void *desc, unsigned entries);
++#ifdef CONFIG_X86_32
+ void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
++#endif
+ unsigned long (*store_tr)(void);
+ void (*load_tls)(struct thread_struct *t, unsigned int cpu);
+ #ifdef CONFIG_X86_64
+@@ -841,11 +843,13 @@ static inline void set_ldt(const void *addr, unsigned entries)
+ {
+ PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
+ }
++#ifdef CONFIG_X86_32
+ static inline void load_user_cs_desc(unsigned int cpu,
+ struct mm_struct *mm)
+ {
+ PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
+ }
++#endif
+ static inline void store_gdt(struct desc_ptr *dtr)
+ {
+ PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
+--
+1.5.4.1
+
--
15 years, 9 months
[patch 6/7] Slightly re-org virt related configs
by Mark McLoughlin
Get all OCD on virt related configs - bring them together,
separate the host stuff from the guest stuff and make the
x86_64 config look much more like the x86 config.
Index: devel/config-x86-generic
===================================================================
--- devel.orig/config-x86-generic 2008-07-23 09:49:15.000000000 +0100
+++ devel.orig/config-x86-generic 2008-07-23 09:49:15.000000000 +0100
@@ -318,9 +318,6 @@ CONFIG_SONY_LAPTOP=m
# CONFIG_SMSC37B787_WDT is not set
CONFIG_W83697HF_WDT=m
-CONFIG_PARAVIRT=y
-# CONFIG_PARAVIRT_DEBUG is not set
-
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x400000
CONFIG_PHYSICAL_START=0x400000
@@ -331,12 +328,21 @@ CONFIG_CRYPTO_DEV_GEODE=m
CONFIG_VIDEO_CAFE_CCIC=m
+CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
+CONFIG_KVM_TRACE=y
+CONFIG_LGUEST=m
+
+CONFIG_PARAVIRT_GUEST=y
+CONFIG_PARAVIRT=y
+# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
-CONFIG_KVM_TRACE=y
+# CONFIG_XEN is not set
+CONFIG_LGUEST_GUEST=y
+CONFIG_VMI=y
CONFIG_MTD_ESB2ROM=m
CONFIG_MTD_CK804XROM=m
@@ -360,14 +366,6 @@ CONFIG_DMIID=y
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_ISCSI_IBFT=m
-CONFIG_VIRTUALIZATION=y
-CONFIG_PARAVIRT_GUEST=y
-CONFIG_VMI=y
-CONFIG_LGUEST=m
-CONFIG_LGUEST_GUEST=y
-# CONFIG_XEN is not set
-# CONFIG_HVC_XEN is not set
-
CONFIG_DMADEVICES=y
CONFIG_INTEL_IOATDMA=m
Index: devel/config-x86_64-generic
===================================================================
--- devel.orig/config-x86_64-generic 2008-07-23 09:49:15.000000000 +0100
+++ devel.orig/config-x86_64-generic 2008-07-23 09:49:15.000000000 +0100
@@ -1,6 +1,5 @@
CONFIG_64BIT=y
CONFIG_UID16=y
-# CONFIG_XEN is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
CONFIG_GENERIC_CPU=y
@@ -227,11 +226,6 @@ CONFIG_W83697HF_WDT=m
# CONFIG_VIDEO_CAFE_CCIC is not set
-CONFIG_KVM=m
-CONFIG_KVM_INTEL=m
-CONFIG_KVM_AMD=m
-CONFIG_KVM_TRACE=y
-
CONFIG_MTD_ESB2ROM=m
CONFIG_MTD_CK804XROM=m
@@ -254,18 +248,23 @@ CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_MENU=y
CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+CONFIG_KVM_AMD=m
+CONFIG_KVM_TRACE=y
+
+CONFIG_PARAVIRT_GUEST=y
+CONFIG_PARAVIRT=y
+# CONFIG_PARAVIRT_DEBUG is not set
+CONFIG_KVM_CLOCK=y
+CONFIG_KVM_GUEST=y
+# CONFIG_XEN is not set
CONFIG_DMADEVICES=y
CONFIG_INTEL_IOATDMA=m
CONFIG_SENSORS_I5K_AMB=m
-CONFIG_PARAVIRT_GUEST=y
-CONFIG_KVM_CLOCK=y
-CONFIG_KVM_GUEST=y
-CONFIG_PARAVIRT=y
-# CONFIG_PARAVIRT_DEBUG is not set
-
# CONFIG_COMPAT_VDSO is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_DEBUG_PER_CPU_MAPS is not set
--
15 years, 9 months
[patch 5/7] Kill -a and -e args to %kernel_variant_files
by Mark McLoughlin
We don't need them anymore
Index: devel/kernel.spec
===================================================================
--- devel.orig/kernel.spec 2008-07-23 09:57:04.000000000 +0100
+++ devel.orig/kernel.spec 2008-07-23 09:57:04.000000000 +0100
@@ -1622,9 +1622,9 @@ fi
#
# This macro defines the %%files sections for a kernel package
# and its devel and debuginfo packages.
-# %%kernel_variant_files [-k vmlinux] [-a <extra-files-glob>] [-e <extra-nonbinary>] <condition> <subpackage>
+# %%kernel_variant_files [-k vmlinux] <condition> <subpackage>
#
-%define kernel_variant_files(a:e:k:) \
+%define kernel_variant_files(k:) \
%if %{1}\
%{expand:%%files %{?2}}\
%defattr(-,root,root)\
@@ -1632,7 +1632,6 @@ fi
/boot/System.map-%{KVERREL}%{?2:.%{2}}\
#/boot/symvers-%{KVERREL}%{?2:.%{2}}.gz\
/boot/config-%{KVERREL}%{?2:.%{2}}\
-%{?-a:%{-a*}}\
%dir /lib/modules/%{KVERREL}%{?2:.%{2}}\
/lib/modules/%{KVERREL}%{?2:.%{2}}/kernel\
/lib/modules/%{KVERREL}%{?2:.%{2}}/build\
@@ -1648,7 +1647,6 @@ fi
/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.order\
%ghost /boot/initrd-%{KVERREL}%{?2:.%{2}}.img\
/etc/ld.so.conf.d/kernelcap-%{KVERREL}%{?2:.%{2}}.nosegneg.conf\
-%{?-e:%{-e*}}\
%{expand:%%files %{?2:%{2}-}devel}\
%defattr(-,root,root)\
%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
--
15 years, 9 months