All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corneliu ZUZU <czuzu@bitdefender.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side.
Date: Mon, 8 Feb 2016 20:43:02 +0200	[thread overview]
Message-ID: <56B8E1B6.8060507@bitdefender.com> (raw)
In-Reply-To: <CABfawhn2PJPzrBcM2HprYntkFL45jwRtpbVHaXCZydwxsYustg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2429 bytes --]

On 2/8/2016 8:15 PM, Tamas K Lengyel wrote:
> On Mon, Feb 8, 2016 at 9:57 AM, Corneliu ZUZU <czuzu@bitdefender.com 
> <mailto:czuzu@bitdefender.com>> 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.

[-- Attachment #1.2: Type: text/html, Size: 7193 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-02-08 18:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 16:57 [PATCH 0/7] Vm-events: move monitor vm-events code to common code Corneliu ZUZU
2016-02-08 16:57 ` [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c Corneliu ZUZU
2016-02-08 17:04   ` Andrew Cooper
2016-02-08 17:12     ` Corneliu ZUZU
2016-02-08 17:14       ` Andrew Cooper
2016-02-09 11:03   ` Stefano Stabellini
2016-02-09 11:28     ` Corneliu ZUZU
2016-02-09 11:55       ` Jan Beulich
2016-02-09 12:22         ` Stefano Stabellini
2016-02-09 12:32         ` Corneliu ZUZU
2016-02-09 17:40           ` Tamas K Lengyel
2016-02-09 19:19             ` Corneliu ZUZU
2016-02-08 16:57 ` [PATCH 2/7] x86: hvm events: merge 2 functions into 1 Corneliu ZUZU
2016-02-08 17:15   ` Andrew Cooper
2016-02-08 17:30     ` Tamas K Lengyel
2016-02-08 17:49     ` Corneliu ZUZU
2016-02-08 18:17       ` Tamas K Lengyel
2016-02-08 18:45         ` Corneliu ZUZU
2016-02-09 11:19   ` Jan Beulich
2016-02-09 11:52     ` Corneliu ZUZU
2016-02-09 12:12       ` Jan Beulich
2016-02-09 12:24         ` Corneliu ZUZU
2016-02-08 16:57 ` [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side Corneliu ZUZU
2016-02-08 18:15   ` Tamas K Lengyel
2016-02-08 18:43     ` Corneliu ZUZU [this message]
2016-02-08 18:50       ` Tamas K Lengyel
2016-02-08 16:57 ` [PATCH 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h Corneliu ZUZU
2016-02-08 18:18   ` Tamas K Lengyel
2016-02-08 18:55     ` Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 5/7] xen/vm-events: Move hvm_event_* functions to common-side Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 6/7] Rename event_x86.c to event.c and event_arch.h to event.h + minor fixes Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 7/7] arch.monitor: move bits to common (arch_domain to domain) Corneliu ZUZU
2016-02-08 18:29   ` Tamas K Lengyel
2016-02-09  7:14     ` Corneliu ZUZU
2016-02-08 17:06 ` [PATCH 0/7] Vm-events: move monitor vm-events code to common code Corneliu ZUZU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B8E1B6.8060507@bitdefender.com \
    --to=czuzu@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tamas@tklengyel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.