1 /******************************************************************************
4 * Memory event common structures.
6 * Copyright (c) 2009 by Citrix Systems, Inc. (Patrick Colp)
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to
10 * deal in the Software without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
27 #ifndef _XEN_PUBLIC_MEM_EVENT_H
28 #define _XEN_PUBLIC_MEM_EVENT_H
33 /* Memory event flags */
34 #define MEM_EVENT_FLAG_VCPU_PAUSED (1 << 0)
35 #define MEM_EVENT_FLAG_DROP_PAGE (1 << 1)
36 #define MEM_EVENT_FLAG_EVICT_FAIL (1 << 2)
37 #define MEM_EVENT_FLAG_FOREIGN (1 << 3)
38 #define MEM_EVENT_FLAG_DUMMY (1 << 4)
40 /* Reasons for the memory event request */
41 #define MEM_EVENT_REASON_UNKNOWN 0 /* typical reason */
42 #define MEM_EVENT_REASON_VIOLATION 1 /* access violation, GFN is address */
43 #define MEM_EVENT_REASON_CR0 2 /* CR0 was hit: gfn is CR0 value */
44 #define MEM_EVENT_REASON_CR3 3 /* CR3 was hit: gfn is CR3 value */
45 #define MEM_EVENT_REASON_CR4 4 /* CR4 was hit: gfn is CR4 value */
46 #define MEM_EVENT_REASON_INT3 5 /* int3 was hit: gla/gfn are RIP */
47 #define MEM_EVENT_REASON_SINGLESTEP 6 /* single step was invoked: gla/gfn are RIP */
49 typedef struct mem_event_st {
55 uint64_t gla; /* if gla_valid */
63 uint16_t available:12;
66 } mem_event_request_t, mem_event_response_t;
68 DEFINE_RING_TYPES(mem_event, mem_event_request_t, mem_event_response_t);
78 * indent-tabs-mode: nil