[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.