From nobody Mon Aug 07 01:00:21 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 4RJyfb5GVqz4pk8b; Mon, 7 Aug 2023 01:00:23 +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 4RJyfZ496sz3Y1M; Mon, 7 Aug 2023 01:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691370022; 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=KS/FvjNwiomed9woklZ+yjyDHxuP4pf8uuycw6pQfrk=; b=UOnNSLPV6Sd3eOlsqbWTysxO4Qn6s0pl0XHiMUhTosWU96Dtn6ydMFd2PjjLdvfDhQ8mUa Co1EgKh4myGuR9EeCGOQivKqOAJX8Ckd7IqrCaOCrU5ox+ctYzc1fjruKi3JqfBojebz7l pfrwohJjimbA/Hiyg+gNvFFX0WLbfrUduh6cb+j2MgPYCX6cHqBWoR/J+ffmgdSFg5WNTT I3/dnhZF7hU0kjiyvfOBOuN75PWexZc9Ksma5SUsdd4HZ+OW+Def3w+lUWpvum6v2A1IvB 3498HkbaedKkg8ow9jBGG+NA9ZunXdGsnusRzSfhVKdcGrelOTuxjD9CynJlJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691370022; 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=KS/FvjNwiomed9woklZ+yjyDHxuP4pf8uuycw6pQfrk=; b=nB+ECl7OFF5OphR6v9OeGQOgSwntvf7UULHETSyt/ALqodosyuYzem6w8QSO51BZOsWjRf U3UHWp+ZpaDMK6n+77RZve37bIPZ74PDdjd4UbcQkhSEm9GNky3uvghu9o9rUg5OUUAcIz LsYyp2JlEIUaa9CvyoN9ZLAT0br7DRCp2UUOq9gnhOYej/7tpE8woiphb15l1H4ifx6rsG JgDZN/EL5TDo7RuA/BtGtcHBYIQpgQIJyXNh+myobPxyJWFGQwb6BzNHE60sUCwtctI6r7 dbEResC0HrW00mu4jmZ+fAImjM4tPBCUs4No8X6ZiTCRg8sbKhxy0Vn/O4yZ8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691370022; a=rsa-sha256; cv=none; b=Xmo+TdfQy6ILln+TzSBHSI+qZjK2HlAgdMRgzjRkZvhoKNQ9hX0BjLi3W3auZSw+epVWjf 7YZPvDsZXdAaq4X0Juz9895YEBSV+GF3Gi7EiwLq9nwUocSFHcP213dk671/iGEe1wjRqS 0uoW6m5PUf37inirIBP0QhPdb7fH7OqLOuqagpugrqXTHwDCvPQ3MmOkbMW8FA3p1JtPrs LH3Cb4Fd2gEBK9ZJ7zzrhleR6jQFTjASO31d+Wspz/Jl1K+PWBavek12tUx3RuXdLTOUm6 5Q8gVBz/sjiQt2y3eg2aJtTOzMRRcLi2dvc42/RXNKg4xc9iX0Ou7TbmiEE2/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RJyfY5wdKzXMX; Mon, 7 Aug 2023 01:00:21 +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 37710LoL087069; Mon, 7 Aug 2023 01:00:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37710LLk087068; Mon, 7 Aug 2023 01:00:21 GMT (envelope-from git) Date: Mon, 7 Aug 2023 01:00:21 GMT Message-Id: <202308070100.37710LLk087068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d1ea07642c47 - main - LinuxKPI: cleanup internal calls to VM_PAGE_TO_PHYS 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1ea07642c47e26effec58f53b7369bf5f797252 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1ea07642c47e26effec58f53b7369bf5f797252 commit d1ea07642c47e26effec58f53b7369bf5f797252 Author: Bjoern A. Zeeb AuthorDate: 2023-07-31 03:15:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-08-07 00:57:42 +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 MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41256 --- 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 01395cc7a0d5..e910545e04fc 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -183,7 +183,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 */ @@ -198,7 +198,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 b448262f3497..703e0a59e03c 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -158,7 +158,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 * @@ -649,7 +649,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 0cb724ebf6c4..cc45a77eadbe 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -91,7 +91,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 +