From nobody Wed Jul 31 23:44:40 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 4WZ7x503LFz5Rb9L; Wed, 31 Jul 2024 23:44:41 +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 4WZ7x45xgyz4x7r; Wed, 31 Jul 2024 23:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722469480; 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=GyKl7sMGQXBzuMnmj76j8hzZ3kGstIi2osvh7lDt6s0=; b=jd1AmkBR78/y72CxfB9bsbvRPuhCky6mPeReONkmuDghfn37tMPfZJ3XKo9DrrBz9beWP8 muXuVuLTggRwaEEQDmJ2l2KM6idDnRa2Pp4Vd61bUVf1dlst0Iqp0GxZNWlr1FsBFdApv8 p9FcDBKIfAnp1L3UjYRBFlHsqHwSf2idi+suKqTZyok+Lkm0FfJC5v24BR+34IcLKyrODr Q9qIuRvvLTu1bq3s5+Z7RsY+xrI9E5rotCrcEpb/kfas40/4eWxJvJLCgCgiiOm/GGQRDN 5N1ljP1fodaS3Qezv4lyT29z9P8AxycKWHQV55jmJpfGw4ml75LoWWhaz2qCKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722469480; a=rsa-sha256; cv=none; b=P/SigIH+qSjeGhzX24/6EvJFwt/0qYh0P82eqbD1IROpaGb1GqYxLmiCyPATztKkeaCDxU D29wdLKQYcRtZ+Rb0f1ddfiiUWipEeaQ9hlJwos989GA2yv+FBYGd/grsD2QZlx+YwsdDB KCYTec066s2QI6cyKqCuaicrjJdi8qo7YfbUmvYPhWjQugJTGi5awDBoLyysTHMVhat/t/ EIw5qnzJH3RMCNLFjQNEndW4OtTtn3q4HkpwfQjPk25xYCvC0ZeawPkU7qpC6iiaMQfIiH ZiGawdG0E1Zi4emKuYv+sUSEQLBelgDVqFglD86uCYxDz5GaDxTmJudZmkeM6Q== 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=1722469480; 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=GyKl7sMGQXBzuMnmj76j8hzZ3kGstIi2osvh7lDt6s0=; b=H0qjv4BhIRkwhXQ/t9FfLu0qmj/Lw8UY48MvTq6ZfejlIF6yzSfUiq0fLYf5AHL8JB7bYe 8GdlpgmcZFI2SK0mjfu4umlAqIyIrHFI4CUAQ9gqGD5Qs0wrSKSu5tZanA9Ep9fi5hrUry FntukYeEEKppsWAoAG5QSflIImfzXimjktU8CpYRDNUuw1mJBdSE/6M60Vw5TI3rZxDmvt xMswLmPXJqNkXJWVN2Es3kZiOE3bswz8yK0QCXnI/Fk+Pf9tEx0ygtfb0/H2FtDaBlcWD3 /ZT6u+ZHiO2V37wEpZRkDaNPgO5p6J9dQ/NxiB1utyNrZgwIsFCUcy5p6vXfAQ== 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 4WZ7x45VzmzM5p; Wed, 31 Jul 2024 23:44:40 +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 46VNieaH017014; Wed, 31 Jul 2024 23:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VNiePr017011; Wed, 31 Jul 2024 23:44:40 GMT (envelope-from git) Date: Wed, 31 Jul 2024 23:44:40 GMT Message-Id: <202407312344.46VNiePr017011@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: 2e2b8afa52da - main - bhyve: Sleep for a short period after VM_EXITCODE_DEBUG exits 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 2e2b8afa52da6e2cd08482bcd512e016aa264ddb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2e2b8afa52da6e2cd08482bcd512e016aa264ddb commit 2e2b8afa52da6e2cd08482bcd512e016aa264ddb Author: Mark Johnston AuthorDate: 2024-07-31 22:41:28 +0000 Commit: Mark Johnston CommitDate: 2024-07-31 22:41:28 +0000 bhyve: Sleep for a short period after VM_EXITCODE_DEBUG exits As on amd64, APs will repeatedly exit until they are brought online, so this hack helps avoid burning CPU time during guest bootup. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46195 --- usr.sbin/bhyve/aarch64/vmexit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.sbin/bhyve/aarch64/vmexit.c b/usr.sbin/bhyve/aarch64/vmexit.c index a47df27e54fc..7f0cfe672c55 100644 --- a/usr.sbin/bhyve/aarch64/vmexit.c +++ b/usr.sbin/bhyve/aarch64/vmexit.c @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -132,6 +133,11 @@ vmexit_debug(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_run *vmrun __unused) { gdb_cpu_suspend(vcpu); + /* + * XXX-MJ sleep for a short period to avoid chewing up the CPU in the + * window between activation of the vCPU thread and the STARTUP IPI. + */ + usleep(1000); return (VMEXIT_CONTINUE); }