From nobody Wed Nov 29 16:37:56 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 4SgQ3m4vDxz52wYj; Wed, 29 Nov 2023 16:37:56 +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 4SgQ3m4FJMz3GFl; Wed, 29 Nov 2023 16:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275876; 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=7tx20D5tNntL59z9HOAa5wegbCQ9xL1175xNoUn6xOQ=; b=sfV4oZPmeos+Jbk2ukeYxP8NCffC091xm07TQpsQMnomnjGQ4VzSqaWi2xN0XQC3YeR1GO RPNR2gnwb+mjASlONqK6lnxIIm1CUwJqNt4f/svX9gLqeA79Vr4C0/dO3zXjdtwjCL8zF5 PoKAZLaUTp6K+xqQ1n+2IkLfyhqu7SYOoWFbraGix13gbdP1A3xeYxpBfmr7ozCzBRy3xt 3AukGHAP0KeoTKJhz3hnFy3HgkqZBUgdtKnTJvntUjqj1a0jjxI8dfx5LVt6vdYegjt3U0 jurzFIrCTqjmlFLois/xa+FCsd2q6K7tsK2SJZEh52ljdw4vgOyBmYKn9aCkSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275876; 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=7tx20D5tNntL59z9HOAa5wegbCQ9xL1175xNoUn6xOQ=; b=XwvGOosAicE8xLy9Rg0RT7dzrR0KhxkLtvm9IWI2dXD623VZaMIpoDgJ10VGk+jFeT1Bdu NZdUk4BteYIEtjiPSW/NH+nib/jtmXK9vVJ5vry+rxu4SCjbmzEMFKDuVwhQB883qHH3Tk JWjHajAPJ8xp0Lw6CuyzM58YdRkxcQThLl2HEg2UWYRLheSsGpG9UP3+ESJqj0JXpmcO3t DzTlnZeoF3LYrl3Y80ke9kuiqHpCgtyGrlDVJOC4PtCbyqe37qKUyDfonEsaqWVG6qjd4x eRFcZCt7T14HlTPtqKEkcOLNy4aPg1KTdNop+M1Vg7JrmvdfAf595fbTPYaITQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275876; a=rsa-sha256; cv=none; b=biUAzVTS/DR1zObkYjDvErEQMqOhxEbKq2Vq4sp/Wn6IEml2smHhblFys8la9f+UmHjAzD njHxUSrT6dIHrXG8QX51AQR/6cmWEtym1ESJkzB5Dw+S7RsvEzljWjhoI2we1VCi7ZJI6q 34LmFCm3oOd/XxeRV5LbAJJAsoZG1oYZRBjTDpRcPobfrPXQlzzTvvAeN8k2wmeOtaOZ6q 6mtth8WM3NV224p1vYRNOvJ4DgBXldLY+7JAEEbycu5C0w8qMI6NM2nP5A6OQhkpW0WGIq Qly/RiluwZ3KppA1fw9v7zPavtEoFrjQTDTqF6dY0wtAVDNJC/QZeY/Sm/QS0w== 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 4SgQ3m3KrVz1C7R; Wed, 29 Nov 2023 16:37:56 +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 3ATGbuEr044538; Wed, 29 Nov 2023 16:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGbu9D044535; Wed, 29 Nov 2023 16:37:56 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:37:56 GMT Message-Id: <202311291637.3ATGbu9D044535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b4e06954f55d - stable/13 - LinuxKPI: cleanup internal calls to VM_PAGE_TO_PHYS 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4e06954f55d9380afb8333791b7b2b16f368be2 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b4e06954f55d9380afb8333791b7b2b16f368be2 commit b4e06954f55d9380afb8333791b7b2b16f368be2 Author: Bjoern A. Zeeb AuthorDate: 2023-07-31 03:15:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:04 +0000 LinuxKPI: cleanup internal calls to VM_PAGE_TO_PHYS Replace FreeBSD native VM_PAGE_TO_PHYS() calls with page_to_phys() allowing us to work on a struct page in the future using the one single public Linux KPI interface to map to a native FreeBSD vm_page. This should be a NOP. Sponsored by: The FreeBSD Foundation (cherry picked from commit d1ea07642c47e26effec58f53b7369bf5f797252) --- sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 4 ++-- sys/compat/linuxkpi/common/include/linux/highmem.h | 2 +- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_page.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 3b98e03ad6a4..4a53b7675302 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -181,7 +181,7 @@ dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir, unsigned long attrs) { - return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size)); + return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); } /* linux_dma_(un)map_sg_attrs does not support attrs yet */ @@ -196,7 +196,7 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) { - return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size)); + return (linux_dma_map_phys(dev, page_to_phys(page) + offset, size)); } static inline void diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index a3f9af82400e..f770bef6b3b7 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -60,7 +60,7 @@ kmap(struct page *page) struct sf_buf *sf; if (PMAP_HAS_DMAP) { - return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))); + return ((void *)PHYS_TO_DMAP(page_to_phys(page))); } else { sched_pin(); sf = sf_buf_alloc(page, SFB_NOWAIT | SFB_CPUPRIVATE); diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 4c4629583080..17928f9c50e5 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -156,7 +156,7 @@ sg_next(struct scatterlist *sg) static inline vm_paddr_t sg_phys(struct scatterlist *sg) { - return (VM_PAGE_TO_PHYS(sg_page(sg)) + sg->offset); + return (page_to_phys(sg_page(sg)) + sg->offset); } static inline void * @@ -647,7 +647,7 @@ sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, break; vaddr = (char *)sf_buf_kva(sf); } else - vaddr = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page)); + vaddr = (char *)PHYS_TO_DMAP(page_to_phys(page)); memcpy(buf, vaddr + sg->offset + offset, len); if (!PMAP_HAS_DMAP) sf_buf_free(sf); diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index ca2f6a8e6d08..d99d64cac403 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -89,7 +89,7 @@ linux_page_address(struct page *page) if (page->object != kernel_object) { return (PMAP_HAS_DMAP ? - ((void *)(uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))) : + ((void *)(uintptr_t)PHYS_TO_DMAP(page_to_phys(page))) : NULL); } return ((void *)(uintptr_t)(VM_MIN_KERNEL_ADDRESS +