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] [PATCH] [VT] add BT instruction support to VMXMMIO decod

To: "Xin Li" <xin.b.li@xxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] [VT] add BT instruction support to VMXMMIO decoder
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 25 Oct 2005 10:42:14 +0200
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 25 Oct 2005 08:38:21 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <59D45D057E9702469E5775CBB56411F1AF7AA3@pdsmsx406>
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>
References: <59D45D057E9702469E5775CBB56411F1AF7AA3@pdsmsx406>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>- in the same place, you implicitly assume that va and gpa are
>>congruent over a range 2**29/2**61 bytes, which is likely wrong,
>>especially for mmio regions (while one could argue that there
shouldn't
>>be accesses with a base address pointing into one mmio region, but
the
>>effective address with the shifted bit offset included pointing into
a
>>different on, I believe the hypervisor should actually verify this
and
>>either handle it properly or fail the request)
>>- the alignment (and thus implicit range) limitations of real
hardware
>>aren't followed (for e.g. a 32-bit operation, hardware confines the
>>access to the aligned 32-bit quantity addressed by 
>>EA+4*(BitOffset/32));
>>to match that you should either pass 1 instead of mmio_inst.op_size
to
>>send_mmio_req, or you should calculate the offset from gpa depending
on
>>the operand size (which is probably the better solution, although I
>>don't know which of the two possible mechanisms real hardware uses)
>
>Yes, this is not perfect.
>Can you help?

Not without first understanding the infrastructure of the decoder,
which I haven't looked at in detail. Looking at the call site of
handle_mmio I believe that getting this right requires more than just
adjusting the specific INSTR_BT cases that you patch touches, because
the call to gva_to_gpa() (and thus the decision made by mmio_space())
must be done *AFTER* instruction decoding. And this is not only true for
bt, but for all instructions that touch more than a single byte, because
(at least for security reasons) one must deal with the case of accesses
that straddle page boundaries (or, if mmio regions are allocated at an
even finer granularity - which is commonly the case -, even device
boundaries).

Jan

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

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