From nobody Wed Oct 11 13:25:22 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 4S5D6B4hntz4xNsb; Wed, 11 Oct 2023 13:25:22 +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 4S5D6B4Cfmz3H8y; Wed, 11 Oct 2023 13:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697030722; 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=7uNRMpXyl28urAfZAgRt2nEsY00ZiWTOztkehQxleF4=; b=NX0r6833jUjAxJFlq8k0WJafdV/5VPL76uOqK+eD/yzsIl3hK14Zkpgh/E5gaDglrO8tIJ LOtxKB1klrffLLYk4qA6hbw+9ANQFAprVET16dhb7qYtlggmMlgl67YLr53LVhBWl0NPRg ul60ihiLwACRxxgdqadqWhkJ1vQmAzH+0jeFcsjBMLcSSTbIRMu/yiyfnWPPxyymSQpBUP ofN0Fx6TzsUmMtj+A2gpJD8bVyyAYAKgEXGjnpg63yV5an319R4I/xYnHr/oRyYhz9Tiu8 XF10tcBwpo39UAn+1P906PBFlumY71zeIeZz1h3rI7gslKXRe7ECF41HUVOn+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697030722; a=rsa-sha256; cv=none; b=vkOhtpOj8eCKA2nhYBkVl8Vk7mm/JY6uZZfxT0tTcoS9GJbL63wYIHgnuXq+x1sN0Fx2Fq xLDO766Yk4TupA1Bf2cGt/bOP+43VLGYd/58epB2vUfthosoHpaB04zg2LdN/W1faVZHRa f5MQEr74ZzFoxKVRb1qwIKwYHG6/TL5/KMaIr8il3WRqZ8v8mbjw2DxLqshIAbixn9ll5B yuJSHCDR3kuYEqtB3rnx/U6K9ZSeCCO2UxYTrmvIy3lAQrXFjz2IJ3e0o4W2ZGnhYQXaC8 bpH8oo6u9yaCkRTdKaNIyPyS+9TclMWD032zmdeaW/30Ici5II/pwghCcTVtyQ== 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=1697030722; 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=7uNRMpXyl28urAfZAgRt2nEsY00ZiWTOztkehQxleF4=; b=tbjb+o86Y1FvLVaH3mfyBOVH8ax48d94tm8U2qiOuW+NyO46CDeayct4cmp3JJZSYAbsO/ lj64JBstz4H6rxQ320FphZwxDTe6yvGHg8TiYxEy3SY8l93TbnBKMdP381RibRu4Bdt9iQ GlQrh+sprui57kuQmkpBnxAsWhmfgd3yZKHGI5QxDG4RrBibs/ahxfbZf4gno+vg9hjTr2 +pC0leAqkUq8pvtBb6Keoe6GNbBQNIHWOCTY0w0N/HH+VQ3yKyXhKLrwhYNGXyzCkkkLgZ pMI3AAkikbttDbKKDq4goGDN+d3aZL1eyQZHUxKL41iLr5cCsxYcIApAR32nbQ== 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 4S5D6B3GJVz7ry; Wed, 11 Oct 2023 13:25:22 +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 39BDPMmw090724; Wed, 11 Oct 2023 13:25:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39BDPMgl090721; Wed, 11 Oct 2023 13:25:22 GMT (envelope-from git) Date: Wed, 11 Oct 2023 13:25:22 GMT Message-Id: <202310111325.39BDPMgl090721@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: a43a3efa5ab1 - stable/14 - bhyve: Build the HPET ACPI table on amd64 only 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: a43a3efa5ab13d937d1eb7e5f447babb4b8f66c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a43a3efa5ab13d937d1eb7e5f447babb4b8f66c5 commit a43a3efa5ab13d937d1eb7e5f447babb4b8f66c5 Author: Mark Johnston AuthorDate: 2023-10-04 16:28:28 +0000 Commit: Mark Johnston CommitDate: 2023-10-11 13:24:40 +0000 bhyve: Build the HPET ACPI table on amd64 only There is no HPET on arm64 and vm_get_hpet_capabilities() is not implemented there. Move the vm_get_hpet_capabilities() call into build_hpet(): I cannot see a downside, and doing so eliminates a global variable and reduces the amount of code that needs to be conditionally compiled. No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40990 (cherry picked from commit 83b003fbe965869124706b4a80b212734152356d) --- usr.sbin/bhyve/acpi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c index 4a3233291b7a..050e1a0ab75f 100644 --- a/usr.sbin/bhyve/acpi.c +++ b/usr.sbin/bhyve/acpi.c @@ -71,7 +71,6 @@ static int basl_keep_temps; static int basl_verbose_iasl; static int basl_ncpu; -static uint32_t hpet_capabilities; /* * Contains the full pathname of the template to be passed @@ -218,6 +217,7 @@ basl_fwrite_dsdt(FILE *fp) pci_write_dsdt(); +#ifdef __amd64__ dsdt_line(""); dsdt_line(" Scope (_SB.PC00)"); dsdt_line(" {"); @@ -233,6 +233,7 @@ basl_fwrite_dsdt(FILE *fp) dsdt_line(" })"); dsdt_line(" }"); dsdt_line(" }"); +#endif vmgenc_write_dsdt(); @@ -530,11 +531,18 @@ build_fadt(struct vmctx *const ctx) return (0); } +#ifdef __amd64__ static int build_hpet(struct vmctx *const ctx) { ACPI_TABLE_HPET hpet; struct basl_table *table; + uint32_t hpet_capabilities; + int err; + + err = vm_get_hpet_capabilities(ctx, &hpet_capabilities); + if (err != 0) + return (err); BASL_EXEC(basl_table_create(&table, ctx, ACPI_SIG_HPET, BASL_TABLE_ALIGNMENT)); @@ -551,6 +559,7 @@ build_hpet(struct vmctx *const ctx) return (0); } +#endif static int build_madt(struct vmctx *const ctx) @@ -720,14 +729,8 @@ build_spcr(struct vmctx *const ctx) int acpi_build(struct vmctx *ctx, int ncpu) { - int err; - basl_ncpu = ncpu; - err = vm_get_hpet_capabilities(ctx, &hpet_capabilities); - if (err != 0) - return (err); - /* * For debug, allow the user to have iasl compiler output sent * to stdout rather than /dev/null @@ -756,7 +759,9 @@ acpi_build(struct vmctx *ctx, int ncpu) BASL_EXEC(build_rsdp(ctx)); BASL_EXEC(build_fadt(ctx)); BASL_EXEC(build_madt(ctx)); +#ifdef __amd64__ BASL_EXEC(build_hpet(ctx)); +#endif BASL_EXEC(build_mcfg(ctx)); BASL_EXEC(build_facs(ctx)); BASL_EXEC(build_spcr(ctx));