All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers
@ 2012-03-16  7:48 Olaf Hering
  2012-03-16  7:48 ` [PATCH 1 of 4] unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+ Olaf Hering
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Olaf Hering @ 2012-03-16  7:48 UTC (permalink / raw)
  To: xen-devel


This series of patches is used since some time to compile the PVonHVM
drivers against the forward ported xenlinux tree used in openSuSE.

Please review and apply.

Changes:
unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+
unmodified_drivers: add pfn_is_ram helper for kdump
unmodified_drivers: use upstream sync_bitops if available
unmodified_drivers: compile vcd.c into blkfront if available

 unmodified_drivers/linux-2.6/blkfront/Kbuild                      |    1 
 unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h |   10 +++
 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c          |   31 ++++++++++
 3 files changed, 42 insertions(+)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1 of 4] unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+
  2012-03-16  7:48 [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers Olaf Hering
@ 2012-03-16  7:48 ` Olaf Hering
  2012-03-16  7:48 ` [PATCH 2 of 4] unmodified_drivers: add pfn_is_ram helper for kdump Olaf Hering
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2012-03-16  7:48 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1331883705 -3600
# Node ID 5504366919926f8a2d6fc7fdc392e6218ae6c702
# Parent  1b68427875f7ffe3025ea13c7f6e8cf71ce54769
unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+

Allow compilation of PVonHVM drivers with forward-ported xenlinux
sources in openSuSE 12.1.  xen_cpuid_base() is now in mainline, the copy
in the xen tree leads to a compilation error.  The current state leads
to a compile error:

/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/platform-pci/platform-pci.c:121: error: redefinition of 'xen_cpuid_base'
/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/xen/hypervisor.h:43: error: previous definition of 'xen_cpuid_base' was here

The reason is that the kernel sources are searched before the xen
sources for asm/hypervisor.h:

/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/hypervisor.h
/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/include/asm/hypervisor.h

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Jan Beulich <jbeulich@suse.com>

diff -r 1b68427875f7 -r 550436691992 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -118,6 +118,7 @@ unsigned long alloc_xen_mmio(unsigned lo
 
 #ifndef __ia64__
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 static uint32_t xen_cpuid_base(void)
 {
 	uint32_t base, eax, ebx, ecx, edx;
@@ -136,6 +137,7 @@ static uint32_t xen_cpuid_base(void)
 
 	return 0;
 }
+#endif
 
 static int init_hypercall_stubs(void)
 {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2 of 4] unmodified_drivers: add pfn_is_ram helper for kdump
  2012-03-16  7:48 [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers Olaf Hering
  2012-03-16  7:48 ` [PATCH 1 of 4] unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+ Olaf Hering
@ 2012-03-16  7:48 ` Olaf Hering
  2012-03-16  7:48 ` [PATCH 3 of 4] unmodified_drivers: use upstream sync_bitops if available Olaf Hering
  2012-03-16  7:48 ` [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront " Olaf Hering
  3 siblings, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2012-03-16  7:48 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1331883706 -3600
# Node ID dacdcaaf113263ee748bef99d175b1b7e7013be5
# Parent  5504366919926f8a2d6fc7fdc392e6218ae6c702
unmodified_drivers: add pfn_is_ram helper for kdump

Register pfn_is_ram helper speed up reading /proc/vmcore in the kdump
kernel. It is compiled only if the kernel source is recent enough to
have the pfn_is_ram helper (v3.0-rc1, commit
997c136f518c5debd63847e78e2a8694f56dcf90).

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 550436691992 -r dacdcaaf1132 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
@@ -351,6 +351,32 @@ static int check_platform_magic(struct d
 	return -ENODEV;
 }
 
+#if defined(HAVE_OLDMEM_PFN_IS_RAM)
+static int xen_oldmem_pfn_is_ram(unsigned long pfn)
+{
+	struct xen_hvm_get_mem_type a;
+	int ret;
+
+	a.domid = DOMID_SELF;
+	a.pfn = pfn;
+	if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a))
+		return -ENXIO;
+
+	switch (a.mem_type) {
+		case HVMMEM_mmio_dm:
+			ret = 0;
+			break;
+		case HVMMEM_ram_rw:
+		case HVMMEM_ram_ro:
+		default:
+			ret = 1;
+			break;
+	}
+
+	return ret;
+}
+#endif
+
 static int __devinit platform_pci_init(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
@@ -419,6 +445,9 @@ static int __devinit platform_pci_init(s
 	if ((ret = xen_panic_handler_init()))
 		goto out;
 
+#if defined(HAVE_OLDMEM_PFN_IS_RAM)
+	register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram);
+#endif
  out:
 	if (ret) {
 		pci_release_region(pdev, 0);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3 of 4] unmodified_drivers: use upstream sync_bitops if available
  2012-03-16  7:48 [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers Olaf Hering
  2012-03-16  7:48 ` [PATCH 1 of 4] unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+ Olaf Hering
  2012-03-16  7:48 ` [PATCH 2 of 4] unmodified_drivers: add pfn_is_ram helper for kdump Olaf Hering
@ 2012-03-16  7:48 ` Olaf Hering
  2012-03-16  7:48 ` [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront " Olaf Hering
  3 siblings, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2012-03-16  7:48 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1331883707 -3600
# Node ID d721480672b9686011cef0965cefd81a969277b0
# Parent  dacdcaaf113263ee748bef99d175b1b7e7013be5
unmodified_drivers: use upstream sync_bitops if available

The forward ported xenlinux sources in openSuSE 12.2 were switched from
the old synch_bitops to the sync_bitops since kernel version 3.3. Add
compat macros to use either old or new helpers depending on used kernel
source version.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r dacdcaaf1132 -r d721480672b9 unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
@@ -161,4 +161,14 @@ typedef irqreturn_t (*irq_handler_t)(int
 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
 #endif
 
+#ifdef sync_test_bit
+#define synch_change_bit		sync_change_bit
+#define synch_clear_bit			sync_clear_bit
+#define synch_set_bit			sync_set_bit
+#define synch_test_and_change_bit	sync_test_and_change_bit
+#define synch_test_and_clear_bit	sync_test_and_clear_bit
+#define synch_test_and_set_bit		sync_test_and_set_bit
+#define synch_test_bit			sync_test_bit
 #endif
+
+#endif

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront if available
  2012-03-16  7:48 [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers Olaf Hering
                   ` (2 preceding siblings ...)
  2012-03-16  7:48 ` [PATCH 3 of 4] unmodified_drivers: use upstream sync_bitops if available Olaf Hering
@ 2012-03-16  7:48 ` Olaf Hering
  2012-03-16  9:07   ` Jan Beulich
  3 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2012-03-16  7:48 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1331883708 -3600
# Node ID 321e3ada9b40a0b164ac617f26d254fc3354c024
# Parent  d721480672b9686011cef0965cefd81a969277b0
unmodified_drivers: compile vcd.c into blkfront if available

The forward ported xenlinux sources in openSuSE have a PV CDROM driver
since a long time. Detect the presence of this driver and compile it
into the xen_vbd module.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r d721480672b9 -r 321e3ada9b40 unmodified_drivers/linux-2.6/blkfront/Kbuild
--- a/unmodified_drivers/linux-2.6/blkfront/Kbuild
+++ b/unmodified_drivers/linux-2.6/blkfront/Kbuild
@@ -3,3 +3,4 @@ include $(M)/overrides.mk
 obj-m += xen-vbd.o
 
 xen-vbd-objs := blkfront.o vbd.o
+xen-vbd-objs += $(patsubst %.c,%.o,$(notdir $(wildcard $(src)/vcd.c)))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront if available
  2012-03-16  7:48 ` [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront " Olaf Hering
@ 2012-03-16  9:07   ` Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2012-03-16  9:07 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

>>> On 16.03.12 at 08:48, Olaf Hering <olaf@aepfle.de> wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1331883708 -3600
> # Node ID 321e3ada9b40a0b164ac617f26d254fc3354c024
> # Parent  d721480672b9686011cef0965cefd81a969277b0
> unmodified_drivers: compile vcd.c into blkfront if available
> 
> The forward ported xenlinux sources in openSuSE have a PV CDROM driver
> since a long time. Detect the presence of this driver and compile it
> into the xen_vbd module.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> diff -r d721480672b9 -r 321e3ada9b40 
> unmodified_drivers/linux-2.6/blkfront/Kbuild
> --- a/unmodified_drivers/linux-2.6/blkfront/Kbuild
> +++ b/unmodified_drivers/linux-2.6/blkfront/Kbuild
> @@ -3,3 +3,4 @@ include $(M)/overrides.mk
>  obj-m += xen-vbd.o
>  
>  xen-vbd-objs := blkfront.o vbd.o
> +xen-vbd-objs += $(patsubst %.c,%.o,$(notdir $(wildcard $(src)/vcd.c)))

This is an entirely Novell/SuSE-only thing, we shouldn't bother
upstream with that (unless someone decides to upstream the base
kernel code too, which seems pointless for the old tree). Further
more, just last week I eliminated the need for compiling this file
when building the pv drivers (the change above will need to be
dropped from our patches once the kernel side change gets
submitted to the build system), largely because we don't allow
blkfront to handle CDs anyway (see the master branch's
current patches.xen/xen-blkfront-hvm-no-cdrom).

Jan
.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-16  9:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16  7:48 [PATCH 0 of 4] unmodified_drivers: misc changes for xenlinux PVonHVM drivers Olaf Hering
2012-03-16  7:48 ` [PATCH 1 of 4] unmodified_drivers: hide xen_cpuid_base() in version 2.6.38+ Olaf Hering
2012-03-16  7:48 ` [PATCH 2 of 4] unmodified_drivers: add pfn_is_ram helper for kdump Olaf Hering
2012-03-16  7:48 ` [PATCH 3 of 4] unmodified_drivers: use upstream sync_bitops if available Olaf Hering
2012-03-16  7:48 ` [PATCH 4 of 4] unmodified_drivers: compile vcd.c into blkfront " Olaf Hering
2012-03-16  9:07   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.