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

2022-11-16 Thread Ashok Raj
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 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > --- a/drivers/iommu/amd/iommu.c >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:35PM +0100, Thomas Gleixner wrote: > 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 Acked-by: Bjorn Helgaas > --- >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:50PM +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. > > Make pci_alloc_irq_vectors() a real function instead of wrapper and add > proper

[PATCH printk v5 00/40] reduce console_lock scope

2022-11-16 Thread John Ogness
This is v5 of a series to prepare for threaded/atomic printing. v4 is here [0]. This series focuses on reducing the scope of the BKL console_lock. It achieves this by switching to SRCU and a dedicated mutex for console list iteration and modification, respectively. The console_lock will no longer

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:03PM +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. > > Move pci_msi_enabled() and add kernel-doc for the function. > >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:01PM +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. > > Move pci_msi_enabled() and make its kernel-doc comprehensive. > > Signed-off-by:

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:09PM +0100, Thomas Gleixner wrote: > When hierarchical MSI interrupt domains are enabled then there is no point > to do tons of work and detect the missing support for multi-MSI late in the > allocation path. > > Just query the domain feature flags right away. The

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

2022-11-16 Thread Ashok Raj
On Fri, Nov 11, 2022 at 02:54:32PM +0100, Thomas Gleixner wrote: > 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 +- >

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_bool y >> depends on PCI_MSI >> select

Re: [PATCH 38/44] KVM: Disable CPU hotplug during hardware enabling

2022-11-16 Thread Sean Christopherson
On Wed, Nov 16, 2022, Huang, Kai wrote: > On Tue, 2022-11-15 at 20:16 +, Sean Christopherson wrote: > > On Thu, Nov 10, 2022, Huang, Kai wrote: > > > On Thu, 2022-11-10 at 01:33 +, Huang, Kai wrote: > > > Hmm.. I wasn't thinking thoroughly. I forgot CPU compatibility check also > > >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:20PM +0100, Thomas Gleixner wrote: > 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:

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:22PM +0100, Thomas Gleixner wrote: > 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 |

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:32PM +0100, Thomas Gleixner wrote: > 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 +- >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:42PM +0100, Thomas Gleixner wrote: > 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(-)

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:43PM +0100, Thomas Gleixner wrote: > 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

[PATCH mm-unstable v1 07/20] mm: don't call vm_ops->huge_fault() in wp_huge_pmd()/wp_huge_pud() for private mappings

2022-11-16 Thread David Hildenbrand
If we already have a PMD/PUD mapped write-protected in a private mapping and we want to break COW either due to FAULT_FLAG_WRITE or FAULT_FLAG_UNSHARE, there is no need to inform the file system just like on the PTE path. Let's just split (->zap) + fallback in that case. This is a preparation

[PATCH mm-unstable v1 18/20] RDMA/hw/qib/qib_user_pages: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
FOLL_FORCE is really only for ptrace access. As we unpin the pinned pages using unpin_user_pages_dirty_lock(true), the assumption is that all these pages are writable. FOLL_FORCE in this case seems to be a legacy leftover. Let's just remove it. Cc: Dennis Dalessandro Cc: Jason Gunthorpe Cc:

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:42PM +0100, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > Follow the style of > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/msi.h |8 > 1 file changed, 4 insertions(+),

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:37PM +0100, Thomas Gleixner wrote: > 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 Acked-by: Bjorn Helgaas > --- >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:51PM +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. > > Move pci_alloc_irq_vectors_affinity() and let its kernel-doc reference >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:07PM +0100, Thomas Gleixner wrote: > 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 Acked-by: Bjorn Helgaas >

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 " irq_affinity" some

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: [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc

2022-11-16 Thread Christophe Leroy
Le 16/11/2022 à 18:01, Hari Bathini a écrit : >> >> I also managed to test it on QEMU. The config is based on >> pmac32_defconfig. > > I had the same config but hit this problem: > > # echo 1 > /proc/sys/net/core/bpf_jit_enable; modprobe test_bpf > test_bpf: #0 TAX >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:23PM +0100, Thomas Gleixner wrote: > W=1 complains about this. > > Signed-off-by: Thomas Gleixner > --- > kernel/irq/msi.c |1 + > 1 file changed, 1 insertion(+) Reviewed-by: Jason Gunthorpe Jason

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:40PM +0100, Thomas Gleixner wrote: > 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 +- >

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

2022-11-16 Thread Jason Gunthorpe
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_bool y > depends on PCI_MSI > select GENERIC_MSI_IRQ_DOMAIN > > Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:15PM +0100, Thomas Gleixner wrote: > 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(-) Reviewed-by: Jason Gunthorpe Jason

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

2022-11-16 Thread Ashok Raj
On Fri, Nov 11, 2022 at 02:54:15PM +0100, Thomas Gleixner wrote: > 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(+) >

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

2022-11-16 Thread Bjorn Helgaas
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_bool y > depends on PCI_MSI > select GENERIC_MSI_IRQ_DOMAIN > > Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:48PM +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. > > Move pci_enable_msix_range() and make its kernel-doc comprehensive. > >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:04PM +0100, Thomas Gleixner wrote: > 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. > >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:14PM +0100, Thomas Gleixner wrote: > All these sanity checks are now done _before_ any allocation work > happens. No point in doing it twice. > > Signed-off-by: Thomas Gleixner Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/irqdomain.c | 48 >

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 31/39] Documentation: PCI: Add reference to PCI/MSI device driver APIs

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:04PM +0100, Thomas Gleixner wrote: > 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. > >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:15PM +0100, Thomas Gleixner wrote: > 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(+)

Re: [PATCH 1/2] cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
On 11/11/2022 15:54, Yang Yingliang wrote: If device_register() fails in cxl_register_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device. As comment of

Re: [PATCH 13/44] KVM: x86: Serialize vendor module initialization (hardware setup)

2022-11-16 Thread Sean Christopherson
On Wed, Nov 16, 2022, Huang, Kai wrote: > On Wed, 2022-11-02 at 23:18 +, Sean Christopherson wrote: > > Acquire a new mutex, vendor_module_lock, in kvm_x86_vendor_init() while > > doing hardware setup to ensure that concurrent calls are fully serialized. > > KVM rejects attempts to load vendor

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

2022-11-16 Thread Ashok Raj
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 |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > ---

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:45PM +0100, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > msi.c is a maze of randomly sorted functions which makes the code > unreadable. As a first step split the driver visible API and the internal > implementation which also allows proper API documentation

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:54PM +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. > > Move pci_free_irq_vectors() and make its kernel-doc comprehensive. > >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:56PM +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. > > Move pci_msix_vec_count() and make its kernel-doc comprehensive. > > Signed-off-by:

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:12PM +0100, Thomas Gleixner wrote: > With interrupt domains the sanity check for MSI-X vector validation can be > done _before_ any allocation happens. The sanity check only applies to the > allocation functions which have an 'entries' array argument. The entries >

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 +-- >> 1 file changed, 1 insertion(+),

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:03PM +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. > > Move pci_msi_enabled() and add kernel-doc for the function. > >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:28PM +0100, Thomas Gleixner wrote: > 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

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:07PM +0100, Thomas Gleixner wrote: > 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 > --- >

Re: [PATCH 2/2] cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()

2022-11-16 Thread Frederic Barrat
On 11/11/2022 15:54, Yang Yingliang wrote: If device_register() fails in cxl_pci_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device. As comment of device_register()

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

2022-11-16 Thread Jason Gunthorpe
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 anymore. > Remove the flag and rely on MSI_FLAG_MULTI_PCI_MSI. Reviewed-by: Jason Gunthorpe Jason

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

2022-11-16 Thread Ashok Raj
On Fri, Nov 11, 2022 at 02:54:20PM +0100, Thomas Gleixner wrote: > 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:

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:58PM +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. > > Move pci_disable_msix() and make its kernel-doc comprehensive. > > Signed-off-by:

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 and MSI-X specific functions are >>

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

2022-11-16 Thread Ashok Raj
On Wed, Nov 16, 2022 at 06:02:30PM +0100, Thomas Gleixner wrote: > 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 > >> ---

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:30PM +0100, Thomas Gleixner wrote: > 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(-)

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:11PM +0100, Thomas Gleixner wrote: > 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

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:09PM +0100, Thomas Gleixner wrote: > When hierarchical MSI interrupt domains are enabled then there is no point > to do tons of work and detect the missing support for multi-MSI late in the > allocation path. > > Just query the domain feature flags right away. The

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:43PM +0100, Thomas Gleixner wrote: > 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

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:53PM +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. > > Move pci_irq_vector() and let its kernel-doc match the rest of the file. > >

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:55:11PM +0100, Thomas Gleixner wrote: > 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 Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/msi.c |4

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 |3 +-- >> 1 file changed, 1

Re: [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc

2022-11-16 Thread Hari Bathini
On 16/11/22 12:14 am, Christophe Leroy wrote: Le 14/11/2022 à 18:27, Christophe Leroy a écrit : Le 14/11/2022 à 15:47, Hari Bathini a écrit : Hi Christophe, On 11/11/22 4:55 pm, Christophe Leroy wrote: Le 10/11/2022 à 19:43, Hari Bathini a écrit : Most BPF programs are small, but

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

2022-11-16 Thread Jason Gunthorpe
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 > the problem of the only user of __msi_domain_free_irqs() in arch/powerpc. > >

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:25PM +0100, Thomas Gleixner wrote: > 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(-) Reviewed-by:

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:35PM +0100, Thomas Gleixner wrote: > 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

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

2022-11-16 Thread Jason Gunthorpe
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. > > That allows to remove the bus token updates at the call sites. > > Suggested-by: Thomas

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:14PM +0100, Thomas Gleixner wrote: > 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 >

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

2022-11-16 Thread Bjorn Helgaas
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. > > Move pci_enable_msi() and make its kernel-doc comprehensive. > > Signed-off-by: Ahmed

[PATCH printk v5 25/40] tty: hvc: use console_is_registered()

2022-11-16 Thread John Ogness
It is not reliable to check for CON_ENABLED in order to identify if a console is registered. Use console_is_registered() instead. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- drivers/tty/hvc/hvc_console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

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

2022-11-16 Thread Bjorn Helgaas
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 and MSI-X specific functions are > intermingled and the code flow is completely non-obvious.

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:15PM +0100, Thomas Gleixner wrote: > 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 Acked-by: Bjorn Helgaas > --- > drivers/pci/msi/msi.c |5 + > 1 file

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

2022-11-16 Thread Bjorn Helgaas
On Fri, Nov 11, 2022 at 02:54:59PM +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. > > Move pci_irq_get_affinity() and let its kernel-doc match rest of the > file. > >

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. >> >> Move pci_enable_msi() and

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:54:37PM +0100, Thomas Gleixner wrote: > 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 |

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

2022-11-16 Thread Jason Gunthorpe
On Fri, Nov 11, 2022 at 02:55:12PM +0100, Thomas Gleixner wrote: > With interrupt domains the sanity check for MSI-X vector validation can be > done _before_ any allocation happens. The sanity check only applies to the > allocation functions which have an 'entries' array argument. The entries >

[PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks

2022-11-16 Thread David Hildenbrand
For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not dealing with a COW mapping, such that we treat it like a read fault as documented and don't have to worry about the flag throughout all fault handlers. While

[PATCH mm-unstable v1 10/20] RDMA/umem: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
GUP now supports reliable R/O long-term pinning in COW mappings, such that we break COW early. MAP_SHARED VMAs only use the shared zeropage so far in one corner case (DAXFS file with holes), which can be ignored because GUP does not support long-term pinning in fsdax (see check_vma_flags()).

Re: [PATCH mm-unstable v1 13/20] media: videobuf-dma-sg: remove FOLL_FORCE usage

2022-11-16 Thread Daniel Vetter
On Wed, Nov 16, 2022 at 11:26:52AM +0100, David Hildenbrand wrote: > GUP now supports reliable R/O long-term pinning in COW mappings, such > that we break COW early. MAP_SHARED VMAs only use the shared zeropage so > far in one corner case (DAXFS file with holes), which can be ignored > because GUP

[PATCH mm-unstable v1 09/20] mm/gup: reliable R/O long-term pinning in COW mappings

2022-11-16 Thread David Hildenbrand
We already support reliable R/O pinning of anonymous memory. However, assume we end up pinning (R/O long-term) a pagecache page or the shared zeropage inside a writable private ("COW") mapping. The next write access will trigger a write-fault and replace the pinned page by an exclusive anonymous

Re: [RFC PATCH] seccomp: Add protection keys into seccomp_data

2022-11-16 Thread Stephen Röttger
On Tue, Nov 15, 2022 at 5:16 AM Michael Sammler wrote: > > We're currently working on a feature in chromium that uses pkeys for > > in-process isolation. Being able to use the pkey state in the seccomp > > filter would be pretty useful for this. For example, it would allow > > us to enforce that

Re: [PATCH 38/44] KVM: Disable CPU hotplug during hardware enabling

2022-11-16 Thread Huang, Kai
On Tue, 2022-11-15 at 20:16 +, Sean Christopherson wrote: > On Thu, Nov 10, 2022, Huang, Kai wrote: > > On Thu, 2022-11-10 at 01:33 +, Huang, Kai wrote: > > > > @@ -9283,7 +9283,13 @@ static int > > > > kvm_x86_check_processor_compatibility(struct kvm_x86_init_ops *ops) > > > >   int

[PATCH mm-unstable v1 08/20] mm: extend FAULT_FLAG_UNSHARE support to anything in a COW mapping

2022-11-16 Thread David Hildenbrand
Extend FAULT_FLAG_UNSHARE to break COW on anything mapped into a COW (i.e., private writable) mapping and adjust the documentation accordingly. FAULT_FLAG_UNSHARE will now also break COW when encountering the shared zeropage, a pagecache page, a PFNMAP, ... inside a COW mapping, by properly

[PATCH mm-unstable v1 11/20] RDMA/usnic: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
GUP now supports reliable R/O long-term pinning in COW mappings, such that we break COW early. MAP_SHARED VMAs only use the shared zeropage so far in one corner case (DAXFS file with holes), which can be ignored because GUP does not support long-term pinning in fsdax (see check_vma_flags()).

[PATCH mm-unstable v1 12/20] RDMA/siw: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
GUP now supports reliable R/O long-term pinning in COW mappings, such that we break COW early. MAP_SHARED VMAs only use the shared zeropage so far in one corner case (DAXFS file with holes), which can be ignored because GUP does not support long-term pinning in fsdax (see check_vma_flags()).

[PATCH mm-unstable v1 01/20] selftests/vm: anon_cow: prepare for non-anonymous COW tests

2022-11-16 Thread David Hildenbrand
Originally, the plan was to have a separate tests for testing COW of non-anonymous (e.g., shared zeropage) pages. Turns out, that we'd need a lot of similar functionality and that there isn't a really good reason to separate it. So let's prepare for non-anon tests by renaming to "cow".

[PATCH mm-unstable v1 02/20] selftests/vm: cow: basic COW tests for non-anonymous pages

2022-11-16 Thread David Hildenbrand
Let's add basic tests for COW with non-anonymous pages in private mappings: write access should properly trigger COW and result in the private changes not being visible through other page mappings. Especially, add tests for: * Zeropage * Huge zeropage * Ordinary pagecache pages via memfd and

[PATCH mm-unstable v1 13/20] media: videobuf-dma-sg: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
GUP now supports reliable R/O long-term pinning in COW mappings, such that we break COW early. MAP_SHARED VMAs only use the shared zeropage so far in one corner case (DAXFS file with holes), which can be ignored because GUP does not support long-term pinning in fsdax (see check_vma_flags()).

[PATCH mm-unstable v1 14/20] drm/etnaviv: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
GUP now supports reliable R/O long-term pinning in COW mappings, such that we break COW early. MAP_SHARED VMAs only use the shared zeropage so far in one corner case (DAXFS file with holes), which can be ignored because GUP does not support long-term pinning in fsdax (see check_vma_flags()).

Re: [PATCH mm-unstable v1 14/20] drm/etnaviv: remove FOLL_FORCE usage

2022-11-16 Thread Daniel Vetter
On Wed, Nov 16, 2022 at 11:26:53AM +0100, David Hildenbrand wrote: > GUP now supports reliable R/O long-term pinning in COW mappings, such > that we break COW early. MAP_SHARED VMAs only use the shared zeropage so > far in one corner case (DAXFS file with holes), which can be ignored > because GUP

[PATCH] arch/powerpc/setup: Fix reference count issue in pas_setup_mce_regs()

2022-11-16 Thread Xiongfeng Wang
pci_get_device() will increase the reference count for the returned pci_dev, and also decrease the reference count for the input parameter *from* if it is not NULL. In function pas_setup_mce_regs(), after we break out the loop with 'dev' not NULL, we need to decrease the reference count of 'dev'.

[PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
FOLL_FORCE is really only for ptrace access. According to commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable"), get_vaddr_frames() currently pins all pages writable as a workaround for issues with read-only buffers. FOLL_FORCE, however, seems to be a legacy

[PATCH mm-unstable v1 15/20] media: pci/ivtv: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
FOLL_FORCE is really only for ptrace access. R/O pinning a page is supposed to fail if the VMA misses proper access permissions (no VM_READ). Let's just remove FOLL_FORCE usage here; there would have to be a pretty good reason to allow arbitrary drivers to R/O pin pages in a PROT_NONE VMA. Most

Re: [PATCH mm-unstable v1 17/20] drm/exynos: remove FOLL_FORCE usage

2022-11-16 Thread Daniel Vetter
On Wed, Nov 16, 2022 at 11:26:56AM +0100, David Hildenbrand wrote: > FOLL_FORCE is really only for ptrace access. As we unpin the pinned pages > using unpin_user_pages_dirty_lock(true), the assumption is that all these > pages are writable. > > FOLL_FORCE in this case seems to be a legacy

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-16 Thread Daniel Vetter
On Wed, Nov 16, 2022 at 11:26:55AM +0100, David Hildenbrand wrote: > FOLL_FORCE is really only for ptrace access. According to commit > 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always > writable"), get_vaddr_frames() currently pins all pages writable as a > workaround for

[PATCH mm-unstable v1 03/20] selftests/vm: cow: R/O long-term pinning reliability tests for non-anon pages

2022-11-16 Thread David Hildenbrand
Let's test whether R/O long-term pinning is reliable for non-anonymous memory: when R/O long-term pinning a page, the expectation is that we break COW early before pinning, such that actual write access via the page tables won't break COW later and end up replacing the R/O-pinned page in the page

Re: [PATCH mm-unstable v1 09/20] mm/gup: reliable R/O long-term pinning in COW mappings

2022-11-16 Thread Daniel Vetter
On Wed, Nov 16, 2022 at 11:26:48AM +0100, David Hildenbrand wrote: > We already support reliable R/O pinning of anonymous memory. However, > assume we end up pinning (R/O long-term) a pagecache page or the shared > zeropage inside a writable private ("COW") mapping. The next write access > will

[PATCH mm-unstable v1 19/20] habanalabs: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
FOLL_FORCE is really only for ptrace access. As we unpin the pinned pages using unpin_user_pages_dirty_lock(true), the assumption is that all these pages are writable. FOLL_FORCE in this case seems to be due to copy-and-past from other drivers. Let's just remove it. Acked-by: Oded Gabbay Cc:

[PATCH mm-unstable v1 06/20] mm: rework handling in do_wp_page() based on private vs. shared mappings

2022-11-16 Thread David Hildenbrand
We want to extent FAULT_FLAG_UNSHARE support to anything mapped into a COW mapping (pagecache page, zeropage, PFN, ...), not just anonymous pages. Let's prepare for that by handling shared mappings first such that we can handle private mappings last. While at it, use folio-based functions instead

[PATCH mm-unstable v1 05/20] mm: add early FAULT_FLAG_WRITE consistency checks

2022-11-16 Thread David Hildenbrand
Let's catch abuse of FAULT_FLAG_WRITE early, such that we don't have to care in all other handlers and might get "surprises" if we forget to do so. Write faults without VM_MAYWRITE don't make any sense, and our maybe_mkwrite() logic could have hidden such abuse for now. Write faults without

[PATCH mm-unstable v1 17/20] drm/exynos: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
FOLL_FORCE is really only for ptrace access. As we unpin the pinned pages using unpin_user_pages_dirty_lock(true), the assumption is that all these pages are writable. FOLL_FORCE in this case seems to be a legacy leftover. Let's just remove it. Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park

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. >> >> That allows to remove the bus

  1   2   >