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

[Xen-devel] RE: How to map HVM guest virtual address to MMIO space?

To: "Petersson, Mats" <Mats.Petersson@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] RE: How to map HVM guest virtual address to MMIO space?
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Wed, 28 Jun 2006 15:58:02 +0200
Delivery-date: Wed, 28 Jun 2006 06:58:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <907625E08839C4409CE5768403633E0BA7FD40@xxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acaat2ThEd3eIKfSSX6XwI+hU8OIcAAAzqVw
Thread-topic: How to map HVM guest virtual address to MMIO space?
> -----Original Message-----
> From: Petersson, Mats 
> Sent: 28 June 2006 14:33
> To: xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: How to map HVM guest virtual address to MMIO space?
> 
> I'm writing some code to test my new x86_emulate_memop() 
> function in QEMU, and I'm "stuck"... I want to map the VGA 
> memory (one page at 0xB8000 in guest-physical memory) to some 
> completely different virtual address (say 0x4000000 for 
> arguments sake). I've got a paging-enabled, with a 1:1 
> mapping (for easy of coding), and it works fine to run the 
> code (now that I've figured out the correct values to shift 
> the virtual address when setting the page-table up). But when 
> I try to map the VGA memory, it doesn't seem to behave like I 
> want - it's not recognised by mmio_space(). How should I do this? 
> 
> As far as I understand, just setting the correct entries in 
> the page table to point to 0xB8000 should do it, right?
> 
> [It's still quite possible that there's more bugs in my code, 
> I'm just asking this in case I've missed something (else)...]

In fact, I was trying to use the same PTE as something else, and ended
up not doing the right thing, so it was a bug in my code.

And to answer my own question, you just make the virtual address point
to the VGA memory, and all works just as you'd expect. It just doesn't
work when the page-tables aren't set up correctly! Doh!
> 
> --
> Mats



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

<Prev in Thread] Current Thread [Next in Thread>