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


[Xen-devel] [PATCH][SVM]Replace call to svm_load_cr2 with conditional ca

To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][SVM]Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Fri, 18 May 2007 13:53:03 +0200
Delivery-date: Fri, 18 May 2007 04:52:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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: AceZQxctjS833JLRRJaFW/0A0m1nfw==
Thread-topic: [PATCH][SVM]Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry
The attached patch removes the call to svm_load_cr2 (which doesn't do
anything useful, unless someone can see something useful in setting host
CR2 to equal the guest CR2!). 

The old svm_load_cr2 is now replaced with a svm_trace_vmentry (as a
side-effect of svm_load_cr2 was that it traced the "vmentry". A call to
this function is done if "tb_init_done" is non-zero, so we don't call
this unless it's actually being used. 

I have tested this in x86_64, including tracing and checking that the
VMENTRY traces do come out when enabled. The x86_32 code is
compile-tested only. 

Keir: If you prefer to solve this with the "Intel equivalent" and remove
the "tb_init_done" check, feel free to do so. I'm sure this doesn't save
that many clock-cycles, but it's in the frequently used code-path, so
even small savings are worth having, I think. 

As another option, the whole piece of code could be conditional on
DO_HVM_TRC_VMENTRY - but that's probably overkill at the moment.

A further step would of course be to use a common hvm_trace_vmentry
funtion, as there are now two identical funcitons. Let me know if you
want me to take that extra step. 

Signed off by: Mats Petersson <mats.petersson@xxxxxxx>


Attachment: patch.remove_svm_load_cr2
Description: patch.remove_svm_load_cr2

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][SVM]Replace call to svm_load_cr2 with conditional call to svm_trace_vmentry, Petersson, Mats <=