From patchwork Mon Jun 20 12:56:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9187359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 547A36075F for ; Mon, 20 Jun 2016 13:01:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BFB52237D for ; Mon, 20 Jun 2016 13:01:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F3A627813; Mon, 20 Jun 2016 13:01:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 36B892237D for ; Mon, 20 Jun 2016 13:01:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEynO-0007NM-FC; Mon, 20 Jun 2016 12:59:18 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEynN-0007N4-8w for xen-devel@lists.xenproject.org; Mon, 20 Jun 2016 12:59:17 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id F1/6D-02783-4A8E7675; Mon, 20 Jun 2016 12:59:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsXS6fjDS7fvRXq 4wYJdjBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0brzXPMBT3zGSsenZrP3MC4s6qLkZNDSCBP YvfHa0xdjBwcvAJ2EvdeBYKEJQQMJfbNX8UGYrMIqEr0LtrMBGKzCahLtD3bzgpSLiJgIHHua FIXIxcHs8BeJom2aZ9YQOLCAhYSnTN0IabbSby59YEZxOYUsJdYOXkDK8QmQYm/O4RBTGagkp 1bfSYw8sxCSMxCSMwCamUW0JJ4+OsWC4StLbFs4WtmiBJpieX/OCDCBhIr7txix1RiLbH3Av8 CRo5VjOrFqUVlqUW6RnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIFBWs/AwLiD 8VSz8yFGSQ4mJVHe6U/Sw4X4kvJTKjMSizPii0pzUosPMcpwcChJ8Mo+A8oJFqWmp1akZeYA4 wUmLcHBoyTCu/spUJq3uCAxtzgzHSJ1ilFRSpxXBKRPACSRUZoH1waL0UuMslLCvIwMDAxCPA WpRbmZJajyrxjFORiVhHm/gYznycwrgZv+CmgxE9DiZf1gi0sSEVJSDYzL+FVOSQlNu6foGNF g+TWW5VDrM37d/qRlq5lmZbhELbayEPOa2pLw/SlDpdXSSE+tfPfwXZlSvN4tnX2CV8ouSJ7i sxY7yeKrlLeQ05bZ+N1nw7UfRSY0Rhf/l9iQczluvuqvav1lE5yeGz9sD3r/s3xC2FXn6UllX YryGeqejLkmlrvllFiKMxINtZiLihMB06e6NMwCAAA= X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1466427405!29599634!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60070 invoked from network); 20 Jun 2016 12:57:57 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-12.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Jun 2016 12:57:57 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 20 Jun 2016 06:56:45 -0600 Message-Id: <5768042902000078000F6BFA@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Mon, 20 Jun 2016 06:56:41 -0600 From: "Jan Beulich" To: "xen-devel" References: <5768002C02000078000F6B8D@prv-mh.provo.novell.com> In-Reply-To: <5768002C02000078000F6B8D@prv-mh.provo.novell.com> Mime-Version: 1.0 Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Paul Durrant , dgdegra@tycho.nsa.gov Subject: [Xen-devel] [PATCH 08/11] hvmctl: convert HVMOP_inject_trap X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jan Beulich hvmctl: convert HVMOP_inject_trap Signed-off-by: Jan Beulich --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -584,31 +584,15 @@ int xc_hvm_inject_trap( uint32_t type, uint32_t error_code, uint32_t insn_len, uint64_t cr2) { - DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg); - int rc; + DECLARE_HVMCTL(inject_trap, dom, + .vcpuid = vcpu, + .type = type, + .vector = vector, + .insn_len = insn_len, + .error_code = error_code, + .cr2 = cr2); - arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg)); - if ( arg == NULL ) - { - PERROR("Could not allocate memory for xc_hvm_inject_trap hypercall"); - return -1; - } - - arg->domid = dom; - arg->vcpuid = vcpu; - arg->vector = vector; - arg->type = type; - arg->error_code = error_code; - arg->insn_len = insn_len; - arg->cr2 = cr2; - - rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op, - HVMOP_inject_trap, - HYPERCALL_BUFFER_AS_ARG(arg)); - - xc_hypercall_buffer_free(xch, arg); - - return rc; + return do_hvmctl(xch, &hvmctl); } int xc_livepatch_upload(xc_interface *xch, --- a/tools/tests/xen-access/xen-access.c +++ b/tools/tests/xen-access/xen-access.c @@ -41,6 +41,7 @@ #include #include #include +#include #if defined(__arm__) || defined(__aarch64__) #include @@ -643,7 +644,7 @@ int main(int argc, char *argv[]) /* Reinject */ rc = xc_hvm_inject_trap( xch, domain_id, req.vcpu_id, 3, - HVMOP_TRAP_sw_exc, -1, 0, 0); + XEN_HVMCTL_TRAP_sw_exc, -1, 0, 0); if (rc < 0) { ERROR("Error %d injecting breakpoint\n", rc); --- a/xen/arch/x86/hvm/control.c +++ b/xen/arch/x86/hvm/control.c @@ -91,6 +91,32 @@ static int track_dirty_vram(struct domai : hap_track_dirty_vram(d, op->first_gfn, op->nr, op->dirty_bitmap); } +static int inject_trap(struct domain *d, + const struct xen_hvm_inject_trap *op) +{ + struct vcpu *v; + + if ( !is_hvm_domain(d) ) + return -EINVAL; + + if ( op->rsvd8 || op->rsvd32 ) + return -EINVAL; + + if ( op->vcpuid >= d->max_vcpus || (v = d->vcpu[op->vcpuid]) == NULL ) + return -ENOENT; + + if ( v->arch.hvm_vcpu.inject_trap.vector != -1 ) + return -EBUSY; + + v->arch.hvm_vcpu.inject_trap.vector = op->vector; + v->arch.hvm_vcpu.inject_trap.type = op->type; + v->arch.hvm_vcpu.inject_trap.error_code = op->error_code; + v->arch.hvm_vcpu.inject_trap.insn_len = op->insn_len; + v->arch.hvm_vcpu.inject_trap.cr2 = op->cr2; + + return 0; +} + /* * Note that this value is effectively part of the ABI, even if we don't need * to make it a formal part of it. Hence this value may only be changed if @@ -265,6 +291,10 @@ long do_hvmctl(XEN_GUEST_HANDLE_PARAM(xe rc = set_mem_type(d, &op.u.set_mem_type, &iter); break; + case XEN_HVMCTL_inject_trap: + rc = inject_trap(d, &op.u.inject_trap); + break; + default: rc = -EOPNOTSUPP; break; --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5366,48 +5366,6 @@ long do_hvm_op(unsigned long op, XEN_GUE break; } - case HVMOP_inject_trap: - { - xen_hvm_inject_trap_t tr; - struct domain *d; - struct vcpu *v; - - if ( copy_from_guest(&tr, arg, 1 ) ) - return -EFAULT; - - rc = rcu_lock_remote_domain_by_id(tr.domid, &d); - if ( rc != 0 ) - return rc; - - rc = -EINVAL; - if ( !is_hvm_domain(d) ) - goto injtrap_fail; - - rc = xsm_hvm_control(XSM_DM_PRIV, d, op); - if ( rc ) - goto injtrap_fail; - - rc = -ENOENT; - if ( tr.vcpuid >= d->max_vcpus || (v = d->vcpu[tr.vcpuid]) == NULL ) - goto injtrap_fail; - - if ( v->arch.hvm_vcpu.inject_trap.vector != -1 ) - rc = -EBUSY; - else - { - v->arch.hvm_vcpu.inject_trap.vector = tr.vector; - v->arch.hvm_vcpu.inject_trap.type = tr.type; - v->arch.hvm_vcpu.inject_trap.error_code = tr.error_code; - v->arch.hvm_vcpu.inject_trap.insn_len = tr.insn_len; - v->arch.hvm_vcpu.inject_trap.cr2 = tr.cr2; - rc = 0; - } - - injtrap_fail: - rcu_unlock_domain(d); - break; - } - case HVMOP_guest_request_vm_event: if ( guest_handle_is_null(arg) ) vm_event_monitor_guest_request(); --- a/xen/include/public/hvm/control.h +++ b/xen/include/public/hvm/control.h @@ -89,6 +89,37 @@ struct xen_hvm_set_mem_type { uint64_aligned_t first_gfn; }; +/* XEN_HVMCTL_inject_trap */ +/* + * Inject a trap into a VCPU, which will get taken up on the next + * scheduling of it. Note that the caller should know enough of the + * state of the CPU before injecting, to know what the effect of + * injecting the trap will be. + */ +struct xen_hvm_inject_trap { + /* VCPU */ + uint32_t vcpuid; + /* Trap type (XEN_HVMCTL_TRAP_*). */ + uint8_t type; +/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_*. */ +#define XEN_HVMCTL_TRAP_ext_int 0 /* external interrupt */ +#define XEN_HVMCTL_TRAP_nmi 2 /* NMI */ +#define XEN_HVMCTL_TRAP_hw_exc 3 /* hardware exception */ +#define XEN_HVMCTL_TRAP_sw_int 4 /* software interrupt (CD nn) */ +#define XEN_HVMCTL_TRAP_pri_sw_exc 5 /* ICEBP (F1) */ +#define XEN_HVMCTL_TRAP_sw_exc 6 /* INT3 (CC), INTO (CE) */ + /* Vector number. */ + uint8_t vector; + /* Instruction length. */ + uint8_t insn_len; + uint8_t rsvd8; + /* Error code, or ~0u to skip. */ + uint32_t error_code; + uint32_t rsvd32; + /* CR2 for page faults. */ + uint64_aligned_t cr2; +}; + struct xen_hvmctl { uint16_t interface_version; /* XEN_HVMCTL_INTERFACE_VERSION */ domid_t domain; @@ -99,6 +130,7 @@ struct xen_hvmctl { #define XEN_HVMCTL_track_dirty_vram 4 #define XEN_HVMCTL_modified_memory 5 #define XEN_HVMCTL_set_mem_type 6 +#define XEN_HVMCTL_inject_trap 7 uint16_t opaque; /* Must be zero on initial invocation. */ union { struct xen_hvm_set_pci_intx_level set_pci_intx_level; @@ -107,6 +139,7 @@ struct xen_hvmctl { struct xen_hvm_track_dirty_vram track_dirty_vram; struct xen_hvm_modified_memory modified_memory; struct xen_hvm_set_mem_type set_mem_type; + struct xen_hvm_inject_trap inject_trap; uint8_t pad[120]; } u; }; --- a/xen/include/public/hvm/hvm_op.h +++ b/xen/include/public/hvm/hvm_op.h @@ -123,49 +123,6 @@ struct xen_hvm_xentrace { typedef struct xen_hvm_xentrace xen_hvm_xentrace_t; DEFINE_XEN_GUEST_HANDLE(xen_hvm_xentrace_t); -/* Following tools-only interfaces may change in future. */ -#if defined(__XEN__) || defined(__XEN_TOOLS__) - -/* Deprecated by XENMEM_access_op_set_access */ -#define HVMOP_set_mem_access 12 - -/* Deprecated by XENMEM_access_op_get_access */ -#define HVMOP_get_mem_access 13 - -#define HVMOP_inject_trap 14 -/* Inject a trap into a VCPU, which will get taken up on the next - * scheduling of it. Note that the caller should know enough of the - * state of the CPU before injecting, to know what the effect of - * injecting the trap will be. - */ -struct xen_hvm_inject_trap { - /* Domain to be queried. */ - domid_t domid; - /* VCPU */ - uint32_t vcpuid; - /* Vector number */ - uint32_t vector; - /* Trap type (HVMOP_TRAP_*) */ - uint32_t type; -/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */ -# define HVMOP_TRAP_ext_int 0 /* external interrupt */ -# define HVMOP_TRAP_nmi 2 /* nmi */ -# define HVMOP_TRAP_hw_exc 3 /* hardware exception */ -# define HVMOP_TRAP_sw_int 4 /* software interrupt (CD nn) */ -# define HVMOP_TRAP_pri_sw_exc 5 /* ICEBP (F1) */ -# define HVMOP_TRAP_sw_exc 6 /* INT3 (CC), INTO (CE) */ - /* Error code, or ~0u to skip */ - uint32_t error_code; - /* Intruction length */ - uint32_t insn_len; - /* CR2 for page faults */ - uint64_aligned_t cr2; -}; -typedef struct xen_hvm_inject_trap xen_hvm_inject_trap_t; -DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_trap_t); - -#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ - #define HVMOP_get_mem_type 15 /* Return hvmmem_type_t for the specified pfn. */ struct xen_hvm_get_mem_type { --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -273,8 +273,7 @@ class hvm # XEN_HVMCTL_track_dirty_vram trackdirtyvram # XEN_HVMCTL_modified_memory, HVMOP_get_mem_type, XEN_HVMCTL_set_mem_type, -# HVMOP_set_mem_access, HVMOP_get_mem_access, HVMOP_pagetable_dying, -# HVMOP_inject_trap +# HVMOP_pagetable_dying, XEN_HVMCTL_inject_trap hvmctl # XEN_DOMCTL_mem_sharing_op and XENMEM_sharing_op_{share,add_physmap} with: # source = the domain making the hypercall Reviewed-by: Wei Liu --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -584,31 +584,15 @@ int xc_hvm_inject_trap( uint32_t type, uint32_t error_code, uint32_t insn_len, uint64_t cr2) { - DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg); - int rc; + DECLARE_HVMCTL(inject_trap, dom, + .vcpuid = vcpu, + .type = type, + .vector = vector, + .insn_len = insn_len, + .error_code = error_code, + .cr2 = cr2); - arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg)); - if ( arg == NULL ) - { - PERROR("Could not allocate memory for xc_hvm_inject_trap hypercall"); - return -1; - } - - arg->domid = dom; - arg->vcpuid = vcpu; - arg->vector = vector; - arg->type = type; - arg->error_code = error_code; - arg->insn_len = insn_len; - arg->cr2 = cr2; - - rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op, - HVMOP_inject_trap, - HYPERCALL_BUFFER_AS_ARG(arg)); - - xc_hypercall_buffer_free(xch, arg); - - return rc; + return do_hvmctl(xch, &hvmctl); } int xc_livepatch_upload(xc_interface *xch, --- a/tools/tests/xen-access/xen-access.c +++ b/tools/tests/xen-access/xen-access.c @@ -41,6 +41,7 @@ #include #include #include +#include #if defined(__arm__) || defined(__aarch64__) #include @@ -643,7 +644,7 @@ int main(int argc, char *argv[]) /* Reinject */ rc = xc_hvm_inject_trap( xch, domain_id, req.vcpu_id, 3, - HVMOP_TRAP_sw_exc, -1, 0, 0); + XEN_HVMCTL_TRAP_sw_exc, -1, 0, 0); if (rc < 0) { ERROR("Error %d injecting breakpoint\n", rc); --- a/xen/arch/x86/hvm/control.c +++ b/xen/arch/x86/hvm/control.c @@ -91,6 +91,32 @@ static int track_dirty_vram(struct domai : hap_track_dirty_vram(d, op->first_gfn, op->nr, op->dirty_bitmap); } +static int inject_trap(struct domain *d, + const struct xen_hvm_inject_trap *op) +{ + struct vcpu *v; + + if ( !is_hvm_domain(d) ) + return -EINVAL; + + if ( op->rsvd8 || op->rsvd32 ) + return -EINVAL; + + if ( op->vcpuid >= d->max_vcpus || (v = d->vcpu[op->vcpuid]) == NULL ) + return -ENOENT; + + if ( v->arch.hvm_vcpu.inject_trap.vector != -1 ) + return -EBUSY; + + v->arch.hvm_vcpu.inject_trap.vector = op->vector; + v->arch.hvm_vcpu.inject_trap.type = op->type; + v->arch.hvm_vcpu.inject_trap.error_code = op->error_code; + v->arch.hvm_vcpu.inject_trap.insn_len = op->insn_len; + v->arch.hvm_vcpu.inject_trap.cr2 = op->cr2; + + return 0; +} + /* * Note that this value is effectively part of the ABI, even if we don't need * to make it a formal part of it. Hence this value may only be changed if @@ -265,6 +291,10 @@ long do_hvmctl(XEN_GUEST_HANDLE_PARAM(xe rc = set_mem_type(d, &op.u.set_mem_type, &iter); break; + case XEN_HVMCTL_inject_trap: + rc = inject_trap(d, &op.u.inject_trap); + break; + default: rc = -EOPNOTSUPP; break; --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5366,48 +5366,6 @@ long do_hvm_op(unsigned long op, XEN_GUE break; } - case HVMOP_inject_trap: - { - xen_hvm_inject_trap_t tr; - struct domain *d; - struct vcpu *v; - - if ( copy_from_guest(&tr, arg, 1 ) ) - return -EFAULT; - - rc = rcu_lock_remote_domain_by_id(tr.domid, &d); - if ( rc != 0 ) - return rc; - - rc = -EINVAL; - if ( !is_hvm_domain(d) ) - goto injtrap_fail; - - rc = xsm_hvm_control(XSM_DM_PRIV, d, op); - if ( rc ) - goto injtrap_fail; - - rc = -ENOENT; - if ( tr.vcpuid >= d->max_vcpus || (v = d->vcpu[tr.vcpuid]) == NULL ) - goto injtrap_fail; - - if ( v->arch.hvm_vcpu.inject_trap.vector != -1 ) - rc = -EBUSY; - else - { - v->arch.hvm_vcpu.inject_trap.vector = tr.vector; - v->arch.hvm_vcpu.inject_trap.type = tr.type; - v->arch.hvm_vcpu.inject_trap.error_code = tr.error_code; - v->arch.hvm_vcpu.inject_trap.insn_len = tr.insn_len; - v->arch.hvm_vcpu.inject_trap.cr2 = tr.cr2; - rc = 0; - } - - injtrap_fail: - rcu_unlock_domain(d); - break; - } - case HVMOP_guest_request_vm_event: if ( guest_handle_is_null(arg) ) vm_event_monitor_guest_request(); --- a/xen/include/public/hvm/control.h +++ b/xen/include/public/hvm/control.h @@ -89,6 +89,37 @@ struct xen_hvm_set_mem_type { uint64_aligned_t first_gfn; }; +/* XEN_HVMCTL_inject_trap */ +/* + * Inject a trap into a VCPU, which will get taken up on the next + * scheduling of it. Note that the caller should know enough of the + * state of the CPU before injecting, to know what the effect of + * injecting the trap will be. + */ +struct xen_hvm_inject_trap { + /* VCPU */ + uint32_t vcpuid; + /* Trap type (XEN_HVMCTL_TRAP_*). */ + uint8_t type; +/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_*. */ +#define XEN_HVMCTL_TRAP_ext_int 0 /* external interrupt */ +#define XEN_HVMCTL_TRAP_nmi 2 /* NMI */ +#define XEN_HVMCTL_TRAP_hw_exc 3 /* hardware exception */ +#define XEN_HVMCTL_TRAP_sw_int 4 /* software interrupt (CD nn) */ +#define XEN_HVMCTL_TRAP_pri_sw_exc 5 /* ICEBP (F1) */ +#define XEN_HVMCTL_TRAP_sw_exc 6 /* INT3 (CC), INTO (CE) */ + /* Vector number. */ + uint8_t vector; + /* Instruction length. */ + uint8_t insn_len; + uint8_t rsvd8; + /* Error code, or ~0u to skip. */ + uint32_t error_code; + uint32_t rsvd32; + /* CR2 for page faults. */ + uint64_aligned_t cr2; +}; + struct xen_hvmctl { uint16_t interface_version; /* XEN_HVMCTL_INTERFACE_VERSION */ domid_t domain; @@ -99,6 +130,7 @@ struct xen_hvmctl { #define XEN_HVMCTL_track_dirty_vram 4 #define XEN_HVMCTL_modified_memory 5 #define XEN_HVMCTL_set_mem_type 6 +#define XEN_HVMCTL_inject_trap 7 uint16_t opaque; /* Must be zero on initial invocation. */ union { struct xen_hvm_set_pci_intx_level set_pci_intx_level; @@ -107,6 +139,7 @@ struct xen_hvmctl { struct xen_hvm_track_dirty_vram track_dirty_vram; struct xen_hvm_modified_memory modified_memory; struct xen_hvm_set_mem_type set_mem_type; + struct xen_hvm_inject_trap inject_trap; uint8_t pad[120]; } u; }; --- a/xen/include/public/hvm/hvm_op.h +++ b/xen/include/public/hvm/hvm_op.h @@ -123,49 +123,6 @@ struct xen_hvm_xentrace { typedef struct xen_hvm_xentrace xen_hvm_xentrace_t; DEFINE_XEN_GUEST_HANDLE(xen_hvm_xentrace_t); -/* Following tools-only interfaces may change in future. */ -#if defined(__XEN__) || defined(__XEN_TOOLS__) - -/* Deprecated by XENMEM_access_op_set_access */ -#define HVMOP_set_mem_access 12 - -/* Deprecated by XENMEM_access_op_get_access */ -#define HVMOP_get_mem_access 13 - -#define HVMOP_inject_trap 14 -/* Inject a trap into a VCPU, which will get taken up on the next - * scheduling of it. Note that the caller should know enough of the - * state of the CPU before injecting, to know what the effect of - * injecting the trap will be. - */ -struct xen_hvm_inject_trap { - /* Domain to be queried. */ - domid_t domid; - /* VCPU */ - uint32_t vcpuid; - /* Vector number */ - uint32_t vector; - /* Trap type (HVMOP_TRAP_*) */ - uint32_t type; -/* NB. This enumeration precisely matches hvm.h:X86_EVENTTYPE_* */ -# define HVMOP_TRAP_ext_int 0 /* external interrupt */ -# define HVMOP_TRAP_nmi 2 /* nmi */ -# define HVMOP_TRAP_hw_exc 3 /* hardware exception */ -# define HVMOP_TRAP_sw_int 4 /* software interrupt (CD nn) */ -# define HVMOP_TRAP_pri_sw_exc 5 /* ICEBP (F1) */ -# define HVMOP_TRAP_sw_exc 6 /* INT3 (CC), INTO (CE) */ - /* Error code, or ~0u to skip */ - uint32_t error_code; - /* Intruction length */ - uint32_t insn_len; - /* CR2 for page faults */ - uint64_aligned_t cr2; -}; -typedef struct xen_hvm_inject_trap xen_hvm_inject_trap_t; -DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_trap_t); - -#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ - #define HVMOP_get_mem_type 15 /* Return hvmmem_type_t for the specified pfn. */ struct xen_hvm_get_mem_type { --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -273,8 +273,7 @@ class hvm # XEN_HVMCTL_track_dirty_vram trackdirtyvram # XEN_HVMCTL_modified_memory, HVMOP_get_mem_type, XEN_HVMCTL_set_mem_type, -# HVMOP_set_mem_access, HVMOP_get_mem_access, HVMOP_pagetable_dying, -# HVMOP_inject_trap +# HVMOP_pagetable_dying, XEN_HVMCTL_inject_trap hvmctl # XEN_DOMCTL_mem_sharing_op and XENMEM_sharing_op_{share,add_physmap} with: # source = the domain making the hypercall