Date: Sat, 29 Dec 2007 08:19:11 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131955 for review Message-ID: <200712290819.lBT8JBTJ081183@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131955 Change 131955 by kmacy@pandemonium:kmacy:xen31 on 2007/12/29 08:18:34 update to most recent hypercall interfaces still no clock interrupts :-( Affected files ... .. //depot/projects/xen31/sys/dev/xen/blkfront/blkfront.c#3 edit .. //depot/projects/xen31/sys/i386/include/xen/evtchn.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/hypercall.h#4 edit .. //depot/projects/xen31/sys/i386/include/xen/hypervisor-ifs.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/hypervisor.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/arch-x86_32.h#3 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/dom0_ops.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/event_channel.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/grant_table.h#3 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/memory.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/physdev.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/sched.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/vcpu.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/xen-compat.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/xen.h#4 edit .. //depot/projects/xen31/sys/i386/xen/clock.c#2 edit .. //depot/projects/xen31/sys/i386/xen/xen_machdep.c#9 edit .. //depot/projects/xen31/sys/xen/evtchn/evtchn.c#2 edit .. //depot/projects/xen31/sys/xen/gnttab.c#2 edit .. //depot/projects/xen31/sys/xen/xenbus/xenbus_client.c#2 edit Differences ... ==== //depot/projects/xen31/sys/dev/xen/blkfront/blkfront.c#3 (text+ko) ==== @@ -336,7 +336,7 @@ err = xenbus_transaction_end(xbt, 0); if (err) { - if (err == EAGAIN) + if (err == -EAGAIN) goto again; xenbus_dev_fatal(dev, err, "completing transaction"); goto destroy_blkring; ==== //depot/projects/xen31/sys/i386/include/xen/evtchn.h#2 (text+ko) ==== @@ -66,10 +66,8 @@ static inline void notify_remote_via_evtchn(int port) { - evtchn_op_t op; - op.cmd = EVTCHNOP_send; - op.u.send.port = port; - (void)HYPERVISOR_event_channel_op(&op); + struct evtchn_send send = { .port = port }; + (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); } /* ==== //depot/projects/xen31/sys/i386/include/xen/hypercall.h#4 (text+ko) ==== @@ -124,7 +124,7 @@ static inline int HYPERVISOR_mmuext_op( - struct mmuext_op *op, int count, int *success_count, domid_t domid) + mmuext_op_t *op, int count, int *success_count, domid_t domid) { return _hypercall4(int, mmuext_op, op, count, success_count, domid); } @@ -175,15 +175,15 @@ unsigned long timeout_lo = (unsigned long)timeout; return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi); } - +#if 0 static inline int -HYPERVISOR_dom0_op( - dom0_op_t *dom0_op) +HYPERVISOR_platform_op( + struct xen_platform_op *platform_op) { - dom0_op->interface_version = DOM0_INTERFACE_VERSION; - return _hypercall1(int, dom0_op, dom0_op); + platform_op->interface_version = XENPF_INTERFACE_VERSION; + return _hypercall1(int, platform_op, platform_op); } - +#endif static inline int HYPERVISOR_set_debugreg( int reg, unsigned long value) @@ -233,9 +233,9 @@ static inline int HYPERVISOR_event_channel_op( - void *op) + int cmd, void *op) { - return _hypercall1(int, event_channel_op, op); + return _hypercall2(int, event_channel_op, cmd, op); } static inline int @@ -254,9 +254,9 @@ static inline int HYPERVISOR_physdev_op( - void *physdev_op) + int cmd, void *physdev_op) { - return _hypercall1(int, physdev_op, physdev_op); + return _hypercall2(int, physdev_op, cmd, physdev_op); } static inline int @@ -302,7 +302,42 @@ return _hypercall3(int, sched_op, SCHEDOP_shutdown, &sched_shutdown, srec); } +#ifdef notyet +static inline int +HYPERVISOR_nmi_op( + unsigned long op, void *arg) +{ + return _hypercall2(int, nmi_op, op, arg); +} +static inline unsigned long +HYPERVISOR_hvm_op( + int op, void *arg) +{ + return _hypercall2(unsigned long, hvm_op, op, arg); +} + +static inline int +HYPERVISOR_callback_op( + int cmd, void *arg) +{ + return _hypercall2(int, callback_op, cmd, arg); +} + +static inline int +HYPERVISOR_xenoprof_op( + int op, void *arg) +{ + return _hypercall2(int, xenoprof_op, op, arg); +} + +static inline int +HYPERVISOR_kexec_op( + unsigned long op, void *args) +{ + return _hypercall2(int, kexec_op, op, args); +} +#endif #endif /* __HYPERCALL_H__ */ /* ==== //depot/projects/xen31/sys/i386/include/xen/hypervisor-ifs.h#2 (text+ko) ==== @@ -18,8 +18,8 @@ #endif } pte_t; -#define __XEN_INTERFACE_VERSION__ 0x00030101 #define CONFIG_XEN_BLKDEV_GRANT +#include <machine/xen/xen-public/xen-compat.h> #include <machine/xen/xen-public/xen.h> #include <machine/xen/xen-public/grant_table.h> #include <machine/xen/xen-public/io/netif.h> ==== //depot/projects/xen31/sys/i386/include/xen/hypervisor.h#2 (text+ko) ==== @@ -36,6 +36,24 @@ static inline void HYPERVISOR_crash(void) __dead2; static inline int +HYPERVISOR_yield(void) +{ + int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL); + + return rc; +} + +static inline int +HYPERVISOR_block( + void) +{ + int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL); + + return rc; +} + + +static inline int HYPERVISOR_shutdown(unsigned int reason) { struct sched_shutdown sched_shutdown = { @@ -60,10 +78,10 @@ evtchn_port_t *ports, unsigned int nr_ports, int ticks) { struct sched_poll sched_poll = { - .ports = ports, .nr_ports = nr_ports, .timeout = get_system_time(ticks) }; + set_xen_guest_handle(sched_poll.ports, ports); return HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll); } ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/arch-x86_32.h#3 (text+ko) ==== @@ -9,26 +9,24 @@ #ifndef __XEN_PUBLIC_ARCH_X86_32_H__ #define __XEN_PUBLIC_ARCH_X86_32_H__ -#ifdef __XEN__ -#define __DEFINE_GUEST_HANDLE(name, type) \ +#define __DEFINE_XEN_GUEST_HANDLE(name, type) \ typedef struct { type *p; } __guest_handle_ ## name -#else -#define __DEFINE_GUEST_HANDLE(name, type) \ - typedef type * __guest_handle_ ## name -#endif + +#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name) +#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name +#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) +#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) -#define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name) -#define GUEST_HANDLE(name) __guest_handle_ ## name #ifndef __ASSEMBLY__ /* Guest handles for primitive C types. */ -__DEFINE_GUEST_HANDLE(uchar, unsigned char); -__DEFINE_GUEST_HANDLE(uint, unsigned int); -__DEFINE_GUEST_HANDLE(ulong, unsigned long); -DEFINE_GUEST_HANDLE(char); -DEFINE_GUEST_HANDLE(int); -DEFINE_GUEST_HANDLE(long); -DEFINE_GUEST_HANDLE(void); +__DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char); +__DEFINE_XEN_GUEST_HANDLE(uint, unsigned int); +__DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long); +DEFINE_XEN_GUEST_HANDLE(char); +DEFINE_XEN_GUEST_HANDLE(int); +DEFINE_XEN_GUEST_HANDLE(long); +DEFINE_XEN_GUEST_HANDLE(void); #endif /* @@ -102,7 +100,7 @@ uint16_t cs; /* code selector */ unsigned long address; /* code offset */ } trap_info_t; -DEFINE_GUEST_HANDLE(trap_info_t); +DEFINE_XEN_GUEST_HANDLE(trap_info_t); typedef struct cpu_user_regs { uint32_t ebx; @@ -126,7 +124,7 @@ uint16_t fs, _pad4; uint16_t gs, _pad5; } cpu_user_regs_t; -DEFINE_GUEST_HANDLE(cpu_user_regs_t); +DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t); typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ @@ -154,7 +152,7 @@ unsigned long failsafe_callback_eip; unsigned long vm_assist; /* VMASST_TYPE_* bitmap */ } vcpu_guest_context_t; -DEFINE_GUEST_HANDLE(vcpu_guest_context_t); +DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); typedef struct arch_shared_info { unsigned long max_pfn; /* max pfn that appears in table */ ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/dom0_ops.h#2 (text+ko) ==== @@ -28,21 +28,21 @@ /* IN variables. */ domid_t domain; unsigned long max_pfns; - GUEST_HANDLE(ulong) buffer; + XEN_GUEST_HANDLE(ulong) buffer; /* OUT variables. */ unsigned long num_pfns; } dom0_getmemlist_t; -DEFINE_GUEST_HANDLE(dom0_getmemlist_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getmemlist_t); #define DOM0_SCHEDCTL 6 /* struct sched_ctl_cmd is from sched-ctl.h */ typedef struct sched_ctl_cmd dom0_schedctl_t; -DEFINE_GUEST_HANDLE(dom0_schedctl_t); +DEFINE_XEN_GUEST_HANDLE(dom0_schedctl_t); #define DOM0_ADJUSTDOM 7 /* struct sched_adjdom_cmd is from sched-ctl.h */ typedef struct sched_adjdom_cmd dom0_adjustdom_t; -DEFINE_GUEST_HANDLE(dom0_adjustdom_t); +DEFINE_XEN_GUEST_HANDLE(dom0_adjustdom_t); #define DOM0_CREATEDOMAIN 8 typedef struct dom0_createdomain { @@ -53,28 +53,28 @@ /* Identifier for new domain (auto-allocate if zero is specified). */ domid_t domain; } dom0_createdomain_t; -DEFINE_GUEST_HANDLE(dom0_createdomain_t); +DEFINE_XEN_GUEST_HANDLE(dom0_createdomain_t); #define DOM0_DESTROYDOMAIN 9 typedef struct dom0_destroydomain { /* IN variables. */ domid_t domain; } dom0_destroydomain_t; -DEFINE_GUEST_HANDLE(dom0_destroydomain_t); +DEFINE_XEN_GUEST_HANDLE(dom0_destroydomain_t); #define DOM0_PAUSEDOMAIN 10 typedef struct dom0_pausedomain { /* IN parameters. */ domid_t domain; } dom0_pausedomain_t; -DEFINE_GUEST_HANDLE(dom0_pausedomain_t); +DEFINE_XEN_GUEST_HANDLE(dom0_pausedomain_t); #define DOM0_UNPAUSEDOMAIN 11 typedef struct dom0_unpausedomain { /* IN parameters. */ domid_t domain; } dom0_unpausedomain_t; -DEFINE_GUEST_HANDLE(dom0_unpausedomain_t); +DEFINE_XEN_GUEST_HANDLE(dom0_unpausedomain_t); #define DOM0_GETDOMAININFO 12 typedef struct dom0_getdomaininfo { @@ -100,7 +100,7 @@ uint32_t ssidref; xen_domain_handle_t handle; } dom0_getdomaininfo_t; -DEFINE_GUEST_HANDLE(dom0_getdomaininfo_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getdomaininfo_t); #define DOM0_SETVCPUCONTEXT 13 typedef struct dom0_setvcpucontext { @@ -108,9 +108,9 @@ domid_t domain; uint32_t vcpu; /* IN/OUT parameters */ - GUEST_HANDLE(vcpu_guest_context_t) ctxt; + XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt; } dom0_setvcpucontext_t; -DEFINE_GUEST_HANDLE(dom0_setvcpucontext_t); +DEFINE_XEN_GUEST_HANDLE(dom0_setvcpucontext_t); #define DOM0_MSR 15 typedef struct dom0_msr { @@ -124,7 +124,7 @@ uint32_t out1; uint32_t out2; } dom0_msr_t; -DEFINE_GUEST_HANDLE(dom0_msr_t); +DEFINE_XEN_GUEST_HANDLE(dom0_msr_t); /* * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC, @@ -137,7 +137,7 @@ uint32_t nsecs; uint64_t system_time; } dom0_settime_t; -DEFINE_GUEST_HANDLE(dom0_settime_t); +DEFINE_XEN_GUEST_HANDLE(dom0_settime_t); #define DOM0_GETPAGEFRAMEINFO 18 #define LTAB_SHIFT 28 @@ -159,7 +159,7 @@ /* Is the page PINNED to a type? */ uint32_t type; /* see above type defs */ } dom0_getpageframeinfo_t; -DEFINE_GUEST_HANDLE(dom0_getpageframeinfo_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getpageframeinfo_t); /* * Read console content from Xen buffer ring. @@ -169,10 +169,10 @@ /* IN variables. */ uint32_t clear; /* Non-zero -> clear after reading. */ /* IN/OUT variables. */ - GUEST_HANDLE(char) buffer; /* In: Buffer start; Out: Used buffer start */ + XEN_GUEST_HANDLE(char) buffer; /* In: Buffer start; Out: Used buffer start */ uint32_t count; /* In: Buffer size; Out: Used buffer size */ } dom0_readconsole_t; -DEFINE_GUEST_HANDLE(dom0_readconsole_t); +DEFINE_XEN_GUEST_HANDLE(dom0_readconsole_t); /* * Set which physical cpus a vcpu can execute on. @@ -184,7 +184,7 @@ uint32_t vcpu; cpumap_t cpumap; } dom0_setvcpuaffinity_t; -DEFINE_GUEST_HANDLE(dom0_setvcpuaffinity_t); +DEFINE_XEN_GUEST_HANDLE(dom0_setvcpuaffinity_t); /* Get trace buffers machine base address */ #define DOM0_TBUFCONTROL 21 @@ -204,7 +204,7 @@ unsigned long buffer_mfn; uint32_t size; } dom0_tbufcontrol_t; -DEFINE_GUEST_HANDLE(dom0_tbufcontrol_t); +DEFINE_XEN_GUEST_HANDLE(dom0_tbufcontrol_t); /* * Get physical information about the host machine @@ -220,7 +220,7 @@ unsigned long free_pages; uint32_t hw_cap[8]; } dom0_physinfo_t; -DEFINE_GUEST_HANDLE(dom0_physinfo_t); +DEFINE_XEN_GUEST_HANDLE(dom0_physinfo_t); /* * Get the ID of the current scheduler. @@ -230,7 +230,7 @@ /* OUT variable */ uint32_t sched_id; } dom0_sched_id_t; -DEFINE_GUEST_HANDLE(dom0_sched_id_t); +DEFINE_XEN_GUEST_HANDLE(dom0_sched_id_t); /* * Control shadow pagetables operation @@ -252,19 +252,19 @@ uint32_t dirty_net_count; uint32_t dirty_block_count; } dom0_shadow_control_stats_t; -DEFINE_GUEST_HANDLE(dom0_shadow_control_stats_t); +DEFINE_XEN_GUEST_HANDLE(dom0_shadow_control_stats_t); typedef struct dom0_shadow_control { /* IN variables. */ domid_t domain; uint32_t op; - GUEST_HANDLE(ulong) dirty_bitmap; + XEN_GUEST_HANDLE(ulong) dirty_bitmap; /* IN/OUT variables. */ unsigned long pages; /* size of buffer, updated with actual size */ /* OUT variables. */ dom0_shadow_control_stats_t stats; } dom0_shadow_control_t; -DEFINE_GUEST_HANDLE(dom0_shadow_control_t); +DEFINE_XEN_GUEST_HANDLE(dom0_shadow_control_t); #define DOM0_SETDOMAINMAXMEM 28 typedef struct dom0_setdomainmaxmem { @@ -272,7 +272,7 @@ domid_t domain; unsigned long max_memkb; } dom0_setdomainmaxmem_t; -DEFINE_GUEST_HANDLE(dom0_setdomainmaxmem_t); +DEFINE_XEN_GUEST_HANDLE(dom0_setdomainmaxmem_t); #define DOM0_GETPAGEFRAMEINFO2 29 /* batched interface */ typedef struct dom0_getpageframeinfo2 { @@ -280,9 +280,9 @@ domid_t domain; unsigned long num; /* IN/OUT variables. */ - GUEST_HANDLE(ulong) array; + XEN_GUEST_HANDLE(ulong) array; } dom0_getpageframeinfo2_t; -DEFINE_GUEST_HANDLE(dom0_getpageframeinfo2_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getpageframeinfo2_t); /* * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type. @@ -301,7 +301,7 @@ uint32_t handle; uint32_t reg; } dom0_add_memtype_t; -DEFINE_GUEST_HANDLE(dom0_add_memtype_t); +DEFINE_XEN_GUEST_HANDLE(dom0_add_memtype_t); /* * Tear down an existing memory-range type. If @handle is remembered then it @@ -316,7 +316,7 @@ uint32_t handle; uint32_t reg; } dom0_del_memtype_t; -DEFINE_GUEST_HANDLE(dom0_del_memtype_t); +DEFINE_XEN_GUEST_HANDLE(dom0_del_memtype_t); /* Read current type of an MTRR (x86-specific). */ #define DOM0_READ_MEMTYPE 33 @@ -328,7 +328,7 @@ unsigned long nr_mfns; uint32_t type; } dom0_read_memtype_t; -DEFINE_GUEST_HANDLE(dom0_read_memtype_t); +DEFINE_XEN_GUEST_HANDLE(dom0_read_memtype_t); /* Interface for controlling Xen software performance counters. */ #define DOM0_PERFCCONTROL 34 @@ -340,23 +340,23 @@ uint32_t nr_vals; /* number of values for this counter */ uint32_t vals[64]; /* array of values */ } dom0_perfc_desc_t; -DEFINE_GUEST_HANDLE(dom0_perfc_desc_t); +DEFINE_XEN_GUEST_HANDLE(dom0_perfc_desc_t); typedef struct dom0_perfccontrol { /* IN variables. */ uint32_t op; /* DOM0_PERFCCONTROL_OP_??? */ /* OUT variables. */ uint32_t nr_counters; /* number of counters */ - GUEST_HANDLE(dom0_perfc_desc_t) desc; /* counter information (or NULL) */ + XEN_GUEST_HANDLE(dom0_perfc_desc_t) desc; /* counter information (or NULL) */ } dom0_perfccontrol_t; -DEFINE_GUEST_HANDLE(dom0_perfccontrol_t); +DEFINE_XEN_GUEST_HANDLE(dom0_perfccontrol_t); #define DOM0_MICROCODE 35 typedef struct dom0_microcode { /* IN variables. */ - GUEST_HANDLE(void) data; /* Pointer to microcode data */ + XEN_GUEST_HANDLE(void) data; /* Pointer to microcode data */ uint32_t length; /* Length of microcode data. */ } dom0_microcode_t; -DEFINE_GUEST_HANDLE(dom0_microcode_t); +DEFINE_XEN_GUEST_HANDLE(dom0_microcode_t); #define DOM0_IOPORT_PERMISSION 36 typedef struct dom0_ioport_permission { @@ -365,7 +365,7 @@ uint32_t nr_ports; /* size of port range */ uint8_t allow_access; /* allow or deny access to range? */ } dom0_ioport_permission_t; -DEFINE_GUEST_HANDLE(dom0_ioport_permission_t); +DEFINE_XEN_GUEST_HANDLE(dom0_ioport_permission_t); #define DOM0_GETVCPUCONTEXT 37 typedef struct dom0_getvcpucontext { @@ -373,9 +373,9 @@ domid_t domain; /* domain to be affected */ uint32_t vcpu; /* vcpu # */ /* OUT variables. */ - GUEST_HANDLE(vcpu_guest_context_t) ctxt; + XEN_GUEST_HANDLE(vcpu_guest_context_t) ctxt; } dom0_getvcpucontext_t; -DEFINE_GUEST_HANDLE(dom0_getvcpucontext_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getvcpucontext_t); #define DOM0_GETVCPUINFO 43 typedef struct dom0_getvcpuinfo { @@ -390,18 +390,18 @@ uint32_t cpu; /* current mapping */ cpumap_t cpumap; /* allowable mapping */ } dom0_getvcpuinfo_t; -DEFINE_GUEST_HANDLE(dom0_getvcpuinfo_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getvcpuinfo_t); #define DOM0_GETDOMAININFOLIST 38 typedef struct dom0_getdomaininfolist { /* IN variables. */ domid_t first_domain; uint32_t max_domains; - GUEST_HANDLE(dom0_getdomaininfo_t) buffer; + XEN_GUEST_HANDLE(dom0_getdomaininfo_t) buffer; /* OUT variables. */ uint32_t num_domains; } dom0_getdomaininfolist_t; -DEFINE_GUEST_HANDLE(dom0_getdomaininfolist_t); +DEFINE_XEN_GUEST_HANDLE(dom0_getdomaininfolist_t); #define DOM0_PLATFORM_QUIRK 39 #define QUIRK_NOIRQBALANCING 1 @@ -409,7 +409,7 @@ /* IN variables. */ uint32_t quirk_id; } dom0_platform_quirk_t; -DEFINE_GUEST_HANDLE(dom0_platform_quirk_t); +DEFINE_XEN_GUEST_HANDLE(dom0_platform_quirk_t); #define DOM0_PHYSICAL_MEMORY_MAP 40 typedef struct dom0_memory_map_entry { @@ -417,36 +417,36 @@ uint32_t flags; /* reserved */ uint8_t is_ram; } dom0_memory_map_entry_t; -DEFINE_GUEST_HANDLE(dom0_memory_map_entry_t); +DEFINE_XEN_GUEST_HANDLE(dom0_memory_map_entry_t); typedef struct dom0_physical_memory_map { /* IN variables. */ uint32_t max_map_entries; /* OUT variables. */ uint32_t nr_map_entries; - GUEST_HANDLE(dom0_memory_map_entry_t) memory_map; + XEN_GUEST_HANDLE(dom0_memory_map_entry_t) memory_map; } dom0_physical_memory_map_t; -DEFINE_GUEST_HANDLE(dom0_physical_memory_map_t); +DEFINE_XEN_GUEST_HANDLE(dom0_physical_memory_map_t); #define DOM0_MAX_VCPUS 41 typedef struct dom0_max_vcpus { domid_t domain; /* domain to be affected */ uint32_t max; /* maximum number of vcpus */ } dom0_max_vcpus_t; -DEFINE_GUEST_HANDLE(dom0_max_vcpus_t); +DEFINE_XEN_GUEST_HANDLE(dom0_max_vcpus_t); #define DOM0_SETDOMAINHANDLE 44 typedef struct dom0_setdomainhandle { domid_t domain; xen_domain_handle_t handle; } dom0_setdomainhandle_t; -DEFINE_GUEST_HANDLE(dom0_setdomainhandle_t); +DEFINE_XEN_GUEST_HANDLE(dom0_setdomainhandle_t); #define DOM0_SETDEBUGGING 45 typedef struct dom0_setdebugging { domid_t domain; uint8_t enable; } dom0_setdebugging_t; -DEFINE_GUEST_HANDLE(dom0_setdebugging_t); +DEFINE_XEN_GUEST_HANDLE(dom0_setdebugging_t); #define DOM0_IRQ_PERMISSION 46 typedef struct dom0_irq_permission { @@ -454,7 +454,7 @@ uint8_t pirq; uint8_t allow_access; /* flag to specify enable/disable of IRQ access */ } dom0_irq_permission_t; -DEFINE_GUEST_HANDLE(dom0_irq_permission_t); +DEFINE_XEN_GUEST_HANDLE(dom0_irq_permission_t); #define DOM0_IOMEM_PERMISSION 47 typedef struct dom0_iomem_permission { @@ -463,14 +463,14 @@ unsigned long nr_mfns; /* number of pages in range (>0) */ uint8_t allow_access; /* allow (!0) or deny (0) access to range? */ } dom0_iomem_permission_t; -DEFINE_GUEST_HANDLE(dom0_iomem_permission_t); +DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permission_t); #define DOM0_HYPERCALL_INIT 48 typedef struct dom0_hypercall_init { domid_t domain; /* domain to be affected */ unsigned long mfn; /* machine frame to be initialised */ } dom0_hypercall_init_t; -DEFINE_GUEST_HANDLE(dom0_hypercall_init_t); +DEFINE_XEN_GUEST_HANDLE(dom0_hypercall_init_t); typedef struct dom0_op { uint32_t cmd; @@ -516,7 +516,7 @@ uint8_t pad[128]; } u; } dom0_op_t; -DEFINE_GUEST_HANDLE(dom0_op_t); +DEFINE_XEN_GUEST_HANDLE(dom0_op_t); #endif /* __XEN_PUBLIC_DOM0_OPS_H__ */ ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/event_channel.h#2 (text+ko) ==== @@ -10,7 +10,7 @@ #define __XEN_PUBLIC_EVENT_CHANNEL_H__ typedef uint32_t evtchn_port_t; -DEFINE_GUEST_HANDLE(evtchn_port_t); +DEFINE_XEN_GUEST_HANDLE(evtchn_port_t); /* * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as @@ -190,7 +190,7 @@ evtchn_unmask_t unmask; } u; } evtchn_op_t; -DEFINE_GUEST_HANDLE(evtchn_op_t); +DEFINE_XEN_GUEST_HANDLE(evtchn_op_t); #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */ ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/grant_table.h#3 (text+ko) ==== @@ -167,7 +167,7 @@ grant_handle_t handle; uint64_t dev_bus_addr; } gnttab_map_grant_ref_t; -DEFINE_GUEST_HANDLE(gnttab_map_grant_ref_t); +DEFINE_XEN_GUEST_HANDLE(gnttab_map_grant_ref_t); /* * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings @@ -189,7 +189,7 @@ /* OUT parameters. */ int16_t status; /* GNTST_* */ } gnttab_unmap_grant_ref_t; -DEFINE_GUEST_HANDLE(gnttab_unmap_grant_ref_t); +DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_grant_ref_t); /* * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least @@ -207,9 +207,9 @@ uint32_t nr_frames; /* OUT parameters. */ int16_t status; /* GNTST_* */ - GUEST_HANDLE(ulong) frame_list; + XEN_GUEST_HANDLE(ulong) frame_list; } gnttab_setup_table_t; -DEFINE_GUEST_HANDLE(gnttab_setup_table_t); +DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t); /* * GNTTABOP_dump_table: Dump the contents of the grant table to the @@ -222,7 +222,7 @@ /* OUT parameters. */ int16_t status; /* GNTST_* */ } gnttab_dump_table_t; -DEFINE_GUEST_HANDLE(gnttab_dump_table_t); +DEFINE_XEN_GUEST_HANDLE(gnttab_dump_table_t); /* * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The @@ -241,7 +241,7 @@ /* OUT parameters. */ int16_t status; } gnttab_transfer_t; -DEFINE_GUEST_HANDLE(gnttab_transfer_t); +DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_t); /* * Bitfield values for update_pin_status.flags. ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/memory.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT: GMFN bases of extents that were allocated * (NB. This command also updates the mach_to_phys translation table) */ - GUEST_HANDLE(ulong) extent_start; + XEN_GUEST_HANDLE(ulong) extent_start; /* Number of extents, and size/alignment of each (2^extent_order pages). */ unsigned long nr_extents; @@ -50,7 +50,7 @@ domid_t domid; } xen_memory_reservation_t; -DEFINE_GUEST_HANDLE(xen_memory_reservation_t); +DEFINE_XEN_GUEST_HANDLE(xen_memory_reservation_t); /* * Returns the maximum machine frame number of mapped RAM in this system. @@ -86,7 +86,7 @@ * any large discontiguities in the machine address space, 2MB gaps in * the machphys table will be represented by an MFN base of zero. */ - GUEST_HANDLE(ulong) extent_start; + XEN_GUEST_HANDLE(ulong) extent_start; /* * Number of extents written to the above array. This will be smaller @@ -94,7 +94,7 @@ */ unsigned int nr_extents; } xen_machphys_mfn_list_t; -DEFINE_GUEST_HANDLE(xen_machphys_mfn_list_t); +DEFINE_XEN_GUEST_HANDLE(xen_machphys_mfn_list_t); /* * Sets the GPFN at which a particular page appears in the specified guest's @@ -117,7 +117,7 @@ /* GPFN where the source mapping page should appear. */ unsigned long gpfn; } xen_add_to_physmap_t; -DEFINE_GUEST_HANDLE(xen_add_to_physmap_t); +DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t); /* * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error @@ -132,15 +132,15 @@ unsigned long nr_gpfns; /* List of GPFNs to translate. */ - GUEST_HANDLE(ulong) gpfn_list; + XEN_GUEST_HANDLE(ulong) gpfn_list; /* * Output list to contain MFN translations. May be the same as the input * list (in which case each input GPFN is overwritten with the output MFN). */ - GUEST_HANDLE(ulong) mfn_list; + XEN_GUEST_HANDLE(ulong) mfn_list; } xen_translate_gpfn_list_t; -DEFINE_GUEST_HANDLE(xen_translate_gpfn_list_t); +DEFINE_XEN_GUEST_HANDLE(xen_translate_gpfn_list_t); #endif /* __XEN_PUBLIC_MEMORY_H__ */ ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/physdev.h#2 (text+ko) ==== @@ -1,62 +1,160 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ #ifndef __XEN_PUBLIC_PHYSDEV_H__ #define __XEN_PUBLIC_PHYSDEV_H__ -/* Commands to HYPERVISOR_physdev_op() */ -#define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4 -#define PHYSDEVOP_IRQ_STATUS_QUERY 5 -#define PHYSDEVOP_SET_IOPL 6 -#define PHYSDEVOP_SET_IOBITMAP 7 -#define PHYSDEVOP_APIC_READ 8 -#define PHYSDEVOP_APIC_WRITE 9 -#define PHYSDEVOP_ASSIGN_VECTOR 10 +/* + * Prototype for this hypercall is: + * int physdev_op(int cmd, void *args) + * @cmd == PHYSDEVOP_??? (physdev operation). + * @args == Operation-specific extra arguments (NULL if none). + */ + +/* + * Notify end-of-interrupt (EOI) for the specified IRQ. + * @arg == pointer to physdev_eoi structure. + */ +#define PHYSDEVOP_eoi 12 +struct physdev_eoi { + /* IN */ + uint32_t irq; +}; +typedef struct physdev_eoi physdev_eoi_t; +DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t); -typedef struct physdevop_irq_status_query { +/* + * Query the status of an IRQ line. + * @arg == pointer to physdev_irq_status_query structure. + */ +#define PHYSDEVOP_irq_status_query 5 +struct physdev_irq_status_query { /* IN */ uint32_t irq; /* OUT */ -/* Need to call PHYSDEVOP_IRQ_UNMASK_NOTIFY when the IRQ has been serviced? */ -#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY (1<<0) - uint32_t flags; -} physdevop_irq_status_query_t; + uint32_t flags; /* XENIRQSTAT_* */ +}; +typedef struct physdev_irq_status_query physdev_irq_status_query_t; +DEFINE_XEN_GUEST_HANDLE(physdev_irq_status_query_t); + +/* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */ +#define _XENIRQSTAT_needs_eoi (0) +#define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi) + +/* IRQ shared by multiple guests? */ +#define _XENIRQSTAT_shared (1) +#define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared) -typedef struct physdevop_set_iopl { +/* + * Set the current VCPU's I/O privilege level. + * @arg == pointer to physdev_set_iopl structure. + */ +#define PHYSDEVOP_set_iopl 6 +struct physdev_set_iopl { /* IN */ uint32_t iopl; -} physdevop_set_iopl_t; +}; +typedef struct physdev_set_iopl physdev_set_iopl_t; +DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl_t); -typedef struct physdevop_set_iobitmap { +/* + * Set the current VCPU's I/O-port permissions bitmap. + * @arg == pointer to physdev_set_iobitmap structure. + */ +#define PHYSDEVOP_set_iobitmap 7 +struct physdev_set_iobitmap { /* IN */ - uint8_t *bitmap; + XEN_GUEST_HANDLE_00030205(uint8_t) bitmap; uint32_t nr_ports; -} physdevop_set_iobitmap_t; +}; +typedef struct physdev_set_iobitmap physdev_set_iobitmap_t; +DEFINE_XEN_GUEST_HANDLE(physdev_set_iobitmap_t); -typedef struct physdevop_apic { +/* + * Read or write an IO-APIC register. + * @arg == pointer to physdev_apic structure. + */ +#define PHYSDEVOP_apic_read 8 +#define PHYSDEVOP_apic_write 9 +struct physdev_apic { /* IN */ unsigned long apic_physbase; uint32_t reg; /* IN or OUT */ uint32_t value; -} physdevop_apic_t; +}; +typedef struct physdev_apic physdev_apic_t; +DEFINE_XEN_GUEST_HANDLE(physdev_apic_t); -typedef struct physdevop_irq { +/* + * Allocate or free a physical upcall vector for the specified IRQ line. + * @arg == pointer to physdev_irq structure. + */ +#define PHYSDEVOP_alloc_irq_vector 10 +#define PHYSDEVOP_free_irq_vector 11 +struct physdev_irq { /* IN */ uint32_t irq; - /* OUT */ + /* IN or OUT */ uint32_t vector; -} physdevop_irq_t; +}; +typedef struct physdev_irq physdev_irq_t; +DEFINE_XEN_GUEST_HANDLE(physdev_irq_t); -typedef struct physdev_op { +/* + * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() + * hypercall since 0x00030202. + */ +struct physdev_op { uint32_t cmd; union { - physdevop_irq_status_query_t irq_status_query; - physdevop_set_iopl_t set_iopl; - physdevop_set_iobitmap_t set_iobitmap; - physdevop_apic_t apic_op; - physdevop_irq_t irq_op; + struct physdev_irq_status_query irq_status_query; + struct physdev_set_iopl set_iopl; + struct physdev_set_iobitmap set_iobitmap; + struct physdev_apic apic_op; + struct physdev_irq irq_op; } u; -} physdev_op_t; -DEFINE_GUEST_HANDLE(physdev_op_t); +}; +typedef struct physdev_op physdev_op_t; +DEFINE_XEN_GUEST_HANDLE(physdev_op_t); + +/* + * Notify that some PIRQ-bound event channels have been unmasked. + * ** This command is obsolete since interface version 0x00030202 and is ** + * ** unsupported by newer versions of Xen. ** + */ +#define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4 + +/* + * These all-capitals physdev operation names are superceded by the new names + * (defined above) since interface version 0x00030202. + */ +#define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query +#define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl +#define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap +#define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read +#define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write +#define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector +#define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector +#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712290819.lBT8JBTJ081183>