PV drivers for HVM guests
PATCH RESEND 1/1 PV drivers for HVM guests
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian's and DOI's work.
linux-2.6/blkfront/blkfront.c +26 -0
@@ -47,6 +47,7 @@#include <xen/gnttab.h> #include <asm/hypervisor.h> #include <asm/maddr.h> +#include <xen/platform_compat.h> #define BLKIF_STATE_DISCONNECTED 0#define BLKIF_STATE_CONNECTED 1
@@ -466,6 +467,27 @@ command, (long)argument, inode->i_rdev);switch (command) { +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,16 ) +case HDIO_GETGEO : { +struct block_device *bd = inode->i_bdev; +struct hd_geometry geo; +int ret; + +if (!argument) +return -EINVAL ; + + geo.start =get_start_sect (bd); + ret =blkif_getgeo (bd, &geo); +if (ret) +return ret; + +if (copy_to_user ((struct hd_geometry __user *)argument, &geo, +sizeof (geo))) +return -EFAULT ; + +return 0 ; + } +#endif case CDROMMULTISESSION :DPRINTK ("FIXME: support multisession CDs later\n" );for (i =0 ; i <sizeof (struct cdrom_multisession ); i++)
@@ -678,8 +700,12 @@ req, (bret->status ==BLKIF_RSP_OKAY ), req->hard_nr_sectors);BUG_ON (ret); +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,16 ) +end_that_request_last (req); +#else end_that_request_last ( req, (bret->status ==BLKIF_RSP_OKAY )); +#endif break ;default :BUG ();
linux-2.6/blkfront/Makefile +3 -3
@@ -1,5 +1,5 @@ +include $(M)/overrides.mk -obj-$(CONFIG_XEN_BLKDEV_FRONTEND) := xenblk.o - -xenblk-objs := blkfront.o vbd.o +obj-m += xen-vbd.o +xen-vbd-objs := blkfront.o vbd.o
linux-2.6/blkfront/vbd.c +7 -0
@@ -35,6 +35,7 @@#include "block.h" #include <linux/blkdev.h> #include <linux/list.h> +#include <xen/platform_compat.h> #define BLKIF_MAJOR (dev) ((dev)>>8)#define BLKIF_MINOR (dev) ((dev) & 0xff)
@@ -91,7 +92,9 @@ .open = blkif_open, .release = blkif_release, .ioctl = blkif_ioctl, +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,15 ) .getgeo = blkif_getgeo +#endif };DEFINE_SPINLOCK (blkif_io_lock);
@@ -186,7 +189,11 @@if (rq ==NULL )return -1 ; +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,9 )elevator_init (rq,"noop" ); +#else +elevator_init (rq, &elevator_noop); +#endif /* Hard sector size and max sectors impersonate the equiv. hardware. */ blk_queue_hardsect_size (rq, sector_size);
linux-2.6/include/asm/hypervisor.h +7 -3
@@ -47,10 +47,14 @@#include <asm/ptrace.h> #include <asm/page.h> #if defined(__i386__) -# ifdef CONFIG_X86_PAE -# include <asm-generic/pgtable-nopud.h> +# if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,10 ) +# ifdef CONFIG_X86_PAE +# include <asm-generic/pgtable-nopud.h> +# else +# include <asm-generic/pgtable-nopmd.h> +# endif # else -# include <asm-generic/pgtable-nopmd.h> +typedef struct {pgd_t pgd; }pud_t ;# endif #endif
linux-2.6/include/asm/synch_bitops.h +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/config.h> +#include <xen/platform_compat.h> #define ADDR (*(volatile long *) addr)
linux-2.6/include/xen/platform_compat.h +55 -0
55 lines not on this page · raw message
linux-2.6/include/xen/xenbus.h +5 -0
@@ -35,13 +35,18 @@#define _XEN_XENBUS_H#include <linux/device.h> +#include <linux/init.h> #include <linux/notifier.h> +#include <linux/version.h> +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,15 )#include <linux/mutex.h> +#endif #include <linux/completion.h> #include <xen/interface/xen.h> #include <xen/interface/grant_table.h> #include <xen/interface/io/xenbus.h> #include <xen/interface/io/xs_wire.h> +#include <xen/platform_compat.h> /* Register callback to watch this node. */ struct xenbus_watch
linux-2.6/netfront/Makefile +3 -3
@@ -1,4 +1,4 @@ +include $(M)/overrides.mk -obj-$(CONFIG_XEN_NETDEV_FRONTEND) := xennet.o - -xennet-objs := netfront.o +obj-m = xen-vnif.o +xen-vnif-objs := netfront.o
linux-2.6/netfront/netfront.c +0 -1
@@ -46,7 +46,6 @@#include <linux/ethtool.h> #include <linux/in.h> #include <linux/if_ether.h> -#include <linux/io.h> #include <net/sock.h> #include <net/pkt_sched.h> #include <net/arp.h>
linux-2.6/platform-pci/features.c +1 -0
@@ -10,6 +10,7 @@#include <linux/module.h> #include <asm/hypervisor.h> #include <xen/features.h> +#include <xen/platform_compat.h> u8 xen_features[XENFEAT_NR_SUBMAPS *32 ]__read_mostly ;/* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */
linux-2.6/platform-pci/Kbuild +1 -1
@@ -4,4 +4,4 @@ EXTRA_CFLAGS += -I$(M)/platform-pci -xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o +xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform_compat.o
linux-2.6/platform-pci/Makefile +7 -0
@@ -0,0 +1,7 @@ +include $(M)/overrides.mk + +obj-m := xen-platform-pci.o + +EXTRA_CFLAGS += -I$(M)/platform-pci + +xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform_compat.o
linux-2.6/platform-pci/platform_compat.c +93 -0
93 lines not on this page · raw message
linux-2.6/platform-pci/platform-pci.c +1 -0
@@ -35,6 +35,7 @@#include <asm/hypervisor.h> #include <xen/interface/memory.h> #include <xen/features.h> +#include <xen/platform_compat.h> #include "platform-pci.h"
linux-2.6/xenbus/Makefile +6 -8
@@ -1,12 +1,10 @@ -obj-y += xenbus.o -obj-$(CONFIG_XEN_BACKEND) += xenbus_be.o - -xenbus_be-objs = -xenbus_be-objs += xenbus_backend_client.o +include $(M)/overrides.mk +obj-m += xenbus.o xenbus-objs = -xenbus-objs += xenbus_client.o xenbus-objs += xenbus_comms.o xenbus-objs += xenbus_xs.o -xenbus-objs += xenbus_probe.o -obj-$(CONFIG_XEN_XENBUS_DEV) += xenbus_dev.o +xenbus-objs += xenbus_probe.o +xenbus-objs += xenbus_dev.o +xenbus-objs += xenbus_client.o +xenbus-objs += xen_proc.o
linux-2.6/xenbus/xenbus_probe.c +58 -11
235 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi,
Quoted 5 lines · You (ksrinivasan)
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian's and DOI's work.
Signed-off-by K. Y. Srinivasan ([email protected])
The patch seems that the source files of unmodified_drivers are split
from linux-2.6-xen-sparse, I think.
I think it because ...
linux-2.6/blkfront/blkfront.c
Quoted 3 lines
diff -Nur
unmodified_drivers/linux-2.6/blkfront/blkfront.cunmodified_drivers_new/linux-2.6/blkfront/blkfront.clinux-2.6/blkfront/blkfront.c +0
-0
and
linux-2.6/blkfront/blkfront.c line 53
Quoted 8 lines
linux-2.6/blkfront/blkfront.c +1
-0@@ -47,6 +47,7 @@#include <xen/gnttab.h> #include <asm/hypervisor.h> #include <asm/maddr.h> +#include <xen/platform_compat.h> #define BLKIF_STATE_DISCONNECTED 0#define BLKIF_STATE_CONNECTED 1
xen/platform_compat.h is introduced, but it exists in unmodified_drviers
except linux-2.6-xen-sparse.
Am I true ?
Thanks,
- Tsunehisa Doi
We intend to maintain the source for the unmodified drivers separately in our source tree. The idea is that this will track the official xen source tree; we would apply the patch to target this source for a particular unmodified guest target. This would eliminate the need to carry the compatibility baggage in the pristine unmodified driver code.
Regards,
K. Y
Quoted 1 line
Quoted 1 line
Quoted 1 line
On Wed, Oct 18, 2006 at 7:56 PM, in message
Quoted 39 lines · <[email protected]> wrote:
Hi,
Quoted 5 lines · You (ksrinivasan)
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian's and DOI's work.
Signed- off- by: K. Y. Srinivasan ([email protected])
The patch seems that the source files of
unmodified_driversare split
from linux- 2.6- xen- sparse, I think.I think it because ...
Quoted 1 line
diff - Nur unmodified_drivers/linux-
2.6/blkfront/blkfront.cunmodified_drivers_new/linux-
2.6/blkfront/blkfront.cQuoted 1 line
--- unmodified_drivers/linux-
2.6/blkfront/blkfront.c2006- 10- 04 00:38:41.000000000- 0400
Quoted 1 line
+++ unmodified_drivers_new/linux-
2.6/blkfront/blkfront.c2006- 10- 1311:11:43.000000000 - 0400
and
Quoted 8 lines
@@ - 47,6 +47,7 @@
#include <xen/gnttab.h>
#include <asm/hypervisor.h>
#include <asm/maddr.h>
+#include <xen/platform_compat.h>#define
BLKIF_STATE_DISCONNECTED0
#defineBLKIF_STATE_CONNECTED1
xen/platform_compat.his introduced, but it exists inunmodified_drviers
except linux- 2.6- xen- sparse.Am I true ?
Thanks,
- Tsunehisa Doi
Hi,
Quoted 5 lines · You (ksrinivasan)
We intend to maintain the source for the unmodified drivers separately in our source tree. The idea is that this will track the official xen source tree; we would apply the patch to target this source for a particular unmodified guest target. This would eliminate the need to carry the compatibility baggage in the pristine unmodified driver code.
I understand that it has to be separated from xen source tree for
maintenacne as products. But I think that we should avoid to fork the source tree. Because its code structure is not stable, I think.
What do you think about ?
Thanks,
- Tsunehisa Doi
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
On Fri, Oct 20, 2006 at 6:12 AM, in message
Quoted 9 lines · <[email protected]> wrote:
Hi,
Quoted 5 lines · You (ksrinivasan)
We intend to maintain the source for the unmodified drivers separately in our source tree. The idea is that this will track the official xen source tree; we would apply the patch to target this source for a particular unmodified guest target. This would eliminate the need to carry the compatibility baggage in the pristine unmodified driver code.
Quoted 5 lines
I understand that it has to be separated from xen source tree for
maintenacne as products. But I think that we should avoid to fork the source tree. Because its code structure is not stable, I think.What do you think about ?
We are not forking tree. The pristine PV driver code will always be the exact code in the xen source tree.
Regards,
K. Y
Quoted 1 line
Hi,
Quoted 8 lines · You (ksrinivasan)
Quoted 5 lines
I understand that it has to be separated from xen source tree for
maintenacne as products. But I think that we should avoid to fork the source tree. Because its code structure is not stable, I think.What do you think about ?
We are not forking tree. The pristine PV driver code will always be the exact code in the xen source tree.
Sorry, My explaining seems to be bad.
My opinion is that unmodified_drivers tree should not be forked from
linux-sparse tree. Because its code structure will be changed from now on, so we will have to follow.
Thanks,
- Tsunehisa Doi
Hi all,
Quoted 4 lines · Ky Srinivasan
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian's and DOI's work.
I merged Srinivasan's work and a part of modification for IA64
platform.
I tested only compiling on RHEL4 Update 2.
Thanks,
- Tsunehisa Doi
# HG changeset patch
# User [email protected]
# Node ID e08cd46b951535a7d21beb1d476dc9c895c4d4ef # Parent 29b02d929b7e4df6016c16ebba71d6d73462882e Modify for backporting PV-on-HVM drivers
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +25 -0
@@ -48,6 +48,10 @@#include <asm/hypervisor.h> #include <asm/maddr.h> +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +#define BLKIF_STATE_DISCONNECTED 0#define BLKIF_STATE_CONNECTED 1#define BLKIF_STATE_SUSPENDED 2
@@ -468,6 +472,27 @@ int blkif_ioctl(struct inode *inode, str command, (long)argument, inode->i_rdev);switch (command) { +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,16 ) +case HDIO_GETGEO : { +struct block_device *bd = inode->i_bdev; +struct hd_geometry geo; +int ret; + +if (!argument) +return -EINVAL ; + + geo.start =get_start_sect (bd); + ret =blkif_getgeo (bd, &geo); +if (ret) +return ret; + +if (copy_to_user ((struct hd_geometry __user *)argument, &geo, +sizeof (geo))) +return -EFAULT ; + +return 0 ; + } +#endif case CDROMMULTISESSION :DPRINTK ("FIXME: support multisession CDs later\n" );for (i =0 ; i <sizeof (struct cdrom_multisession ); i++)
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c +10 -0
@@ -36,6 +36,10 @@#include <linux/blkdev.h> #include <linux/list.h> +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +#define BLKIF_MAJOR (dev) ((dev)>>8)#define BLKIF_MINOR (dev) ((dev) & 0xff)
@@ -91,7 +95,9 @@ static struct block_device_operations xl .open = blkif_open, .release = blkif_release, .ioctl = blkif_ioctl, +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,15 ) .getgeo = blkif_getgeo +#endif };DEFINE_SPINLOCK (blkif_io_lock);
@@ -186,7 +192,11 @@ xlvbd_init_blk_queue(struct gendisk *gd,if (rq ==NULL )return -1 ; +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,9 )elevator_init (rq,"noop" ); +#else +elevator_init (rq, &elevator_noop); +#endif /* Hard sector size and max sectors impersonate the equiv. hardware. */ blk_queue_hardsect_size (rq, sector_size);
linux-2.6-xen-sparse/drivers/xen/core/features.c +4 -0
@@ -10,6 +10,10 @@#include <linux/module.h> #include <asm/hypervisor.h> #include <xen/features.h> + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif u8 xen_features[XENFEAT_NR_SUBMAPS *32 ]__read_mostly ;/* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c +4 -0
@@ -44,6 +44,10 @@#include <asm/io.h> #include <xen/interface/memory.h> +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +/* External tools reserve first few grant table entries. */ #define NR_RESERVED_ENTRIES 8
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +4 -0
@@ -64,6 +64,10 @@#include <xen/interface/grant_table.h> #include <xen/gnttab.h> +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +/* * Mutually-exclusive module options to select receive data path: * rx_copy : Packets are copied by network backend into local memory
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c +4 -0
@@ -34,6 +34,10 @@#include <xen/gnttab.h> #include <xen/xenbus.h> #include <xen/driver_util.h> + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif /* xenbus_probe.c */ extern char *kasprintf (const char *fmt, ...);
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c +4 -0
@@ -39,6 +39,10 @@#include <xen/xenbus.h> #include "xenbus_comms.h" +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +static int xenbus_irq;extern void xenbus_probe (void *);
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +54 -2
234 lines not on this page · raw message
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c +5 -0
@@ -42,8 +42,13 @@#include <linux/fcntl.h> #include <linux/kthread.h> #include <linux/rwsem.h> +#include <linux/module.h> #include <xen/xenbus.h> #include "xenbus_comms.h" + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif /* xenbus_probe.c */ extern char *kasprintf (const char *fmt, ...);
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h +4 -0
@@ -8,6 +8,10 @@*/ #include <linux/config.h> + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif #define ADDR (*(volatile long *) addr)
linux-2.6-xen-sparse/include/xen/xenbus.h +5 -0
@@ -38,10 +38,15 @@#include <linux/notifier.h> #include <linux/mutex.h> #include <linux/completion.h> +#include <linux/init.h> #include <xen/interface/xen.h> #include <xen/interface/grant_table.h> #include <xen/interface/io/xenbus.h> #include <xen/interface/io/xs_wire.h> + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif /* Register callback to watch this node. */ struct xenbus_watch
unmodified_drivers/linux-2.6/overrides.mk +1 -1
@@ -9,4 +9,4 @@ EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRAN EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX EXTRA_CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030202 -EXTRA_CFLAGS += -I$(M)/include +EXTRA_CFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_COMPAT_H
unmodified_drivers/linux-2.6/platform-pci/Kbuild +7 -1
@@ -4,4 +4,10 @@ obj-m := xen-platform-pci.o EXTRA_CFLAGS += -I$(M)/platform-pci -xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o +xen-platform-pci-objs := +xen-platform-pci-objs += platform-pci.o +xen-platform-pci-objs += features.o +xen-platform-pci-objs += evtchn.o +xen-platform-pci-objs += gnttab.o +xen-platform-pci-objs += xen_support.o +xen-platform-pci-objs += compat.o
unmodified_drivers/linux-2.6/platform-pci/evtchn.c +4 -0
@@ -35,6 +35,10 @@#include <xen/interface/hvm/ioreq.h> #include <xen/features.h> #include "platform-pci.h" + +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif void *shared_info_area;
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +4 -0
@@ -38,6 +38,10 @@#include "platform-pci.h" +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +#define DRV_NAME "xen-platform-pci"#define DRV_VERSION "0.10"#define DRV_RELDATE "03/03/2005"
unmodified_drivers/linux-2.6/platform-pci/xen_support.c +4 -0
@@ -26,6 +26,10 @@#include <asm/hypervisor.h> #include "platform-pci.h" +#ifdef HAVE_COMPAT_H +#include <compat.h> +#endif +void xen_machphys_update (unsigned long mfn,unsigned long pfn) {BUG ();
unmodified_drivers/linux-2.6/blkfront/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(KERNELRELEASE),) +include $(src)/Kbuild +endif
unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopmd.h new file +14 -0
@@ -0,0 +1,14 @@ +#ifndef _PGTABLE_NOPMD_H +#define _PGTABLE_NOPMD_H + +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,10 ) +#error "This version of Linux should not need compat pgtable-nopmd.h" +#endif + +#define pud_t pgd_t +#define pud_offset (d, va) (d) +#define pud_none (pud) 0 +#define pud_present (pud) 1 +#define PTRS_PER_PUD 1 + +#endif /* _PGTABLE_NOPMD_H */
unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _PGTABLE_NOPUD_H +#define _PGTABLE_NOPUD_H + +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,10 ) +#error "This version of Linux should not need compat pgtable-nopud.h" +#endif + +#define pud_t pgd_t +#define pud_offset (d, va) (d) +#define pud_none (pud) 0 +#define pud_bad (pud) 0 +#define pud_present (pud) 1 +#define PTRS_PER_PUD 1 + +#endif /* _PGTABLE_NOPUD_H */
unmodified_drivers/linux-2.6/compat-include/compat.h new file +62 -0
62 lines not on this page · raw message
unmodified_drivers/linux-2.6/compat-include/linux/io.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _LINUX_IO_H +#define _LINUX_IO_H + +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,15 ) +#error "This version of Linux should not need compat linux/io.h" +#endif + +#include <asm/io.h> + +#endif
unmodified_drivers/linux-2.6/compat-include/linux/mutex.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright (c) 2006 Cisco Systems. All rights reserved. +* +* This file is released under the GPLv2. +*/ + +/* mutex compatibility for pre-2.6.16 kernels */ + +#ifndef __LINUX_MUTEX_H +#define __LINUX_MUTEX_H + +#include <linux/version.h> +#include <asm/semaphore.h> + +#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,15 ) +#error "This version of Linux should not need compat mutex.h" +#endif + +#define mutex semaphore +#define DEFINE_MUTEX (foo) DECLARE_MUTEX(foo) +#define mutex_init (foo) init_MUTEX(foo) +#define mutex_lock (foo) down(foo) +#define mutex_lock_interruptible (foo) down_interruptible(foo) +/* this function follows the spin_trylock() convention, so * +* it is negated to the down_trylock() return values! Be careful */ +#define mutex_trylock (foo) !down_trylock(foo) +#define mutex_unlock (foo) up(foo) + +#endif /* __LINUX_MUTEX_H */
unmodified_drivers/linux-2.6/netfront/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(KERNELRELEASE),) +include $(src)/Kbuild +endif
unmodified_drivers/linux-2.6/platform-pci/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(KERNELRELEASE),) +include $(src)/Kbuild +endif
unmodified_drivers/linux-2.6/platform-pci/compat.c new file +101 -0
101 lines not on this page · raw message
unmodified_drivers/linux-2.6/xenbus/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(KERNELRELEASE),) +include $(src)/Kbuild +endif
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 10 lines · DOI Tsunehisa
Hi all,
Quoted 4 lines · Ky Srinivasan
I am enclosing the patch I have been working on. I have tested this on sles9 (2.6.5) and RHEL 4 (2.6.9). The patch applies cleanly on ChangeSet 11635. This patch was cleaned up based on Ian's and DOI's work.
I merged Srinivasan's work and a part of modification for IA64 platform.
Thank you. I am just in the process of cleaning up the patch and breaking it into manageable chunks. I've incorporated changes from your patches and added both your signed-off-by's to the bits you've signed off on.
Quoted 1 line
I tested only compiling on RHEL4 Update 2.
OK, I'm boot testing on sles9sp3 and rhel4.4. Perhaps that explains some of the extra bits you seem to have which I don't seem to need? Or perhaps they are IA64 specific?
I've left the bits that I've quoted below out for now since I didn't need them for the releases I'm testing. Once I've committed the first batch we can revisit these as well as anything I've dropped by mistake.
Cheers,
Ian.
Quoted 22 lines
unmodified_drivers/linux-2.6/compat-include/compat.h new file +15
-0+#if defined(__LINUX_COMPILER_H) && !defined(__nocast) +#define __nocast +#endif +#if defined(_LINUX_SCHED_H) && !defined(__sched) +#define __sched +#endif +#if defined(_LINUX_TYPES_H) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,14 ) +typedef unsigned __nocast gfp_t ; +#endif +#if defined(_LINUX_ERR_H) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,12 ) +#define IS_ERR_VALUE (x) unlikely((x) > (unsigned long)-1000L) +#endif +#if defined(__ia64__) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,11 ) +#include <asm-generic/pgtable-nopud.h> +#endif
Hi Ian,
Quoted 5 lines · You (Ian.Campbell)
Quoted 1 line
I tested only compiling on RHEL4 Update 2.
OK, I'm boot testing on sles9sp3 and rhel4.4. Perhaps that explains some of the extra bits you seem to have which I don't seem to need? Or perhaps they are IA64 specific?
In my patch, IA64 specfic part is below.
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h line 60
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h new file +3
-0+#if defined(__ia64__) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,11 ) +#include <asm-generic/pgtable-nopud.h> +#endif
Thanks,
- Tsunehisa Doi
Hi Ian,
Quoted 2 lines · I (Doi.Tsunehisa)
Quoted 1 line · You (Ian.Campbell)
OK, I'm boot testing on sles9sp3 and rhel4.4.
I've met a compile error about gfp_t in rhel4.4. Thus, I avoided to meet
the compile error with preliminary patch like below.
Thanks,
- Tsunehisa Doi
unmodified_drivers/linux-2.6/compat-include/compat.h Tue Oct 24 17:55:16 2006 +0900 renamed from unmodified_drivers/linux-2.6/compat-include/compat.h Tue Oct 24 09:25:24 2006 +0900 +2 -1
@@ -31,7 +31,8 @@ #define __sched #endif -#if defined(_LINUX_TYPES_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +#if defined(_LINUX_TYPES_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) \ + && !defined(HAVE_GFP_T) typedef unsigned __nocast gfp_t; #endif
unmodified_drivers/linux-2.6/overrides.mk Tue Oct 24 17:55:16 2006 +0900 renamed from unmodified_drivers/linux-2.6/overrides.mk Tue Oct 24 09:25:24 2006 +0900 +3 -0
@@ -10,3 +10,6 @@ EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRAN EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX EXTRA_CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030202 EXTRA_CFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_COMPAT_H +ifeq ($(KERNELRELEASE),2.6.9-42.EL) # for RHEL4 U4 + EXTRA_CFLAGS += -DHAVE_GFP_T +endif
Quoted 2 lines · On Wed, 2006-10-25 at 12:11 +0900, [email protected] wrote:
I've met a compile error about
gfp_tin rhel4.4. Thus, I avoided to meet
the compile error with preliminary patch like below.
Oh, you mean you were seeing problems because gfp_t is backported to RHEL 4.4? I thought your patch was adding the typedef but actually you are conditionally removing it.
I not sure the typedef is needed at all -- nothing in unmodified_drivers uses gpf_t as far as I can see. My current patchset doesn't define it at all and builds ok on RHEL4.4. Perhaps it is an arch specific issue?
Cheers,
Ian.
Quoted 10 lines · You (Ian.Campbell)
Quoted 2 lines
I've met a compile error about
gfp_tin rhel4.4. Thus, I avoided to meet
the compile error with preliminary patch like below.Oh, you mean you were seeing problems because
gfp_tis backported to RHEL 4.4? I thought your patch was adding the typedef but actually you are conditionally removing it.I not sure the typedef is needed at all -- nothing in
unmodified_driversusesgpf_tas far as I can see. My current patchset doesn't define it at all and builds ok on RHEL4.4. Perhaps it is an arch specific issue?
Sorry, I might be confused. I'll check it.
Thanks,
- Tsunehisa Doi
Hi Ian,
Quoted 5 lines · I (Doi.Tsunehisa)
Quoted 3 lines
I not sure the typedef is needed at all -- nothing in
unmodified_driversusesgpf_tas far as I can see. My current patchset doesn't define it at all and builds ok on RHEL4.4. Perhaps it is an arch specific issue?Sorry, I might be confused. I'll check it.
I've checked it. It's an ia64 arch specific issue indeed.
Thanks,
- Tsunehisa Doi
Hi Ian,
Quoted 1 line · I (Doi.Tsunehisa)
I've checked it. It's an ia64 arch specific issue indeed.
BTW, I might find a issue about NET_IP_ALIGN in the compatible shim.
Currentry, its value is 0, but the value should be matched a value of netback module. Thus, its value should be 2, I think.
What do you think about the issue ?
Thanks,
- Tsunehisa Doi
Quoted 8 lines · On Thu, 2006-10-26 at 12:58 +0900, [email protected] wrote:
Quoted 5 lines · I (Doi.Tsunehisa)
Quoted 3 lines
I not sure the typedef is needed at all -- nothing in
unmodified_driversusesgpf_tas far as I can see. My current patchset doesn't define it at all and builds ok on RHEL4.4. Perhaps it is an arch specific issue?Sorry, I might be confused. I'll check it.
I've checked it. It's an ia64 arch specific issue indeed.
I'd much prefer it if we can find a way to avoid encoding specific RHEL kernel versions as you had in your patch. I've gone with
#define gfp_t unsigned
which basically ignores any existing typedef. I think this is OK in this instance since gfp_t has always been
Quoted 5 lines · On Thu, 2006-10-26 at 15:37 +0900, [email protected] wrote:
BTW, I might find a issue about
NET_IP_ALIGNin the compatible shim.
Currentry, its value is 0, but the value should be matched a value of netback module. Thus, its value should be 2, I think.What do you think about the issue ?
My thinking was that since those older kernels don't define NET_IP_ALIGN and don't hardcode the number 2 anywhere they don't expect any extra alignment. Therefore using 0 seems correct in terms of behaving the same as native drivers do on those versions. I'm not sure I would want to backport the addition of the extra padding in our drivers, the distros haven't seen the need for example...
My current patch is below, it cross-compiles for IA64 without warnings against RHEL4.4 and SLES9sp3. Could you let me know if it works for you? If so would you mind submitting the ia64 bits via the ia64 maintainer. I'll apply the unmodified_drivers bits.
Ian.
Additional PV-on-HVM fixes for IA64.
linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c +5 -0
@@ -20,6 +20,11 @@#include <linux/mm.h> #include <xen/interface/xen.h> #include <asm/page.h> + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include <xen/platform-compat.h> +#endif +#include <asm/xen/xencomm.h> static int xencomm_debug =0 ;
linux-2.6-xen-sparse/include/asm-ia64/hypercall.h +3 -0
@@ -283,6 +283,9 @@ static inline void exit_idle(void) {}#ifdef CONFIG_XEN #include <asm/xen/privop.h> #endif /* CONFIG_XEN */ +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include <xen/platform-compat.h> +#endif static inline unsigned long __HYPERVISOR_ioremap (unsigned long ioaddr,unsigned long size)
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h +1 -1
@@ -56,8 +56,8 @@ extern int running_on_xen;#include <xen/interface/event_channel.h> #include <xen/interface/physdev.h> #include <xen/interface/sched.h> +#include <asm/ptrace.h> #include <asm/hypercall.h> -#include <asm/ptrace.h> #include <asm/page.h> extern shared_info_t *HYPERVISOR_shared_info;
unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h +1 -0
@@ -9,6 +9,7 @@#define pud_offset (d, va) d#define pud_none (pud) 0#define pud_present (pud) 1 +#define pud_bad (pud) 0#define PTRS_PER_PUD 1#endif /* _PGTABLE_NOPUD_H */
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +15 -0
@@ -25,6 +25,21 @@#define NET_IP_ALIGN 0#endif +#if defined(_LINUX_ERR_H) && !defined(IS_ERR_VALUE ) +#define IS_ERR_VALUE (x) unlikely((x) > (unsigned long)-1000L) +#endif + +#if defined(_ASM_IA64_PGTABLE_H) && !defined(_PGTABLE_NOPUD_H) +#include <asm-generic/pgtable-nopud.h> +#endif + +/* Some kernels have this typedef backported so we cannot reliably +* detect based on version number, hence we forcibly #define it. +*/ +#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) +#define gfp_t unsigned +#endif +#if defined(_LINUX_FS_H) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,9 )#define nonseekable_open (inode, filp)/* Nothing to do */ #endif
diff -r a0a65da68861 unmodified_drivers/linux-2.6/mkbuildtree
Hi Ian,
Quoted 5 lines · You (Ian.Campbell)
I'd much prefer it if we can find a way to avoid encoding specific RHEL kernel versions as you had in your patch. I've gone with
#define gfp_t unsignedwhich basically ignores any existing typedef. I think this is OK in this instance since
gfp_thas always been
.....
Quoted 4 lines
My current patch is below, it cross-compiles for IA64 without warnings against RHEL4.4 and SLES9sp3. Could you let me know if it works for you? If so would you mind submitting the ia64 bits via the ia64 maintainer. I'll apply the
unmodified_driversbits.
Takanori (he is my co-worker) checked this patch, but it occures
compile error in linux-xen. We are investigating it.
Quoted 4 lines
Quoted 4 lines
BTW, I might find a issue about
NET_IP_ALIGNin the compatible shim.
Currentry, its value is 0, but the value should be matched a value of netback module. Thus, its value should be 2, I think.
Quoted 8 lines
Quoted 1 line
What do you think about the issue ?
My thinking was that since those older kernels don't define
NET_IP_ALIGNand don't hardcode the number 2 anywhere they don't expect any extra alignment. Therefore using 0 seems correct in terms of behaving the same as native drivers do on those versions. I'm not sure I would want to backport the addition of the extra padding in our drivers, the distros haven't seen the need for example...
Hmm, I thought that NET_IF_ALIGN mismatch between netfront and netback
occures a confusion of VNIF. But I might be imagining if it was used correctly.
Is it used on SLES9 guest ? I don't have the environment.
Thanks,
- Tsunehisa Doi
Quoted 2 lines · On Fri, 2006-10-27 at 13:11 +0900, [email protected] wrote:
Takanori (he is my co-worker) checked this patch, but it occures compile error in linux-xen. We are investigating it.
Thanks, I'll reply to him in a moment.
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
BTW, I might find a issue about
NET_IP_ALIGNin the compatible shim.
Currentry, its value is 0, but the value should be matched a value of netback module. Thus, its value should be 2, I think.Quoted 8 lines
Quoted 1 line
What do you think about the issue ?
My thinking was that since those older kernels don't define
NET_IP_ALIGNand don't hardcode the number 2 anywhere they don't expect any extra alignment. Therefore using 0 seems correct in terms of behaving the same as native drivers do on those versions. I'm not sure I would want to backport the addition of the extra padding in our drivers, the distros haven't seen the need for example...
Quoted 3 lines
Hmm, I thought that
NET_IF_ALIGNmismatch between netfront and netback occures a confusion of VNIF. But I might be imagining if it was used correctly.
I'd not heard about or seen that problem. Lets leave things as they are and if a problem arises we'll revisit it.
Quoted 1 line
Is it used on SLES9 guest ? I don't have the environment.
Yes, I'm compile testing against SLES9sp3 (2.6.5 based) and RHEL4 update 4 (2.6.9 based) kernels. I don't have an IA64 platform to do anything more than that.
Ian.
A message that is not in the archive (sent off-list or not yet received): 00a201c6f96a$811feac0$dab2220a@VF03007L
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Ian,
Quoted 6 lines
Quoted 1 line
How do you think of this patch?
In general we want to avoid adding compatibility bits to generic code and confine it to platform-compat.[ch] wherever possible. You have added code in xencomm.[ch] and
hypercall.hwhich I think we can avoid.
Quoted 7 lines
I also try to avoid checking version numbers if I can, preferring to check for the presence of absence of specific definitions instead. This is useful when dealing with kernels with backported bits. Unfortunately it doesn't help with the
gfp_ttypedef :-( but we'll come to that later.I've attached my current patch including the ptrace fix from above and the comments from below. Can you give it a go?
I'll try it.
Thanks
-
Takanori Kasai
A message that is not in the archive (sent off-list or not yet received): 03b301c6fa5a$8cc725a0$dab2220a@VF03007L
Re: [PATCH][RESEND] PV drivers for HVMguests
Hi Ian,
I confirmed this patch.
However, this patch has not been applied yet.
Do you think that this patch has another problem? If this patch has no problem, could you apply this patch?
Thanks
--
Takanori Kasai
----- Original Message ----- From: "Kasai Takanori" <[email protected]>
To: "Ian Campbell" <[email protected]>
Cc: "xen-ia64-devel" <[email protected]>
Sent: Saturday, October 28, 2006 3:30 PM
Subject: [Xen-ia64-devel] Re: [Xen-devel][PATCH][RESEND] PV drivers for HVMguests
Quoted 96 lines
Hi Ian,
Quoted 2 lines
I've attached my current patch including the ptrace fix from above and the comments from below. Can you give it a go?
I confirmed this patch. (cs:12004)
I tested compiling it and simple test on RHEL4U2 and RHEL4U4.Thanks
--
Takanori KasaiAs follows:
------------
diff -rcf05aabe6e65linux-2.6-xen-sparse/include/asm-ia64/hypercall.h---a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.hWed Oct 25 15:29:00 2006 -0600
+++b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.hSat Oct 28 13:30:39 2006 +0900linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c +4
-0@@ -39,6 +39,10 @@#include <asm/xen/xcom_hcall.h> struct xencomm_handle ; + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include <xen/platform-compat.h> +#endif /* * Assembler stubs for hyper-calls. diff -r
cf05aabe6e65linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.h---a/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.hWed Oct 25 15:29:00 2006 -0600
+++b/linux-2.6-xen-sparse/include/asm-ia64/xen/xencomm.hSat Oct 28 13:42:40 2006 +0900linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c +4
-0@@ -20,6 +20,10 @@#define _LINUX_XENCOMM_H_#include <xen/interface/xencomm.h> + +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include <xen/platform-compat.h> +#endif #define XENCOMM_MINI_ADDRS 3struct xencomm_mini {diff -r
cf05aabe6e65unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h---a/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.hWed Oct 25 15:29:00 2006 -0600
+++b/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.hSat Oct 28 12:50:07 2006 +0900unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h +1
-0@@ -9,6 +9,7 @@#define pud_offset (d, va) d#define pud_none (pud) 0#define pud_present (pud) 1 +#define pud_bad (pud) 0#define PTRS_PER_PUD 1#endif /* _PGTABLE_NOPUD_H */ diff -r
cf05aabe6e65unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h---a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.hWedOct 25 15:29:00 2006 -0600 +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Sat Oct 28 13:16:35 2006 +0900unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +15
-0@@ -25,6 +25,21 @@#define NET_IP_ALIGN 0#endif +#if defined(_LINUX_ERR_H) && !defined(IS_ERR_VALUE ) +#define IS_ERR_VALUE (x) unlikely((x) > (unsigned long)-1000L) +#endif + +#if defined(_ASM_IA64_PGTABLE_H) && !defined(_PGTABLE_NOPUD_H) +#include <asm-generic/pgtable-nopud.h> +#endif + +/* Some kernels have this typedef backported so we cannot reliably +* detect based on version number, hence we forcibly #define it. +*/ +#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) +#define gfp_t unsigned +#endif +#if defined(_LINUX_FS_H) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,9 )#define nonseekable_open (inode, filp)/* Nothing to do */ #endif _______________________________________________
Xen-ia64-devel mailing list
[email protected]
http://lists.xensource.com/xen-ia64-devel
Re: [PATCH][RESEND] PV drivers for HVMguests
Quoted 7 lines · Kasai Takanori
Hi Ian,
I confirmed this patch.
However, this patch has not been applied yet.Do you think that this patch has another problem? If this patch has no problem, could you apply this patch?
Sorry, I simply forgot. I'll get to it today.
Ian.
Quoted 5 lines · On Wed, 2006-10-25 at 08:54 +0900, [email protected] wrote:
In my patch, IA64 specfic part is below.
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h line 60
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h new file +3
-0+#if defined(__ia64__) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,11 ) +#include <asm-generic/pgtable-nopud.h> +#endif
Can we come up with a more specific guard? Does something like this work for you?
#if defined _ASM_IA64_PGTABLE_H && !defined(_PGTABLE_NOPUD_H)
Cheers,
Ian.
Hi Ian,
Quoted 9 lines · You (Ian.Campbell)
Quoted 5 lines
In my patch, IA64 specfic part is below.
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h line 60
Quoted 3 lines
unmodified_drivers/linux-2.6/compat-include/compat.h new file +3
-0+#if defined(__ia64__) &&LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,11 ) +#include <asm-generic/pgtable-nopud.h> +#endif Can we come up with a more specific guard? Does something like this work for you?
#if defined _ASM_IA64_PGTABLE_H && !defined(_PGTABLE_NOPUD_H)
Ok. I'll try it.
Thanks,
- Tsunehisa Doi