@@ -52,21 +52,29 @@ struct hvm_ioreq_vcpu {
#define MAX_NR_IO_RANGES 256
struct hvm_ioreq_server {
- struct domain *target, *emulator;
-
+ struct domain *target;
/* Lock to serialize toolstack modifications */
spinlock_t lock;
-
- struct hvm_ioreq_page ioreq;
- struct list_head ioreq_vcpu_list;
- struct hvm_ioreq_page bufioreq;
-
- /* Lock to serialize access to buffered ioreq ring */
- spinlock_t bufioreq_lock;
- evtchn_port_t bufioreq_evtchn;
struct rangeset *range[NR_IO_RANGE_TYPES];
bool enabled;
- uint8_t bufioreq_handling;
+ bool internal;
+
+ union {
+ struct {
+ struct domain *emulator;
+ struct hvm_ioreq_page ioreq;
+ struct list_head ioreq_vcpu_list;
+ struct hvm_ioreq_page bufioreq;
+
+ /* Lock to serialize access to buffered ioreq ring */
+ spinlock_t bufioreq_lock;
+ evtchn_port_t bufioreq_evtchn;
+ uint8_t bufioreq_handling;
+ };
+ struct {
+ int (*handler)(struct vcpu *v, ioreq_t *);
+ };
+ };
};
/*
Internal ioreq servers are plain function handlers implemented inside of the hypervisor. Note that most fields used by current (external) ioreq servers are not needed for internal ones, and hence have been placed inside of a struct and packed in an union together with the only internal specific field, a function pointer to a handler. This is required in order to have PCI config accesses forwarded to external ioreq servers or to internal ones (ie: QEMU emulated devices vs vPCI passthrough), and is the first step in order to allow unprivileged domains to use vPCI. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- xen/include/asm-x86/hvm/domain.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)