All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tamas K Lengyel <tamas.lengyel@zentific.com>, xen-devel@lists.xen.org
Cc: kevin.tian@intel.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
	eddie.dong@intel.com, andres@lagarcavilla.org,
	jun.nakajima@intel.com, rshriram@cs.ubc.ca,
	dgdegra@tycho.nsa.gov, yanghy@cn.fujitsu.com
Subject: Re: [PATCH RFC 1/7] xen/mem_event: Cleanup of mem_event structures
Date: Wed, 12 Nov 2014 15:58:25 +0000	[thread overview]
Message-ID: <546383A1.8030604@citrix.com> (raw)
In-Reply-To: <1415806309-5206-2-git-send-email-tamas.lengyel@zentific.com>

On 12/11/14 15:31, Tamas K Lengyel wrote:
> diff --git a/xen/include/public/mem_event.h b/xen/include/public/mem_event.h
> index 599f9e8..c0e9394 100644
> --- a/xen/include/public/mem_event.h
> +++ b/xen/include/public/mem_event.h
> @@ -49,15 +49,19 @@
>  #define MEM_EVENT_FLAG_EMULATE_NOWRITE (1 << 6)
>  
>  /* Reasons for the memory event request */
> -#define MEM_EVENT_REASON_UNKNOWN     0    /* typical reason */
> -#define MEM_EVENT_REASON_VIOLATION   1    /* access violation, GFN is address */
> -#define MEM_EVENT_REASON_CR0         2    /* CR0 was hit: gfn is new CR0 value, gla is previous */
> -#define MEM_EVENT_REASON_CR3         3    /* CR3 was hit: gfn is new CR3 value, gla is previous */
> -#define MEM_EVENT_REASON_CR4         4    /* CR4 was hit: gfn is new CR4 value, gla is previous */
> -#define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
> -#define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
> -#define MEM_EVENT_REASON_MSR         7    /* MSR was hit: gfn is MSR value, gla is MSR address;
> -                                             does NOT honour HVMPME_onchangeonly */
> +typedef enum {
> +    MEM_EVENT_REASON_UNKNOWN,              /* Default case */
> +    MEM_EVENT_REASON_MEM_ACCESS_VIOLATION, /* Memory access violation */
> +    MEM_EVENT_REASON_MEM_SHARING,          /* Memory sharing event */
> +    MEM_EVENT_REASON_MEM_PAGING,           /* Memory paging event */
> +    MEM_EVENT_REASON_CR0,                  /* CR0 was updated */
> +    MEM_EVENT_REASON_CR3,                  /* CR3 was updated */
> +    MEM_EVENT_REASON_CR4,                  /* CR4 was updated */
> +    MEM_EVENT_REASON_INT3,                 /* Debug operation executed (int3) */
> +    MEM_EVENT_REASON_SINGLESTEP,           /* Single-step (MTF) */
> +    MEM_EVENT_REASON_MSR,                  /* An MSR was updated.
> +                                            * Does NOT honour HVMPME_onchangeonly */
> +} mem_event_reason_t;

Please keep these as defines.  The width of an enum is implementation
defined, meaning that different compilers are free to interpret the
width of the above definition differently, which affects the size and
alignment of mem_event_st below.

(It is completely wrong that Xen's ABI/API was ever specified using C,
rather than a document stating actual data structure widths, but that
horse has long-since bolted)

~Andrew

  reply	other threads:[~2014-11-12 15:58 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 [this message]
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
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=546383A1.8030604@citrix.com \
    --to=andrew.cooper3@citrix.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=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.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.