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/
Home Products Support Community News


Re: [Xen-devel] Can't map the page referenced by HVM-DomU CR3 in Dom0

To: david <david_n@xxxxxx>
Subject: Re: [Xen-devel] Can't map the page referenced by HVM-DomU CR3 in Dom0
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Tue, 19 Apr 2011 23:14:15 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 19 Apr 2011 15:15:14 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=aCUzVECbUMXkNmfCta57JO1UqKlcAG3FlwC6QrbIAcs=; b=LpKByYtul8q6L87l8e3kRyPjCi7WDgJ/FXjKggR2EmMCELbGFO831gcyCJOSuOAhkE e8rLJo5D5KyzuybFf+O3M5Ra9xnx4+aaACBcaXwXkkWeMd29+zJM9rldCUGVxRbDMnOj Qdw1YOKSZ35rExAI5qU2dkNFV724t4/zCyaYQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=QQhZbtA5IZfkLj3kzZpc7UqANT1I5UIyecJfTz2byyXGdDGqZ9/zeT6SFVEOV8DBAU BrD+wIOg9ASgn0cCpiTnDymT3I3XxpV9LRjTvqhPPMPi8ahP9ahTCACpKxjzRmubldMC CJx6v7lOnitLKyKzFbHcBa8ZZgd3pXmzQjqWs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DAE056C.30108@xxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acv+3x5RqaXX+JfDBEuhVKMMTrRakQ==
Thread-topic: [Xen-devel] Can't map the page referenced by HVM-DomU CR3 in Dom0
User-agent: Microsoft-Entourage/
On 19/04/2011 22:58, "david" <david_n@xxxxxx> wrote:

>> xc_translate_foreign_address() will convert a guest virtual address into a
>> guest physical address. It's not working out for you because guest cr3
>> values are already guest physical addresses. Thus the virtual-to-physical
>> conversion you subject the values to is meaningless.
> ahhh, .. I see. I thought the translation is between guest physical and
> real physical address.

The toolstack deals entirely with guest physical addresses for HVM guests.
There's actually no way, and no need, to find out the underlying real
physical addresses.

> The way to calculate the correct physical frame
> number is cr3 >> PAGE_SHIFT corresponding to xen_cr3_to_pfn(cr3) in
> public/arch-x86/xen-x86_64.h, right?

Yes, although strictly speaking the xen_cr3_to_pfn() macro is intended to be
used only with PV guests' cr3 values (the x86_32 version of that macro is
not suitable for use with HVM cr3 values). Consider an HVM guest in 32-bit
PAE mode -- its CR3 value may not be page aligned.

 -- Keir

Xen-devel mailing list