Skip to contentSkip to conversation

xen: fix some things which make ia64 upset

PATCH New Jeremy Fitzhardinge 2 participants 7 messages Oct 15, 2008 – Oct 16, 2008

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 xen-netfront: Avoid unaligned accesses to IP header

In reply to Jeremy Fitzhardinge

From: Isaku Yamahata <[email protected]>

Align ip header to a 16 byte boundary to avoid unaligned access like other drivers.
Without this patch, xen-netfront doesn't work well on ia64.

[ Jeff, this is the only patch in the series which is in your
territory. -J ]

---
 drivers/net/xen-netfront.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/xen-netfront.c +4 -1
@@ -239,10 +239,13 @@
 	 */
 	batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
 	for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) {
-		skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD,
+		skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN,
 					 GFP_ATOMIC | __GFP_NOWARN);
 		if (unlikely(!skb))
 			goto no_skb;
+
+		/* Align ip header to a 16 bytes boundary */
+		skb_reserve(skb, NET_IP_ALIGN);
 
 		page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
 		if (!page) {
#0 lore raw

PATCH 1/1 xen: fix some things which make ia64 upset

Hi Ingo,

This series corrects some x86-specific things in the generic Xen code, to allow the ia64 Xen work to proceed.

(There's one xen-netfront patch in the middle of the series, which I've sent to Jeff Garzik for inclusion.)

Thanks,
J

#3 lore raw

PATCH 1/1 xen: don't reload cr3 on suspend

It isn't necessary, and it makes the code needlessly non-portable.

---
 drivers/xen/manage.c |    2 --
 1 file changed, 2 deletions(-)
drivers/xen/manage.c +0 -2
@@ -38,8 +38,6 @@
 	int err;
 
 	BUG_ON(!irqs_disabled());
-
-	load_cr3(swapper_pg_dir);
 
 	err = device_power_down(PMSG_SUSPEND);
 	if (err) {
#4 lore raw

PATCH 1/1 xen: portability clean up and some minor clean up for xencomm.c

In reply to Jeremy Fitzhardinge

From: Isaku Yamahata <[email protected]>

clean up of xencomm.c. is_phys_contiguous() is arch dependent function that depends on how virtual memory are laid out. So split out the function into arch specific code.

---
 drivers/xen/xencomm.c |   25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)
drivers/xen/xencomm.c +4 -19
@@ -23,13 +23,7 @@
 #include <asm/page.h>
 #include <xen/xencomm.h>
 #include <xen/interface/xen.h>
-#ifdef __ia64__
-#include <asm/xen/xencomm.h>	/* for is_kern_addr() */
-#endif
-
-#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-#include <xen/platform-compat.h>
-#endif
+#include <asm/xen/xencomm.h>	/* for xencomm_is_phys_contiguous() */
 
 static int xencomm_init(struct xencomm_desc *desc,
 			void *buffer, unsigned long bytes)
@@ -157,20 +151,11 @@
 	return 0;
 }
 
-/* check if memory address is within VMALLOC region  */
-static int is_phys_contiguous(unsigned long addr)
-{
-	if (!is_kernel_addr(addr))
-		return 0;
-
-	return (addr < VMALLOC_START) || (addr >= VMALLOC_END);
-}
-
 static struct xencomm_handle *xencomm_create_inline(void *ptr)
 {
 	unsigned long paddr;
 
-	BUG_ON(!is_phys_contiguous((unsigned long)ptr));
+	BUG_ON(!xencomm_is_phys_contiguous((unsigned long)ptr));
 
 	paddr = (unsigned long)xencomm_pa(ptr);
 	BUG_ON(paddr & XENCOMM_INLINE_FLAG);
@@ -202,7 +187,7 @@
 	int rc;
 	struct xencomm_desc *desc;
 
-	if (is_phys_contiguous((unsigned long)ptr))
+	if (xencomm_is_phys_contiguous((unsigned long)ptr))
 		return xencomm_create_inline(ptr);
 
 	rc = xencomm_create(ptr, bytes, &desc, GFP_KERNEL);
@@ -219,7 +204,7 @@
 	int rc;
 	struct xencomm_desc *desc = NULL;
 
-	if (is_phys_contiguous((unsigned long)ptr))
+	if (xencomm_is_phys_contiguous((unsigned long)ptr))
 		return xencomm_create_inline(ptr);
 
 	rc = xencomm_create_mini(ptr, bytes, xc_desc,
#5 lore raw

PATCH 1/1 xen: compilation fix fo xen CPU hotplugging

In reply to Jeremy Fitzhardinge

From: Isaku Yamahata <[email protected]>

This patch fixes compilation error on ia64.
include asm/xen/hypervisor.h instead of asm-x86/xen/hypervisor.h use xen_pv_domain() instead of is_running_on_xen()

Quoted 11 lines

CC drivers/xen/cpu_hotplug.o
In file included from /linux-2.6/drivers/xen/cpu_hotplug.c:5:
/linux-2.6/include/asm-x86/xen/hypervisor.h:44:22: error: asm/desc.h: No such file or directory /linux-2.6/include/asm-x86/xen/hypervisor.h:66:1: warning: "MULTI_UVMFLAGS_INDEX" redefined In file included from /linux-2.6/include/asm-x86/xen/hypervisor.h:52,

                 from /linux-2.6/drivers/xen/cpu_hotplug.c:5:

/linux-2.6/arch/ia64/include/asm/xen/hypercall.h:233:1: warning: this is the location of the previous definition /linux-2.6/drivers/xen/cpu_hotplug.c: In function 'setup_vcpu_hotplug_event':
/linux-2.6/drivers/xen/cpu_hotplug.c:81: error: implicit declaration of function 'is_running_on_xen' make[4]: *** [drivers/xen/cpu_hotplug.o] Error 1
make[4]: *** Waiting for unfinished jobs....

---
 drivers/xen/cpu_hotplug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/cpu_hotplug.c +1 -1
@@ -2,7 +2,7 @@
 
 #include <xen/xenbus.h>
 
-#include <asm-x86/xen/hypervisor.h>
+#include <asm/xen/hypervisor.h>
 #include <asm/cpu.h>
 
 static void enable_hotplug_cpu(int cpu)
#6 lore raw

PATCH 1/1 xen: compilation fix of drivers/xen/events.c on IA64

In reply to Jeremy Fitzhardinge

From: Isaku Yamahata <[email protected]>

use set_xen_guest_handle() instead of direct assigning.

Quoted 3 lines

linux-2.6/drivers/xen/events.c: In function 'xen_poll_irq':
linux-2.6/drivers/xen/events.c:757: error: incompatible types in assignment make[4]: *** [drivers/xen/events.o] Error 1

---
 drivers/xen/events.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/xen/events.c +1 -1
@@ -776,7 +776,7 @@
 
 		poll.nr_ports = 1;
 		poll.timeout = 0;
-		poll.ports = &evtchn;
+		set_xen_guest_handle(poll.ports, &evtchn);
 
 		if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0)
 			BUG();
Applied
#2 lore raw

Re: [PATCH 3 of 5] xen-netfront: Avoid unaligned accesses to IP header

In reply to Jeremy Fitzhardinge
Quoted 6 lines · Jeremy Fitzhardinge

From: Isaku Yamahata <[email protected]>

Align ip header to a 16 byte boundary to avoid unaligned access like other drivers.
Without this patch, xen-netfront doesn't work well on ia64.

Quoted 8 lines

[ Jeff, this is the only patch in the series which is in your
territory. -J ]

---
 drivers/net/xen-netfront.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

applied