Re: [PATCH] powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

2024-12-16 Thread Sourabh Jain
Hello Ritesh, On 17/12/24 02:19, Ritesh Harjani (IBM) wrote: Ritesh Harjani (IBM) writes: Sourabh Jain writes: Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/

Re: [PATCH] mm/ptdump: Drop GENERIC_PTDUMP

2024-12-16 Thread Christophe Leroy
Le 17/12/2024 à 04:48, Anshuman Khandual a écrit : GENERIC_PTDUMP does not guard any code but instead just used for platform's subscription into core ptdump defined under PTDUMP_CORE, which is selected. Instead use PTDUMP_CORE for platform subscription and drop GENERIC_PTDUMP. Cc: Catalin Mar

[PATCH v2] powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

2024-12-16 Thread Sourabh Jain
Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not populating hpage_shift/HPAGE_SHIFT. Later, commit 2354ad252b66 ("powerpc/mm: Update def

[powerpc:next-test] BUILD SUCCESS 34064c8267a61063d684408db6ae78b571a9999d

2024-12-16 Thread kernel test robot
gcc-13.2.0 arc allnoconfiggcc-13.2.0 arc allyesconfiggcc-13.2.0 arc nsimosci_hs_defconfiggcc-13.2.0 arc randconfig-001-20241216gcc-13.2.0 arc randconfig-002-20241216

[PATCH 5/5] crash: option to let arch decide mem range is usable

2024-12-16 Thread Sourabh Jain
On PowerPC, the memory reserved for the crashkernel can contain components like RTAS, TCE, OPAL, etc., which should be avoided when loading kexec segments into crashkernel memory. Due to these special components, PowerPC has its own set of functions to locate holes in the crashkernel memory for loa

[PATCH 1/5] crash: remove an unused argument from reserve_crashkernel_generic()

2024-12-16 Thread Sourabh Jain
cmdline argument is not used in reserve_crashkernel_generic() so remove it. Correspondingly, all the callers have been updated as well. No functional change intended. Cc: Andrew Morton Cc: Baoquan he Cc: Hari Bathini CC: Madhavan Srinivasan Cc: Michael Ellerman Cc: ke...@lists.infradead.org

[PATCH 4/5] powerpc/crash: use generic crashkernel reservation

2024-12-16 Thread Sourabh Jain
Commit 0ab97169aa05 ("crash_core: add generic function to do reservation") added a generic function to reserve crashkernel memory. So let's use the same function on powerpc and remove the architecture-specific code that essentially does the same thing. The generic crashkernel reservation also prov

[PATCH 3/5] powerpc/kdump: preserve user-specified memory limit

2024-12-16 Thread Sourabh Jain
Commit 59d58189f3d9 ("crash: fix crash memory reserve exceed system memory bug") fails crashkernel parsing if the crash size is found to be higher than system RAM, which makes the memory_limit adjustment code ineffective due to an early exit from reserve_crashkernel(). Regardless lets not violated

[PATCH 2/5] crash: let arch decide crash memory export to iomem_resource

2024-12-16 Thread Sourabh Jain
insert_crashkernel_resources() adds crash memory to iomem_resource if generic crashkernel reservation is enabled on an architecture. On PowerPC, system RAM is added to iomem_resource. See commit c40dd2f766440 ("powerpc: Add System RAM to /proc/iomem"). Enabling generic crashkernel reservation on

[PATCH 0/5] powerpc/crash: use generic crashkernel reservation

2024-12-16 Thread Sourabh Jain
Commit 0ab97169aa05 ("crash_core: add generic function to do reservation") added a generic function to reserve crashkernel memory. So let's use the same function on powerpc and remove the architecture-specific code that essentially does the same thing. The generic crashkernel reservation also prov

Re: [PATCH v1] perf test expr: Fix system_tsc_freq for only x86

2024-12-16 Thread Athira Rajeev
> On 12 Dec 2024, at 12:37 PM, Namhyung Kim wrote: > > On Wed, 04 Dec 2024 18:23:05 -0800, Ian Rogers wrote: > >> The refactoring of tool PMU events to have a PMU then adding the expr >> literals to the tool PMU made it so that the literal system_tsc_freq >> was only supported on x86. Update

Re: [PATCH] tools/perf/arch/powerpc: Add register mask for power11 PVR in extended regs

2024-12-16 Thread Athira Rajeev
> On 16 Dec 2024, at 10:15 PM, Arnaldo Carvalho de Melo wrote: > > On Mon, Dec 16, 2024 at 03:32:12PM +0530, Athira Rajeev wrote: >>> On 11 Dec 2024, at 5:32 PM, kajoljain wrote: >>> On 12/6/24 19:26, Athira Rajeev wrote: Perf tools side uses extended mask to display the platform su

Re: [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts

2024-12-16 Thread Alistair Popple
per acks. > > But I'm having difficulty determining how practical that is because the > v3 series is almost a month old so my test merging was quite ugly. > > Perhaps you could prepare a new-doesn't-need-to-be-final version for > people to look at and to aid with this head-scrat

[PATCH v4 24/25] mm: Remove devmap related functions and page table bits

2024-12-16 Thread Alistair Popple
Now that DAX and all other reference counts to ZONE_DEVICE pages are managed normally there is no need for the special devmap PTE/PMD/PUD page table bits. So drop all references to these, freeing up a software defined page table bit on architectures supporting it. Signed-off-by: Alistair Popple A

[PATCH v4 25/25] Revert "riscv: mm: Add support for ZONE_DEVICE"

2024-12-16 Thread Alistair Popple
DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove them. Signed-off-by: Alistair Popple Suggested-by: Chunyan Zhang Reviewed-by: Björn Töpel --- arch/riscv/Kconfig| 1 - arch/riscv/include/asm/pgtable-64.h | 20 arch/riscv/include/as

[PATCH v4 20/25] mm/mlock: Skip ZONE_DEVICE PMDs during mlock

2024-12-16 Thread Alistair Popple
At present mlock skips ptes mapping ZONE_DEVICE pages. A future change to remove pmd_devmap will allow pmd_trans_huge_lock() to return ZONE_DEVICE folios so make sure we continue to skip those. Signed-off-by: Alistair Popple --- mm/mlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm

[PATCH v4 23/25] mm: Remove pXX_devmap callers

2024-12-16 Thread Alistair Popple
The devmap PTE special bit was used to detect mappings of FS DAX pages. This tracking was required to ensure the generic mm did not manipulate the page reference counts as FS DAX implemented it's own reference counting scheme. Now that FS DAX pages have their references counted the same way as nor

[PATCH v4 22/25] device/dax: Properly refcount device dax pages when mapping

2024-12-16 Thread Alistair Popple
Device DAX pages are currently not reference counted when mapped, instead relying on the devmap PTE bit to ensure mapping code will not get/put references. This requires special handling in various page table walkers, particularly GUP, to manage references on the underlying pgmap to ensure the page

[PATCH v4 21/25] fs/dax: Properly refcount fs dax pages

2024-12-16 Thread Alistair Popple
Currently fs dax pages are considered free when the refcount drops to one and their refcounts are not increased when mapped via PTEs or decreased when unmapped. This requires special logic in mm paths to detect that these pages should not be properly refcounted, and to detect when the refcount drop

[PATCH v4 19/25] proc/task_mmu: Ignore ZONE_DEVICE pages

2024-12-16 Thread Alistair Popple
The procfs mmu files such as smaps currently ignore device dax and fs dax pages because these pages are considered special. To maintain existing behaviour once these pages are treated as normal pages and returned from vm_normal_page() add tests to explicitly skip them. Signed-off-by: Alistair Popp

[PATCH v4 18/25] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2024-12-16 Thread Alistair Popple
Longterm pinning of FS DAX pages should already be disallowed by various pXX_devmap checks. However a future change will cause these checks to be invalid for FS DAX pages so make folio_is_longterm_pinnable() return false for FS DAX pages. Signed-off-by: Alistair Popple Reviewed-by: John Hubbard

[PATCH v4 17/25] memremap: Add is_device_dax_page() and is_fsdax_page() helpers

2024-12-16 Thread Alistair Popple
Add helpers to determine if a page or folio is a device dax or fs dax page or folio. Signed-off-by: Alistair Popple --- include/linux/memremap.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/linux/memremap.h b/include/linux/memremap.h index 0256a42..f2a8d13

[PATCH v4 16/25] huge_memory: Add vmf_insert_folio_pmd()

2024-12-16 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pmd. This will map the entire PMD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

[PATCH v4 14/25] rmap: Add support for PUD sized mappings to rmap

2024-12-16 Thread Alistair Popple
The rmap doesn't currently support adding a PUD mapping of a folio. This patch adds support for entire PUD mappings of folios, primarily to allow for more standard refcounting of device DAX folios. Currently DAX is the only user of this and it doesn't require support for partially mapped PUD-sized

[PATCH v4 15/25] huge_memory: Add vmf_insert_folio_pud()

2024-12-16 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pud. This will map the entire PUD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

[PATCH v4 13/25] mm/memory: Add vmf_insert_page_mkwrite()

2024-12-16 Thread Alistair Popple
Currently to map a DAX page the DAX driver calls vmf_insert_pfn. This creates a special devmap PTE entry for the pfn but does not take a reference on the underlying struct page for the mapping. This is because DAX page refcounts are treated specially, as indicated by the presence of a devmap entry.

[PATCH v4 12/25] mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings

2024-12-16 Thread Alistair Popple
In preparation for using insert_page() for DAX, enhance insert_page_into_pte_locked() to handle establishing writable mappings. Recall that DAX returns VM_FAULT_NOPAGE after installing a PTE which bypasses the typical set_pte_range() in finish_fault. Signed-off-by: Alistair Popple Suggested-by:

[PATCH v4 11/25] mm: Allow compound zone device pages

2024-12-16 Thread Alistair Popple
Zone device pages are used to represent various type of device memory managed by device drivers. Currently compound zone device pages are not supported. This is because MEMORY_DEVICE_FS_DAX pages are the only user of higher order zone device pages and have their own page reference counting. A futu

[PATCH v4 09/25] mm/gup.c: Remove redundant check for PCI P2PDMA page

2024-12-16 Thread Alistair Popple
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the check in __gup_device_huge() is redundant. Remove it Signed-off-by: Alistair Popple Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Wiliams Acked-by: David Hildenbrand --- mm/gup.c | 5 - 1 file changed, 5 deletions(-) diff

[PATCH v4 10/25] mm/mm_init: Move p2pdma page refcount initialisation to p2pdma

2024-12-16 Thread Alistair Popple
Currently ZONE_DEVICE page reference counts are initialised by core memory management code in __init_zone_device_page() as part of the memremap() call which driver modules make to obtain ZONE_DEVICE pages. This initialises page refcounts to 1 before returning them to the driver. This was presumabl

[PATCH v4 08/25] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag

2024-12-16 Thread Alistair Popple
PAGE_MAPPING_DAX_SHARED is the same as PAGE_MAPPING_ANON. This isn't currently a problem because FS DAX pages are treated specially. However a future change will make FS DAX pages more like normal pages, so folio_test_anon() must not return true for a FS DAX page. We could explicitly test for a FS

[PATCH v4 06/25] fs/dax: Always remove DAX page-cache entries when breaking layouts

2024-12-16 Thread Alistair Popple
Prior to any truncation operations file systems call dax_break_mapping() to ensure pages in the range are not under going DMA. Later DAX page-cache entries will be removed by truncate_folio_batch_exceptionals() in the generic page-cache code. However this makes it possible for folios to be removed

[PATCH v4 07/25] fs/dax: Ensure all pages are idle prior to filesystem unmount

2024-12-16 Thread Alistair Popple
File systems call dax_break_mapping() prior to reallocating file system blocks to ensure the page is not undergoing any DMA or other accesses. Generally this is needed when a file is truncated to ensure that if a block is reallocated nothing is writing to it. However filesystems currently don't cal

[PATCH v4 05/25] fs/dax: Create a common implementation to break DAX layouts

2024-12-16 Thread Alistair Popple
Prior to freeing a block file systems supporting FS DAX must check that the associated pages are both unmapped from user-space and not undergoing DMA or other access from eg. get_user_pages(). This is achieved by unmapping the file range and scanning the FS DAX page-cache to see if any pages within

[PATCH v4 04/25] fs/dax: Refactor wait for dax idle page

2024-12-16 Thread Alistair Popple
A FS DAX page is considered idle when its refcount drops to one. This is currently open-coded in all file systems supporting FS DAX. Move the idle detection to a common function to make future changes easier. Signed-off-by: Alistair Popple Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Re

[PATCH v4 02/25] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2024-12-16 Thread Alistair Popple
dax_layout_busy_page_range() is used by file systems to scan the DAX page-cache to unmap mapping pages from user-space and to determine if any pages in the given range are busy, either due to ongoing DMA or other get_user_pages() usage. Currently it checks to see the file mapping is mapped into us

[PATCH v4 03/25] fs/dax: Don't skip locked entries when scanning entries

2024-12-16 Thread Alistair Popple
Several functions internal to FS DAX use the following pattern when trying to obtain an unlocked entry: xas_for_each(&xas, entry, end_idx) { if (dax_is_locked(entry)) entry = get_unlocked_entry(&xas, 0); This is problematic because get_unlocked_entry() will get the next pr

[PATCH v4 00/25] fs/dax: Fix ZONE_DEVICE page reference counts

2024-12-16 Thread Alistair Popple
Main updates since v3: - Rebased onto next-20241216 - Fixed a bunch of build breakages reported by John Hubbard and the kernel test robot due to various combinations of CONFIG options. - Split the rmap changes into a separate patch as suggested by David H. - Reworded the description for

[PATCH v4 01/25] fuse: Fix dax truncate/punch_hole fault path

2024-12-16 Thread Alistair Popple
FS DAX requires file systems to call into the DAX layout prior to unlinking inodes to ensure there is no ongoing DMA or other remote access to the direct mapped page. The fuse file system implements fuse_dax_break_layouts() to do this which includes a comment indicating that passing dmap_end == 0 l

Re: [PATCH] powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

2024-12-16 Thread Sourabh Jain
Hello Ritesh, On 17/12/24 00:07, Ritesh Harjani (IBM) wrote: Sourabh Jain writes: Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not

[PATCH] mm/ptdump: Drop GENERIC_PTDUMP

2024-12-16 Thread Anshuman Khandual
GENERIC_PTDUMP does not guard any code but instead just used for platform's subscription into core ptdump defined under PTDUMP_CORE, which is selected. Instead use PTDUMP_CORE for platform subscription and drop GENERIC_PTDUMP. Cc: Catalin Marinas Cc: Will Deacon Cc: Jonathan Corbet Cc: Marc Zyn

Re: [PATCH 0/2] Remove cxl and cxlflash drivers

2024-12-16 Thread Andrew Donnellan
On Tue, 2024-12-17 at 14:26 +1100, Michael Ellerman wrote: > It would be good to explain that this only removes support for the > original CAPI interface - not the Power9 "OpenCAPI", which is still > supported by drivers/misc/ocxl. Agreed, will mention if/when I respin this -- Andrew Donnellan

Re: [PATCH 0/2] Remove cxl and cxlflash drivers

2024-12-16 Thread Michael Ellerman
Andrew Donnellan writes: > This series removes the cxl and cxlflash drivers for IBM CAPI devices. > > CAPI devices have been out of production for some time, and we're not > aware of any remaining users who are likely to want a modern kernel. > There's almost certainly some remaining driver bugs a

[PATCH] macintosh: declare ctl_table as const

2024-12-16 Thread Luis Felipe Hernandez
_table mac_hid_files[] = { { .procname = "mouse_button_emulation", .data = &mouse_emulate_buttons, --- base-commit: e25c8d66f6786300b680866c0e0139981273feba change-id: 20241216-constify_sysctl_mac_hid-55886592c206 Best regards, -- Luis Felipe Hernandez

Re: [PATCH] powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

2024-12-16 Thread IBM
Ritesh Harjani (IBM) writes: > Sourabh Jain writes: > >> Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump >> is active") disabled hugetlb support when fadump is active by returning >> early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not >> populating hpage_sh

Re: [PATCH] powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

2024-12-16 Thread IBM
Sourabh Jain writes: > Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump > is active") disabled hugetlb support when fadump is active by returning > early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not > populating hpage_shift/HPAGE_SHIFT. > > Later, commit 235

Re: [PATCH] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel

2024-12-16 Thread Athira Rajeev
> On 5 Dec 2024, at 11:16 PM, Athira Rajeev wrote: > > > >> On 14 Nov 2024, at 3:35 PM, Michael Petlan wrote: >> >> On Sun, 3 Nov 2024, Athira Rajeev wrote: On 17 Oct 2024, at 3:44 PM, Michael Petlan wrote: On Mon, 14 Oct 2024, Athira Rajeev wrote: >> [...] I am

Re: [PATCH v2 1/3] fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE

2024-12-16 Thread Simona Vetter
On Fri, Dec 13, 2024 at 08:26:19AM +0100, Thomas Zimmermann wrote: > Hi > > > Am 13.12.24 um 00:56 schrieb Helge Deller: > > On 12/13/24 00:24, Jani Nikula wrote: > > > On Thu, 12 Dec 2024, "Arnd Bergmann" wrote: > > > > On Thu, Dec 12, 2024, at 19:44, Helge Deller wrote: > > > > > On 12/12/24 1

Re: [PATCH V3] tools/perf/tests/shell/base_probe: Enhance print_overall_results to print summary information

2024-12-16 Thread Arnaldo Carvalho de Melo
On Wed, Dec 11, 2024 at 05:33:50PM +0530, kajoljain wrote: > On 12/6/24 19:22, Athira Rajeev wrote: > > Here -a and -d doesn't require DWARF. Similarly there > > are few other tests requiring DWARF. To hint the user that > > missing dwarf could be one issue, update print_overall_results > > to prin

Re: [PATCH v2 3/3] selftest/powerpc/ptrace: Cleanup duplicate macro definitions

2024-12-16 Thread IBM
Madhavan Srinivasan writes: > Both core-pkey.c and ptrace-pkey.c tests have > similar macro definitions, move them to "pkeys.h" > and remove the macro definitions from the C file. > > Signed-off-by: Madhavan Srinivasan > --- > Changelog v1: > - Removed additional macros pointed out by Ritesh >

Re: [PATCH] tools/perf/arch/powerpc: Add register mask for power11 PVR in extended regs

2024-12-16 Thread Arnaldo Carvalho de Melo
On Mon, Dec 16, 2024 at 03:32:12PM +0530, Athira Rajeev wrote: > > On 11 Dec 2024, at 5:32 PM, kajoljain wrote: > > On 12/6/24 19:26, Athira Rajeev wrote: > >> Perf tools side uses extended mask to display the platform > >> supported register names (with -I? option) to the user > >> and also send

Re: [RFC PATCH 0/2] sched/fair: introduce new scheduler group type group_parked

2024-12-16 Thread Tobias Huschle
On 10/12/2024 21:24, Shrikanth Hegde wrote: On 12/9/24 13:35, Tobias Huschle wrote: [...] So I gave it a try with using a debugfs based hint to say which CPUs are parked. It is a hack to try it out. patch is below so one could try something similar is their archs and see if it help if

[PATCH 3/4] PCI: shpchp: Cleanup logging and debug wrappers

2024-12-16 Thread Ilpo Järvinen
The shpchp hotplug driver defines logging wrappers ctrl_*() and another set of wrappers with generic names which are just duplicates of existing generic printk() wrappers. Only the former are useful to preserve as they handle the controller dereferencing (the latter are also unused). The "shpchp_d

[PATCH 1/4] PCI: shpchp: Remove logging from module init/exit functions

2024-12-16 Thread Ilpo Järvinen
The logging in shpchp module init/exit functions is not very useful. Remove it. Signed-off-by: Ilpo Järvinen --- drivers/pci/hotplug/shpchp_core.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c

[PATCH 0/4] PCI: pci_printk() removal (+ related cleanups)

2024-12-16 Thread Ilpo Järvinen
include/linux/pci.h provides pci_printk() which is a low-level interface with level that is only useful for AER due to error severity variations. This series cleans up shpchp logging wrappers to avoid using low-level pci_printk() unnecessarily and replaces pci_printk() with aer_printk(). Ilpo Jär

[PATCH 4/4] PCI: Descope pci_printk() to aer_printk()

2024-12-16 Thread Ilpo Järvinen
include/linux/pci.h provides low-level pci_printk() interface that is only used by AER because it needs to print the same message with different levels depending on the error severity. No other PCI code uses that functionality and calls pci_() logging functions directly with the appropriate level.

[PATCH 2/4] PCI: shpchp: Change dbg() -> ctrl_dbg()

2024-12-16 Thread Ilpo Järvinen
Convert the last user of dbg() to use ctrl_dbg(). Signed-off-by: Ilpo Järvinen --- drivers/pci/hotplug/shpchp_hpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 012b9e3fe5b0..bfbec7c1a6b1 100644 ---

[PATCH v2 1/3] selftest/powerpc/ptrace/core-pkey: Remove duplicate macros

2024-12-16 Thread Madhavan Srinivasan
./powerpc/ptrace/Makefile includes flags.mk. In flags.mk, -I$(selfdir)/powerpc/include is always included as part of CFLAGS. So it will pick up the "pkeys.h" defined in powerpc/include. core-pkey.c test has couple of macros defined which are part of "pkeys.h" header file. Remove those duplicates a

[PATCH v2 2/3] selftest/powerpc/ptrace/ptrace-pkey: Remove duplicate macros

2024-12-16 Thread Madhavan Srinivasan
./powerpc/ptrace/Makefile includes flags.mk. In flags.mk, -I$(selfdir)/powerpc/include is always included as part of CFLAGS. So it will pick up the "pkeys.h" defined in powerpc/include. ptrace-pkey.c test has macros defined which are part of "pkeys.h" header file. Remove those duplicates and inclu

[PATCH v2 3/3] selftest/powerpc/ptrace: Cleanup duplicate macro definitions

2024-12-16 Thread Madhavan Srinivasan
Both core-pkey.c and ptrace-pkey.c tests have similar macro definitions, move them to "pkeys.h" and remove the macro definitions from the C file. Signed-off-by: Madhavan Srinivasan --- Changelog v1: - Removed additional macros pointed out by Ritesh which are duplicates and are avilable in "pk

[PATCH 04/17] vdso: Add generic random data storage

2024-12-16 Thread Thomas Weißschuh
Extend the generic vDSO data storage with a page for the random state data. The random state data is stored in a dedicated page, as the existing storage page is only meant for time-related, time-namespace-aware data. This simplifies to access logic to not need to handle time namespaces anymore and

[PATCH 16/17] vdso: Remove remnants of architecture-specific time storage

2024-12-16 Thread Thomas Weißschuh
All users of the random vDSO are using the generic storage implementation. Remove the now unnecessary compatibility accessor functions and symbols. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/arm/include/asm/vdso/vsyscall.h | 2 +- include/asm-gene

[PATCH 17/17] vdso: Remove kconfig symbol GENERIC_VDSO_DATA_STORE

2024-12-16 Thread Thomas Weißschuh
All users of HAVE_GENERIC_VDSO have been switched over to the generic storage logic. The dedicated kconfig symbol can be removed and replaced by HAVE_GENERIC_VDSO. Signed-off-by: Thomas Weißschuh --- arch/Kconfig | 2 +- arch/arm/mm/Kconfig | 1 - arch/arm64/Kconfig | 1 -

[PATCH 15/17] vdso: Remove remnants of architecture-specific random state storage

2024-12-16 Thread Thomas Weißschuh
All users of the random vDSO are using the generic storage implementation. Remove the now unnecessary compatibility accessor functions and symbols. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- drivers/char/random.c | 6 +++--- include/vdso/datapage.h |

[PATCH 07/17] riscv: vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/riscv/Kconfig |

[PATCH 05/17] vdso: Add generic architecture-specific data storage

2024-12-16 Thread Thomas Weißschuh
Some architectures need to architecture-specific data to the vDSO. Enable the generic vDSO storage mechanism to both store and map this data. Some architectures require more than a single page, like LoongArch, so prepare for that usecase, too. Signed-off-by: Thomas Weißschuh --- arch/Kconfig

[PATCH 12/17] powerpc/vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/powerpc/Kconfig | 2 +

[PATCH 13/17] x86/vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. This switch also moves the random state data out of the time data page. The currently used hardcoded __VDSO_RND_DATA_OFFSET does not take into

[PATCH 06/17] arm64: vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. This switch also moves the random state data out of the time data page. The currently used hardcoded __VDSO_RND_DATA_OFFSET does not take into

[PATCH 08/17] LoongArch: vDSO: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/loongarch/Kconfig | 2 +

[PATCH 14/17] x86/vdso/vdso2c: Remove page handling

2024-12-16 Thread Thomas Weißschuh
The values are not used anymore. Also the sanity checks performed by vdso2c can never trigger as they only validate invariants already enforced by the linker script. Signed-off-by: Thomas Weißschuh --- arch/x86/entry/vdso/vdso-layout.lds.S | 4 arch/x86/entry/vdso/vdso2c.c | 21 --

[PATCH 10/17] s390/vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/s390/Kconfig | 1 + arch

[PATCH 09/17] arm: vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/arm/include/asm/vdso.h | 2 ++ arch

[PATCH 11/17] MIPS: vdso: Switch to generic storage implementation

2024-12-16 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/mips/Kconfig | 1 + arch

[PATCH 03/17] vdso: Add generic time data storage

2024-12-16 Thread Thomas Weißschuh
Historically each architecture defined their own way to store the vDSO data page. Add a generic mechanism to provide storage for that page. Furthermore this generic storage will be extended to also provide uniform storage for *non*-time-related data, like the random state or architecture-specific

[PATCH 02/17] vdso: Introduce vdso/align.h

2024-12-16 Thread Thomas Weißschuh
The vDSO implementation can only include headers from the vdso/ namespace. To enable the usage of the ALIGN() macro from the vDSO, move linux/align.h to vdso/align.h wholly. As the only dependency linux/const.h is only a wrapper around vdso/const.h anyways adapt that dependency. Also provide a com

[PATCH 00/17] vDSO: Introduce generic data storage

2024-12-16 Thread Thomas Weißschuh
Currently each architecture defines the setup of the vDSO data page on its own, mostly through copy-and-paste from some other architecture. Extend the existing generic vDSO implementation to also provide generic data storage. This removes duplicated code and paves the way for further changes to the

[PATCH 01/17] parisc: Remove unused symbol vdso_data

2024-12-16 Thread Thomas Weißschuh
The symbol vdso_data is and has been unused. Remove it. Signed-off-by: Thomas Weißschuh --- arch/parisc/include/asm/vdso.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/parisc/include/asm/vdso.h b/arch/parisc/include/asm/vdso.h index 2a2dc11b5545fc642a7ae4596dc174111433e948..5f581c1

Re: [PATCH v10 4/5] Documentation/kbuild: Document storage of symbol information

2024-12-16 Thread Petr Pavlu
On 11/23/24 03:42, Matthew Maurer wrote: > Document where exported and imported symbols are kept, format options, > and limitations. > > Signed-off-by: Matthew Maurer > --- > Documentation/kbuild/modules.rst | 20 > 1 file changed, 20 insertions(+) > > diff --git a/Document

[PATCH] powerpc/64: Use get_user() in start_thread()

2024-12-16 Thread Michael Ellerman
For ELFv1 binaries (big endian), the ELF entry point isn't the address of the first instruction, instead it points to the function descriptor for the entry point. The address of the first instruction is in the function descriptor. That means the kernel has to fetch the address of the first instruc

Re: [PATCH 1/3] selftest/powerpc/ptrace/core-pkey: Remove duplicate macros

2024-12-16 Thread Madhavan Srinivasan
On 12/16/24 4:17 PM, Ritesh Harjani (IBM) wrote: > Madhavan Srinivasan writes: > >> core-pkey.c test has couple of macros defined which >> are part of "pkeys.h" header file. Remove those >> duplicates and include "pkeys.h" >> >> Signed-off-by: Madhavan Srinivasan >> --- >> .../selftests/powe

Re: [PATCH 2/3] selftest/powerpc/ptrace/ptrace-pkey: Remove duplicate macros

2024-12-16 Thread Madhavan Srinivasan
On 12/16/24 4:24 PM, Ritesh Harjani (IBM) wrote: > Madhavan Srinivasan writes: > >> ptrace-pkey.c test has macros defined which >> are part of "pkeys.h" header file. Remove those >> duplicates and include "pkeys.h" >> >> Signed-off-by: Madhavan Srinivasan >> --- >> .../testing/selftests/powe

Re: [PATCH 3/3] selftest/powerpc/ptrace: Cleanup duplicate macro definitions

2024-12-16 Thread Madhavan Srinivasan
On 12/16/24 4:27 PM, Ritesh Harjani (IBM) wrote: > Madhavan Srinivasan writes: > >> Both core-pkey.c and ptrace-pkey.c tests have similar macro >> definitions, move them to "pkeys.h" and remove the macro >> definitions from the C file. >> >> Signed-off-by: Madhavan Srinivasan >> --- >> tools

[PATCH 1/9] ocxl: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/ocxl/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 2/9] cxl: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/cxl/sysfs.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH 5/9] misc: c2port: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/c2port/core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 de

[PATCH 9/9] misc: ds1682: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/ds1682.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH 8/9] misc: eeprom/max6875: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/eeprom/max6875.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

[PATCH 7/9] misc: eeprom/idt_89hpesx: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 de

[PATCH 6/9] misc: pch_phub: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/pch_phub.c | 8 1 file changed, 4 insertions(+), 4 deletions(

[PATCH 3/9] misc: sram: constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/misc/sram.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH 4/9] misc: c2port: Calculate bin_attribute size through group callback

2024-12-16 Thread Thomas Weißschuh
Modifying the size of the global bin_attribute instance can be racy. Instead use the new .bin_size callback to do so safely. Signed-off-by: Thomas Weißschuh --- drivers/misc/c2port/core.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/misc/c2port/cor

[PATCH 0/9] misc: constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (9): ocxl: Constify 'struct bin_attribute' cxl: Constif

[PATCH 05/11] scsi: ibmvfc: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/ibmvscsi/ibmvfc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 delet

[PATCH 11/11] scsi: qla4xxx: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/qla4xxx/ql4_attr.c | 12 ++-- 1 file changed, 6 insertions(+),

[PATCH 10/11] scsi: qla2xxx: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/qla2xxx/qla_attr.c | 80 - 1 f

[PATCH 02/11] scsi: 3w-sas: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/3w-sas.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletio

[PATCH 01/11] scsi: core: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/scsi_sysfs.c | 16 1 file changed, 8 insertions(+), 8

[PATCH 09/11] scsi: qedi: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/qedi/qedi_dbg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 08/11] scsi: qedf: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/scsi/qedf/qedf_attr.c | 10 +- drivers/scsi/qedf/qedf_dbg.h | 2 +

  1   2   >