From nobody Tue Jan 02 00:41:55 2024 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 4T3vF016Tdz55ytX; Tue, 2 Jan 2024 00:41:56 +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 4T3vDz1ymLz3PtB; Tue, 2 Jan 2024 00:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156115; 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=k3eBq4MZdttClNWMbz0H7117AftDVK6q8S8ANDilC4M=; b=PEuamcYYNudEtN7DF/ZrKKUhOZf24ylDOLjI7DaTCsVd9qFl515Cu9z4kGpdffvQC8jg7Y ahtR6f4Q9MGwhLj6ResaCMaMFHugJTwCXefkQd86/z/pYo0WnUvHuDFj/aCQr5SI0pk14k Usj5s3HKTyE/ywbL3lewR+CZUYLPO4PCRBz7kAwBI8n5QR8A1yAgphzC9beczUFvH4eePt Mq25ngrESwTgA2UQHNt3LmwgZM8K9wUi8O7zHkvvqe92GsjYNutrAPtD6AZoYfV0zsQFmi GMAX9N8M4uM3HJ7TdAt1kn1OHjG4ltgA+rP7cXt/s+9vodfCrsxmnQaL9Sasgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704156115; a=rsa-sha256; cv=none; b=PCb2k7LKeMJFCCDuLEyt4zDT7xpTZOGYb3l/HcIjKFdkFOxLYA43DBm/KcZbTE7xlE2XTC my/oRiBxZUfokJxRyF9EVCztNQ9xQkkQkioXtPOXPJ7oH29QTSzw0k5dQSZl8iSa9CmFbc JYsZvigQ2vg6Qp/MCkN2z6YS18whRTji7qfgXLZR7JEkMk9/9XkR0T9T9Xv4w5exs45UV+ 5Z9bZaIisqWosCcvRrnztSRNwUgDVRuK9lA3WJv2Dya3IhGMHaeeuakJKZtaAHJr0wt4Ti CTpigk16v14UIbaGrbbWHCPYnUYFXE1+mI7wRIh3+DVimCwMoM3h9DvY/1T39A== 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=1704156115; 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=k3eBq4MZdttClNWMbz0H7117AftDVK6q8S8ANDilC4M=; b=rY85j1MNUsum7uXf2OaveaoyoabBLnN4hlSoyRgYv6tz7R/l4nSaGGSmm3r2Rrl7tMspXb agWhWazHFGTzGF/5lCtOPgCiGryX338tZsrX+nrGjo1a9Vw1Vmb3rYNsf9RSYCkUIVKkcA UZgzQDSVIefvn3SnVWw3yKOPBxYGDBLoPt/atMURsTfYvTjbU4q06/nRbJ+ROr3hOXyoUS jKnINKeSNYLwPLMdRC9BrSIWrAzg8MAjTaGFvDoyBHN65gbtj9jgwFFQI5jIjYN3YNPdI/ 4NNMKCfiP/5iMRjd1h3gjHb+kcDiuChcCY/Efg+605NMRLekGmDM/1mt7REbWQ== 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 4T3vDz13ngzft8; Tue, 2 Jan 2024 00:41:55 +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 4020ftQX096774; Tue, 2 Jan 2024 00:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020ft2o096771; Tue, 2 Jan 2024 00:41:55 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:41:55 GMT Message-Id: <202401020041.4020ft2o096771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 43ccf1cf37b0 - stable/14 - DMAR: add knob to disable RMRR entries installation into domains 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 43ccf1cf37b0629ff3bdabcfccf16865fbac4c8f Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43ccf1cf37b0629ff3bdabcfccf16865fbac4c8f commit 43ccf1cf37b0629ff3bdabcfccf16865fbac4c8f Author: Konstantin Belousov AuthorDate: 2023-12-23 16:57:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-02 00:41:38 +0000 DMAR: add knob to disable RMRR entries installation into domains (cherry picked from commit 24e38af60a637073b5164837959098acaa3d8daa) --- sys/x86/iommu/intel_ctx.c | 3 +++ sys/x86/iommu/intel_dmar.h | 1 + sys/x86/iommu/intel_drv.c | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 90c883b28ea6..65ca88b052ed 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -239,6 +239,9 @@ domain_init_rmrr(struct dmar_domain *domain, device_t dev, int bus, vm_pindex_t size, i; int error, error1; + if (!dmar_rmrr_enable) + return (0); + error = 0; TAILQ_INIT(&rmrr_entries); dmar_dev_parse_rmrr(domain, dev_domain, dev_busno, dev_path, diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index 1c428e60d96f..e20144094c80 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -319,6 +319,7 @@ extern iommu_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; extern int dmar_batch_coalesce; +extern int dmar_rmrr_enable; static inline uint32_t dmar_read4(const struct dmar_unit *unit, int reg) diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index 274ba566ad23..c4bb3a1745f4 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -156,6 +156,8 @@ dmar_count_iter(ACPI_DMAR_HEADER *dmarh, void *arg) return (1); } +int dmar_rmrr_enable = 1; + static int dmar_enable = 0; static void dmar_identify(driver_t *driver, device_t parent) @@ -170,6 +172,8 @@ dmar_identify(driver_t *driver, device_t parent) TUNABLE_INT_FETCH("hw.dmar.enable", &dmar_enable); if (!dmar_enable) return; + TUNABLE_INT_FETCH("hw.dmar.rmrr_enable", &dmar_rmrr_enable); + status = AcpiGetTable(ACPI_SIG_DMAR, 1, (ACPI_TABLE_HEADER **)&dmartbl); if (ACPI_FAILURE(status)) return; @@ -905,6 +909,9 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) char *ptr, *ptrend; int match; + if (!dmar_rmrr_enable) + return (1); + if (dmarh->Type != ACPI_DMAR_TYPE_RESERVED_MEMORY) return (1); @@ -991,6 +998,9 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) iria = arg; + if (!dmar_rmrr_enable) + return (1); + if (dmarh->Type != ACPI_DMAR_TYPE_RESERVED_MEMORY) return (1);