Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1956d551da2433756e2b94372d3a6181 > files > 451

xen-doc-4.12.1-1.mga7.noarch.rpm

<html><head><title>include/public/hvm/hvm_op.h - arch-x86_64 - Xen public headers</title></head><body><pre>
/*
 * 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.
 *
 * Copyright (c) 2007, Keir Fraser
 */

#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
#define __XEN_PUBLIC_HVM_HVM_OP_H__

#include "../xen.h"
#include "../trace.h"
#include "../event_channel.h"

/* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
#define HVMOP_set_param           0
#define HVMOP_get_param           1
<a  name="Struct_xen_hvm_param"><strong>struct xen_hvm_param</strong></a> {
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a>  domid;    /* IN */
    uint32_t index;    /* IN */
    uint64_t value;    /* IN/OUT */
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_param">struct xen_hvm_param</a> <a  name="Typedef_xen_hvm_param_t"><strong>xen_hvm_param_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_param">xen_hvm_param_t</a>);

<a  name="Struct_xen_hvm_altp2m_suppress_ve"><strong>struct xen_hvm_altp2m_suppress_ve</strong></a> {
    uint16_t view;
    uint8_t suppress_ve; /* Boolean type. */
    uint8_t pad1;
    uint32_t pad2;
    uint64_t gfn;
};

#if __XEN_INTERFACE_VERSION__ &lt; 0x00040900

/* Set the logical level of one of a domain's PCI INTx wires. */
#define HVMOP_set_pci_intx_level  2
<a  name="Struct_xen_hvm_set_pci_intx_level"><strong>struct xen_hvm_set_pci_intx_level</strong></a> {
    /* Domain to be updated. */
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a>  domid;
    /* PCI INTx identification in PCI topology (domain:bus:device:intx). */
    uint8_t  domain, bus, device, intx;
    /* Assertion level (0 = unasserted, 1 = asserted). */
    uint8_t  level;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_pci_intx_level">struct xen_hvm_set_pci_intx_level</a> <a  name="Typedef_xen_hvm_set_pci_intx_level_t"><strong>xen_hvm_set_pci_intx_level_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_pci_intx_level">xen_hvm_set_pci_intx_level_t</a>);

/* Set the logical level of one of a domain's ISA IRQ wires. */
#define HVMOP_set_isa_irq_level   3
<a  name="Struct_xen_hvm_set_isa_irq_level"><strong>struct xen_hvm_set_isa_irq_level</strong></a> {
    /* Domain to be updated. */
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a>  domid;
    /* ISA device identification, by ISA IRQ (0-15). */
    uint8_t  isa_irq;
    /* Assertion level (0 = unasserted, 1 = asserted). */
    uint8_t  level;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_isa_irq_level">struct xen_hvm_set_isa_irq_level</a> <a  name="Typedef_xen_hvm_set_isa_irq_level_t"><strong>xen_hvm_set_isa_irq_level_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_isa_irq_level">xen_hvm_set_isa_irq_level_t</a>);

#define HVMOP_set_pci_link_route  4
<a  name="Struct_xen_hvm_set_pci_link_route"><strong>struct xen_hvm_set_pci_link_route</strong></a> {
    /* Domain to be updated. */
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a>  domid;
    /* PCI link identifier (0-3). */
    uint8_t  link;
    /* ISA IRQ (1-15), or 0 (disable link). */
    uint8_t  isa_irq;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_pci_link_route">struct xen_hvm_set_pci_link_route</a> <a  name="Typedef_xen_hvm_set_pci_link_route_t"><strong>xen_hvm_set_pci_link_route_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_set_pci_link_route">xen_hvm_set_pci_link_route_t</a>);

#endif /* __XEN_INTERFACE_VERSION__ &lt; 0x00040900 */

/* Flushes all VCPU TLBs: @arg must be NULL. */
#define HVMOP_flush_tlbs          5

/*
 * hvmmem_type_t should not be defined when generating the corresponding
 * compat header. This will ensure that the improperly named HVMMEM_(*)
 * values are defined only once.
 */
#ifndef XEN_GENERATING_COMPAT_HEADERS

typedef enum {
    HVMMEM_ram_rw,             /* Normal read/write guest RAM */
    HVMMEM_ram_ro,             /* Read-only; writes are discarded */
    HVMMEM_mmio_dm,            /* Reads and write go to the device model */
#if __XEN_INTERFACE_VERSION__ &lt; 0x00040700
    HVMMEM_mmio_write_dm,      /* Read-only; writes go to the device model */
#else
    HVMMEM_unused,             /* Placeholder; setting memory to this type
                                  will fail for code after 4.7.0 */
#endif
    HVMMEM_ioreq_server        /* Memory type claimed by an ioreq server; type
                                  changes to this value are only allowed after
                                  an ioreq server has claimed its ownership.
                                  Only pages with HVMMEM_ram_rw are allowed to
                                  change to this type; conversely, pages with
                                  this type are only allowed to be changed back
                                  to HVMMEM_ram_rw. */
} hvmmem_type_t;

#endif /* XEN_GENERATING_COMPAT_HEADERS */

/* Hint from PV drivers for pagetable destruction. */
#define HVMOP_pagetable_dying        9
<a  name="Struct_xen_hvm_pagetable_dying"><strong>struct xen_hvm_pagetable_dying</strong></a> {
    /* Domain with a pagetable about to be destroyed. */
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a>  domid;
    uint16_t pad[3]; /* align next field on 8-byte boundary */
    /* guest physical address of the toplevel pagetable dying */
    uint64_t gpa;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_pagetable_dying">struct xen_hvm_pagetable_dying</a> <a  name="Typedef_xen_hvm_pagetable_dying_t"><strong>xen_hvm_pagetable_dying_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_pagetable_dying">xen_hvm_pagetable_dying_t</a>);

/* Get the current Xen time, in nanoseconds since system boot. */
#define HVMOP_get_time              10
<a  name="Struct_xen_hvm_get_time"><strong>struct xen_hvm_get_time</strong></a> {
    uint64_t now;      /* OUT */
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_get_time">struct xen_hvm_get_time</a> <a  name="Typedef_xen_hvm_get_time_t"><strong>xen_hvm_get_time_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_get_time">xen_hvm_get_time_t</a>);

#define HVMOP_xentrace              11
<a  name="Struct_xen_hvm_xentrace"><strong>struct xen_hvm_xentrace</strong></a> {
    uint16_t event, extra_bytes;
    uint8_t extra[TRACE_EXTRA_MAX * sizeof(uint32_t)];
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_xentrace">struct xen_hvm_xentrace</a> <a  name="Typedef_xen_hvm_xentrace_t"><strong>xen_hvm_xentrace_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_xentrace">xen_hvm_xentrace_t</a>);

/* 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

#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */

#define HVMOP_get_mem_type    15
/* Return hvmmem_type_t for the specified pfn. */
<a  name="Struct_xen_hvm_get_mem_type"><strong>struct xen_hvm_get_mem_type</strong></a> {
    /* Domain to be queried. */
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a> domid;
    /* OUT variable. */
    uint16_t mem_type;
    uint16_t pad[2]; /* align next field on 8-byte boundary */
    /* IN variable. */
    uint64_t pfn;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_get_mem_type">struct xen_hvm_get_mem_type</a> <a  name="Typedef_xen_hvm_get_mem_type_t"><strong>xen_hvm_get_mem_type_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_get_mem_type">xen_hvm_get_mem_type_t</a>);

/* Following tools-only interfaces may change in future. */
#if defined(__XEN__) || defined(__XEN_TOOLS__)

/*
 * Definitions relating to DMOP_create_ioreq_server. (Defined here for
 * backwards compatibility).
 */

#define HVM_IOREQSRV_BUFIOREQ_OFF    0
#define HVM_IOREQSRV_BUFIOREQ_LEGACY 1
/*
 * Use this when read_pointer gets updated atomically and
 * the pointer pair gets read atomically:
 */
#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2

#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */

#if defined(__i386__) || defined(__x86_64__)

/*
 * HVMOP_set_evtchn_upcall_vector: Set a &lt;vector&gt; that should be used for event
 *                                 channel upcalls on the specified &lt;vcpu&gt;. If set,
 *                                 this vector will be used in preference to the
 *                                 domain global callback via (see
 *                                 HVM_PARAM_CALLBACK_IRQ).
 */
#define HVMOP_set_evtchn_upcall_vector 23
<a  name="Struct_xen_hvm_evtchn_upcall_vector"><strong>struct xen_hvm_evtchn_upcall_vector</strong></a> {
    uint32_t vcpu;
    uint8_t vector;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_evtchn_upcall_vector">struct xen_hvm_evtchn_upcall_vector</a> <a  name="Typedef_xen_hvm_evtchn_upcall_vector_t"><strong>xen_hvm_evtchn_upcall_vector_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_evtchn_upcall_vector">xen_hvm_evtchn_upcall_vector_t</a>);

#endif /* defined(__i386__) || defined(__x86_64__) */

#define HVMOP_guest_request_vm_event 24

/* HVMOP_altp2m: perform altp2m state operations */
#define HVMOP_altp2m 25

#define HVMOP_ALTP2M_INTERFACE_VERSION 0x00000001

<a  name="Struct_xen_hvm_altp2m_domain_state"><strong>struct xen_hvm_altp2m_domain_state</strong></a> {
    /* IN or OUT variable on/off */
    uint8_t state;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_domain_state">struct xen_hvm_altp2m_domain_state</a> <a  name="Typedef_xen_hvm_altp2m_domain_state_t"><strong>xen_hvm_altp2m_domain_state_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_domain_state">xen_hvm_altp2m_domain_state_t</a>);

<a  name="Struct_xen_hvm_altp2m_vcpu_enable_notify"><strong>struct xen_hvm_altp2m_vcpu_enable_notify</strong></a> {
    uint32_t vcpu_id;
    uint32_t pad;
    /* #VE info area gfn */
    uint64_t gfn;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_enable_notify">struct xen_hvm_altp2m_vcpu_enable_notify</a> <a  name="Typedef_xen_hvm_altp2m_vcpu_enable_notify_t"><strong>xen_hvm_altp2m_vcpu_enable_notify_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_enable_notify">xen_hvm_altp2m_vcpu_enable_notify_t</a>);

<a  name="Struct_xen_hvm_altp2m_vcpu_disable_notify"><strong>struct xen_hvm_altp2m_vcpu_disable_notify</strong></a> {
    uint32_t vcpu_id;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_disable_notify">struct xen_hvm_altp2m_vcpu_disable_notify</a> <a  name="Typedef_xen_hvm_altp2m_vcpu_disable_notify_t"><strong>xen_hvm_altp2m_vcpu_disable_notify_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_disable_notify">xen_hvm_altp2m_vcpu_disable_notify_t</a>);

<a  name="Struct_xen_hvm_altp2m_view"><strong>struct xen_hvm_altp2m_view</strong></a> {
    /* IN/OUT variable */
    uint16_t view;
    /* Create view only: default access type
     * NOTE: currently ignored */
    uint16_t hvmmem_default_access; /* xenmem_access_t */
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_view">struct xen_hvm_altp2m_view</a> <a  name="Typedef_xen_hvm_altp2m_view_t"><strong>xen_hvm_altp2m_view_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_view">xen_hvm_altp2m_view_t</a>);

#if __XEN_INTERFACE_VERSION__ &lt; 0x00040a00
<a  name="Struct_xen_hvm_altp2m_set_mem_access"><strong>struct xen_hvm_altp2m_set_mem_access</strong></a> {
    /* view */
    uint16_t view;
    /* Memory type */
    uint16_t access; /* xenmem_access_t */
    uint32_t pad;
    /* gfn */
    uint64_t gfn;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_set_mem_access">struct xen_hvm_altp2m_set_mem_access</a> <a  name="Typedef_xen_hvm_altp2m_set_mem_access_t"><strong>xen_hvm_altp2m_set_mem_access_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_set_mem_access">xen_hvm_altp2m_set_mem_access_t</a>);
#endif /* __XEN_INTERFACE_VERSION__ &lt; 0x00040a00 */

<a  name="Struct_xen_hvm_altp2m_mem_access"><strong>struct xen_hvm_altp2m_mem_access</strong></a> {
    /* view */
    uint16_t view;
    /* Memory type */
    uint16_t access; /* xenmem_access_t */
    uint32_t pad;
    /* gfn */
    uint64_t gfn;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_mem_access">struct xen_hvm_altp2m_mem_access</a> <a  name="Typedef_xen_hvm_altp2m_mem_access_t"><strong>xen_hvm_altp2m_mem_access_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_mem_access">xen_hvm_altp2m_mem_access_t</a>);

<a  name="Struct_xen_hvm_altp2m_set_mem_access_multi"><strong>struct xen_hvm_altp2m_set_mem_access_multi</strong></a> {
    /* view */
    uint16_t view;
    uint16_t pad;
    /* Number of pages */
    uint32_t nr;
    /*
     * Used for continuation purposes.
     * Must be set to zero upon initial invocation.
     */
    uint64_t opaque;
    /* List of pfns to set access for */
    XEN_GUEST_HANDLE(const_uint64) pfn_list;
    /* Corresponding list of access settings for pfn_list */
    XEN_GUEST_HANDLE(const_uint8) access_list;
};

<a  name="Struct_xen_hvm_altp2m_change_gfn"><strong>struct xen_hvm_altp2m_change_gfn</strong></a> {
    /* view */
    uint16_t view;
    uint16_t pad1;
    uint32_t pad2;
    /* old gfn */
    uint64_t old_gfn;
    /* new gfn, INVALID_GFN (~0UL) means revert */
    uint64_t new_gfn;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_change_gfn">struct xen_hvm_altp2m_change_gfn</a> <a  name="Typedef_xen_hvm_altp2m_change_gfn_t"><strong>xen_hvm_altp2m_change_gfn_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_change_gfn">xen_hvm_altp2m_change_gfn_t</a>);

<a  name="Struct_xen_hvm_altp2m_op"><strong>struct xen_hvm_altp2m_op</strong></a> {
    uint32_t version;   /* HVMOP_ALTP2M_INTERFACE_VERSION */
    uint32_t cmd;
/* Get/set the altp2m state for a domain */
#define HVMOP_altp2m_get_domain_state     1
#define HVMOP_altp2m_set_domain_state     2
/* Set a given VCPU to receive altp2m event notifications */
#define HVMOP_altp2m_vcpu_enable_notify   3
/* Create a new view */
#define HVMOP_altp2m_create_p2m           4
/* Destroy a view */
#define HVMOP_altp2m_destroy_p2m          5
/* Switch view for an entire domain */
#define HVMOP_altp2m_switch_p2m           6
/* Notify that a page of memory is to have specific access types */
#define HVMOP_altp2m_set_mem_access       7
/* Change a p2m entry to have a different gfn-&gt;mfn mapping */
#define HVMOP_altp2m_change_gfn           8
/* Set access for an array of pages */
#define HVMOP_altp2m_set_mem_access_multi 9
/* Set the "Suppress #VE" bit on a page */
#define HVMOP_altp2m_set_suppress_ve      10
/* Get the "Suppress #VE" bit of a page */
#define HVMOP_altp2m_get_suppress_ve      11
/* Get the access of a page of memory from a certain view */
#define HVMOP_altp2m_get_mem_access       12
/* Disable altp2m event notifications for a given VCPU */
#define HVMOP_altp2m_vcpu_disable_notify  13
    <a href="include,public,xen.h.html#Typedef_domid_t">domid_t</a> domain;
    uint16_t pad1;
    uint32_t pad2;
    union {
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_domain_state">struct xen_hvm_altp2m_domain_state</a>         domain_state;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_enable_notify">struct xen_hvm_altp2m_vcpu_enable_notify</a>   enable_notify;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_view">struct xen_hvm_altp2m_view</a>                 view;
#if __XEN_INTERFACE_VERSION__ &lt; 0x00040a00
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_set_mem_access">struct xen_hvm_altp2m_set_mem_access</a>       set_mem_access;
#endif /* __XEN_INTERFACE_VERSION__ &lt; 0x00040a00 */
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_mem_access">struct xen_hvm_altp2m_mem_access</a>           mem_access;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_change_gfn">struct xen_hvm_altp2m_change_gfn</a>           change_gfn;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_set_mem_access_multi">struct xen_hvm_altp2m_set_mem_access_multi</a> set_mem_access_multi;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_suppress_ve">struct xen_hvm_altp2m_suppress_ve</a>          suppress_ve;
        <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_vcpu_disable_notify">struct xen_hvm_altp2m_vcpu_disable_notify</a>  disable_notify;
        uint8_t pad[64];
    } u;
};
typedef <a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_op">struct xen_hvm_altp2m_op</a> <a  name="Typedef_xen_hvm_altp2m_op_t"><strong>xen_hvm_altp2m_op_t</strong></a>;
DEFINE_XEN_GUEST_HANDLE(<a href="include,public,hvm,hvm_op.h.html#Struct_xen_hvm_altp2m_op">xen_hvm_altp2m_op_t</a>);

#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */
</pre></body></html>