Due to CPU/Memory hotplug or online/offline events, the elfcorehdr
(which describes the CPUs and memory of the crashed kernel) and FDT
(Flattened Device Tree) of kdump image becomes outdated. Consequently,
attempting dump collection with an outdated elfcorehdr or FDT can lead
to failed or
Move the following functions form kexec/{file_load_64.c => ranges.c} and
make them public so that components other than KEXEC_FILE can also use
these functions.
1. get_exclude_memory_ranges
2. get_reserved_memory_ranges
3. get_crash_memory_ranges
4. get_usable_memory_ranges
Later in the series
Move the update_cpus_node() from kexec/{file_load_64.c => core_64.c}
to allow other kexec components to use it.
Later in the series, this function is used for in-kernel updates
to the kdump image during CPU/memory hotplug or online/offline events for
both kexec_load and kexec_file_load syscalls.
Commit a72bbec70da2 ("crash: hotplug support for kexec_load()")
introduced a new kexec flag, `KEXEC_UPDATE_ELFCOREHDR`. Kexec tool uses
this flag to indicate to the kernel that it is safe to modify the
elfcorehdr of the kdump image loaded using the kexec_load system call.
However, it is possible
Commit 247262756121 ("crash: add generic infrastructure for crash
hotplug support") added a generic infrastructure that allows
architectures to selectively update the kdump image component during CPU
or memory add/remove events within the kernel itself.
This patch series adds crash hotplug
In the event of memory hotplug or online/offline events, the crash
memory hotplug notifier `crash_memhp_notifier()` receives a
`memory_notify` object but doesn't forward that object to the
generic and architecture-specific crash hotplug handler.
The `memory_notify` object contains the starting
On 3/25/24 18:09, Maíra Canal wrote:
On 3/25/24 16:24, Guenter Roeck wrote:
Hi,
On Mon, Mar 25, 2024 at 04:05:06PM -0300, Maíra Canal wrote:
Hi Guenter,
On 3/25/24 14:52, Guenter Roeck wrote:
The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests
intentionally trigger
Hi Michael,
On 3/13/24 18:23, Michael Ellerman wrote:
Hi Shivaprasad,
Shivaprasad G Bhat writes:
The commit 9d67c9433509 ("powerpc/iommu: Add \"borrowing\"
iommu_table_group_ops") implemented the "borrow" mechanism for
the pSeries SPAPR TCE. It did implement this support partially
that it
On Fri, Mar 8, 2024 at 5:18 AM Aneesh Kumar K.V wrote:
>
> Joel Savitz writes:
>
> > On 64-bit powerpc, usage of a non-16MB-aligned value for the mem= kernel
> > cmdline parameter results in a system hang at boot.
> >
> > For example, using 'mem=4198400K' will always reproduce this issue.
> >
>
We currently enable -Werror on the arch/powerpc subtree. However this
only catches C warnings. Assembly warnings are logged, but the make
invocation will still succeed. This can allow incorrect syntax such as
ori r3, r4, r5
to be compiled without catching that the assembler is treating r5
as
Future changes will need to add a new member to struct
vm_unmapped_area_info. This would cause trouble for any call site that
doesn't initialize the struct. Currently every caller sets each member
manually, so if new members are added they will be uninitialized and the
core code parsing the struct
On 3/25/2024 6:15 PM, Xi Ruoyao wrote:
On Mon, 2024-03-25 at 16:45 +0800, Ethan Zhao wrote:
On 3/25/2024 1:19 AM, Xi Ruoyao wrote:
On Mon, 2023-09-18 at 14:39 -0500, Bjorn Helgaas wrote:
On Mon, Sep 18, 2023 at 07:42:30PM +0800, Xi Ruoyao wrote:
...
My workstation suffers from too much
On 3/25/24 16:24, Guenter Roeck wrote:
Hi,
On Mon, Mar 25, 2024 at 04:05:06PM -0300, Maíra Canal wrote:
Hi Guenter,
On 3/25/24 14:52, Guenter Roeck wrote:
The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests
intentionally trigger warning backtraces by providing bad
Hi Wolfram,
> > @Andi: are you okay with this approach? It means you'd need to merge
> > -rc2 into your for-next branch. Or rebase if all fails.
>
> I think it's a good plan, I'll try to support you with it.
Do you feel more comfortable if I take the patches as soon as
they are reviewd?
So far
The new open/close abstraction makes it more difficult for a
compiler to optimise. This causes 10% worse performance on
ppc32 as in [1]. Restoring the page alignment mask and inlining
the helpers allows the compiler to better reason about the address
alignment, allowing more optimised cache
The code patching capabilities have grown, and the specific quirks for
setting up and tearing down the patching window are getting duplicated.
This commit introduces an abstraction for working with this patching
window. It defines open_patch_window() to set up the writable alias
page, and
The existing patching alias page setup and teardown sections can be
simplified to make use of the new open_patch_window() abstraction.
This eliminates the _mm variants of the helpers, consumers no longer
need to check mm_patch_enabled(), and consumers no longer need to worry
about synchronization
Hi Guenter,
On 3/25/24 14:52, Guenter Roeck wrote:
The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests
intentionally trigger warning backtraces by providing bad parameters to
the tested functions. What is tested is the return value, not the existence
of a warning backtrace.
On Mon, 2024-03-25 at 18:15 +0800, Xi Ruoyao wrote:
> On Mon, 2024-03-25 at 16:45 +0800, Ethan Zhao wrote:
> > On 3/25/2024 1:19 AM, Xi Ruoyao wrote:
> > > On Mon, 2023-09-18 at 14:39 -0500, Bjorn Helgaas wrote:
> > > > On Mon, Sep 18, 2023 at 07:42:30PM +0800, Xi Ruoyao wrote:
> > > > > ...
> > >
On Mon, Mar 25, 2024 at 03:34:30PM -0500, Nathan Lynch wrote:
> Mathieu Desnoyers writes:
> For what it's worth, I found a copy of an IBM Journal of Research &
> Development article confirming that POWER5's L3 had a 256-byte line
> size:
>
> Each slice [of the L3] is 12-way set-associative,
-Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
ready to enable it globally.
Use the `__struct_group()` helper to separate the flexible array
from the rest of the members in flexible `struct nx842_crypto_header`,
through tagged `struct nx842_crypto_header_hdr`, and avoid
Mathieu Desnoyers writes:
> In the powerpc architecture support within the liburcu project [1]
> we have a cache line size defined as 256 bytes with the following
> comment:
>
> /* Include size of POWER5+ L3 cache lines: 256 bytes */
> #define CAA_CACHE_LINE_SIZE 256
>
> I recently received a
Hi,
On Mon, Mar 25, 2024 at 04:05:06PM -0300, Maíra Canal wrote:
> Hi Guenter,
>
> On 3/25/24 14:52, Guenter Roeck wrote:
> > The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests
> > intentionally trigger warning backtraces by providing bad parameters to
> > the tested
The gpio field is not used anymore, remove the leftover.
This also fixes the compilation error after the ...
Fixes: 9855f05e5536 ("ASoC: fsl: imx-es8328: Switch to using gpiod API")
Signed-off-by: Andy Shevchenko
---
sound/soc/fsl/imx-es8328.c | 1 -
1 file changed, 1 deletion(-)
diff --git
Le 25/03/2024 à 17:19, Jason Gunthorpe a écrit :
> On Mon, Mar 25, 2024 at 03:55:54PM +0100, Christophe Leroy wrote:
>> Unlike many architectures, powerpc 8xx hardware tablewalk requires
>> a two level process for all page sizes, allthough second level only
>> has one entry when pagesize is 8M.
On Fri, Mar 22, 2024 at 01:10:00PM -0300, Jason Gunthorpe wrote:
> On Thu, Mar 21, 2024 at 06:07:50PM -0400, pet...@redhat.com wrote:
> > From: Peter Xu
> >
> > v3:
> > - Rebased to latest mm-unstalbe (a824831a082f, of March 21th)
> > - Dropped patch to introduce pmd_thp_or_huge(), replace such
On Mon, Mar 25, 2024, at 07:40, Adrian Hunter wrote:
>
> Extend the facility also to VDSO, dependent on new config option
> GENERIC_VDSO_OVERFLOW_PROTECT which is selected by x86 only, so other
> architectures are not affected. The result is a calculation that has
> similar performance as before.
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
Add name of functions triggering warning backtraces to the __bug_table
object section to enable support for suppressing WARNING backtraces.
To limit image size impact, the pointer to the function name is only added
to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
dev_addr_lists_test generates lock warning noise at the end of tests
if lock debugging is enabled. There are two sets of warnings.
WARNING: CPU: 0 PID: 689 at kernel/locking/mutex.c:923
__mutex_unlock_slowpath.constprop.0+0x13c/0x368
DEBUG_LOCKS_WARN_ON(__owner_task(owner) != __get_current())
The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests
intentionally trigger warning backtraces by providing bad parameters to
the tested functions. What is tested is the return value, not the existence
of a warning backtrace. Suppress the backtraces to avoid clogging the
kernel
Document API functions for suppressing warning backtraces.
Tested-by: Linux Kernel Functional Testing
Acked-by: Dan Carpenter
Reviewed-by: Kees Cook
Signed-off-by: Guenter Roeck
---
- Rebased to v6.9-rc1
- Added Tested-by:, Acked-by:, and Reviewed-by: tags
Add unit tests to verify that warning backtrace suppression works.
If backtrace suppression does _not_ work, the unit tests will likely
trigger unsuppressed backtraces, which should actually help to get
the affected architectures / platforms fixed.
Tested-by: Linux Kernel Functional Testing
Count suppressed warning backtraces to enable code which suppresses
warning backtraces to check if the expected backtrace(s) have been
observed.
Using atomics for the backtrace count resulted in build errors on some
architectures due to include file recursion, so use a plain integer
for now.
Some unit tests intentionally trigger warning backtraces by passing
bad parameters to API functions. Such unit tests typically check the
return value from those calls, not the existence of the warning backtrace.
Such intentionally generated warning backtraces are neither desirable
nor useful for
Some unit tests intentionally trigger warning backtraces by passing bad
parameters to kernel API functions. Such unit tests typically check the
return value from such calls, not the existence of the warning backtrace.
Such intentionally generated warning backtraces are neither desirable
nor
On Mon, 18 Mar 2024 22:07:56 +0200, Andy Shevchenko wrote:
> This updates the driver to gpiod API, and removes yet another use of
> of_get_named_gpio().
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: fsl: imx-es8328: Switch to
On Thu, 14 Mar 2024 15:16:42 +0100, Alexander Stein wrote:
> This happens especially if this driver is built-in, but SDMA driver
> is configured as module.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: fsl: fsl_ssi: Add
On Mon, Mar 18, 2024 at 10:07:56PM +0200, Andy Shevchenko wrote:
> This updates the driver to gpiod API, and removes yet another use of
> of_get_named_gpio().
This also needs a leftover removal. :-(
--
With Best Regards,
Andy Shevchenko
On Mon, Mar 25, 2024 at 03:55:53PM +0100, Christophe Leroy wrote:
> This series reimplements hugepages with hugepd on powerpc 8xx.
>
> Unlike most architectures, powerpc 8xx HW requires a two-level
> pagetable topology for all page sizes. So a leaf PMD-contig approach
> is not feasible as such.
>
On Mon, Mar 25, 2024 at 03:55:57PM +0100, Christophe Leroy wrote:
> arch/arm64/include/asm/hugetlb.h | 2 +-
> fs/hugetlbfs/inode.c | 2 +-
> fs/proc/task_mmu.c | 8 +++---
> fs/userfaultfd.c | 2 +-
> include/asm-generic/hugetlb.h| 2 +-
>
On Mon, Mar 25, 2024 at 03:55:54PM +0100, Christophe Leroy wrote:
> Unlike many architectures, powerpc 8xx hardware tablewalk requires
> a two level process for all page sizes, allthough second level only
> has one entry when pagesize is 8M.
>
> To fit with Linux page table topology and without
On 19/03/2024 08.58, Nicholas Piggin wrote:
The migration harness is complicated and easy to break so CI will
be helpful.
Signed-off-by: Nicholas Piggin
---
.gitlab-ci.yml | 18 +++---
s390x/unittests.cfg | 8
2 files changed, 19 insertions(+), 7 deletions(-)
On 19/03/2024 08.58, Nicholas Piggin wrote:
The migration harness will be expanded to deal with more commands
from the test, moving these checks into functions helps keep things
managable.
Signed-off-by: Nicholas Piggin
---
scripts/arch-run.bash | 20 +++-
1 file changed, 15
Since the current calculation of calc_nr_kernel_pages() has taken into
consideration of kernel reserved memory, no need to have
arch_reserved_kernel_pages() any more.
Signed-off-by: Baoquan He
---
arch/powerpc/include/asm/mmu.h | 4
arch/powerpc/kernel/fadump.c | 5 -
Nobody calls calc_memmap_size() now.
Signed-off-by: Baoquan He
---
mm/mm_init.c | 20
1 file changed, 20 deletions(-)
diff --git a/mm/mm_init.c b/mm/mm_init.c
index 7f71e56e83f3..e269a724f70e 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -1331,26 +1331,6 @@ static void
Currently, in free_area_init_core(), when initialize zone's field, a
rough value is set to zone->managed_pages. That value is calculated by
(zone->present_pages - memmap_pages).
In the meantime, add the value to nr_all_pages and nr_kernel_pages which
represent all free pages of system (only low
This is a preparation to calculate nr_kernel_pages and nr_all_pages,
both of which will be used later in alloc_large_system_hash().
nr_all_pages counts up all free but not reserved memory in memblock
allocator, including HIGHMEM memory. While nr_kernel_pages counts up
all free but not reserved
Now nobody calls set_dma_reserve() to set value for dma_reserve, remove
set_dma_reserve(), global variable dma_reserve and the codes using it.
Signed-off-by: Baoquan He
---
include/linux/mm.h | 1 -
mm/mm_init.c | 23 ---
2 files changed, 24 deletions(-)
diff --git
In order to fit better with standard Linux page tables layout, add
support for 8M pages using contiguous PTE entries in a standard
page table. Page tables will then be populated with 1024 similar
entries and two PMD entries will point to that page table.
The PMD entries also get a flag to tell it
Variable dma_reserve and its usage was introduced in commit 0e0b864e069c
("[PATCH] Account for memmap and optionally the kernel image as holes").
Its original purpose was to accounting for the reserved pages in DMA
zone to make DMA zone's watermarks calculation more accurate on x86.
However,
In function free_area_init_core(), the code calculating
zone->managed_pages and the subtracting dma_reserve from DMA zone looks
very confusing.
>From git history, the code calculating zone->managed_pages was for
zone->present_pages originally. The early rough assignment is for
optimize zone's pcp
Remove support for 8M pages in order to stop using hugepd.
Support for 8M pages will be added back later using the same
approach as for 512k pages, in extenso using contiguous page
entries in the regular page table.
Signed-off-by: Christophe Leroy
---
arch/powerpc/Kconfig
Le 21/03/2024 à 23:07, pet...@redhat.com a écrit :
> From: Peter Xu
>
> v3:
> - Rebased to latest mm-unstalbe (a824831a082f, of March 21th)
> - Dropped patch to introduce pmd_thp_or_huge(), replace such uses (and also
>pXd_huge() users) with pXd_leaf() [Jason]
> - Add a comment for
set_huge_pte_at() expects the real page size, not the psize which is
the index of the page definition in table mmu_psize_defs[]
Fixes: 935d4f0c6dc8 ("mm: hugetlb: add huge page size param to
set_huge_pte_at()")
Signed-off-by: Christophe Leroy
---
arch/powerpc/mm/nohash/8xx.c | 3 ++-
1 file
In preparation of implementing huge pages on powerpc 8xx
without hugepd, enclose hugepd related code inside an
ifdef CONFIG_ARCH_HAS_HUGEPD
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/hugetlb.h| 2 ++
arch/powerpc/include/asm/nohash/pgtable.h | 8 +---
On powerpc 8xx huge_ptep_get() will need to know whether the given
ptep is a PTE entry or a PMD entry. This cannot be known with the
PMD entry itself because there is no easy way to know it from the
content of the entry.
So huge_ptep_get() will need to know either the size of the page
or get the
On powerpc 8xx, when a page is 8M size, the information is in the PMD
entry. So provide it to pte_leaf_size().
Signed-off-by: Christophe Leroy
---
arch/arm64/include/asm/pgtable.h | 2 +-
arch/powerpc/include/asm/nohash/32/pte-8xx.h | 2 +-
arch/riscv/include/asm/pgtable.h
In order to be able to flag the PMD entry with _PMD_HUGE_8M on
powerpc 8xx, provide page size to pte_alloc_huge() and use it
through the newly introduced pte_alloc_size().
Signed-off-by: Christophe Leroy
---
arch/arm64/mm/hugetlbpage.c | 2 +-
arch/parisc/mm/hugetlbpage.c | 2 +-
Unlike many architectures, powerpc 8xx hardware tablewalk requires
a two level process for all page sizes, allthough second level only
has one entry when pagesize is 8M.
To fit with Linux page table topology and without requiring special
page directory layout like hugepd, the page entry will be
This series reimplements hugepages with hugepd on powerpc 8xx.
Unlike most architectures, powerpc 8xx HW requires a two-level
pagetable topology for all page sizes. So a leaf PMD-contig approach
is not feasible as such.
Possible sizes are 4k, 16k, 512k and 8M.
First level (PGD/PMD) covers 4M
On Fri, Mar 22, 2024 at 12:53:50PM +0100, Niklas Cassel wrote:
> On Thu, Mar 14, 2024 at 01:18:06PM +0530, Manivannan Sadhasivam wrote:
> > "core_init_notifier" flag is set by the glue drivers requiring refclk from
> > the host to complete the DWC core initialization. Also, those drivers will
> >
On 3/25/2024 1:19 AM, Xi Ruoyao wrote:
On Mon, 2023-09-18 at 14:39 -0500, Bjorn Helgaas wrote:
On Mon, Sep 18, 2023 at 07:42:30PM +0800, Xi Ruoyao wrote:
...
My workstation suffers from too much correctable AER reporting as well
(related to Intel's errata "RPL013: Incorrectly Formed PCIe
Configured:
CONFIG_VMCORE_INFO=y
# CONFIG_CRASH_DUMP is not set
CONFIG_KEXEC_CORE=y
PowerPC updates 6.9-2:
-#ifdef CONFIG_VMCORE_INFO
+#ifdef CONFIG_CRASH_DUMP
/* This keeps a track of which one is the crashing cpu. */
int crashing_cpu = -1;
#endif
-
int crashing_cpu = -1; was
Regular expression used to match the unit address part should not allow
non-hex numbers. Expect at least one hex digit as well.
Acked-by: Rob Herring
Signed-off-by: Krzysztof Kozlowski
---
v2: Change '*' into '+' in the regex.
---
.../devicetree/bindings/timer/arm,arch_timer_mmio.yaml
Regular expression used to match the unit address part should not allow
non-hex numbers.
Acked-by: Rob Herring
Signed-off-by: Krzysztof Kozlowski
---
v2: No changes
---
.../devicetree/bindings/soc/fsl/fsl,layerscape-dcfg.yaml| 2 +-
On Mon, 2024-03-25 at 16:45 +0800, Ethan Zhao wrote:
> On 3/25/2024 1:19 AM, Xi Ruoyao wrote:
> > On Mon, 2023-09-18 at 14:39 -0500, Bjorn Helgaas wrote:
> > > On Mon, Sep 18, 2023 at 07:42:30PM +0800, Xi Ruoyao wrote:
> > > > ...
> > > > My workstation suffers from too much correctable AER
On 03/25/24 at 09:24am, Geert Uytterhoeven wrote:
> Hi Baoquan,
>
> On Wed, Jan 24, 2024 at 6:13 AM Baoquan He wrote:
> > Now move the relevant codes into separate files:
> > kernel/crash_reserve.c, include/linux/crash_reserve.h.
> >
> > And add config item CRASH_RESERVE to control its enabling.
Hi, Thomas
On 2024/3/24 04:43, Thomas Gleixner wrote:
On Wed, Mar 06 2024 at 20:52, Bitao Hu wrote:
+ if (__this_cpu_read(snapshot_taken)) {
+ for_each_active_irq(i) {
+ count = kstat_get_irq_since_snapshot(i);
+
We have configured (kernel config):
# CONFIG_CRASH_DUMP is not set
CONFIG_KEXEC_CORE=y
Link:
https://github.com/chzigotzky/kernels/blob/main/configs/x5000_defconfig
Compiling error:
arch/powerpc/platforms/85xx/smp.c: In function 'mpc85xx_smp_kexec_cpu_down':
On 3/22/24 3:25 PM, Wolfram Sang wrote:
Match the wording in i2c_algorithm in I2C drivers wrt. the newest I2C
v7, SMBus 3.2, I3C specifications and replace "master/slave" with more
appropriate terms. For some drivers, this means no more conversions are
needed. For the others more work needs to
On Fri, Mar 22, 2024 at 02:25:57PM +0100, Wolfram Sang wrote:
> Match the wording in i2c_algorithm in I2C drivers wrt. the newest I2C
> v7, SMBus 3.2, I3C specifications and replace "master/slave" with more
> appropriate terms. For some drivers, this means no more conversions are
> needed. For the
Hi Sachin,
Sorry for the mess.
On Mon, Mar 25, 2024 at 12:08:35PM +0530, Sachin Sant wrote:
> Today’s next (6.9.0-rc1-next-20240325) fails to boot on powerpc:
>
> [ 1.955512] usercopy: Kernel memory exposure attempt detected from SLUB
> object 'cpumask' (offset 0, size 16)!
Hi Baoquan,
On Wed, Jan 24, 2024 at 6:13 AM Baoquan He wrote:
> Now move the relevant codes into separate files:
> kernel/crash_reserve.c, include/linux/crash_reserve.h.
>
> And add config item CRASH_RESERVE to control its enabling.
>
> And also update the old ifdeffery of CONFIG_CRASH_CORE,
Thanks a lot for the hint.
Could you please add #include to
arch/powerpc/platforms/85xx/smp.c for the next PowerPC fixes?
Christian
On 25 March 2024 at 07:43 am, Christophe Leroy wrote:
Hi,
Le 25/03/2024 à 06:18, Christian Zigotzky a écrit :
I have created a patch:
---
Hi,
Le 25/03/2024 à 06:18, Christian Zigotzky a écrit :
> I have created a patch:
>
> --- a/arch/powerpc/platforms/85xx/smp.c 2024-03-25 06:14:02.201209476 +0100
> +++ b/arch/powerpc/platforms/85xx/smp.c 2024-03-25 06:10:04.421425931 +0100
> @@ -393,6 +393,7 @@ static void
Kernel timekeeping is designed to keep the change in cycles (since the last
timer interrupt) below max_cycles, which prevents multiplication overflow
when converting cycles to nanoseconds. However, if timer interrupts stop,
the clocksource_cyc2ns() calculation will eventually overflow.
Add
For the case !CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE, forego overflow
protection in the range (mask << 1) < delta <= mask, and interpret it
always as an inconsistency between CPU clock values. That allows
slightly neater code, and it is on a slow path so has no effect on
performance.
Kernel timekeeping is designed to keep the change in cycles (since the last
timer interrupt) below max_cycles, which prevents multiplication overflow
when converting cycles to nanoseconds. However, if timer interrupts stop,
the calculation will eventually overflow.
Add protection against that. In
Open code clocksource_delta() in timekeeping_cycles_to_ns() so that
overflow safety can be added efficiently.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
timekeeping_delta_to_ns() is now called only from
timekeeping_cycles_to_ns(), and it is not useful otherwise. Simplify by
folding it into timekeeping_cycles_to_ns().
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 13 +
1 file changed, 1
Consolidate timekeeping helpers, making use of timekeeping_cycles_to_ns()
in preference to directly using timekeeping_delta_to_ns().
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
Simplify use of timekeeping sanity checking, in preparation for
consolidating timekeeping helpers. This works towards eliminating
timekeeping_delta_to_ns() in favour of timekeeping_cycles_to_ns().
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 20
Simplify __timekeeping_get_ns() by reusing timekeeping_cycles_to_ns().
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index
Put together declaration and initialization of the local variable 'delta'.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
Rename fast_tk_get_delta_ns() to __timekeeping_get_ns() to prepare for its
reuse as a general timekeeping helper function.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
Move timekeeping helper functions to prepare for their reuse.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
kernel/time/timekeeping.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/kernel/time/timekeeping.c
Kernel timekeeping is designed to keep the change in cycles (since the last
timer interrupt) below max_cycles, which prevents multiplication overflow
when converting cycles to nanoseconds. However, if timer interrupts stop,
the calculation will eventually overflow.
Add protection against that.
Kernel timekeeping is designed to keep the change in cycles (since the last
timer interrupt) below max_cycles, which prevents multiplication overflow
when converting cycles to nanoseconds. However, if timer interrupts stop,
the calculation will eventually overflow.
Add protection against that,
Add vdso_data::max_cycles in preparation to use it to detect potential
multiplication overflow.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
include/vdso/datapage.h | 4
kernel/time/vsyscall.c | 6 ++
2 files changed, 10 insertions(+)
diff --git
Provide mul_u64_u32_add_u64_shr() which is a calculation that will be used
by timekeeping and VDSO.
Place #include after #include to allow
architecture-specific overrides, at least for the kernel.
Signed-off-by: Adrian Hunter
---
include/linux/math64.h | 2 +-
include/vdso/math64.h | 38
Put together declaration and initialization of local variables.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
include/linux/math64.h | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/include/linux/math64.h b/include/linux/math64.h
index
Add CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT in preparation to add
multiplication overflow protection to the VDSO time getter functions.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
lib/vdso/Kconfig | 7 +++
1 file changed, 7 insertions(+)
diff --git a/lib/vdso/Kconfig
Consolidate nanoseconds calculation to simplify and reduce code
duplication.
Suggested-by: Thomas Gleixner
Signed-off-by: Adrian Hunter
---
Changes in V2:
Adjusted due to changes in "vdso: Consolidate vdso_calc_delta()"
arch/x86/include/asm/vdso/gettimeofday.h | 17 +
1 - 100 of 102 matches
Mail list logo