All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Tamas K Lengyel <tamas.lengyel@zentific.com>
Cc: Tim Deegan <tim@xen.org>, Kevin Tian <kevin.tian@intel.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Steven Maresca <steve@zentific.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	Jun Nakajima <jun.nakajima@intel.com>,
	"rshriram@cs.ubc.ca" <rshriram@cs.ubc.ca>,
	Keir Fraser <keir@xen.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"yanghy@cn.fujitsu.com" <yanghy@cn.fujitsu.com>
Subject: Re: [PATCH V5 07/12] xen: Introduce monitor_op domctl
Date: Wed, 18 Feb 2015 09:26:00 +0000	[thread overview]
Message-ID: <54E468B80200007800060F1B@mail.emea.novell.com> (raw)
In-Reply-To: <CAErYnsgNZEZWQm8LMWZDtaRhztBcdLVi5mRQvjb5q+LFraO1rQ@mail.gmail.com>

>>> On 17.02.15 at 19:20, <tamas.lengyel@zentific.com> wrote:
> On Tue, Feb 17, 2015 at 3:02 PM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>> On 13.02.15 at 17:33, <tamas.lengyel@zentific.com> wrote:
>>>              rc = vm_event_enable(d, vec, ved, _VPF_mem_access,
>>> -                                    HVM_PARAM_MONITOR_RING_PFN,
>>> -                                    mem_access_notification);
>>> -
>>> -            if ( vec->op == XEN_VM_EVENT_MONITOR_ENABLE_INTROSPECTION
>>> -                 && !rc )
>>> -                p2m_setup_introspection(d);
>>> -
>>> -        }
>>> -        break;
>>> +                                 HVM_PARAM_MONITOR_RING_PFN,
>>> +                                 mem_access_notification);
>>
>> I don't see what changes for these two lines. If it's indentation, it
>> should be done right when the code gets added.
> 
> Indentation can't be fixed in the code addition as it breaks git -M.
> It reverts to the old format where it just removes the whole file and
> adds the new one. I think its a waste to add a whole new separate
> patch just to fix indentations so I just fix it here.

Considering that indentation is broken already prior to your
series, this is perhaps acceptable. But at least if indentation
was correct before the rename, it should be afterwards. You'd
have to use of git's -B option to control the resulting diff.

>>> +#include <public/domctl.h>
>>> +
>>> +static inline
>>> +int monitor_domctl(struct xen_domctl_monitor_op *op, struct domain *d)
>>
>> The includes above are insufficient for the types used, or you should
>> forward declare _both_ structs and not have any includes.
> 
> Just including sched.h additionally should be enough IMHO.

Resulting in a huge pile of further dependencies. Our goal really
should be to get the dependencies down, not up - improving build
time. Hence forward declarations are very likely the better choice
here.

>>> --- a/xen/include/asm-x86/domain.h
>>> +++ b/xen/include/asm-x86/domain.h
>>> @@ -241,6 +241,24 @@ struct time_scale {
>>>      u32 mul_frac;
>>>  };
>>>
>>> +/************************************************/
>>> +/*            monitor event options             */
>>> +/************************************************/
>>> +struct mov_to_cr {
>>> +    uint8_t enabled;
>>> +    uint8_t sync;
>>> +    uint8_t onchangeonly;
>>> +};
>>> +
>>> +struct mov_to_msr {
>>> +    uint8_t enabled;
>>> +    uint8_t extended_capture;
>>> +};
>>> +
>>> +struct debug_event {
>>> +    uint8_t enabled;
>>> +};
>>
>> These are all internal structures - is there anything wrong with using
>> bitfields here?
> 
> The use if bitfields is not good performance-wise AFAIK. Would there
> be any benefit that would offset that?

As Andrew already said - total structure size. Also I'm pretty
convinced "or $<val>, <mem>" as well as "and $~<val>,<mem>"
aren't much worse than "mov $<val>,<mem>", and the code
writing these fields shouldn't be performance critical. And
"test $<val>,<mem>" and "cmp $<val>,<mem>" (as well as
their split up alternatives, should the compiler elect to do so)
ought to be equal performance wise.

Jan

  parent reply	other threads:[~2015-02-18  9:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 16:33 [PATCH V5 00/12] xen: Clean-up of mem_event subsystem Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 01/12] xen/mem_event: Cleanup of mem_event structures Tamas K Lengyel
2015-02-13 17:23   ` Andrew Cooper
2015-02-13 18:03     ` Tamas K Lengyel
2015-02-13 18:09       ` Andrew Cooper
2015-02-13 18:13         ` Tamas K Lengyel
2015-02-17 11:48         ` Jan Beulich
2015-02-13 16:33 ` [PATCH V5 02/12] xen/mem_event: Cleanup mem_event ring names and domctls Tamas K Lengyel
2015-02-13 17:53   ` Andrew Cooper
2015-02-13 18:06     ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 03/12] xen/mem_paging: Convert mem_event_op to mem_paging_op Tamas K Lengyel
2015-02-13 18:17   ` Andrew Cooper
2015-02-13 18:30     ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 04/12] xen: Rename mem_event to vm_event Tamas K Lengyel
2015-02-13 18:31   ` Andrew Cooper
2015-02-13 16:33 ` [PATCH V5 05/12] tools/tests: Clean-up tools/tests/xen-access Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 06/12] x86/hvm: factor out and rename vm_event related functions Tamas K Lengyel
2015-02-13 18:41   ` Andrew Cooper
2015-02-17 11:56   ` Jan Beulich
2015-02-17 17:37     ` Tamas K Lengyel
2015-02-18  9:07       ` Jan Beulich
2015-02-18 12:09         ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 07/12] xen: Introduce monitor_op domctl Tamas K Lengyel
2015-02-13 20:09   ` Andrew Cooper
2015-02-17 14:02   ` Jan Beulich
2015-02-17 18:20     ` Tamas K Lengyel
2015-02-17 18:37       ` Andrew Cooper
2015-02-17 18:48         ` Tamas K Lengyel
2015-02-17 22:59       ` Tamas K Lengyel
2015-02-18  9:26       ` Jan Beulich [this message]
2015-02-18 12:11         ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 08/12] xen/vm_event: Check for VM_EVENT_FLAG_DUMMY only in Debug builds Tamas K Lengyel
2015-02-13 20:14   ` Andrew Cooper
2015-02-13 22:48     ` Tamas K Lengyel
2015-02-13 22:53       ` Tamas K Lengyel
2015-02-13 23:00         ` Andrew Cooper
2015-02-13 23:02           ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 09/12] xen/vm_event: Decouple vm_event and mem_access Tamas K Lengyel
2015-02-13 21:05   ` Andrew Cooper
2015-02-13 23:00     ` Tamas K Lengyel
2015-02-17 14:17   ` Jan Beulich
2015-02-17 18:30     ` Tamas K Lengyel
2015-02-17 18:34       ` Andrew Cooper
2015-02-17 18:49         ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 10/12] xen/vm_event: Relocate memop checks Tamas K Lengyel
2015-02-13 21:23   ` Andrew Cooper
2015-02-13 23:20     ` Tamas K Lengyel
2015-02-13 23:24       ` Tamas K Lengyel
2015-02-17 14:25   ` Jan Beulich
2015-02-17 18:47     ` Tamas K Lengyel
2015-02-18  9:29       ` Jan Beulich
2015-02-18 12:13         ` Tamas K Lengyel
2015-02-13 16:33 ` [PATCH V5 11/12] xen/xsm: Split vm_event_op into three separate labels Tamas K Lengyel
2015-02-13 21:25   ` Andrew Cooper
2015-02-13 16:33 ` [PATCH V5 12/12] xen/vm_event: Add RESUME option to vm_event_op domctl Tamas K Lengyel
2015-02-13 21:44   ` Andrew Cooper
2015-02-13 23:10     ` Tamas K Lengyel
2015-02-17 14:31   ` Jan Beulich
2015-02-17 18:32     ` Tamas K Lengyel
2015-02-18  9:31       ` Jan Beulich
2015-02-18 12:18         ` Tamas K Lengyel

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=54E468B80200007800060F1B@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=andres@lagarcavilla.org \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=eddie.dong@intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=steve@zentific.com \
    --cc=tamas.lengyel@zentific.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yanghy@cn.fujitsu.com \
    /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.