aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-02-20 22:09:40 +0100
committerOlaf Hering <olaf@aepfle.de>2012-02-20 22:09:40 +0100
commit6eac9387aa320979c626d556fcdda8e8b83fd70a (patch)
treed16978491a2370772c93d370dff93a8d94bf48d9
parentb38c115140ed14179d6f7ec095ca29a79de58394 (diff)
downloadxen-6eac9387aa320979c626d556fcdda8e8b83fd70a.tar.gz
xen-6eac9387aa320979c626d556fcdda8e8b83fd70a.tar.bz2
xen-6eac9387aa320979c626d556fcdda8e8b83fd70a.zip
mem_event: remove type member
When mem_event was added the type flag should indicate who the consumer is. But the concept of a single ring buffer for multiple event types can not work for two reasons. One is that no multiplexer exists which provides individual event types to the final consumer, and second is that even if such multiplexer can not work reliable because a request needs to be answered with a response. The response should be sent roughly in the order of received events. But with multiple consumers one of them can so stall all the others. For that reason the single mem_event buffer for all types of events was split into individual ring buffers with commit 23842:483c5f8319ad. This commit made the type member already obsolete because the meaning of each buffer is now obvious. This change removes the type member and increases the flags field. Even though this is an ABI incompatible change, it will have no practical impact on existing binaries because the changeset referenced above already bumped the SONAME. So these binaries have to be recompiled anyway for the upcoming major release. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
-rw-r--r--xen/arch/x86/hvm/hvm.c1
-rw-r--r--xen/arch/x86/mm/mem_sharing.c3
-rw-r--r--xen/arch/x86/mm/p2m.c3
-rw-r--r--xen/include/public/mem_event.h8
4 files changed, 2 insertions, 13 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6bbb4252e4..d00eaf5fed 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4322,7 +4322,6 @@ static int hvm_memory_event_traps(long p, uint32_t reason,
return rc;
memset(&req, 0, sizeof(req));
- req.type = MEM_EVENT_TYPE_ACCESS;
req.reason = reason;
if ( (p & HVMPME_MODE_MASK) == HVMPME_mode_sync )
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index b73d48827f..50d3d6ed6d 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -347,7 +347,7 @@ int mem_sharing_audit(void)
static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
{
struct vcpu *v = current;
- mem_event_request_t req = { .type = MEM_EVENT_TYPE_SHARED };
+ mem_event_request_t req = { .gfn = gfn };
if ( v->domain != d )
{
@@ -369,7 +369,6 @@ static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
vcpu_pause_nosync(v);
- req.gfn = gfn;
req.p2mt = p2m_ram_shared;
req.vcpu_id = v->vcpu_id;
mem_event_put_request(d, &d->mem_event->share, &req);
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 19b831715e..9eb0ba5f35 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -925,7 +925,6 @@ void p2m_mem_paging_drop_page(struct domain *d, unsigned long gfn,
/* Send release notification to pager */
memset(&req, 0, sizeof(req));
- req.type = MEM_EVENT_TYPE_PAGING;
req.gfn = gfn;
req.flags = MEM_EVENT_FLAG_DROP_PAGE;
@@ -982,7 +981,6 @@ void p2m_mem_paging_populate(struct domain *d, unsigned long gfn)
return;
memset(&req, 0, sizeof(req));
- req.type = MEM_EVENT_TYPE_PAGING;
/* Fix p2m mapping */
gfn_lock(p2m, gfn, 0);
@@ -1221,7 +1219,6 @@ bool_t p2m_mem_access_check(unsigned long gpa, bool_t gla_valid, unsigned long g
{
*req_ptr = req;
memset(req, 0, sizeof(req));
- req->type = MEM_EVENT_TYPE_ACCESS;
req->reason = MEM_EVENT_REASON_VIOLATION;
/* Pause the current VCPU */
diff --git a/xen/include/public/mem_event.h b/xen/include/public/mem_event.h
index 770cc7cb9a..29e125a5a7 100644
--- a/xen/include/public/mem_event.h
+++ b/xen/include/public/mem_event.h
@@ -30,11 +30,6 @@
#include "xen.h"
#include "io/ring.h"
-/* Memory event type */
-#define MEM_EVENT_TYPE_SHARED 0
-#define MEM_EVENT_TYPE_PAGING 1
-#define MEM_EVENT_TYPE_ACCESS 2
-
/* Memory event flags */
#define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0)
#define MEM_EVENT_FLAG_DROP_PAGE (1 << 1)
@@ -56,8 +51,7 @@ typedef struct mem_event_shared_page {
} mem_event_shared_page_t;
typedef struct mem_event_st {
- uint16_t type;
- uint16_t flags;
+ uint32_t flags;
uint32_t vcpu_id;
uint64_t gfn;