From nobody Thu Feb 9 07:06:29 2023 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 4PC7Fd6V5Cz3pqmb; Thu, 9 Feb 2023 07:06:29 +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 4PC7Fd60Phz3ymH; Thu, 9 Feb 2023 07:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926389; 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=iEXEB8wgAH5ib/92Q2Vzxyj9r2KeZi0E2gBM+Ih/Spc=; b=jBvGeBfceJEdATsDY6kqKVtemy9DX/s1S1e2dPpSZkQCpDGaq0v1nLw3GXf9IXwRWTigvC Zn2PJgO2BSkw8Eoc98MGseR0gUCX4fU8qbAqbO2L3i7vOq1WznTyh0enhu/O/42cpQbsK5 7Q9NoqpWw/NsUGkdrLk+uHBR/8Ms02eifVLrq6eg0LBTg8MaF3j4eYLZb0q8q/kfOEToS5 6KwRztoGV7Yk0XapfuNFcOQy/EmXKApZJ4Xr1HTSRu6bqPBPuTN3w0UfPXAnYTQX/9eFfa 8NXvs/vwSICihyxbrRyoajE9NGjFqG22vrvtcKYpWYBk7eC90nIg3cptC1CKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675926389; 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=iEXEB8wgAH5ib/92Q2Vzxyj9r2KeZi0E2gBM+Ih/Spc=; b=VxFv0Ff7Xgh8N3Mw4RUg7nKWEw8Ch1OAzNqQgEYNg6GGKY2WAiX4ahEUQgLsZGW9dDGrPQ 1RmAw1iBNlVFoNAs67IKU4ZIt7BoTz5IlE0/srHUWqwyMG9nSoA0G4pReXIYBKByZyYIqm YAcXl9tVqbIZFnQlmJWQNTQmoHAYuf6r7AfBFC/T2KmmzW0a2LtKpEyHP1FDWENsHRYYO9 qC8aZWE99o5GV4zwgoy0KEmtiwdegNZ6VYCV28LLivf3HlnSzAjSHCJ2Ox9Rq9zU3iOEzd GxkLHhcNhuAwC9j1/9C58CZ/6ClTVkisg99bhYo29++Kq3mHFhih81ProjB1Hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675926389; a=rsa-sha256; cv=none; b=nmEORfsCwZg73czS0oGakUSIwTE05A16n6o/jDlMMazfjEZ6tEYwcgO6b52wICSJQO6TKo 0xTgsvPDslNI0eaMFac8sAKvIALYILqe/q0U3EGmv072iRmPL8zY+GyKQcs3l+kyLcEKOg lNGR148U60pPUTWXS46Z83XQGwyBaSMdWJgra/gmE9ELzNW2L+WjhtOtL5ig5sDA1AdLtF tH3niT2FcRD+lada7vDy+GikDgmebok6/kiQucU429kdK2Nnu3k7LJ3dgoYebFY84ZAPKd QKHhjs0JVRODrpU5R56szpt8l5mS5FQjWmNsOWjiui7UNG5sJXlJLCV+hcFA6A== 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 4PC7Fd542zzSZR; Thu, 9 Feb 2023 07:06:29 +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 31976TJb022218; Thu, 9 Feb 2023 07:06:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31976TNp022217; Thu, 9 Feb 2023 07:06:29 GMT (envelope-from git) Date: Thu, 9 Feb 2023 07:06:29 GMT Message-Id: <202302090706.31976TNp022217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Moore Subject: git: 26a9c64d9df9 - stable/13 - iommu_gas: initialize start_gap as first node 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 commit 26a9c64d9df9d4e9ac543a5efeca375918fd1cc5 Author: Doug Moore AuthorDate: 2023-02-08 17:04:13 +0000 Commit: Doug Moore CommitDate: 2023-02-09 07:05:51 +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 (cherry picked from commit 87d405eab91169e0b650a7dd2e5097c0b990fac5) --- 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;