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

Re: [Xen-devel] [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side.


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
  • Date: Mon, 8 Feb 2016 20:43:02 +0200
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Keir Fraser <keir@xxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Mon, 08 Feb 2016 18:43:21 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=zo7zONbFCKwtbLFF9wfO22GyFu+uOCthr98RXkDrcb3j7hQyD7dvCWto5EZepQQA4SD5PzvvWqWRzSingqWlMRfMSocaO83oCB9vEoMLKbcD1vZEJ4mhfWTLtPbX+Z7wXvwYjW5l8jpC4aq5tXieOk3XKLKzi/ZeliU6E+DULBjOuNSVEPh4et+/dLeS7ToHoOtcS9Wl0NII4TMd7p+CekI3h3FR/JheGbnysqdvroF6GrT46JLibO94LVoLT2f/kEc+QI///RIEgOrLE3jZHqfZjb4EsTOEysmmtO9LAbzJceM/AXw3Eo4mxtmIJWQy0nqXF0dsPVaYXTWkOYA1dw==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 2/8/2016 8:15 PM, Tamas K Lengyel wrote:
On Mon, Feb 8, 2016 at 9:57 AM, Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx> wrote:
+#if CONFIG_X86

Wouldn't it be safe to include these headers on ARM as well?
Â
+#include <public/vm_event.h>Â Â Â Â /* for VM_EVENT_X86_CR3 */
+#include <asm/hvm/hvm.h>Â Â Â Â Â Â /* for hvm_update_guest_cr, ... */
+#endif

It wouldn't break anything, but they are only necessary on X86, so why include them?

+
+Â Â if ( unlikely(mop->op != XEN_DOMCTL_MONITOR_OP_ENABLE &&
+Â Â Â Â Â Â Â Â Â mop->op != XEN_DOMCTL_MONITOR_OP_DISABLE) )
+Â Â {

Please make a switch on mop->op instead where the default case is to call arch_monitor_domctl. It would be a bit easier to follow.

+Â Â Â Â if ( XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES == mop->op )
+Â Â Â Â {
+Â Â Â Â Â Â mop->event = arch_monitor_get_capabilities(d);
+Â Â Â Â Â Â return 0;
+Â Â Â Â }
+

Noted, good point.


"proly"->probably?
Â
+Â Â Â Â /* The monitor op is proly handled on the arch-side. */
+Â Â Â Â if ( likely(arch_monitor_domctl_op(d, mop, &rc)) )
+Â Â Â Â Â Â return rc;

Yep, will "proly" change that, heh, just kidding. Noted :D.

Â
Empty line not needed. (*)

Noted.


So I don't particularly like this #if check here. IMHO this should be done in arch-specific function that you call from here that is just empty for ARM. It could be a static inline function as it's rather small.
Â
+#if CONFIG_X86
+Â Â Â Â if ( VM_EVENT_X86_CR3 == mop->u.mov_to_cr.index )
+Â Â Â Â {
+Â Â Â Â Â Â struct vcpu *v;
+Â Â Â Â Â Â /* Latches new CR3 mask through CR0 code. */
+Â Â Â Â Â Â for_each_vcpu ( d, v )
+Â Â Â Â Â Â Â Â hvm_update_guest_cr(v, 0);
+Â Â Â Â }
+#endif

I agree, but I was actually hoping to approach that in a future ARM-patch I'm going to send after this one.
On ARM, that part of code (where hypervisor CR trapping is enabled based on write_ctrlreg_enabled bits)
is done in another place (on the scheduling tail). I wanted to approach removing that #ifdef and finding maybe
a solution to do that similarly for X86. Would it be ok to leave this for that discussion? It would be simpler to illustrate
what I have in mind.


Looks good otherwise.

Thanks,
Tamas

Thanks,
Corneliu.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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