WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel][PATCH][RESEND] PV drivers for HVM guests

To: Doi.Tsunehisa@xxxxxxxxxxxxxx
Subject: Re: [Xen-devel][PATCH][RESEND] PV drivers for HVM guests
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Thu, 26 Oct 2006 15:15:06 +0100
Cc: Ky Srinivasan <ksrinivasan@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 26 Oct 2006 07:15:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200610260358.k9Q3w4F20001@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4535F8F5.E57C.0030.0@xxxxxxxxxx> Your message of Wed, 18 Oct 2006 07:51:45 -0600. <4535F8F5.E57C.0030.0@xxxxxxxxxx> <200610182356.k9INuAF03840@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <45374AE9.E57C.0030.0@xxxxxxxxxx> Your message of Thu, 19 Oct 2006 07:53:42 -0600. <45374AE9.E57C.0030.0@xxxxxxxxxx> <200610201012.k9KACIF29714@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <45389CA5.E57C.0030.0@xxxxxxxxxx> <200610230145.k9N1jGF01307@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <453D8055.4030509@xxxxxxxxxxxxxx> <1161703595.22514.59.camel@xxxxxxxxxxxxxxxxxxxxx> <200610242354.k9ONsIF02543@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <200610250311.k9P3BwF04686@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <1161774212.22514.86.camel@xxxxxxxxxxxxxxxxxxxxx> <200610260013.k9Q0DuF16474@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <200610260358.k9Q3w4F20001@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2006-10-26 at 12:58 +0900, Doi.Tsunehisa@xxxxxxxxxxxxxx wrote:
> I (Doi.Tsunehisa) said:
> >> 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?
> > 
> >   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 

On Thu, 2006-10-26 at 15:37 +0900, Doi.Tsunehisa@xxxxxxxxxxxxxx wrote: 
>   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 ?

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.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>

diff -r a0a65da68861 linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c      Thu Oct 26 12:27:51 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xencomm.c      Thu Oct 26 15:06:15 
2006 +0100
@@ -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;
diff -r a0a65da68861 linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Thu Oct 26 12:27:51 
2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h Thu Oct 26 15:06:15 
2006 +0100
@@ -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)
diff -r a0a65da68861 linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Thu Oct 26 
12:27:51 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Thu Oct 26 
15:06:15 2006 +0100
@@ -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;
diff -r a0a65da68861 
unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h
--- a/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h   
Thu Oct 26 12:27:51 2006 +0100
+++ b/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h   
Thu Oct 26 15:06:15 2006 +0100
@@ -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 a0a65da68861 
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Thu Oct 
26 12:27:51 2006 +0100
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Thu Oct 
26 15:06:15 2006 +0100
@@ -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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel