From nobody Tue Jun 04 20:06:33 2024 X-Original-To: dev-commits-src-all@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 4Vv1nj2qs6z5MQ7F; Tue, 04 Jun 2024 20:06:33 +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 4Vv1nj1P7wz4fpD; Tue, 4 Jun 2024 20:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717531593; 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=PlShY+XOC/8ag/YhFR0QU9oOVez7uBD1fcuTQn29xok=; b=MnLZn1i0Z3uiE12aeMZS0dHNrLImR8UnPJYFzpOP5dWhQ9Fg7FXXcHqVtsrSkQI8PSX57Z xXGmBzB2bq68cPe4eo/p/DzjjvEimrFNLPF362QOC9p+WY86KprdC3m+cVJN4JBOyD1YAs xvXcp67tYs2nyNh2S89laAvCYYdd1qxqASmNMxjDGHl5RX+ignyUGla+td1dKBheqFdZU/ xmpkB4hvPvcCAZhIWqjCA8E+TeZshxUbtid7LD6Q7AOx1ZA2+gndlSo2/6o+m1puCTWVpr QEgbpgKDhccArHehKy2S6CRQipyGzMGtS7Ls+DxTu9MeHI1I47IjEmJBrFGiOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717531593; a=rsa-sha256; cv=none; b=QAwT1u2Q6+w3cOh2fljF6zXjT5JfN0vfS9k+1JeD6YZCfyA2iRPcOX7AxP6wygl9JBHKpw ftgulJAuMzI9PjN4gvecjcsZTCFxeBkXMnTrIqBRwoXoAzQ2fIybJDFmGsLPKPfI46B2E8 EqZVulkMDSL67OxgCSsAD1LYHrMadtiGCVlX0esu0B8AgnWLqcnGSoqSCXbuJDN4chMm0D GZKpoT10mVlxAz72hgCyW26gbx/9Yievaa60Xm4fu85ld7GcVpKmzilIMpIGYXXVQuO4WZ DuSv4hN3XMXqY/8ay3nLL+jByVbSp0vcEGXe4xWfSFc1Ap9angtlce9G0lcjog== 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=1717531593; 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=PlShY+XOC/8ag/YhFR0QU9oOVez7uBD1fcuTQn29xok=; b=cFLfrus0PjEM15Hh5Ktim0+Izs9PhjYtciYM8hMlXe9vkUXGfrMDZqIToVkVigxiKMUnbZ X99fBF7Z5HRBK4m5O34NIUaCbVs5RD2j+8AIkzwSEjeMHNGG/2rw/5n6Ap0jCHEQ+e88Ky miVZ6DjNWEjX+eyNbVHSTfqRC13TfQnZhIkHq87/T1UgwoJHC0xP19NsvFnxxLVJryxveF VdaqGAdvkuh1OtSssnOHDJLjj7idiJCqJW6APVKqQBQZlFtudjl2WEziP1sDJiqdQDgn9t 7ynuzDfHb0INW62gsGGpXfcT7nLPETQ4061lTBxClywyv0MVfr/SGf45oSF8NQ== 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 4Vv1nj0psyzXxR; Tue, 4 Jun 2024 20:06:33 +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 454K6X3U075168; Tue, 4 Jun 2024 20:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 454K6XQB075165; Tue, 4 Jun 2024 20:06:33 GMT (envelope-from git) Date: Tue, 4 Jun 2024 20:06:33 GMT Message-Id: <202406042006.454K6XQB075165@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: 05704402ac85 - main - bhyve: Add a stub VM_EXITCODE_REG_EMUL handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 05704402ac85e0864eda63cecc20eb7810ecb503 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=05704402ac85e0864eda63cecc20eb7810ecb503 commit 05704402ac85e0864eda63cecc20eb7810ecb503 Author: Mark Johnston AuthorDate: 2024-06-04 19:06:42 +0000 Commit: Mark Johnston CommitDate: 2024-06-04 19:06:42 +0000 bhyve: Add a stub VM_EXITCODE_REG_EMUL handler This lets us print a few fields of interest before aborting the VM loop. No functional change intended. Reviewed by: corvink, andrew Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D44741 --- usr.sbin/bhyve/aarch64/vmexit.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/usr.sbin/bhyve/aarch64/vmexit.c b/usr.sbin/bhyve/aarch64/vmexit.c index 03fc2f8b21e3..a47df27e54fc 100644 --- a/usr.sbin/bhyve/aarch64/vmexit.c +++ b/usr.sbin/bhyve/aarch64/vmexit.c @@ -84,6 +84,21 @@ fail: return (VMEXIT_ABORT); } +static int +vmexit_reg_emul(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, + struct vm_run *vmrun) +{ + struct vm_exit *vme; + struct vre *vre; + + vme = vmrun->vm_exit; + vre = &vme->u.reg_emul.vre; + + EPRINTLN("Unhandled register access: pc %#lx syndrome %#x reg %d\n", + vme->pc, vre->inst_syndrome, vre->reg); + return (VMEXIT_ABORT); +} + static int vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { @@ -269,6 +284,7 @@ vmexit_ss(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_run *vmrun) const vmexit_handler_t vmexit_handlers[VM_EXITCODE_MAX] = { [VM_EXITCODE_BOGUS] = vmexit_bogus, [VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, + [VM_EXITCODE_REG_EMUL] = vmexit_reg_emul, [VM_EXITCODE_SUSPENDED] = vmexit_suspend, [VM_EXITCODE_DEBUG] = vmexit_debug, [VM_EXITCODE_SMCCC] = vmexit_smccc,