From nobody Tue Dec 26 01:28:51 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 4SzccM73Gbz55GPg; Tue, 26 Dec 2023 01:28:51 +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 4SzccM3Kpvz3fy5; Tue, 26 Dec 2023 01:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703554131; 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=AiMFb8PR8TBiV8pzLDsN+px2cfCKMFnRxGnpkpPxgao=; b=ZA1oqtIx29koWXQIeMd9z3nSX8ERZ/TMp72ttGt/+b3MZ4rI20BBeR0IWb7mXLAgS4J/82 fW5TQHT0oaCGDfcyQrK5kMgC551k653byUxN3MY6D5zeOMh+j/uJdS1eJ3TFPBUY3zwwar PWOOHjPhn0AxrmMuj2/HrMQzsaTxKFQaKJEV+ZiYYDBAgxJMq889p81Q8iF4DpPIBKUW4U rtWPklID57hgZremzw3GLJlexEoybes4prvX/cDYCjY96fLaLNhCHdtpFntR6ubrUKO9SU AcanhuXsPvf6NelDqCn3XgGlhYsTDR90FBTQx99tFJzkSUAelQ0gnoSTH6cP4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703554131; a=rsa-sha256; cv=none; b=RxrDfhOabV8z/vbkjnCVyMTq1xGivzroGXjdUbPKzJijdk/02nKf8rMvx/7B2HQgwCwQf5 QTDgo6uPtlWQB30ync5iKfqoT7PRQ2opOP82R1hfa2skEOdUClMJj3NZZrMs2vnw9J8mok uI15+tNTTyH+XOzOck3YPwkgX5BW3YaeV3FV3jvmQh8DFJltyeA89PLMD5lDw8EukB6uWA e6EIXMKLmUpGPz+71g/ns8D+S3eGcbEaH1a9/fyL9ULyb56G7rBZBoaXyzbtpRX4XtIikr wAPqlYoNw4a2Q0d2Q94Nt3S58ucQt6GzgyS3vm0flI5ZfQNzw/DZPn2O6Fklyw== 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=1703554131; 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=AiMFb8PR8TBiV8pzLDsN+px2cfCKMFnRxGnpkpPxgao=; b=Jv1riivvsDjf/geV8ZVsat/mGg6MqLvQXvaPADmuoRK4xtCFfYCgqD/5QyZOB2XeyreCYs dBXOmNSJYblOla9eg3redXvUphQ6L+DRyySliM0otB3IV1mRuszmwpWldrPwuRCMmKeK60 KNsqhT1UMs92XvBQeww3BUiK4u2AaXHdrsomDLmb/CfKhTwDYkBHeFo1yYOJPJhTVUJP1y utcQOBMD0A01mSa4HE8iG7Gdd1I+hzX21QaXfz4xN936za3jOfnC/qYeY1fgdRMiwuloTl sUpGEpxempKzANhikafzeVjYdK4iACgrc0zosE/RYdYEsLLtCQ7H4I65bh07oA== 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 4SzccM26xXzZxb; Tue, 26 Dec 2023 01:28:51 +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 3BQ1SpQn035495; Tue, 26 Dec 2023 01:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ1Spbr035492; Tue, 26 Dec 2023 01:28:51 GMT (envelope-from git) Date: Tue, 26 Dec 2023 01:28:51 GMT Message-Id: <202312260128.3BQ1Spbr035492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 24e38af60a63 - main - DMAR: add knob to disable RMRR entries installation into domains 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24e38af60a637073b5164837959098acaa3d8daa Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=24e38af60a637073b5164837959098acaa3d8daa commit 24e38af60a637073b5164837959098acaa3d8daa Author: Konstantin Belousov AuthorDate: 2023-12-23 16:57:19 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-26 01:28:22 +0000 DMAR: add knob to disable RMRR entries installation into domains Sponsored by: The FreeBSD Foundation MFC after: 1 week --- 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 76a53f6bbd1a..49c87cf0b39f 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -237,6 +237,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 c29508300b29..7346162d1502 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);