From ba69ea42f8ba8286cbe0e939bd1ce781b7905b84 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Thu, 8 Oct 2009 13:23:08 -0400 Subject: Fix toogle whether xenbus driver should be built as module or part of kernel. The "select" statement in the Kconfig ensures that all other users of the xenbus will have the same dependency. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Jeremy Fitzhardinge diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index cd50c00..b8e0424 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -153,6 +153,7 @@ config XEN_KBDDEV_FRONTEND tristate "Xen virtual keyboard and mouse support" depends on XEN_FBDEV_FRONTEND default y + select XEN_XENBUS_FRONTEND help This driver implements the front-end of the Xen virtual keyboard and mouse device driver. It communicates with a back-end diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 3b54b39..1b332d1 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -2070,6 +2070,7 @@ config XEN_FBDEV_FRONTEND select FB_SYS_IMAGEBLIT select FB_SYS_FOPS select FB_DEFERRED_IO + select XEN_XENBUS_FRONTEND default y help This driver implements the front-end of the Xen virtual -- cgit v0.10.2 From 7164bb4393cef668d3da281fa1c599a6673ea768 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Thu, 3 Dec 2009 10:31:56 -0500 Subject: fb-defio: If FBINFO_VIRTFB is defined, do not set VM_IO flag. Most users (except sh_mobile_lcdcfb.c) get their framebuffer from vmalloc. Setting VM_IO is not necessary as the memory obtained from vmalloc is System RAM type and is not susceptible to PCI memory constraints. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Jeremy Fitzhardinge Acked-by: Jaya Kumar diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 0a7a667..875d019 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c @@ -144,7 +144,9 @@ static const struct address_space_operations fb_deferred_io_aops = { static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) { vma->vm_ops = &fb_deferred_io_vm_ops; - vma->vm_flags |= ( VM_IO | VM_RESERVED | VM_DONTEXPAND ); + vma->vm_flags |= ( VM_RESERVED | VM_DONTEXPAND ); + if (!(info->flags & FBINFO_VIRTFB)) + vma->vm_flags |= VM_IO; vma->vm_private_data = info; return 0; } diff --git a/include/linux/fb.h b/include/linux/fb.h index f847df9..6e8ebf7 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -768,6 +768,7 @@ struct fb_tile_ops { * takes over; acceleration engine should be in a quiescent state */ /* hints */ +#define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. */ #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ -- cgit v0.10.2 From a9b5ff99c34e3f6ca7ad7fa01deba2df1108465e Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Thu, 3 Dec 2009 10:31:58 -0500 Subject: fb-defio: Inhibit VM_IO flag to be set on vmalloc-ed framebuffers. The framebuffers (screenbase) these drivers present are actually vmalloc-ed pages. There is no need for them to have the VM_IO flag set. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Jeremy Fitzhardinge Acked-by: Jaya Kumar diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c index 509cb92..df9ccb9 100644 --- a/drivers/video/broadsheetfb.c +++ b/drivers/video/broadsheetfb.c @@ -470,7 +470,7 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev) par->read_reg = broadsheet_read_reg; init_waitqueue_head(&par->waitq); - info->flags = FBINFO_FLAG_DEFAULT; + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; info->fbdefio = &broadsheetfb_defio; fb_deferred_io_init(info); diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c index 0b4bffb..f9d77ad 100644 --- a/drivers/video/hecubafb.c +++ b/drivers/video/hecubafb.c @@ -253,7 +253,7 @@ static int __devinit hecubafb_probe(struct platform_device *dev) par->send_command = apollo_send_command; par->send_data = apollo_send_data; - info->flags = FBINFO_FLAG_DEFAULT; + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; info->fbdefio = &hecubafb_defio; fb_deferred_io_init(info); diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c index df1f757..661bfd2 100644 --- a/drivers/video/metronomefb.c +++ b/drivers/video/metronomefb.c @@ -700,7 +700,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev) if (retval < 0) goto err_free_irq; - info->flags = FBINFO_FLAG_DEFAULT; + info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; info->fbdefio = &metronomefb_defio; fb_deferred_io_init(info); -- cgit v0.10.2 From df11303c90406426847255ba498607f15a472a0a Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Thu, 3 Dec 2009 10:31:57 -0500 Subject: xen pvfb: Inhibit VM_IO flag to be set on vmalloc-ed framebuffers. In Xen-paravirt mode, VM_IO flag signifies that the page frame number (PFN) is actually a machine frame number (MFN). This is correct for memory backed by PCI devices, but wrong for memory allocated from System RAM where the PFN != MFN. During page faults, pages with VM_IO, get assigned to special domain I/O domain and as said, the PFN is interpreted as MFN. When Xen hypervisor modifies the PTE it interprets the PFN as the MFN, complains and fails the PTE modification. The end result is an infinitive page fault in the domain. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Jeremy Fitzhardinge diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 54cd916..91a68e9 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c @@ -440,7 +440,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, fb_info->fix.type = FB_TYPE_PACKED_PIXELS; fb_info->fix.accel = FB_ACCEL_NONE; - fb_info->flags = FBINFO_FLAG_DEFAULT; + fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; ret = fb_alloc_cmap(&fb_info->cmap, 256, 0); if (ret < 0) { -- cgit v0.10.2