All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xen.org,
	Tamas K Lengyel <tamas.lengyel@zentific.com>
Cc: kevin.tian@intel.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
	eddie.dong@intel.com, ian.jackson@eu.citrix.com,
	andres@lagarcavilla.org, jun.nakajima@intel.com,
	rshriram@cs.ubc.ca, dgdegra@tycho.nsa.gov, yanghy@cn.fujitsu.com
Subject: Re: [PATCH RFC 0/7] xen: Clean-up of mem_event subsystem
Date: Mon, 17 Nov 2014 18:43:40 +0200	[thread overview]
Message-ID: <546A25BC.3020000@bitdefender.com> (raw)
In-Reply-To: <546A32720200007800048873@mail.emea.novell.com>

On 11/17/2014 06:37 PM, Jan Beulich wrote:
>>>> On 12.11.14 at 16:48, <andrew.cooper3@citrix.com> wrote:
>> On 12/11/14 15:31, Tamas K Lengyel wrote:
>>>  xen/include/public/domctl.h         |  44 +--
>>>  xen/include/public/hvm/params.h     |   2 +-
>>>  xen/include/public/mem_event.h      | 134 -------
>>>  xen/include/public/memory.h         |   6 +-
>>>  xen/include/public/vm_event.h       | 179 +++++++++
>>
>> While in principle I think this series is a very good thing, there is a
>> problem with editing the pubic header files.
>>
>> The contents of mem_event.h is not currently hidden behind #ifdef
>> __XEN_TOOLS__
>>
>> As a result, it is strictly speaking part of the VM-visible public
>> API/ABI and not permitted to change in a backwards incompatible manor.
>>
>> Having said that, it is currently only usable by privileged domains, so
>> there is an argument to be made for declaring that it should have been
>> hidden behind __XEN_TOOLS__ in the first place, making it permittable to
>> change.
> 
> I'm not sure I agree - the meaning of "tools" here would seem quite a
> bit different than e.g. in domctl.h. Looking at patch 1, I can't see how
> an old consumer (remember that for many of these we have at best
> fake consumers in the tree) would deal with the now differently
> arranged data. I don't see any versioning of the interface, and hence
> I can't see how tools would know which of the formats to expect.

In the initial patch I've sent Tamas I had arranged things as follows,
(so that the layout would stay compatible) but I think we ended up
discussing it and deciding it would look cleaner to just re-do the whole
thing:

+struct mem_event_ept_data {
+    uint64_t gfn;
+    uint64_t offset;
+    uint64_t gla; /* if gla_valid */
+};
+
+struct mem_event_cr_data {
+    uint64_t new_value;
+    uint64_t _pad;
+    uint64_t old_value;
+};
+
+struct mem_event_int3_data {
+    uint64_t gfn;
+    uint64_t _pad;
+    uint64_t eip;
+};
+
+struct mem_event_singlestep_data {
+    uint64_t gfn;
+    uint64_t _pad;
+    uint64_t eip;
+};
+
+struct mem_event_msr_data {
+    uint64_t msr;
+    uint64_t old_value;
+    uint64_t new_value;
+};
+
 typedef struct mem_event_st {
     uint32_t flags;
     uint32_t vcpu_id;

-    uint64_t gfn;
-    uint64_t offset;
-    uint64_t gla; /* if gla_valid */
+    union {
+        struct mem_event_ept_data        ept_event;
+        struct mem_event_cr_data         cr_event;
+        struct mem_event_int3_data       int3_event;
+        struct mem_event_singlestep_data singlestep_event;
+        struct mem_event_msr_data        msr_event;
+    };

     uint32_t p2mt;

Would something like this be more along the right lines?


Thanks,
Razvan

  reply	other threads:[~2014-11-17 16:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 15:31 [PATCH RFC 0/7] xen: Clean-up of mem_event subsystem Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 1/7] xen/mem_event: Cleanup of mem_event structures Tamas K Lengyel
2014-11-12 15:58   ` Andrew Cooper
2014-11-13 16:32     ` Tamas K Lengyel
2014-11-17 16:44   ` Jan Beulich
2014-11-17 17:07     ` Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 2/7] xen/mem_event: Rename the mem_event ring from 'access' to 'monitor' Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 3/7] xen/mem_paging: Convert mem_event_op to mem_paging_op Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 4/7] x86/hvm: rename hvm_memory_event_* functions to hvm_event_* Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 5/7] xen/mem_event: Rename mem_event to vm_event Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 6/7] xen/vm_event: Decouple vm_event and mem_access Tamas K Lengyel
2014-11-12 15:31 ` [PATCH RFC 7/7] tools/tests: Remove superfluous and incomplete spinlock from xen-access Tamas K Lengyel
2014-11-28 12:51   ` Razvan Cojocaru
2014-11-12 15:48 ` [PATCH RFC 0/7] xen: Clean-up of mem_event subsystem Andrew Cooper
2014-11-13 16:36   ` Tamas K Lengyel
2014-11-17 16:37   ` Jan Beulich
2014-11-17 16:43     ` Razvan Cojocaru [this message]
2014-11-18  7:31       ` Jan Beulich
2014-11-17 17:06     ` Tamas K Lengyel
2014-11-18  7:32       ` Jan Beulich
2014-11-18 12:27         ` 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=546A25BC.3020000@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andres@lagarcavilla.org \
    --cc=andrew.cooper3@citrix.com \
    --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=kevin.tian@intel.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tamas.lengyel@zentific.com \
    --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.