From nobody Wed Jul 31 23:44:41 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 4WZ7x60tL3z5RZt4; Wed, 31 Jul 2024 23:44:42 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZ7x56v2Tz4wll; Wed, 31 Jul 2024 23:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722469482; 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=Un0H89iCzD0brYtqtR4f0X9a4T/qMpOzQnFEyFb6jZs=; b=uPM+ZdIHsAQZyQLJs94HcfGOb5n2XuzlBUERtyRUAIc3dP9bY9Yr5XtAonlpkoSVVZEof0 sL6IbRiIGPqX4bwIHYxjsL8w/t4DbIvhq1Z0CJuPkCETvo96cSU/kWpTGyNfNq6dz9+s8U +/ywgGOU4S24XjIBXT6WVSZC8E0dMy0psPzF0AHO8dlsT3MKOpNEjGd3gBHLtIQIe4WSY0 uJmug8AtL8B1i1ZcDxtCE8w0RE6nw4dsYm+EuWrA8K+vFe713rx3Z2AiLd05liKrMysegh gzDkRYOf/3yiLD/vdU46otsMjo7NccCKschefMKTMP9ox7taMVD96KqDmDIsqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722469482; a=rsa-sha256; cv=none; b=ZEbmxN5Hr+IGfy4qP3FGardYW/FkS+ziUkTMYCzTFV7BpAm5ffU2Ep3ukF+4CEdTthzNTY m++1kg8luhjYxcDKchFV/BnInerkAgchpVrnoqk7+pUHsmOkiAENW77YoK6yUwBqrHQzJY V9HB1qLHEyDKFeWFT+u3pkTamkHyfqoWaWUUdesPzwfhAsTuulfdh7og9arstSqr8vFHpS 2QxRQUKnIAdAYcXGzx5XVQkHrvRfcQ+vTnh941X7ihiuZlIKexH1qn+Pl2VGdEeIIQMlUF 7R7HS9aiZjOjNCD9G6wHmKfINUOFG4IWaoL5lRI8Nwa0tqTj6wLpb+p4kxCxYQ== 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=1722469482; 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=Un0H89iCzD0brYtqtR4f0X9a4T/qMpOzQnFEyFb6jZs=; b=j6MH7NKhYu+Ukp0iGHpyWCevnkhh72o/5zskjWnmP1Z2m8EYMIuPsZzXSYTHerYv5tm7eG YXmXtlDBc+h6K5G8XopvXqouDjDkTsZZKGLrZ9l6+TWidlqS30/FSsezcYW2Xgn+yqIY6I g8ZEfHlGEbEkCsUNFtvx5qVWc2amQC1NlLeGQUsj/Um36LNE2RyEhqPC/+55Hxwb0nhQ8s ZQjXj95jKg7V/e6VdPyePSiZVDwAJ59KtiT5RfGV6POiLQ5OrFxXplu7kr6O/avbDFBPn8 KnKdCtMxUlRbmWnpEICnz1xvhJCzWqfMej2dEhPz9uLK2LFiWTQ8AaFpJmf1jw== 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 4WZ7x56GsDzLns; Wed, 31 Jul 2024 23:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46VNifZf017068; Wed, 31 Jul 2024 23:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VNifMW017065; Wed, 31 Jul 2024 23:44:41 GMT (envelope-from git) Date: Wed, 31 Jul 2024 23:44:41 GMT Message-Id: <202407312344.46VNifMW017065@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: 4c5188bbeb88 - main - bhyve: Assert success in a couple of libvmmapi calls 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: 4c5188bbeb88362112fa2891ccb6330f4c429ff3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4c5188bbeb88362112fa2891ccb6330f4c429ff3 commit 4c5188bbeb88362112fa2891ccb6330f4c429ff3 Author: Mark Johnston AuthorDate: 2024-07-31 22:40:51 +0000 Commit: Mark Johnston CommitDate: 2024-07-31 22:41:30 +0000 bhyve: Assert success in a couple of libvmmapi calls - In vmexit_smccc(), copy an assertion from amd64. - In fbsdrun_addcpu(), make sure that our vm_suspend_cpu() call is succesful. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46197 --- usr.sbin/bhyve/aarch64/vmexit.c | 3 ++- usr.sbin/bhyve/bhyverun.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/aarch64/vmexit.c b/usr.sbin/bhyve/aarch64/vmexit.c index 7f0cfe672c55..e1a9509d5d12 100644 --- a/usr.sbin/bhyve/aarch64/vmexit.c +++ b/usr.sbin/bhyve/aarch64/vmexit.c @@ -249,7 +249,8 @@ vmexit_smccc(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) how = VM_SUSPEND_POWEROFF; else how = VM_SUSPEND_RESET; - vm_suspend(ctx, how); + error = vm_suspend(ctx, how); + assert(error == 0 || errno == EALREADY); break; default: break; diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index aca770a92642..f844da90e76c 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -413,7 +413,8 @@ fbsdrun_addcpu(int vcpuid) CPU_SET_ATOMIC(vcpuid, &cpumask); - vm_suspend_cpu(vi->vcpu); + error = vm_suspend_cpu(vi->vcpu); + assert(error == 0); error = pthread_create(&thr, NULL, fbsdrun_start_thread, vi); assert(error == 0);