From nobody Wed Apr 10 15:19:04 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VF61N55Qzz5HHK3; Wed, 10 Apr 2024 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VF61N2gC6z4mcC; Wed, 10 Apr 2024 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712762344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwIYjPUEtKoGYAM/QS2DEbGKkkfR+v9iU8MrqZvqI6Y=; b=nGov2HipWfxFLt+L8AjskZIPwAjIxwGjyhko2R2z5kjQXummULuSiOLbDAg5z2QT7IijTu euVClMNbpB95cfX1XeyBgZ19BcgrVgMF8ezCaWonKjtQkXdAZArni9QqoYRGOoPXnH2huC RGQ0l/mLYyuUla3LqAYwys2i1JDucDeLcMxt78NBuHIJRLOy/ZuU2pK+ajuzuk6mihgAml R5B0znPXEhN6b6F3WGgGLLL5JBId8EZxvHYGGt/xLDmvvpIesgCQOlifXoJIyEhCMTLTHX h2ragvnpGOUAWczl1GB82V3utqp5cCeNT4cwMgRm0ndJvwkegp1mMyxV9sqaVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712762344; a=rsa-sha256; cv=none; b=nSTPCc8AvDitEgP6El3/Z4MzkyVesy0HPGefB341qUxGVDvojUw+NamCq/cIk9jjcurOfh c9ipbnAP9xmGsjjcd5O9cnWSG12ZialU7H7BD8w8jsWh/UJtZOlytkOPoo7z3wRKWSmqzJ XjKGpOMYfHHTCTS4zWTPoBQ9oV9DDrBafe4qbQh+1t7Y9D+yYS56ehnthF3O97+tCOUxBR 30s3ZfuFVwShwRVlWkp+LOH2jXdrdIm+J//8dagUKltDkhEuMak5M56l/SJ9KkPccAun4o 8HLIQIghSqN+98vk0ivPh65Atd0e7XV5xn5L3XUWUhB8X71LzIif4KTrNqMryw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712762344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwIYjPUEtKoGYAM/QS2DEbGKkkfR+v9iU8MrqZvqI6Y=; b=Tq9DE6/Twh3dxJ5WLTlokAWUbmpKa41/mIVGvgV3IuDnD2Bglw2mCEkAFeja9nRR7oAOf/ 08bcvDlKpPWF72BEsuEVUcgWgJb2SM6VZ03OY/sFCz/bOp/A+T2sjzVHjLtiHEExO+kUxl Q9BBep5JYBRyqAkOcvBIGJdggpgGx60OsnPUdxzJ/FZYFHSwjp2CgjsCBHhptrlJhYOEFr 9QNWupqLqpkGuhJgepNiDCO2E0zyJ2qJ4/XLzpylrjmh/jepFTMVWPZuVf4+8/qHkeF1oO N5O0iY3yvingY4T5VPvSW/CcGpdE1Ro0BSn2rDY0IMhgHOb0/pDIJAoFUosUwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VF61N1nRYzj7G; Wed, 10 Apr 2024 15:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43AFJ4PX092742; Wed, 10 Apr 2024 15:19:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43AFJ4xJ092739; Wed, 10 Apr 2024 15:19:04 GMT (envelope-from git) Date: Wed, 10 Apr 2024 15:19:04 GMT Message-Id: <202404101519.43AFJ4xJ092739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e4656e10d131 - main - libvmmapi: Move some ioctl wrappers to vmmapi_machdep.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: dev-commits-src-main+owner@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4656e10d13190d3149e3bb60e01c50f1c210885 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e4656e10d13190d3149e3bb60e01c50f1c210885 commit e4656e10d13190d3149e3bb60e01c50f1c210885 Author: Mark Johnston AuthorDate: 2024-04-03 16:52:25 +0000 Commit: Mark Johnston CommitDate: 2024-04-10 15:17:55 +0000 libvmmapi: Move some ioctl wrappers to vmmapi_machdep.c ioctls relating to segments and various x86-specific interrupt controllers are easy candidates to move to vmmapi_machdep.c. In vmmapi.h I'm just ifdefing MD prototypes for now. We could instead split vmmapi.h into multiple headers, e.g., vmmapi.h and vmmapi_machdep.h, but it's not obvious to me yet that that's the right approach. No functional change intended. Reviewed by: corvink, jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40999 --- lib/libvmmapi/amd64/vmmapi_machdep.c | 195 +++++++++++++++++++++++++++++++++ lib/libvmmapi/internal.h | 12 ++- lib/libvmmapi/vmmapi.c | 201 +---------------------------------- lib/libvmmapi/vmmapi.h | 8 +- 4 files changed, 213 insertions(+), 203 deletions(-) diff --git a/lib/libvmmapi/amd64/vmmapi_machdep.c b/lib/libvmmapi/amd64/vmmapi_machdep.c index e0b592a29b35..5ed198d7b76a 100644 --- a/lib/libvmmapi/amd64/vmmapi_machdep.c +++ b/lib/libvmmapi/amd64/vmmapi_machdep.c @@ -26,11 +26,206 @@ * SUCH DAMAGE. */ +#include +#include + #include +#include + +#include #include "vmmapi.h" #include "internal.h" +int +vm_set_desc(struct vcpu *vcpu, int reg, + uint64_t base, uint32_t limit, uint32_t access) +{ + int error; + struct vm_seg_desc vmsegdesc; + + bzero(&vmsegdesc, sizeof(vmsegdesc)); + vmsegdesc.regnum = reg; + vmsegdesc.desc.base = base; + vmsegdesc.desc.limit = limit; + vmsegdesc.desc.access = access; + + error = vcpu_ioctl(vcpu, VM_SET_SEGMENT_DESCRIPTOR, &vmsegdesc); + return (error); +} + +int +vm_get_desc(struct vcpu *vcpu, int reg, uint64_t *base, uint32_t *limit, + uint32_t *access) +{ + int error; + struct vm_seg_desc vmsegdesc; + + bzero(&vmsegdesc, sizeof(vmsegdesc)); + vmsegdesc.regnum = reg; + + error = vcpu_ioctl(vcpu, VM_GET_SEGMENT_DESCRIPTOR, &vmsegdesc); + if (error == 0) { + *base = vmsegdesc.desc.base; + *limit = vmsegdesc.desc.limit; + *access = vmsegdesc.desc.access; + } + return (error); +} + +int +vm_get_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *seg_desc) +{ + int error; + + error = vm_get_desc(vcpu, reg, &seg_desc->base, &seg_desc->limit, + &seg_desc->access); + return (error); +} + +int +vm_lapic_irq(struct vcpu *vcpu, int vector) +{ + struct vm_lapic_irq vmirq; + + bzero(&vmirq, sizeof(vmirq)); + vmirq.vector = vector; + + return (vcpu_ioctl(vcpu, VM_LAPIC_IRQ, &vmirq)); +} + +int +vm_lapic_local_irq(struct vcpu *vcpu, int vector) +{ + struct vm_lapic_irq vmirq; + + bzero(&vmirq, sizeof(vmirq)); + vmirq.vector = vector; + + return (vcpu_ioctl(vcpu, VM_LAPIC_LOCAL_IRQ, &vmirq)); +} + +int +vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) +{ + struct vm_lapic_msi vmmsi; + + bzero(&vmmsi, sizeof(vmmsi)); + vmmsi.addr = addr; + vmmsi.msg = msg; + + return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi)); +} + +int +vm_apicid2vcpu(struct vmctx *ctx __unused, int apicid) +{ + /* + * The apic id associated with the 'vcpu' has the same numerical value + * as the 'vcpu' itself. + */ + return (apicid); +} + +int +vm_ioapic_assert_irq(struct vmctx *ctx, int irq) +{ + struct vm_ioapic_irq ioapic_irq; + + bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); + ioapic_irq.irq = irq; + + return (ioctl(ctx->fd, VM_IOAPIC_ASSERT_IRQ, &ioapic_irq)); +} + +int +vm_ioapic_deassert_irq(struct vmctx *ctx, int irq) +{ + struct vm_ioapic_irq ioapic_irq; + + bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); + ioapic_irq.irq = irq; + + return (ioctl(ctx->fd, VM_IOAPIC_DEASSERT_IRQ, &ioapic_irq)); +} + +int +vm_ioapic_pulse_irq(struct vmctx *ctx, int irq) +{ + struct vm_ioapic_irq ioapic_irq; + + bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); + ioapic_irq.irq = irq; + + return (ioctl(ctx->fd, VM_IOAPIC_PULSE_IRQ, &ioapic_irq)); +} + +int +vm_ioapic_pincount(struct vmctx *ctx, int *pincount) +{ + + return (ioctl(ctx->fd, VM_IOAPIC_PINCOUNT, pincount)); +} + +int +vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_ASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq)); +} + +int +vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, + enum vm_intr_trigger trigger) +{ + struct vm_isa_irq_trigger isa_irq_trigger; + + bzero(&isa_irq_trigger, sizeof(struct vm_isa_irq_trigger)); + isa_irq_trigger.atpic_irq = atpic_irq; + isa_irq_trigger.trigger = trigger; + + return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger)); +} + +int +vm_inject_nmi(struct vcpu *vcpu) +{ + struct vm_nmi vmnmi; + + bzero(&vmnmi, sizeof(vmnmi)); + + return (vcpu_ioctl(vcpu, VM_INJECT_NMI, &vmnmi)); +} + /* * From Intel Vol 3a: * Table 9-1. IA-32 Processor States Following Power-up, Reset or INIT diff --git a/lib/libvmmapi/internal.h b/lib/libvmmapi/internal.h index 142026e76345..e312e21958ca 100644 --- a/lib/libvmmapi/internal.h +++ b/lib/libvmmapi/internal.h @@ -7,11 +7,21 @@ #ifndef __VMMAPI_INTERNAL_H__ #define __VMMAPI_INTERNAL_H__ -struct vmctx; +struct vmctx { + int fd; + uint32_t lowmem_limit; + int memflags; + size_t lowmem; + size_t highmem; + char *baseaddr; + char *name; +}; struct vcpu { struct vmctx *ctx; int vcpuid; }; +int vcpu_ioctl(struct vcpu *vcpu, u_long cmd, void *arg); + #endif /* !__VMMAPI_INTERNAL_H__ */ diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 5f812bcc832b..2401f7cd2428 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -69,16 +69,6 @@ #define PROT_RW (PROT_READ | PROT_WRITE) #define PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) -struct vmctx { - int fd; - uint32_t lowmem_limit; - int memflags; - size_t lowmem; - size_t highmem; - char *baseaddr; - char *name; -}; - #define CREATE(x) sysctlbyname("hw.vmm.create", NULL, NULL, (x), strlen((x))) #define DESTROY(x) sysctlbyname("hw.vmm.destroy", NULL, NULL, (x), strlen((x))) @@ -594,7 +584,7 @@ done: return (ptr); } -static int +int vcpu_ioctl(struct vcpu *vcpu, u_long cmd, void *arg) { /* @@ -606,52 +596,6 @@ vcpu_ioctl(struct vcpu *vcpu, u_long cmd, void *arg) return (ioctl(vcpu->ctx->fd, cmd, arg)); } -int -vm_set_desc(struct vcpu *vcpu, int reg, - uint64_t base, uint32_t limit, uint32_t access) -{ - int error; - struct vm_seg_desc vmsegdesc; - - bzero(&vmsegdesc, sizeof(vmsegdesc)); - vmsegdesc.regnum = reg; - vmsegdesc.desc.base = base; - vmsegdesc.desc.limit = limit; - vmsegdesc.desc.access = access; - - error = vcpu_ioctl(vcpu, VM_SET_SEGMENT_DESCRIPTOR, &vmsegdesc); - return (error); -} - -int -vm_get_desc(struct vcpu *vcpu, int reg, uint64_t *base, uint32_t *limit, - uint32_t *access) -{ - int error; - struct vm_seg_desc vmsegdesc; - - bzero(&vmsegdesc, sizeof(vmsegdesc)); - vmsegdesc.regnum = reg; - - error = vcpu_ioctl(vcpu, VM_GET_SEGMENT_DESCRIPTOR, &vmsegdesc); - if (error == 0) { - *base = vmsegdesc.desc.base; - *limit = vmsegdesc.desc.limit; - *access = vmsegdesc.desc.access; - } - return (error); -} - -int -vm_get_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *seg_desc) -{ - int error; - - error = vm_get_desc(vcpu, reg, &seg_desc->base, &seg_desc->limit, - &seg_desc->access); - return (error); -} - int vm_set_register(struct vcpu *vcpu, int reg, uint64_t val) { @@ -749,90 +693,6 @@ vm_inject_exception(struct vcpu *vcpu, int vector, int errcode_valid, return (vcpu_ioctl(vcpu, VM_INJECT_EXCEPTION, &exc)); } -int -vm_apicid2vcpu(struct vmctx *ctx __unused, int apicid) -{ - /* - * The apic id associated with the 'vcpu' has the same numerical value - * as the 'vcpu' itself. - */ - return (apicid); -} - -int -vm_lapic_irq(struct vcpu *vcpu, int vector) -{ - struct vm_lapic_irq vmirq; - - bzero(&vmirq, sizeof(vmirq)); - vmirq.vector = vector; - - return (vcpu_ioctl(vcpu, VM_LAPIC_IRQ, &vmirq)); -} - -int -vm_lapic_local_irq(struct vcpu *vcpu, int vector) -{ - struct vm_lapic_irq vmirq; - - bzero(&vmirq, sizeof(vmirq)); - vmirq.vector = vector; - - return (vcpu_ioctl(vcpu, VM_LAPIC_LOCAL_IRQ, &vmirq)); -} - -int -vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) -{ - struct vm_lapic_msi vmmsi; - - bzero(&vmmsi, sizeof(vmmsi)); - vmmsi.addr = addr; - vmmsi.msg = msg; - - return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi)); -} - -int -vm_ioapic_assert_irq(struct vmctx *ctx, int irq) -{ - struct vm_ioapic_irq ioapic_irq; - - bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); - ioapic_irq.irq = irq; - - return (ioctl(ctx->fd, VM_IOAPIC_ASSERT_IRQ, &ioapic_irq)); -} - -int -vm_ioapic_deassert_irq(struct vmctx *ctx, int irq) -{ - struct vm_ioapic_irq ioapic_irq; - - bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); - ioapic_irq.irq = irq; - - return (ioctl(ctx->fd, VM_IOAPIC_DEASSERT_IRQ, &ioapic_irq)); -} - -int -vm_ioapic_pulse_irq(struct vmctx *ctx, int irq) -{ - struct vm_ioapic_irq ioapic_irq; - - bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq)); - ioapic_irq.irq = irq; - - return (ioctl(ctx->fd, VM_IOAPIC_PULSE_IRQ, &ioapic_irq)); -} - -int -vm_ioapic_pincount(struct vmctx *ctx, int *pincount) -{ - - return (ioctl(ctx->fd, VM_IOAPIC_PINCOUNT, pincount)); -} - int vm_readwrite_kernemu_device(struct vcpu *vcpu, vm_paddr_t gpa, bool write, int size, uint64_t *value) @@ -851,65 +711,6 @@ vm_readwrite_kernemu_device(struct vcpu *vcpu, vm_paddr_t gpa, return (rc); } -int -vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) -{ - struct vm_isa_irq isa_irq; - - bzero(&isa_irq, sizeof(struct vm_isa_irq)); - isa_irq.atpic_irq = atpic_irq; - isa_irq.ioapic_irq = ioapic_irq; - - return (ioctl(ctx->fd, VM_ISA_ASSERT_IRQ, &isa_irq)); -} - -int -vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) -{ - struct vm_isa_irq isa_irq; - - bzero(&isa_irq, sizeof(struct vm_isa_irq)); - isa_irq.atpic_irq = atpic_irq; - isa_irq.ioapic_irq = ioapic_irq; - - return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq)); -} - -int -vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) -{ - struct vm_isa_irq isa_irq; - - bzero(&isa_irq, sizeof(struct vm_isa_irq)); - isa_irq.atpic_irq = atpic_irq; - isa_irq.ioapic_irq = ioapic_irq; - - return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq)); -} - -int -vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, - enum vm_intr_trigger trigger) -{ - struct vm_isa_irq_trigger isa_irq_trigger; - - bzero(&isa_irq_trigger, sizeof(struct vm_isa_irq_trigger)); - isa_irq_trigger.atpic_irq = atpic_irq; - isa_irq_trigger.trigger = trigger; - - return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger)); -} - -int -vm_inject_nmi(struct vcpu *vcpu) -{ - struct vm_nmi vmnmi; - - bzero(&vmnmi, sizeof(vmnmi)); - - return (vcpu_ioctl(vcpu, VM_INJECT_NMI, &vmnmi)); -} - static const char *capstrmap[] = { [VM_CAP_HALT_EXIT] = "hlt_exit", [VM_CAP_MTRAP_EXIT] = "mtrap_exit", diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index 8c96bbcb1131..c38e1fca810a 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -141,11 +141,13 @@ int vm_get_memflags(struct vmctx *ctx); const char *vm_get_name(struct vmctx *ctx); size_t vm_get_lowmem_size(struct vmctx *ctx); size_t vm_get_highmem_size(struct vmctx *ctx); +#ifdef __amd64__ int vm_set_desc(struct vcpu *vcpu, int reg, uint64_t base, uint32_t limit, uint32_t access); int vm_get_desc(struct vcpu *vcpu, int reg, uint64_t *base, uint32_t *limit, uint32_t *access); int vm_get_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *seg_desc); +#endif int vm_set_register(struct vcpu *vcpu, int reg, uint64_t val); int vm_get_register(struct vcpu *vcpu, int reg, uint64_t *retval); int vm_set_register_set(struct vcpu *vcpu, unsigned int count, @@ -158,6 +160,7 @@ int vm_reinit(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vcpu *vcpu, int vector, int errcode_valid, uint32_t errcode, int restart_instruction); +#ifdef __amd64__ int vm_lapic_irq(struct vcpu *vcpu, int vector); int vm_lapic_local_irq(struct vcpu *vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); @@ -165,14 +168,15 @@ int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); -int vm_readwrite_kernemu_device(struct vcpu *vcpu, - vm_paddr_t gpa, bool write, int size, uint64_t *value); int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, enum vm_intr_trigger trigger); int vm_inject_nmi(struct vcpu *vcpu); +#endif +int vm_readwrite_kernemu_device(struct vcpu *vcpu, + vm_paddr_t gpa, bool write, int size, uint64_t *value); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); int vm_get_capability(struct vcpu *vcpu, enum vm_cap_type cap,