Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-05-08 Thread Thomas Gleixner
On Tue, May 07 2024 at 15:23, Vignesh Balasubramanian wrote: > +struct xfeat_component { > + u32 xfeat_type; > + u32 xfeat_sz; > + u32 xfeat_off; > + u32 xfeat_flags; > +} __packed; Why repeating xfeat_ for all member names? u32 type; u32 size; u32

Re: [PATCHv12 1/4] genirq: Provide a snapshot mechanism for interrupt statistics

2024-04-10 Thread Thomas Gleixner
On Wed, Apr 10 2024 at 14:45, Bitao Hu wrote: > On 2024/4/9 17:58, Thomas Gleixner wrote: > By the way, what do you think of my reason for using printk() instead of > pr_crit()? Should I change this part of the code in v13? Either way is fine. Just put a proper explanation into the c

Re: [PATCHv12 1/4] genirq: Provide a snapshot mechanism for interrupt statistics

2024-04-09 Thread Thomas Gleixner
e delta > of a specific interrupt later on. > > Originally-by: Thomas Gleixner > Signed-off-by: Bitao Hu > Reviewed-by: Liu Song > Reviewed-by: Douglas Anderson This does not apply anymore. Also can you please split this apart to convert kstat_irqs to a struct with just t

Re: [PATCHv12 4/4] watchdog/softlockup: report the most frequent interrupts

2024-03-23 Thread Thomas Gleixner
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); > + tabulate_irq_count(irq_counts_sorted, i, count, > NUM_HARDIRQ_REPORT); > +

Re: [PATCH 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-03-15 Thread Thomas Gleixner
On Thu, Mar 14 2024 at 17:29, Borislav Petkov wrote: > On Thu, Mar 14, 2024 at 09:19:15AM -0700, Dave Hansen wrote: >> Are you envisioning an *XSAVE* state component that's not described by >> CPUID? > > I want to be prepared. You can imagine some of the short cuts and > corners cutting hw guys

Re: [v2 PATCH 0/3] arch: mm, vdso: consolidate PAGE_SIZE definition

2024-03-06 Thread Thomas Gleixner
On Wed, Mar 06 2024 at 15:14, Arnd Bergmann wrote: > From: Arnd Bergmann > > Naresh noticed that the newly added usage of the PAGE_SIZE macro in > include/vdso/datapage.h introduced a build regression. I had an older > patch that I revived to have this defined through Kconfig rather than >

Re: [PATCH v2 3/3] arch: define CONFIG_PAGE_SIZE_*KB on all architectures

2024-03-06 Thread Thomas Gleixner
n one and allow > only the hardware page size to be selected. > > Acked-by: Guo Ren > Acked-by: Heiko Carstens > Acked-by: Stafford Horne > Acked-by: Johannes Berg > Signed-off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner

Re: [PATCH v2 2/3] arch: simplify architecture specific page size configuration

2024-03-06 Thread Thomas Gleixner
while > leaving the arhcitecture specific ones as the user visible > place for configuring it, to avoid breaking user configs. > > Reviewed-by: Christophe Leroy (powerpc32) > Acked-by: Catalin Marinas > Acked-by: Helge Deller # parisc > Signed-off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner

Re: [PATCH v2 1/3] arch: consolidate existing CONFIG_PAGE_SIZE_*KB definitions

2024-03-06 Thread Thomas Gleixner
off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner

Re: [PATCHv11 2/4] genirq: Provide a snapshot mechanism for interrupt statistics

2024-03-05 Thread Thomas Gleixner
On Tue, Mar 05 2024 at 18:57, Bitao Hu wrote: > On 2024/3/4 22:24, Thomas Gleixner wrote: > "GENERIC_IRQ_STAT_SNAPSHOT" visible to the user. However, after > analyzing the previous emails, it seems that what you were actually > proposing was to directly disable "GENE

Re: [PATCHv11 2/4] genirq: Provide a snapshot mechanism for interrupt statistics

2024-03-04 Thread Thomas Gleixner
On Mon, Mar 04 2024 at 20:00, Bitao Hu wrote: >> +# Snapshot for interrupt statistics >> +config GENERIC_IRQ_STAT_SNAPSHOT >> +bool >> + >> # Support forced irq threading >> config IRQ_FORCED_THREADING >> bool > > I think we should follow Douglas's suggestion by making > "config

Re: [PATCH v2 4/7] mm/x86: Drop two unnecessary pud_leaf() definitions

2024-03-04 Thread Thomas Gleixner
On Thu, Feb 29 2024 at 16:42, pet...@redhat.com wrote: > From: Peter Xu > > pud_leaf() has a fallback macro defined in include/linux/pgtable.h already. > Drop the extra two for x86. > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Ha

Re: [PATCHv11 2/4] genirq: Provide a snapshot mechanism for interrupt statistics

2024-03-01 Thread Thomas Gleixner
Doug! On Wed, Feb 28 2024 at 14:44, Doug Anderson wrote: > I won't insist on it, but I continue to worry about memory > implications with large numbers of CPUs. With a 4-byte int, 8192 max > CPUs, and 100 IRQs the extra "ref" value takes up over 3MB of memory > (8192 * 4 bytes * 100). > >

Re: [PATCHv10 3/4] genirq: Avoid summation loops for /proc/interrupts

2024-02-27 Thread Thomas Gleixner
On Tue, Feb 27 2024 at 19:20, Bitao Hu wrote: > On 2024/2/27 17:26, Thomas Gleixner wrote: >> >> and then let kstat_irqs() and show_interrupts() use it. See? > > I have a concern. kstat_irqs() uses for_each_possible_cpu() for > summation. However, show_interrupts()

Re: [PATCHv10 3/4] genirq: Avoid summation loops for /proc/interrupts

2024-02-27 Thread Thomas Gleixner
On Mon, Feb 26 2024 at 10:09, Bitao Hu wrote: > We could use the irq_desc::tot_count member to avoid the summation > loop for interrupts which are not marked as 'PER_CPU' interrupts in > 'show_interrupts'. This could reduce the time overhead of reading > /proc/interrupts. "Could" is not really a

Re: [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the interrupt descriptor

2024-02-22 Thread Thomas Gleixner
On Fri, Feb 23 2024 at 15:18, Bitao Hu wrote: > On 2024/2/22 21:22, Thomas Gleixner wrote: >>> - if (desc->kstat_irqs) { >>> - for_each_online_cpu(j) >>> - any_count |= data_race(*per_cpu_ptr(desc->kstat_irqs, >>>

Re: [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the interrupt descriptor

2024-02-22 Thread Thomas Gleixner
On Thu, Feb 22 2024 at 17:34, Bitao Hu wrote: First of all the subsystem prefix is 'genirq:'. 'git log kernel/irq/' gives you a pretty good hint. It's documented Secondly the subject line does not match what this patch is about. It's not about using a struct, it's about providing a snapshot

Re: [PATCHv8 2/2] watchdog/softlockup: report the most frequent interrupts

2024-02-20 Thread Thomas Gleixner
On Tue, Feb 20 2024 at 00:19, Bitao Hu wrote: > arch/mips/dec/setup.c| 2 +- > arch/parisc/kernel/smp.c | 2 +- > arch/powerpc/kvm/book3s_hv_rm_xics.c | 2 +- > include/linux/irqdesc.h | 9 ++- > include/linux/kernel_stat.h | 4 + >

Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock

2023-09-15 Thread Thomas Gleixner
On Thu, Sep 14 2023 at 20:01, Maciej W. Rozycki wrote: > On Thu, 14 Sep 2023, John Ogness wrote: > >> Patches 2-74 switch all uart port locking call sites to use the new >> wrappers. These patches were automatically generated using coccinelle. > > Hmm, no need to do this for

Re: [PATCH v4 00/10] Introduce SMT level and add PowerPC support

2023-07-28 Thread Thomas Gleixner
On Fri, Jul 28 2023 at 14:23, Rui Zhang wrote: > On Fri, 2023-07-28 at 09:40 +0200, Thomas Gleixner wrote: >> On Sun, Jul 09 2023 at 15:25, Rui Zhang wrote: >> > I ran into a boot hang regression with latest upstream code, and it >> > took me a while to bisect the offe

Re: [PATCH v4 00/10] Introduce SMT level and add PowerPC support

2023-07-28 Thread Thomas Gleixner
Laurent, Michael! On Wed, Jul 05 2023 at 16:51, Laurent Dufour wrote: > I'm taking over the series Michael sent previously [1] which is smartly > reviewing the initial series I sent [2]. This series is addressing the > comments sent by Thomas and me on the Michael's one. Thanks for getting this

Re: [PATCH v4 00/10] Introduce SMT level and add PowerPC support

2023-07-28 Thread Thomas Gleixner
Rui! On Sun, Jul 09 2023 at 15:25, Rui Zhang wrote: > I ran into a boot hang regression with latest upstream code, and it > took me a while to bisect the offending commit and workaround it. Where is the bug report and the analysis? And what's the workaround? Thanks, tglx

Re: [PATCH 07/10] cpu/SMT: Allow enabling partial SMT states via sysfs

2023-06-22 Thread Thomas Gleixner
On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote: > > - if (ctrlval != cpu_smt_control) { > + orig_threads = cpu_smt_num_threads; > + cpu_smt_num_threads = num_threads; > + > + if (num_threads > orig_threads) { > + ret = cpuhp_smt_enable(); > + } else if

Re: [PATCH 01/10] cpu/SMT: Move SMT prototypes into cpu_smt.h

2023-06-22 Thread Thomas Gleixner
On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote: > From: Michael Ellerman > > A subsequent patch would like to use the cpuhp_smt_control enum as part > of the interface between generic and arch code. This still has the 'patch' and 'arch' style which I pointed out before. It seems you fixed it

Re: [PATCH v2 06/12] mm/execmem: introduce execmem_data_alloc()

2023-06-18 Thread Thomas Gleixner
Kent! On Sun, Jun 18 2023 at 19:14, Kent Overstreet wrote: > On Mon, Jun 19, 2023 at 12:32:55AM +0200, Thomas Gleixner wrote: > > Thomas, you're confusing an internal interface with external No. I am not. Whether that's an internal function or not does not make any difference at all

Re: [PATCH v2 06/12] mm/execmem: introduce execmem_data_alloc()

2023-06-18 Thread Thomas Gleixner
decide that ad hoc hackery is better than proper data structure based design patterns. I actually don't want to know. As much as my voice counts: NAK-ed-by: Thomas Gleixner Thanks, tglx

Re: [PATCH 3/9] cpu/SMT: Store the current/max number of threads

2023-06-13 Thread Thomas Gleixner
On Tue, Jun 13 2023 at 19:16, Laurent Dufour wrote: > On 10/06/2023 23:26:18, Thomas Gleixner wrote: >> On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: >>> #ifdef CONFIG_HOTPLUG_SMT >>> enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLE

Re: [PATCH 8/9] powerpc: Add HOTPLUG_SMT support

2023-06-12 Thread Thomas Gleixner
On Mon, Jun 12 2023 at 17:20, Laurent Dufour wrote: > On 10/06/2023 23:10:02, Thomas Gleixner wrote: >> This needs more thoughts to avoid a completely inconsistent duct tape >> mess. > > Despite the test against smt_enabled_at_boot, mentioned above, I can't see > anyth

Re: [PATCH 5/9] cpu/SMT: Create topology_smt_thread_allowed()

2023-06-10 Thread Thomas Gleixner
On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: > A subsequent patch will enable partial SMT states, ie. when not all SMT > threads are brought online. Nitpick. I stumbled over this 'subsequent patch' theme a couple of times now because it's very similar to the 'This patch does' phrase.

Re: [PATCH 4/9] cpu/SMT: Create topology_smt_threads_supported()

2023-06-10 Thread Thomas Gleixner
On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: > +/** > + * topology_smt_threads_supported - Check if the given number of SMT threads > + * is supported. > + * > + * @threads: The number of SMT threads. > + */ > +bool topology_smt_threads_supported(unsigned int

Re: [PATCH 3/9] cpu/SMT: Store the current/max number of threads

2023-06-10 Thread Thomas Gleixner
On Sat, Jun 10 2023 at 23:26, Thomas Gleixner wrote: > On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: > /* > * The decision whether SMT is supported can only be done after the full > * CPU identification. Called from architecture code. > */ > -void __init cpu_smt_c

Re: [PATCH 3/9] cpu/SMT: Store the current/max number of threads

2023-06-10 Thread Thomas Gleixner
On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: > #ifdef CONFIG_HOTPLUG_SMT > enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED; > +static unsigned int cpu_smt_max_threads __ro_after_init; > +unsigned int cpu_smt_num_threads; Why needs this to be global?

Re: [PATCH 8/9] powerpc: Add HOTPLUG_SMT support

2023-06-10 Thread Thomas Gleixner
On Thu, Jun 01 2023 at 18:19, Laurent Dufour wrote: > @@ -435,12 +435,17 @@ void __init cpu_smt_disable(bool force) > * The decision whether SMT is supported can only be done after the full > * CPU identification. Called from architecture code. > */ > -void __init

Re: [PATCH 6/9] cpu/SMT: Allow enabling partial SMT states via sysfs

2023-06-10 Thread Thomas Gleixner
On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: > There is a hook which allows arch code to control how many threads per Can you please write out architecture in changelogs and comments? I know 'arch' is commonly used but while my brain parser tolerates 'arch_' prefixes it raises an

Re: [PATCH 6/9] cpu/SMT: Allow enabling partial SMT states via sysfs

2023-06-10 Thread Thomas Gleixner
On Sat, Jun 10 2023 at 22:09, Thomas Gleixner wrote: > On Thu, May 25 2023 at 01:56, Michael Ellerman wrote: >> There is a hook which allows arch code to control how many threads per > > Can you please write out architecture in changelogs and comments? > > I know 'arch' is co

Re: [patch 05/39] genirq/msi: Remove filter from msi_free_descs_free_range()

2023-03-01 Thread Thomas Gleixner
Miquel! On Wed, Mar 01 2023 at 11:55, Miquel Raynal wrote: > t...@linutronix.de wrote on Fri, 11 Nov 2022 14:54:22 +0100 (CET): > >> When a range of descriptors is freed then all of them are not associated to >> a linux interrupt. Remove the filter and add a warning to the free function. >> +

Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

2022-11-28 Thread Thomas Gleixner
On Sun, Nov 27 2022 at 09:53, Paul E. McKenney wrote: > On Sun, Nov 27, 2022 at 01:40:28PM +0100, Thomas Gleixner wrote: >> There are quite some reasons why a CPU-hotplug or a hot-unplug operation >> can fail, which is not a fatal problem, really. >> >> So if a

Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

2022-11-27 Thread Thomas Gleixner
Zhouyi, On Sun, Nov 27 2022 at 10:45, Zhouyi Zhou wrote: > On Sun, Nov 27, 2022 at 1:05 AM Thomas Gleixner wrote: > > So, I should construct my patch as: > We avoid ... by ... Not "We avoid". Avoid this behaviour by >> No. We are not exporting this just to

Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

2022-11-26 Thread Thomas Gleixner
On Mon, Nov 21 2022 at 11:51, Zhouyi Zhou wrote: > During CPU-hotplug torture (CONFIG_NO_HZ_FULL=y), if we try to > offline tick_do_timer_cpu, the operation will fail because in > function tick_nohz_cpu_down: > ``` > if (tick_nohz_full_running && tick_do_timer_cpu == cpu) > return -EBUSY; >

Re: [patch 39/39] x86/apic: Remove X86_IRQ_ALLOC_CONTIGUOUS_VECTORS

2022-11-17 Thread Thomas Gleixner
Jason, Bjorn, Ashok! On Wed, Nov 16 2022 at 14:05, Jason Gunthorpe wrote: > On Fri, Nov 11, 2022 at 02:55:17PM +0100, Thomas Gleixner wrote: >> Now that the PCI/MSI core code does early checking for multi-MSI support >> X86_IRQ_ALLOC_CONTIGUOUS_VECTORS is not required anymo

Re: [patch 01/39] PCI/MSI: Check for MSI enabled in __pci_msix_enable()

2022-11-17 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 07:39, Ashok Raj wrote: > On Fri, Nov 11, 2022 at 02:54:15PM +0100, Thomas Gleixner wrote: > > Can the pre-enabled checks for msi and msix be moved up before any vector > range check? > > not that it matters for how it fails, does EBUSY sound better? Do

Re: [patch 34/39] PCI/MSI: Reject multi-MSI early

2022-11-17 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:31, Bjorn Helgaas wrote: > On Fri, Nov 11, 2022 at 02:55:09PM +0100, Thomas Gleixner wrote: >> >> +/** >> + * pci_msi_domain_supports - Check for support of a particular feature flag >> + * @pdev: The PCI device to oper

Re: [patch 13/39] PCI/MSI: Use msi_domain_info::bus_token

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 13:51, Jason Gunthorpe wrote: > On Fri, Nov 11, 2022 at 02:54:35PM +0100, Thomas Gleixner wrote: >> /* PCI-MSI is oneshot-safe */ >> info->chip->flags |= IRQCHIP_ONESHOT_SAFE; >> +/* Let the core update the bus token

Re: [patch 12/39] genirq/msi: Add bus token to struct msi_domain_info

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 13:49, Jason Gunthorpe wrote: > On Fri, Nov 11, 2022 at 02:54:33PM +0100, Thomas Gleixner wrote: >> From: Ahmed S. Darwish >> >> Add a bus token member to struct msi_domain_info and let >> msi_create_irq_domain() set the bus token. >>

Re: [patch 08/39] genirq/msi: Provide msi_domain_ops::post_free()

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 13:44, Jason Gunthorpe wrote: > On Fri, Nov 11, 2022 at 02:54:27PM +0100, Thomas Gleixner wrote: >> To prepare for removing the exposure of __msi_domain_free_irqs() provide a >> post_free() callback in the MSI domain ops which can be used to solve >> th

Re: [patch 32/39] PCI/MSI: Reorder functions in msi.c

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:28, Bjorn Helgaas wrote: > On Fri, Nov 11, 2022 at 02:55:06PM +0100, Thomas Gleixner wrote: >> From: Ahmed S. Darwish >> >> There is no way to navigate msi.c without banging the head against the wall >> every now and then because MSI a

Re: [patch 27/39] PCI/MSI: Move pci_disable_msix() to api.c

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:26, Bjorn Helgaas wrote: >> /** >> + * pci_disable_msix() - Disable MSI-X interrupt mode on device >> + * @dev: the PCI device to operate on >> + * >> + * Legacy device driver API to disable MSI-X interrupt mode on device, >> + * free earlier-allocated interrupt vectors,

Re: [patch 23/39] PCI/MSI: Move pci_alloc_irq_vectors_affinity() to api.c

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:23, Bjorn Helgaas wrote: > On Fri, Nov 11, 2022 at 02:54:51PM +0100, Thomas Gleixner wrote: >> + * Same as pci_alloc_irq_vectors(), but with the extra @affd parameter. >> + * Check that function docs, and irq_affinity, for more details. > > Is "

Re: [patch 22/39] PCI/MSI: Move pci_alloc_irq_vectors() to api.c

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:22, Bjorn Helgaas wrote: >> + * Allocate up to @max_vecs interrupt vectors on device. MSI-X irq > > s/irq/IRQ/ > >> + * vector allocation has a higher precedence over plain MSI, which has a >> + * higher precedence over legacy INTx emulation. >> + * >> + * Upon a

Re: [patch 20/39] PCI/MSI: Move pci_enable_msi() API to api.c

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:18, Bjorn Helgaas wrote: > On Fri, Nov 11, 2022 at 02:54:46PM +0100, Thomas Gleixner wrote: >> From: Ahmed S. Darwish >> >> To distangle the maze in msi.c all exported device-driver MSI APIs are now >> to be grouped in one file, api.c.

Re: [patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 10:12, Bjorn Helgaas wrote: > On Fri, Nov 11, 2022 at 02:54:38PM +0100, Thomas Gleixner wrote: >> What a zoo: >> >> PCI_MSI >> select GENERIC_MSI_IRQ >> >> PCI_MSI_IRQ_DOMAIN >> def_boo

Re: [patch 03/39] iommu/amd: Remove bogus check for multi MSI-X

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 08:02, Ashok Raj wrote: > On Fri, Nov 11, 2022 at 02:54:19PM +0100, Thomas Gleixner wrote: >> PCI/Multi-MSI is MSI specific and not supported for MSI-X >> >> Signed-off-by: Thomas Gleixner >> --- >> drivers/iommu/amd/iommu.c |3 +-

Re: [patch 02/39] iommu/vt-d: Remove bogus check for multi MSI-X

2022-11-16 Thread Thomas Gleixner
On Wed, Nov 16 2022 at 07:52, Ashok Raj wrote: > On Fri, Nov 11, 2022 at 02:54:17PM +0100, Thomas Gleixner wrote: >> PCI/Multi-MSI is MSI specific and not supported for MSI-X. >> >> Signed-off-by: Thomas Gleixner >> --- >> drivers/iommu/intel/irq_remapping.c

[patch 32/39] PCI/MSI: Reorder functions in msi.c

2022-11-11 Thread Thomas Gleixner
are grouped together. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 577 +- 1 file changed, 295 insertions(+), 282 deletions(-) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci

[patch 36/39] PCI/MSI: Validate MSIX contiguous restriction early

2022-11-11 Thread Thomas Gleixner
-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -725,13 +725,17 @@ static int msix_capability_init(struct p return ret; } -static bool pci_msix_validate_entries(struct

[patch 23/39] PCI/MSI: Move pci_alloc_irq_vectors_affinity() to api.c

2022-11-11 Thread Thomas Gleixner
. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 59 +++- drivers/pci/msi/msi.c | 65 + 2 files changed, 59 insertions(+), 65 deletions(-) --- diff --git a/drivers/pci/msi/api.c b

[patch 31/39] Documentation: PCI: Add reference to PCI/MSI device driver APIs

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish All exported device-driver MSI APIs are now grouped in one place at drivers/pci/msi/api.c with comprehensive kernel-docs added. Reference these kernel-docs in the official PCI/MSI howto. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- Documentation

[patch 27/39] PCI/MSI: Move pci_disable_msix() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_disable_msix() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 24

[patch 33/39] PCI/MSI: Sanitize MSI-X checks

2022-11-11 Thread Thomas Gleixner
There is no point in doing the same sanity checks over and over in a loop during MSI-X enablement. Put them in front of the loop and return early when they fail. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 67 +- 1 file changed

[patch 18/39] PCI/MSI: Move mask and unmask helpers to msi.h

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish The upcoming support for per device MSI interrupt domains needs to share some of the inline helpers with the MSI implementation. Move them to the header file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 61

[patch 19/39] PCI/MSI: Move pci_disable_msi() to api.c

2022-11-11 Thread Thomas Gleixner
-driver PCI/MSI APIs in one C file. Begin by moving pci_disable_msi() there and add kernel-doc for the function as appropriate. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/Makefile | 3 +-- drivers/pci/msi/api.c| 37

[patch 28/39] PCI/MSI: Move pci_irq_get_affinity() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_irq_get_affinity() and let its kernel-doc match rest of the file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi

[patch 20/39] PCI/MSI: Move pci_enable_msi() API to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_enable_msi() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 23

[patch 25/39] PCI/MSI: Move pci_free_irq_vectors() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_free_irq_vectors() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c

[patch 24/39] PCI/MSI: Move pci_irq_vector() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_irq_vector() and let its kernel-doc match the rest of the file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi

[patch 34/39] PCI/MSI: Reject multi-MSI early

2022-11-11 Thread Thomas Gleixner
set This allows to use the function universally without ifdeffery in the calling code. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 22 ++ drivers/pci/msi/msi.c |4 drivers/pci/msi/msi.h |9 + 3 files changed, 35

[patch 21/39] PCI/MSI: Move pci_enable_msix_range() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_enable_msix_range() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c

[patch 30/39] PCI/MSI: Move pci_msi_restore_state() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msi_enabled() and add kernel-doc for the function. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner diff --git a/drivers

[patch 29/39] PCI/MSI: Move pci_msi_enabled() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msi_enabled() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 12

[patch 38/39] genirq/msi: Remove msi_domain_ops::msi_check()

2022-11-11 Thread Thomas Gleixner
No more users. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel/irq/msi.c| 17 + 2 files changed, 1 insertion(+), 20 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -288,7 +288,6 @@ struct msi_domain_info; * @get_hwirq

[patch 26/39] PCI/MSI: Move pci_msix_vec_count() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msix_vec_count() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c

[patch 35/39] PCI/MSI: Reject MSI-X early

2022-11-11 Thread Thomas Gleixner
Similar to PCI multi-MSI reject MSI-X enablement when a irq domain is attached to the device which does not support MSI-X. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c |4 1 file changed, 4 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -760,6

[patch 22/39] PCI/MSI: Move pci_alloc_irq_vectors() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Make pci_alloc_irq_vectors() a real function instead of wrapper and add proper kernel doc to it. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner

[patch 17/39] PCI/MSI: Get rid of externs in msi.h

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Follow the style of Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.h |8 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/pci/msi/msi.h +++ b/drivers/pci/msi/msi.h @@ -5,12 +5,12 @@ #define

[patch 37/39] PCI/MSI: Remove redundant msi_check() callback

2022-11-11 Thread Thomas Gleixner
All these sanity checks are now done _before_ any allocation work happens. No point in doing it twice. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 48 1 file changed, 48 deletions(-) --- a/drivers/pci/msi/irqdomain.c +++ b

[patch 02/39] iommu/vt-d: Remove bogus check for multi MSI-X

2022-11-11 Thread Thomas Gleixner
PCI/Multi-MSI is MSI specific and not supported for MSI-X. Signed-off-by: Thomas Gleixner --- drivers/iommu/intel/irq_remapping.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -1334,8 +1334,7

[patch 16/39] genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN

2022-11-11 Thread Thomas Gleixner
Adjust to reality and remove another layer of pointless Kconfig indirection. CONFIG_GENERIC_MSI_IRQ is good enough to serve all purposes. Signed-off-by: Thomas Gleixner --- drivers/base/Makefile |2 +- drivers/bus/fsl-mc/Kconfig |2 +- drivers/dma/Kconfig |2

[patch 10/39] genirq/msi: Make __msi_domain_free_irqs() static

2022-11-11 Thread Thomas Gleixner
Now that the last user is gone, confine it to the core code. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel/irq/msi.c|3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -335,9 +335,6 @@ struct

[patch 13/39] PCI/MSI: Use msi_domain_info::bus_token

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Set the bus token in the msi_domain_info structure and let the core code handle the update. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) --- a/drivers

[patch 00/39] genirq, PCI/MSI: Support for per device MSI and PCI/IMS - Part 1 cleanups

2022-11-11 Thread Thomas Gleixner
Hi! This is a three part series which provides support for per device MSI interrupt domains. This solves conceptual problems of the current PCI/MSI design which are in the way of providing support for PCI/MSI[-X] and the upcoming PCI/IMS mechanism on the same device. IMS (Interrupt Message

[patch 05/39] genirq/msi: Remove filter from msi_free_descs_free_range()

2022-11-11 Thread Thomas Gleixner
When a range of descriptors is freed then all of them are not associated to a linux interrupt. Remove the filter and add a warning to the free function. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c |2 +- include/linux/msi.h |5 ++--- kernel/irq/msi.c

[patch 06/39] genirq/msi: Add missing kernel doc to msi_next_desc()

2022-11-11 Thread Thomas Gleixner
W=1 complains about this. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c |1 + 1 file changed, 1 insertion(+) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -282,6 +282,7 @@ EXPORT_SYMBOL_GPL(msi_first_desc); /** * msi_next_desc - Get the next MSI descriptor of a device * @dev

[patch 11/39] genirq/irqdomain: Move bus token enum into a seperate header

2022-11-11 Thread Thomas Gleixner
Split the bus token defines out into a seperate header file to avoid inclusion of irqdomain.h in msi.h. Signed-off-by: Thomas Gleixner --- include/linux/irqdomain.h | 22 +- include/linux/irqdomain_defs.h | 26 ++ 2 files changed, 27

[patch 01/39] PCI/MSI: Check for MSI enabled in __pci_msix_enable()

2022-11-11 Thread Thomas Gleixner
PCI/MSI and PCI/MSI-X are mutually exclusive, but the MSI-X enable code lacks a check for already enabled MSI. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c |5 + 1 file changed, 5 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -935,6 +935,11

[patch 07/39] genirq/msi: Make __msi_domain_alloc_irqs() static

2022-11-11 Thread Thomas Gleixner
Nothing outside of the core code requires this. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |7 ++- kernel/irq/msi.c|6 -- 2 files changed, 6 insertions(+), 7 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -334,9 +334,8 @@ struct

[patch 04/39] genirq/msi: Use MSI_DESC_ALL in msi_add_simple_msi_descs()

2022-11-11 Thread Thomas Gleixner
There are no associated MSI descriptors in the requested range when the MSI descriptor allocation fails. Use MSI_DESC_ALL as the filter which prepares the next step to get rid of the filter for freeing. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c |2 +- 1 file changed, 1 insertion

[patch 14/39] PCI/MSI: Let the MSI core free descriptors

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Let the core do the freeing of descriptors and just keep it around for the legacy case. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/pci

[patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-11 Thread Thomas Gleixner
are just an indirection to PCI_MSI. Match the reality and just admit that PCI_MSI requires GENERIC_MSI_IRQ_DOMAIN. Signed-off-by: Thomas Gleixner --- arch/um/drivers/Kconfig |1 arch/um/include/asm/pci.h |2 - arch/x86/Kconfig|1

[patch 09/39] powerpc/pseries/msi: Use msi_domain_ops::msi_post_free()

2022-11-11 Thread Thomas Gleixner
Use the new msi_post_free() callback which is invoked after the interrupts have been freed to tell the hypervisor about the shutdown. This allows to remove the exposure of __msi_domain_free_irqs(). Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Christophe Leroy Cc: linuxppc-dev

[patch 08/39] genirq/msi: Provide msi_domain_ops::post_free()

2022-11-11 Thread Thomas Gleixner
To prepare for removing the exposure of __msi_domain_free_irqs() provide a post_free() callback in the MSI domain ops which can be used to solve the problem of the only user of __msi_domain_free_irqs() in arch/powerpc. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel

[patch 12/39] genirq/msi: Add bus token to struct msi_domain_info

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Add a bus token member to struct msi_domain_info and let msi_create_irq_domain() set the bus token. That allows to remove the bus token updates at the call sites. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- include

[patch 03/39] iommu/amd: Remove bogus check for multi MSI-X

2022-11-11 Thread Thomas Gleixner
PCI/Multi-MSI is MSI specific and not supported for MSI-X Signed-off-by: Thomas Gleixner --- drivers/iommu/amd/iommu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -3294,8 +3294,7 @@ static int irq_remapping_alloc

[patch 39/39] x86/apic: Remove X86_IRQ_ALLOC_CONTIGUOUS_VECTORS

2022-11-11 Thread Thomas Gleixner
Now that the PCI/MSI core code does early checking for multi-MSI support X86_IRQ_ALLOC_CONTIGUOUS_VECTORS is not required anymore. Remove the flag and rely on MSI_FLAG_MULTI_PCI_MSI. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/irqdomain.h|4 +--- arch/x86/kernel/apic/msi.c

Re: [PATCH v6 22/29] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector

2022-05-14 Thread Thomas Gleixner
On Fri, May 13 2022 at 15:16, Ricardo Neri wrote: > On Mon, May 09, 2022 at 04:03:39PM +0200, Thomas Gleixner wrote: >> > + /* If we are here, IPI shorthands are enabled. */ >> > + apic->send_IPI_allbutself(NMI_VECTOR); >>

Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic()

2022-05-14 Thread Thomas Gleixner
On Fri, May 13 2022 at 14:19, Ricardo Neri wrote: > On Fri, May 06, 2022 at 11:41:13PM +0200, Thomas Gleixner wrote: >> The argument about not bloating the code >> with an "obvious???" function which is quite small is slightly beyond my >> comprehension level. >

Re: [PATCH v6 05/29] x86/apic/vector: Do not allocate vectors for NMIs

2022-05-14 Thread Thomas Gleixner
On Fri, May 13 2022 at 16:45, Ricardo Neri wrote: > On Fri, May 13, 2022 at 10:50:09PM +0200, Thomas Gleixner wrote: >> > Also, if lapic_nmi_controller.irq_set_affinity() is NULL, then irq_chips >> > INTEL-IR, AMD-IR, those using msi_domain_set_affinity() need to

Re: [PATCH v6 05/29] x86/apic/vector: Do not allocate vectors for NMIs

2022-05-13 Thread Thomas Gleixner
On Fri, May 13 2022 at 11:03, Ricardo Neri wrote: > On Fri, May 06, 2022 at 11:12:20PM +0200, Thomas Gleixner wrote: >> Why would a NMI ever end up in this code? There is no vector management >> required and this find cpu exercise is pointless. > > But even if the N

Re: [PATCH v6 28/29] x86/tsc: Restart NMI watchdog after refining tsc_khz

2022-05-10 Thread Thomas Gleixner
On Tue, May 10 2022 at 21:16, Nicholas Piggin wrote: > Excerpts from Ricardo Neri's message of May 6, 2022 10:00 am: >> +/* >> + * If in use, the HPET hardlockup detector relies on tsc_khz. >> + * Reconfigure it to make use of the refined tsc_khz. >> + */ >> +

Re: [PATCH v6 22/29] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector

2022-05-09 Thread Thomas Gleixner
On Thu, May 05 2022 at 17:00, Ricardo Neri wrote: > + if (is_hpet_hld_interrupt(hdata)) { > + /* > + * Kick the timer first. If the HPET channel is periodic, it > + * helps to reduce the delta between the expected TSC value and > + * its

Re: [PATCH v6 21/29] x86/nmi: Add an NMI_WATCHDOG NMI handler category

2022-05-09 Thread Thomas Gleixner
On Thu, May 05 2022 at 17:00, Ricardo Neri wrote: > Add a NMI_WATCHDOG as a new category of NMI handler. This new category > is to be used with the HPET-based hardlockup detector. This detector > does not have a direct way of checking if the HPET timer is the source of > the NMI. Instead, it

  1   2   3   4   5   6   7   8   >