From nobody Wed Apr 12 07:04:18 2023 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 4PxDGW6XMYz45QHT; Wed, 12 Apr 2023 07:04:19 +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 4PxDGV4dlRz3n6d; Wed, 12 Apr 2023 07:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681283058; 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=vUmFiWomOs1tv3Hv2IbZnx2pIzlAEL+JEROJ6pn1JPk=; b=gFsJ0IvWsGNEc4uA/eHgZvA9FEaYPJBfePff/RylG4G4iVbcUM6wV2wJ3s8GqMfS6NtpvQ tyIEnreW96cWbuPVESDpm0xG+XMyfzjj1bRb9UDFYeuGQQ5NpDDNsl0i41LX/vx2sb9PN4 kuUsbYnCm48H1VuUr1KHjmR54Xo1OZEFFhk+N7O5Gif/UVK5wXNyxsXnOQQADkEMBtPbqc zvksDqee9rSYdAJ4KY6L5cFN7gEKMJUWtyCkCKFN2GnDN0n1TcdDhz8wxgpu3QnfCQqVkQ XQKoRJaIZSlD4rRyu7UmWSRc+4U7yr2XRiudJX8RSIIAosjdLT6Xcb4gBlgW1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681283058; 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=vUmFiWomOs1tv3Hv2IbZnx2pIzlAEL+JEROJ6pn1JPk=; b=FEfHRNIiLhYV6CgDS1d2q+zaO+qvHfFvRVTPWJLJqQsXMODWNQ0odFCittF+mS5/DKlF6m fTEvQGM3sx6Y4kIpZWLcJxc4Jxt/hRPJfXf/qi00MUOq9ApmXBdI7GmoWAIYNEyVM3+pLk DpHlvA890aCrUks0KIlPhmON1FkCjTr6NoBCfDAEvB7XMtVNB9uftjXLsBMj19zDqhNkyO bAOPO9r7Qb6cBiaUNJH7KUmfg6u2Fe8haK8dj/0aApRW6PDqTNhT+qnZ/GnEQWPxfwn7io yEIXYinrrR8BKw0gfXr84Z0JrscmD6mU7Nwkc7Fsj4NJs86eY74JAy9RvUZpLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681283058; a=rsa-sha256; cv=none; b=uNPCYNxnqXItyWsrfW9nNEY+plFABeFIAfwKk8cBfN6MCZMZbJ5ed/7JDz3jRU+jxBAmql 0FGSB3Lj5uUuEgsqR0GPP7zGn7fAPnQqs2iSoyRgK3Rdn+Yl2BJ1gZqtH3Fz29Fz7prp9H GO1gPV9/ie2z9L59EX+InULJmTRAHW9jj1iCZ4FlcO4kiUpyJhr8RJ3A4TTzFUuxW2FKgf khxjWdkakY5CUOq0xvbhPWfdazWImNuq+9r0d6VmXfu3EJ4FVy+evf2HRaRfEN7CxUnCU4 FlhkUHANSOn416xDSBRfA2XJh8YmiPxwjuDTfhlRZKe2E3Q+PNeqGx5WeFNbrQ== 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 4PxDGV3hnhzqYD; Wed, 12 Apr 2023 07:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33C74IOo062604; Wed, 12 Apr 2023 07:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33C74IEr062603; Wed, 12 Apr 2023 07:04:18 GMT (envelope-from git) Date: Wed, 12 Apr 2023 07:04:18 GMT Message-Id: <202304120704.33C74IEr062603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: e976464a50ac - main - bhyve: allow device specific DSDT entries 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e976464a50aceebf97fb3cc6b94058111fc40de1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=e976464a50aceebf97fb3cc6b94058111fc40de1 commit e976464a50aceebf97fb3cc6b94058111fc40de1 Author: Corvin Köhne AuthorDate: 2022-07-22 08:11:14 +0000 Commit: Corvin Köhne CommitDate: 2023-04-12 06:33:47 +0000 bhyve: allow device specific DSDT entries This feature will be used by future commits to implement a device specific method (_DSM) for TPM devices. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D39321 --- usr.sbin/bhyve/acpi_device.c | 5 +++++ usr.sbin/bhyve/acpi_device.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/usr.sbin/bhyve/acpi_device.c b/usr.sbin/bhyve/acpi_device.c index dffb73ba9023..51603e138fba 100644 --- a/usr.sbin/bhyve/acpi_device.c +++ b/usr.sbin/bhyve/acpi_device.c @@ -190,6 +190,11 @@ acpi_device_write_dsdt(const struct acpi_device *const dev) BASL_EXEC(acpi_device_write_dsdt_crs(dev)); dsdt_unindent(4); dsdt_line(" })"); + if (dev->emul->write_dsdt != NULL) { + dsdt_indent(3); + BASL_EXEC(dev->emul->write_dsdt(dev)); + dsdt_unindent(3); + } dsdt_line(" }"); dsdt_line(" }"); diff --git a/usr.sbin/bhyve/acpi_device.h b/usr.sbin/bhyve/acpi_device.h index de72ce1e5370..4d734b422ec5 100644 --- a/usr.sbin/bhyve/acpi_device.h +++ b/usr.sbin/bhyve/acpi_device.h @@ -23,12 +23,15 @@ struct acpi_device; * @param hid Used as _HID in the DSDT. * @param build_table Called to build a device specific ACPI table like the TPM2 * table. + * @param write_dsdt Called to append the DSDT with device specific + * information. */ struct acpi_device_emul { const char *name; const char *hid; int (*build_table)(const struct acpi_device *dev); + int (*write_dsdt)(const struct acpi_device *dev); }; /**