From nobody Thu Jun 20 22:00:07 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 4W4vYN1nvyz5NqT5; Thu, 20 Jun 2024 22:00:08 +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 4W4vYM6hpXz48pr; Thu, 20 Jun 2024 22:00:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718920807; 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=brdg2k5l/cjMdwCeY95lRBy46VfFY27u5oO35c+Q3OA=; b=HE3oiIi+O9wP8wdG6Clucg7CgAMqIjpqEALgtR6cGzF/0L0Xh+73qWApJ/cMQRmiumheRW q/xcp/iNMfxjHmceh7XiCe4c0BZoXGplO0V61DqyqAQt5HOc69LNyKEWSLzhdTKaWnaTlY iKohWs72VZdUCDpppufm/ECzbl3N4xSwBx4POVkypmX7Lk22FSx784o/JtGv2lApoH6edA MUXvYbxUBrOxC2TvV7Td5OEd7M01prQIc95tuTCtgmEk5YQs0UCDi2cStEx+KTsNjYG+c8 92s5bzlAEYlsCj/zKopuntsNTVgr9F9HIE6zpXiQW1F/ZBpH/2hFpFr+6KuqKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718920807; a=rsa-sha256; cv=none; b=sAdLJDh8JegCDj7PkBAArXwOP7pC9WHNB2YSIV+HZqusd0IYIBBxX8Xt63DYRaIGoIP2hm c8v3YqfyeyyixD6GgkFMBZ8KZvyPg8e6Y4zx1elpx18dm4ZNab86C3H30PlYoF6eQUKiMy 7o/J+87poasctnhV2Xo34+s34r4IWM7ijzFw2+ejpCg7qSSZK21xbhLyoj7Kc3focUPHo7 l7is7hsdS0Vpl39zdBIekgJyYzuLJyfQOHSIeSTc8McspaMPvtRO56fNoI6wCo9r7R2HLp QPISsutEdPMGqTsCoJwLKot4RwF2V+GEGH6hGfx+JSPibdP4PH7+Ta8aM3dqeg== 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=1718920807; 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=brdg2k5l/cjMdwCeY95lRBy46VfFY27u5oO35c+Q3OA=; b=pHKoh6y1DzaPJDsRgESxMgbtFzz1ENAp5bqYvWC5ufnnbx3xw+wwnLO45LMCYq6lYug8Tj +MFHhjUn/U4rVWmsARogMREt8vP3vgo5IevIXREceC+/f0NjbToV7h6rwtUNnGlbjztbBC AtHC8LfvPS5LIDER3HHbrvILkpKhT4Ye1T1KcwNGze8gEAHUMF6EL6mPjZSlpgTPVrKWVA bYg0DMRzUqh0B2edHPK/rP34/t9VACt5JyADkuWfA9cs1CSnEfqVDV8LEpSaXd7G28rbWF 8MtJoAJ5QTGzoZjDfama7sZg04Xl8RvknJ3mwBZAi0wLBNDCSeZattMLbsgIDA== 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 4W4vYM5XJFzjCt; Thu, 20 Jun 2024 22:00:07 +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 45KM070Z076987; Thu, 20 Jun 2024 22:00:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45KM07tk076981; Thu, 20 Jun 2024 22:00:07 GMT (envelope-from git) Date: Thu, 20 Jun 2024 22:00:07 GMT Message-Id: <202406202200.45KM07tk076981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d03e1ffbea6d - main - arm64: Remove some redundant calculations from pmap_bootstrap{,_san1}() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d03e1ffbea6dd74ea8716b6a7cd052893d347b58 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d03e1ffbea6dd74ea8716b6a7cd052893d347b58 commit d03e1ffbea6dd74ea8716b6a7cd052893d347b58 Author: Mark Johnston AuthorDate: 2024-06-20 20:43:48 +0000 Commit: Mark Johnston CommitDate: 2024-06-20 21:53:54 +0000 arm64: Remove some redundant calculations from pmap_bootstrap{,_san1}() No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. --- sys/arm64/arm64/pmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index e8991ae706f9..d072a387d9b9 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1323,13 +1323,12 @@ pmap_bootstrap(vm_size_t kernlen) min_pa = pmap_early_vtophys(KERNBASE); physmap_idx = physmem_avail(physmap, nitems(physmap)); - physmap_idx /= 2; /* * Find the minimum physical address. physmap is sorted, * but may contain empty ranges. */ - for (i = 0; i < physmap_idx * 2; i += 2) { + for (i = 0; i < physmap_idx; i += 2) { if (physmap[i] == physmap[i + 1]) continue; if (physmap[i] <= min_pa) @@ -1439,7 +1438,6 @@ pmap_bootstrap_san1(vm_offset_t va, int scale) * allocation since pmap_bootstrap(). */ physmap_idx = physmem_avail(physmap, nitems(physmap)); - physmap_idx /= 2; eva = va + (virtual_avail - VM_MIN_KERNEL_ADDRESS) / scale; @@ -1448,7 +1446,7 @@ pmap_bootstrap_san1(vm_offset_t va, int scale) * the shadow map as high up as we can to avoid depleting the lower 4GB in case * it's needed for, e.g., an xhci controller that can only do 32-bit DMA. */ - for (i = (physmap_idx * 2) - 2; i >= 0; i -= 2) { + for (i = physmap_idx - 2; i >= 0; i -= 2) { vm_paddr_t plow, phigh; /* L2 mappings must be backed by memory that is L2-aligned */