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] ioperm problem

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] ioperm problem
From: Ben Guthro <ben.guthro@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Nov 2011 08:56:34 -0500
Cc: Pavel Matěja <pavel@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, tom.goetz@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 17 Nov 2011 05:56:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20111116145730.GA11502@xxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <201111132219.07211.pavel@xxxxxxxxxx> <20111116145730.GA11502@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15
Attached is our patch to work around issues with the ioports with some older nVidia cards.

This, admittedly is a bit of a hack, and not exactly something that I would see upstream wanting to carry, for a variety of reasons. It really should all be predicated on whether the kernel is the initial domain, etc.

This opens up the legacy VGA ports in the VGA arbiter code.

Konrad - I think that you had suggested an alternate way of doing this, IIRC, but I can't seem to find it in my inbox. Due to competing demands, and my nVidia hardware disappearing, I never went back to rework this code.

As written, however, it did solve the problem at hand - however hacky it may be.

/btg

On 11/16/2011 09:57 AM, Konrad Rzeszutek Wilk wrote:
On Sun, Nov 13, 2011 at 10:19:06PM +0100, Pavel Matěja wrote:
Hi,
I'm trying to port AMD VGA passthru patch to the latest XEN and vanila kernel
and I got SIGSEGV in

static void ati_hw_out(uint16_t hport, uint32_t data)
{
     ioperm(gfx_info.host_pio_base, gfx_info.pio_size, 1);
     asm volatile ("out %1, %0"::"Nd"(hport),"a"(data));
     ioperm(gfx_info.host_pio_base, gfx_info.pio_size, 0);
}

Does it work under baremetal?

What is the host_pio_base?

Is the host_pio_base part of the permitted IO ports? (you can
see that if you run 'xl debug-keys q' and it should show you something
like this:

(XEN) Rangesets belonging to domain 1:
(XEN)     I/O Ports  { b400-b41f, b800-b81f }
(XEN)     Interrupts { 18-19, 54-55 }
(XEN)     I/O Memory { fe940-fe9ff }
(XEN) Memory pages belonging to domain 1:

(you can get that from xm dmesg).

As you can see, the b400->b41f are allowed in the domain 1. Is your
host_pio_base in there?



I tried old 2.6.32 XEN kernel and there is no such problem.
It looks related to arch/x86/kernel/ioport.c but I'm not sure.
Is anyone here familiar with that code?

Yes, and I think I saw somebody ask me about that too.

Lets rope them in this converstation - they got it to work
but my memory is foggy at what was required.

Ben, Thomas,

I remember you guys had a tough time with vd86 which did something similar
and it ultimately was due to to /dev/mem not passing in VM_IO. But the
ioperm/outb sounds familiar too. Was there a missing hypercall when
forking/copying the ioperm bitmap?

Attachment: vga-ioport-enable.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>