From nobody Wed Oct 11 13:25:08 2023 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 4S5D5w6qjGz4xP14; Wed, 11 Oct 2023 13:25:08 +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 4S5D5w65Yfz3GWP; Wed, 11 Oct 2023 13:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697030708; 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=eND62L4cb4XhhpbncgkGcsa78QHA8XOayrfWY1FJLlk=; b=DUX5XbCg2yR3aCgYW8LkfAYWiSef9EL23U2W8+Aap1VWqIq80EQ4BO4SBVC7b0DzZSzuV+ iJntMax+1yPyS0hXRFBwKhxHriTFi7OaTyn1nM/AlxiIuJM73njyYsf8aZpNTBS8+MvZJ0 vTfun2EO8+6MZ8Rufx0tNEceoWdLxB8LvkFx5DzBzcH04LBov8ZuYfcQvJKTw3DLe7owwO wxEbFy3QuvahG8Mse5ptr0rpqsI8Hv7gK1ENH+xeSy/WPa9J2zzyt/yt7UTgp8wBPJMHDq msOSEzyAn21WPTqV6xswwBwe5QRYdRtzi1P+DZD5B+nxr5TlUs7NT7DQIFG6FQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697030708; a=rsa-sha256; cv=none; b=KeyGC5bIaCA+veFasP8Sf5zWubkBYCZFfU7WqSorMG/IWvMupp1gTW8veQktejQcrKb1AD 9te7QvxU+DnGtXPoOX+seCKPxsD07YMjfL5eMXdgw2J+htFkhIOEjCjExJYLAd3j0/RtpT LB4Y3uGgboLSGyEKFCidEho0DD94wIDJBDNPHIHWAvXS1kESr8HiXts+rpzfqZeJvTsitr nUYv9f4VuapWvj2Ao/iLUupUziS88DUKRchY6h/jHF2iIOFZWVgAW5mq7NOLdx5MauhncX TnvI21/6lrnJinokMLCuNeFWRMqxyxx/Vv44UDnLqYniM4CTfBoWSGFjUvh2sQ== 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=1697030708; 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=eND62L4cb4XhhpbncgkGcsa78QHA8XOayrfWY1FJLlk=; b=Tw6qts3u/txA6BRDR5X0n5a0SzcVfxNUqIht2Q3oy1o6gyXzHwCQCHNiRUYUQACLhrXzj+ eL3qSEylbof3yKkO8Mqxu3uwNOMBdMsjc9FuMbUn0SzeFV0El+y0Mx8qWh7qp5IcO7N17B 0mS3K2Yt4FBkYpzEA0COkF+uRnU/KL+AFDkg10wgfBwfvK6R3ECEGKk4PlZ9AL4N7eBw6u D68n3Z8cFn6WBuwH03UjCL4jJMhFZ+11f4HB85xb5IyrLwiFWoTja4C9OI+Mx3/c/fbiwO Yl/p0+DhOyfee28AZubN5KhbBPLNbhePWUgGbUoZPp+nCUZqWPMc/06s3SjftQ== 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 4S5D5w5BrBz7cw; Wed, 11 Oct 2023 13:25:08 +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 39BDP8ck090105; Wed, 11 Oct 2023 13:25:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39BDP8YK090102; Wed, 11 Oct 2023 13:25:08 GMT (envelope-from git) Date: Wed, 11 Oct 2023 13:25:08 GMT Message-Id: <202310111325.39BDP8YK090102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3f23b202e199 - stable/14 - bhyve: Move MSR emulation into amd64/ 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f23b202e199a0a0d823ac2bbe835f2afde386c8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f23b202e199a0a0d823ac2bbe835f2afde386c8 commit 3f23b202e199a0a0d823ac2bbe835f2afde386c8 Author: Mark Johnston AuthorDate: 2023-10-04 16:23:22 +0000 Commit: Mark Johnston CommitDate: 2023-10-11 13:21:58 +0000 bhyve: Move MSR emulation into amd64/ No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40733 (cherry picked from commit 548b11228f7a83785dcf6c4c8b0bbfed0284d794) --- usr.sbin/bhyve/Makefile | 3 +-- usr.sbin/bhyve/amd64/Makefile.inc | 3 ++- usr.sbin/bhyve/{ => amd64}/xmsr.c | 0 usr.sbin/bhyve/{ => amd64}/xmsr.h | 0 usr.sbin/bhyve/bhyverun.c | 6 +++++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index 5f13d457d914..30ecf56ae748 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -76,8 +76,7 @@ SRCS= \ vga.c \ virtio.c \ vmexit.c \ - vmgenc.c \ - xmsr.c + vmgenc.c .if ${MK_BHYVE_SNAPSHOT} != "no" SRCS+= snapshot.c diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc index 6843cec4919f..d655708210ce 100644 --- a/usr.sbin/bhyve/amd64/Makefile.inc +++ b/usr.sbin/bhyve/amd64/Makefile.inc @@ -7,7 +7,8 @@ SRCS+= \ post.c \ ps2kbd.c \ ps2mouse.c \ - task_switch.c + task_switch.c \ + xmsr.c .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c diff --git a/usr.sbin/bhyve/xmsr.c b/usr.sbin/bhyve/amd64/xmsr.c similarity index 100% rename from usr.sbin/bhyve/xmsr.c rename to usr.sbin/bhyve/amd64/xmsr.c diff --git a/usr.sbin/bhyve/xmsr.h b/usr.sbin/bhyve/amd64/xmsr.h similarity index 100% rename from usr.sbin/bhyve/xmsr.h rename to usr.sbin/bhyve/amd64/xmsr.h diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 31fda7028569..005acec77a93 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -106,7 +106,9 @@ #include "rtc.h" #include "vmgenc.h" #include "vmexit.h" -#include "xmsr.h" +#ifdef __amd64__ +#include "amd64/xmsr.h" +#endif #define MB (1024UL * 1024) #define GB (1024UL * MB) @@ -1011,11 +1013,13 @@ main(int argc, char *argv[]) exit(4); } +#ifdef __amd64__ error = init_msr(); if (error) { fprintf(stderr, "init_msr error %d", error); exit(4); } +#endif init_mem(guest_ncpus); init_inout();