From 398f8b2ba9eb8fcd87001a98f31d441dcb0a643a Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Sep 25 2007 05:00:17 +0000 Subject: Really fix 32-on-64 fc6 guests this time --- diff --git a/xen-pvfb-04-compat.patch b/xen-pvfb-04-compat.patch index a4a5c96..9880c80 100644 --- a/xen-pvfb-04-compat.patch +++ b/xen-pvfb-04-compat.patch @@ -1,7 +1,7 @@ -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.c +diff -rupN xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.c --- xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c 1969-12-31 19:00:00.000000000 -0500 -+++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.c 2007-09-24 18:51:06.000000000 -0400 -@@ -0,0 +1,610 @@ ++++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.c 2007-09-25 00:46:38.000000000 -0400 +@@ -0,0 +1,693 @@ +#include +#include +#include @@ -400,10 +400,10 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ + } +} + -+static void oldxenfb_on_fb_event(struct xenfb_private *xenfb) ++static void oldxenfb_on_fb_event32(struct xenfb_private *xenfb) +{ + uint32_t prod, cons; -+ struct xenfb_page *page = xenfb->fb.page; ++ struct xenfb_page32 *page = xenfb->fb.page; + + prod = page->out_prod; + if (prod == page->out_cons) @@ -426,6 +426,50 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ + xc_evtchn_notify(xenfb->evt_xch, xenfb->fb.port); +} + ++static void oldxenfb_on_fb_event64(struct xenfb_private *xenfb) ++{ ++ uint32_t prod, cons; ++ struct xenfb_page64 *page = xenfb->fb.page; ++ ++ prod = page->out_prod; ++ if (prod == page->out_cons) ++ return; ++ rmb(); /* ensure we see ring contents up to prod */ ++ for (cons = page->out_cons; cons != prod; cons++) { ++ union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons); ++ ++ switch (event->type) { ++ case XENFB_TYPE_UPDATE: ++ if (xenfb->pub.update) ++ xenfb->pub.update(&xenfb->pub, ++ event->update.x, event->update.y, ++ event->update.width, event->update.height); ++ break; ++ } ++ } ++ mb(); /* ensure we're done with ring contents */ ++ page->out_cons = cons; ++ xc_evtchn_notify(xenfb->evt_xch, xenfb->fb.port); ++} ++ ++static void xenfb_on_fb_event(struct xenfb_private *xenfb) ++{ ++ int mode; ++ if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_NATIVE)) ++ mode = sizeof(unsigned long) * 8; ++ else if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_X86_32)) ++ mode = 32; ++ else if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_X86_64)) ++ mode = 64; ++ else ++ return; ++ ++ if (mode == 32) ++ oldxenfb_on_fb_event32(xenfb); ++ else ++ oldxenfb_on_fb_event64(xenfb); ++} ++ +static void oldxenfb_on_kbd_event(struct xenfb_private *xenfb) +{ + struct xenkbd_info *page = xenfb->kbd.page; @@ -503,11 +547,30 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ +} + + -+static int oldxenfb_fb_event(struct xenfb_private *xenfb, -+ union xenfb_in_event *event) ++static int oldxenfb_fb_event32(struct xenfb_private *xenfb, ++ union xenfb_in_event *event) +{ + uint32_t prod; -+ struct xenfb_page *page = xenfb->fb.page; ++ struct xenfb_page32 *page = xenfb->fb.page; ++ ++ prod = page->in_prod; ++ if (prod - page->in_cons == XENFB_IN_RING_LEN) { ++ errno = EAGAIN; ++ return -1; ++ } ++ ++ mb(); /* ensure ring space available */ ++ XENFB_IN_RING_REF(page, prod) = *event; ++ wmb(); /* ensure ring contents visible */ ++ page->in_prod = prod + 1; ++ return xc_evtchn_notify(xenfb->evt_xch, xenfb->fb.port); ++} ++ ++static int oldxenfb_fb_event64(struct xenfb_private *xenfb, ++ union xenfb_in_event *event) ++{ ++ uint32_t prod; ++ struct xenfb_page64 *page = xenfb->fb.page; + + prod = page->in_prod; + if (prod - page->in_cons == XENFB_IN_RING_LEN) { @@ -522,6 +585,26 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ + return xc_evtchn_notify(xenfb->evt_xch, xenfb->fb.port); +} + ++static int oldxenfb_fb_event(struct xenfb_private *xenfb, ++ union xenfb_in_event *event) ++{ ++ int mode; ++ if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_NATIVE)) ++ mode = sizeof(unsigned long) * 8; ++ else if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_X86_32)) ++ mode = 32; ++ else if (0 == strcmp(xenfb->protocol, XEN_IO_PROTO_ABI_X86_64)) ++ mode = 64; ++ else ++ return -1; ++ ++ if (mode == 32) ++ return oldxenfb_fb_event32(xenfb, event); ++ else ++ return oldxenfb_fb_event64(xenfb, event); ++} ++ ++ +static int oldxenfb_kbd_event(struct xenfb_private *xenfb, + union xenkbd_in_event *event) +{ @@ -612,10 +695,10 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.c xen-3.1.0-src.new/tools/ + xs_unwatch(xsh, p, ""); + return ret; +} -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.h xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.h +diff -rupN xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.h xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.h --- xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.h 1969-12-31 19:00:00.000000000 -0500 -+++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.h 2007-09-24 18:50:44.000000000 -0400 -@@ -0,0 +1,106 @@ ++++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenfb.h 2007-09-25 00:44:17.000000000 -0400 +@@ -0,0 +1,133 @@ +/* + * linux/include/linux/xenfb.h -- Xen virtual frame buffer device + * @@ -716,15 +799,42 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenfb.h xen-3.1.0-src.new/tools/ + + unsigned long pd[2]; /* FIXME rename to pgdir? */ + /* FIXME pd[1] unused at this time, shrink? */ ++}; ++ ++struct xenfb_page32 ++{ ++ __u16 width; /* the width of the framebuffer (in pixels) */ ++ __u16 height; /* the height of the framebuffer (in pixels) */ ++ __u32 line_length; /* the length of a row of pixels (in bytes) */ ++ __u32 mem_length; /* the length of the framebuffer (in bytes) */ ++ __u8 depth; /* the depth of a pixel (in bits) */ ++ ++ __u32 pd[2]; /* FIXME rename to pgdir? */ ++ /* FIXME pd[1] unused at this time, shrink? */ ++ ++ __u32 in_cons, in_prod; ++ __u32 out_cons, out_prod; ++}; ++ ++struct xenfb_page64 ++{ ++ __u16 width; /* the width of the framebuffer (in pixels) */ ++ __u16 height; /* the height of the framebuffer (in pixels) */ ++ __u32 line_length; /* the length of a row of pixels (in bytes) */ ++ __u32 mem_length; /* the length of the framebuffer (in bytes) */ ++ __u8 depth; /* the depth of a pixel (in bits) */ ++ ++ __u64 pd[2]; /* FIXME rename to pgdir? */ ++ /* FIXME pd[1] unused at this time, shrink? */ + + __u32 in_cons, in_prod; + __u32 out_cons, out_prod; +}; + +#endif -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenkbd.h xen-3.1.0-src.new/tools/ioemu/hw/oldxenkbd.h +diff -rupN xen-3.1.0-src.orig/tools/ioemu/hw/oldxenkbd.h xen-3.1.0-src.new/tools/ioemu/hw/oldxenkbd.h --- xen-3.1.0-src.orig/tools/ioemu/hw/oldxenkbd.h 1969-12-31 19:00:00.000000000 -0500 -+++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenkbd.h 2007-09-24 18:50:44.000000000 -0400 ++++ xen-3.1.0-src.new/tools/ioemu/hw/oldxenkbd.h 2007-09-25 00:42:39.000000000 -0400 @@ -0,0 +1,92 @@ +/* + * linux/include/linux/xenkbd.h -- Xen virtual keyboard/mouse @@ -818,9 +928,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/oldxenkbd.h xen-3.1.0-src.new/tools +void xenkbd_resume(void); + +#endif -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.c xen-3.1.0-src.new/tools/ioemu/hw/xenfb.c ---- xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.c 2007-09-24 18:42:25.000000000 -0400 -+++ xen-3.1.0-src.new/tools/ioemu/hw/xenfb.c 2007-09-24 18:50:44.000000000 -0400 +diff -rupN xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.c xen-3.1.0-src.new/tools/ioemu/hw/xenfb.c +--- xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.c 2007-09-25 00:39:46.000000000 -0400 ++++ xen-3.1.0-src.new/tools/ioemu/hw/xenfb.c 2007-09-25 00:42:39.000000000 -0400 @@ -41,6 +41,7 @@ struct xenfb_private { struct xenfb_device fb, kbd; size_t fb_len; /* size of framebuffer */ @@ -896,9 +1006,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.c xen-3.1.0-src.new/tools/ioe memset(&event, 0, XENKBD_IN_EVENT_SIZE); event.type = XENKBD_TYPE_POS; event.pos.abs_x = abs_x; -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.h xen-3.1.0-src.new/tools/ioemu/hw/xenfb.h ---- xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.h 2007-09-24 18:42:25.000000000 -0400 -+++ xen-3.1.0-src.new/tools/ioemu/hw/xenfb.h 2007-09-24 18:50:44.000000000 -0400 +diff -rupN xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.h xen-3.1.0-src.new/tools/ioemu/hw/xenfb.h +--- xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.h 2007-09-25 00:39:46.000000000 -0400 ++++ xen-3.1.0-src.new/tools/ioemu/hw/xenfb.h 2007-09-25 00:42:39.000000000 -0400 @@ -36,4 +36,18 @@ int xenfb_send_key(struct xenfb *xenfb, int xenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y); int xenfb_send_position(struct xenfb *xenfb, int abs_x, int abs_y); @@ -918,9 +1028,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/hw/xenfb.h xen-3.1.0-src.new/tools/ioe + + #endif -diff -ruNp xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tools/ioemu/Makefile.target ---- xen-3.1.0-src.orig/tools/ioemu/Makefile.target 2007-09-24 18:42:25.000000000 -0400 -+++ xen-3.1.0-src.new/tools/ioemu/Makefile.target 2007-09-24 18:50:44.000000000 -0400 +diff -rupN xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tools/ioemu/Makefile.target +--- xen-3.1.0-src.orig/tools/ioemu/Makefile.target 2007-09-25 00:39:46.000000000 -0400 ++++ xen-3.1.0-src.new/tools/ioemu/Makefile.target 2007-09-25 00:42:39.000000000 -0400 @@ -371,7 +371,7 @@ VL_OBJS+= xenstore.o VL_OBJS+= xen_platform.o VL_OBJS+= xen_machine_fv.o @@ -930,9 +1040,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tool VL_OBJS+= tpm_tis.o DEFINES += -DHAS_AUDIO endif -diff -ruNp xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py ---- xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py 2007-09-24 18:42:25.000000000 -0400 -+++ xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py 2007-09-24 18:50:44.000000000 -0400 +diff -rupN xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py +--- xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py 2007-09-25 00:39:46.000000000 -0400 ++++ xen-3.1.0-src.new/tools/python/xen/xend/server/vfbif.py 2007-09-25 00:42:39.000000000 -0400 @@ -50,7 +50,11 @@ class VfbifController(DevController): if self.vm.info.is_hvm(): # is HVM, so qemu-dm will handle the vfb. @@ -946,9 +1056,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/python/xen/xend/server/vfbif.py xen-3.1.0-sr args = [ xen.util.auxbin.pathTo("qemu-dm"), "-M", "xenpv", "-d", "%d" % self.vm.getDomid(), -diff -ruNp xen-3.1.0-src.orig/tools/python/xen/xend/XendConfig.py xen-3.1.0-src.new/tools/python/xen/xend/XendConfig.py +diff -rupN xen-3.1.0-src.orig/tools/python/xen/xend/XendConfig.py xen-3.1.0-src.new/tools/python/xen/xend/XendConfig.py --- xen-3.1.0-src.orig/tools/python/xen/xend/XendConfig.py 2007-05-18 10:45:21.000000000 -0400 -+++ xen-3.1.0-src.new/tools/python/xen/xend/XendConfig.py 2007-09-24 18:50:44.000000000 -0400 ++++ xen-3.1.0-src.new/tools/python/xen/xend/XendConfig.py 2007-09-25 00:42:39.000000000 -0400 @@ -689,7 +689,7 @@ class XendConfig(dict): self['vtpm_refs'] = cfg.get('vtpm_refs', []) @@ -967,9 +1077,9 @@ diff -ruNp xen-3.1.0-src.orig/tools/python/xen/xend/XendConfig.py xen-3.1.0-src. if key in self['platform']: dev_config.append([key, self['platform'][key]]) -diff -ruNp xen-3.1.0-src.orig/tools/python/xen/xm/create.py xen-3.1.0-src.new/tools/python/xen/xm/create.py +diff -rupN xen-3.1.0-src.orig/tools/python/xen/xm/create.py xen-3.1.0-src.new/tools/python/xen/xm/create.py --- xen-3.1.0-src.orig/tools/python/xen/xm/create.py 2007-05-18 10:45:21.000000000 -0400 -+++ xen-3.1.0-src.new/tools/python/xen/xm/create.py 2007-09-24 18:50:44.000000000 -0400 ++++ xen-3.1.0-src.new/tools/python/xen/xm/create.py 2007-09-25 00:42:39.000000000 -0400 @@ -610,7 +610,7 @@ def configure_vfbs(config_devs, vals): d['type'] = 'sdl' for (k,v) in d.iteritems(): diff --git a/xen.spec b/xen.spec index 1e829c8..75029fe 100644 --- a/xen.spec +++ b/xen.spec @@ -3,7 +3,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 3.1.0 -Release: 8%{?dist} +Release: 9%{?dist} Group: Development/Libraries License: GPL URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html