From nobody Tue Jan 02 00:42:39 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 4T3vFr1435z560Rv; Tue, 2 Jan 2024 00:42:40 +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 4T3vFq6HHtz3RdV; Tue, 2 Jan 2024 00:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156159; 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=nY/psgeP6TpWQMW9CVCKnXrj9dg2TyH9LV9+Al+pwas=; b=s8Zs6ZGi2eTEd0xJVBFRcxHOxKrCDuDmfnAuo/L+QTr63eiQmMXWY4niM2OrmewbvsDdBs YRJUWZikUYK+3FVzA+dVW+56wXRzoVKDI8NGcn3siUZ/pVbsGEBv6Kg/gLwkTew+ZhncBw +nsQiX1ZKyFmnG9C9vSJ1ZbZVMn8EGNLEFiRYQWCjHQOzY8jEgpDrv3JpBjfXjRNiU7cvb /oKFEHrX2tRds8aWI/ndfcgzHCLpM0xTFJcCELJ7Xf62DrmZCUQlU9jfqGg5guhdMot1Qd AawIHm0ACi+T9XS2+nwNfOMsUmhx4PUpw3mkPcM/USRxBrt7ipVqR/WECG/plA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704156159; a=rsa-sha256; cv=none; b=nrZekLjd/ARTehdLoW7skuLpQku4oEWIpxubFDfzaLZQufG9IWeFoJijPPjSaaRF7uJlG8 6mppN/in6HUb1Cm6Cl3lnjsga5iBfV0oSkudfMnypORa2zfRl/9zWvtDfOrDICMjIGhVxk E2dIV0nkmhN1Jrz5lcascifnZHSvYBNoS+kFHPKoY7BjWKCF/yF3jm4HmxLZtjOJfau57J Vve180dl4giskOQjTsPgfJJlBdZ3FB01otuV/8nOeRXqTZdTS8+4nkSjwsX0/PiXmv4zzA utea8T4jsbrrFYKiskqpb6NrUIpoM7tofvIsS+NF33DiqcDscQHEMlleDz8BbA== 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=1704156159; 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=nY/psgeP6TpWQMW9CVCKnXrj9dg2TyH9LV9+Al+pwas=; b=F9mE0uRmHszd5rkaFop1d8bKj/cV2em4zkY+LyG825Oq2xJejI8Xlrs6KsoZc9hTTeSQWl Bm4sMVRRolvgH8XCi8jGjNsl6jbbaJHHgsbCPofr0u+WzEaD9Rbqh+F9Af7zOhdUcWQj94 VdC/xsz0TXlpPdKIn9PdEriutXVmWiT/gMXyym2fzUhkf1JgUGwn+AiR3Q/CcUCCwBtsb0 9ha3J/LMSoSbwEL4ex5a9jvCcI5rneUw9NebCVGepzbdDc6Wkv28rCdC84wXuVJjToRIFj 2xpwQwdC3ds4iLRzcH0tgto1h4qtqdgLspMRQsrsPUOXq+KtVtzc7VvMgpYb3g== 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 4T3vFq5P0qzfpQ; Tue, 2 Jan 2024 00:42:39 +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 4020gdlG003955; Tue, 2 Jan 2024 00:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020gdXb003952; Tue, 2 Jan 2024 00:42:39 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:42:39 GMT Message-Id: <202401020042.4020gdXb003952@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: d4a04574875c - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: d4a04574875cbbdb8bf2600b4618cd02b781e833 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a04574875cbbdb8bf2600b4618cd02b781e833 commit d4a04574875cbbdb8bf2600b4618cd02b781e833 Author: Konstantin Belousov AuthorDate: 2023-12-23 16:57:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-02 00:42:13 +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 fd17933f9556..8ea4ece26073 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 b38407e6fdc9..8343bf1e9f9b 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -318,6 +318,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 b48993fc7969..4205b08cab4f 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -157,6 +157,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) @@ -171,6 +173,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; @@ -895,6 +899,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); @@ -981,6 +988,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);