From nobody Wed Feb 8 17:19:04 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 4PBmtx0JBWz3ngd3; Wed, 8 Feb 2023 17:19:05 +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 4PBmtw6rwxz3hRG; Wed, 8 Feb 2023 17:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675876745; 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=cEDwSgpmJ6vPJvPswgruocBknAxWEsajNViDRQ2nBDc=; b=Lo4Ih/i5xpCavBE9Mgwm9sPo6+2R7qwjLOJ6Oar1D14vrowHbaDDFIEwZ0p3oChMd0GGbc xNmxJ67UvlS0aq7w8X2cuvYoKAIrPffsJANk2ilYmA1lD+y5OvrBm2wZT8CBqHfWqlSUWU LHDvpHe+z8i840tHRqPI5ew/bhA1VxTBNuX/JkjESNLv7RcLrZzpbDpt7Qy288NIUF9qw7 qFuPVlCSA8a0JgadMNdJfGP9nphQicm5BVHQfZt2Q9aH3cMF4NACG0K93RAfw3XX6kDIBw jO0TZY+6X31qsiDbDwouAoyIX8LA3qvfhrfuNGQA398l7VPptBsMGWAVULs8tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675876745; 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=cEDwSgpmJ6vPJvPswgruocBknAxWEsajNViDRQ2nBDc=; b=W9BRn1i7FjjjsEFmyH6nDNtntKkr45r9ypZgLL+Uc8iuzyBNZKGK/Wg4qOwgbyd5Y5hr43 RvGGumRh5BalDany70H6BQFPy0qmHEuPrYqdYoDAOobkdBPnAoksPcUxkohO9f8THHbWBU LiamFo2ksJTiW6fKLPW80SV+Yj8/dBLU1BTj8t+1a7/twEZJJgvB4RtB1pv0qrfST7rv95 udcmQzFwddSQ5b92xouUOEuFCMtE3hVQQBdkg/75YZMY+BYifpF8B2dfgDNBsDe4iBx7FV YZzcrL+ASjg2FVeGsXe53K6wP3u2P4krHyERSknVzRaYY+eYhOafqYUJQqwErw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675876745; a=rsa-sha256; cv=none; b=Nm87MFujxLEk6IcZK4ZcyWpUm6bNZe2qf9cZ5PfA1s2fUu0AYDIn6p1uRWgpq6CxAlJyaJ VzT8AaJ2OZ61CVXdd5nfoZkT4YdrTrrqgFm44vWIkc5gmSDRSQ1Bxu0Vw4KzPVSmIwbaMt WK8OCAjIZPiyCsBz2PxAV/P+GWZ4o61Fsg7nDWKX/lghgUwytOfmypbe/quaQ/c3shHB8s ECWdEZexHZNNPmDkgM2JRpuZPEJKVLCRtBsG5CH5AhUs/ufwyYudCBfrhB/nHzQacz1vp4 N2r/3Rtp92smJCZm+M90mNp6T5lk1zIKg+QydD2kEQ9q9OL3Kyx6tDKymEUwQQ== 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 4PBmtw5wPhz14Mj; Wed, 8 Feb 2023 17:19:04 +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 318HJ4Vw036074; Wed, 8 Feb 2023 17:19:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 318HJ4bM036073; Wed, 8 Feb 2023 17:19:04 GMT (envelope-from git) Date: Wed, 8 Feb 2023 17:19:04 GMT Message-Id: <202302081719.318HJ4bM036073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 87d405eab911 - main - iommu_gas: initialize start_gap as first node 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87d405eab91169e0b650a7dd2e5097c0b990fac5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=87d405eab91169e0b650a7dd2e5097c0b990fac5 commit 87d405eab91169e0b650a7dd2e5097c0b990fac5 Author: Doug Moore AuthorDate: 2023-02-08 17:04:13 +0000 Commit: Doug Moore CommitDate: 2023-02-08 17:04:13 +0000 iommu_gas: initialize start_gap as first node In iommu_gas.c, domain->start_gap points to one of the nodes on either side of the first free, unallocated range. In iommu_gas_init_domain, it is initialized to point to the node after the single free range. Change it to point to the node before that free range, so that, when 'lowaddr' is within the initial free range, the first allocation search for free space below 'lowaddr' does not begin and end at an address above 'lowaddr'. This fixes problems on a machine with Intel DMAR enabled. Reported by: jah Reviewed by: dougm Tested by: jah Obtained from: jah Fixes: commit db151ca0c343531256b8839f938a4ecbd8b4fd7e iommu_gas: start space search from 1st free space MFC after: 1 day --- sys/dev/iommu/iommu_gas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index 86fc3bfa093c..fbef902e2f69 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -264,7 +264,7 @@ iommu_gas_init_domain(struct iommu_domain *domain) begin->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; RB_INSERT_PREV(iommu_gas_entries_tree, &domain->rb_root, end, begin); - domain->start_gap = end; + domain->start_gap = begin; domain->first_place = begin; domain->last_place = end; domain->flags |= IOMMU_DOMAIN_GAS_INITED;