From nobody Wed Feb 5 09:34:40 2025 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 4Ynw7503dwz5mSw1; Wed, 05 Feb 2025 09:34:40 +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 4Ynw742NMPz3W47; Wed, 05 Feb 2025 09:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738748080; 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=sGTNoXZLH921pTgU8AkqEVNwZGQSIB0znpqCy7HPxOM=; b=h6kBN6oAPwb9RdJcUbIJqf9tnjqPxqgZ2UJNd+Nx7HZKFuxHY3i2tfdyw0cENZtUmMVWeN 8c4SclXUhed3cXX1jVh7MmPeybO4YS0E/VjdF/Qwe5f10KS+JIPWp4qnz92kxeBqzZqOyH P8uNZoSKPjVilvsIOmUjFbqA2IBjjCyVllwhttVsR1C5LZfdNOQXw6qQ97uxCll6pt9Io9 GwV8JtE0BG4t7FGd5I8s9nfdLzj+7MNo/mR1P2vUjyN0YbFLGUh5R6Vp1H9OXRnSEUotGQ IHLXlSbPxbJFZQDeIA/8JJIZFynfK2pJZIIs0eDGBMjoto6W/MX9KmLshkNBDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738748080; 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=sGTNoXZLH921pTgU8AkqEVNwZGQSIB0znpqCy7HPxOM=; b=S+1MGCrnxPnaq9eXuKUhAaKvPR1/txy9S0WMDhAu2RMP9zLhBYhern4qtw02V3W2RaCVPP hYcEAF8iNl0fvvVV1SiUH/35LhdvH2tezppnUbY32lr0yirhkqsS7809Xl2gY2AKw8SqNX p6l2Logcial2VFbk2xn6BsdW8PowsQFhTFpbUTnZcPV8y/tVuIacQ6ChxDxnISdbtJKOb6 vtpYFI8q1FpuhnzKIUCAK6yazwIu8CyfMRi9uu6vLckuIT9jsaCzhTikP9j/ov7LAMW2gZ EVQotgS76IKEleYFP/+r67DoZdjRFJvlXGtP0/vzpOIie/RtGg0A1eC6l2F/JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738748080; a=rsa-sha256; cv=none; b=AGgIQzcF1meJ204K01/baZMlr5StSEAawGT+Fg2jbBysYZ9WbD2Wq7a2zDjajfNjBnuJN2 5IKpqGG4DtEBex6QtDnA700pp3iURjaMThxCe0rDffAoWDB1gPh4iLG5GEn2JCiYsA8Qfu CNi6gu0AvBHsGrnHAZgGyCJO+AIkiY5rjyzaXuT6tEANIS7CY6T+p6fFCJs+HBPmgtoJLQ Ft7jkI5B9tiRXy9P2s1fl7O9kJjaxF+gYmWqdSGu2x68A44eijYev9w9dLTNDFsIxmQJu+ 135n4HPv+vw+pVqd8BfqDCMvZeidsSXDLtgIIAh5NEaNYWbfL5zMMpKNkETAUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Ynw741qHtzmYF; Wed, 05 Feb 2025 09:34: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 5159YeLa025578; Wed, 5 Feb 2025 09:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5159Ye37025575; Wed, 5 Feb 2025 09:34:40 GMT (envelope-from git) Date: Wed, 5 Feb 2025 09:34:40 GMT Message-Id: <202502050934.5159Ye37025575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: d69ab49ce081 - main - bhyve/riscv: fix HSM extension handling. 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: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d69ab49ce0814a9c3da7ba6567ed71f8713dc192 Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=d69ab49ce0814a9c3da7ba6567ed71f8713dc192 commit d69ab49ce0814a9c3da7ba6567ed71f8713dc192 Author: Ruslan Bukin AuthorDate: 2025-02-05 09:23:43 +0000 Commit: Ruslan Bukin CommitDate: 2025-02-05 09:24:35 +0000 bhyve/riscv: fix HSM extension handling. Pass private data from supervisor as the second argument on secondary CPU startup. This is used by Linux guest. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48807 --- usr.sbin/bhyve/riscv/vmexit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.sbin/bhyve/riscv/vmexit.c b/usr.sbin/bhyve/riscv/vmexit.c index b7d1a272b87e..e2efd53bdede 100644 --- a/usr.sbin/bhyve/riscv/vmexit.c +++ b/usr.sbin/bhyve/riscv/vmexit.c @@ -207,6 +207,11 @@ vmexit_ecall_hsm(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, vme->u.ecall.args[1]); assert(error == 0); + /* Pass private data. */ + error = vm_set_register(newvcpu, VM_REG_GUEST_A1, + vme->u.ecall.args[2]); + assert(error == 0); + vm_resume_cpu(newvcpu); CPU_SET_ATOMIC(hart_id, &running_hartmask);