i386/xen: add monitor commands to test event injection

Specifically add listing, injection of event channels.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
Joao Martins
2018-08-21 12:16:19 -04:00
committed by David Woodhouse
parent a15b10978f
commit 507cb64d6e
7 changed files with 320 additions and 0 deletions

View File

@@ -380,3 +380,119 @@
#
##
{ 'command': 'query-sgx-capabilities', 'returns': 'SGXInfo', 'if': 'TARGET_I386' }
##
# @EvtchnPortType:
#
# An enumeration of Xen event channel port types.
#
# @closed: The port is unused.
#
# @unbound: The port is allocated and ready to be bound.
#
# @interdomain: The port is connected as an interdomain interrupt.
#
# @pirq: The port is bound to a physical IRQ (PIRQ).
#
# @virq: The port is bound to a virtual IRQ (VIRQ).
#
# @ipi: The post is an inter-processor interrupt (IPI).
#
# Since: 8.0
##
{ 'enum': 'EvtchnPortType',
'data': ['closed', 'unbound', 'interdomain', 'pirq', 'virq', 'ipi'],
'if': 'TARGET_I386' }
##
# @EvtchnInfo:
#
# Information about a Xen event channel port
#
# @port: the port number
#
# @vcpu: target vCPU for this port
#
# @type: the port type
#
# @remote-domain: remote domain for interdomain ports
#
# @target: remote port ID, or virq/pirq number
#
# @pending: port is currently active pending delivery
#
# @masked: port is masked
#
# Since: 8.0
##
{ 'struct': 'EvtchnInfo',
'data': {'port': 'uint16',
'vcpu': 'uint32',
'type': 'EvtchnPortType',
'remote-domain': 'str',
'target': 'uint16',
'pending': 'bool',
'masked': 'bool'},
'if': 'TARGET_I386' }
##
# @xen-event-list:
#
# Query the Xen event channels opened by the guest.
#
# Returns: list of open event channel ports.
#
# Since: 8.0
#
# Example:
#
# -> { "execute": "xen-event-list" }
# <- { "return": [
# {
# "pending": false,
# "port": 1,
# "vcpu": 1,
# "remote-domain": "qemu",
# "masked": false,
# "type": "interdomain",
# "target": 1
# },
# {
# "pending": false,
# "port": 2,
# "vcpu": 0,
# "remote-domain": "",
# "masked": false,
# "type": "virq",
# "target": 0
# }
# ]
# }
#
##
{ 'command': 'xen-event-list',
'returns': ['EvtchnInfo'],
'if': 'TARGET_I386' }
##
# @xen-event-inject:
#
# Inject a Xen event channel port (interrupt) to the guest.
#
# @port: The port number
#
# Returns: - Nothing on success.
#
# Since: 8.0
#
# Example:
#
# -> { "execute": "xen-event-inject", "arguments": { "port": 1 } }
# <- { "return": { } }
#
##
{ 'command': 'xen-event-inject',
'data': { 'port': 'uint32' },
'if': 'TARGET_I386' }