[PATCH v2 2/3] rseq: remove redundant access_ok()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet After commit 8f2817701492 ("rseq: Use get_user/put_user rather than __get_user/__put_user") we no longer need an access_ok() call from __rseq_handle_notify_resume() Mathieu pointed out the same cleanup can be done in rseq_syscall(). Signed-off-by: Eric Dumazet C

[PATCH v2 1/3] rseq: optimize rseq_update_cpu_id()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Two put_user() in rseq_update_cpu_id() are replaced by a pair of unsafe_put_user() with appropriate surroundings. This removes one stac/clac pair on x86 in fast path. Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: "Paul E. McKenney"

[PATCH v2 0/3] rseq: minor optimizations

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet rseq is a heavy user of copy to/from user data in fast paths. This series tries to reduce the cost. v2: Addressed Peter and Mathieu feedbacks, thanks ! Eric Dumazet (3): rseq: optimize rseq_update_cpu_id() rseq: remove redundant access_ok() rseq: optimise

Re: [PATCH 1/3] rseq: optimize rseq_update_cpu_id()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 4:29 PM Mathieu Desnoyers wrote: > > - On Apr 13, 2021, at 3:36 AM, Eric Dumazet eric.duma...@gmail.com wrote: > > > From: Eric Dumazet > > > > Two put_user() in rseq_update_cpu_id() are replaced > > by a pair of unsafe_put_use

Re: [PATCH 2/3] rseq: remove redundant access_ok()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 4:34 PM Mathieu Desnoyers wrote: > > - On Apr 13, 2021, at 3:36 AM, Eric Dumazet eric.duma...@gmail.com wrote: > > > From: Eric Dumazet > > > > After commit 8f2817701492 ("rseq: Use get_user/put_user rather > > than __g

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 3:38 PM Michael S. Tsirkin wrote: > > On Tue, Apr 13, 2021 at 03:33:40PM +0200, Eric Dumazet wrote: > > On Tue, Apr 13, 2021 at 3:27 PM Eric Dumazet wrote: > > > > > > On Tue, Apr 13, 2021 at 2:57 PM Michael S. Tsirkin > > > wrot

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 3:27 PM Eric Dumazet wrote: > > On Tue, Apr 13, 2021 at 2:57 PM Michael S. Tsirkin wrote: > > > > On Mon, Apr 12, 2021 at 06:47:07PM +0200, Eric Dumazet wrote: > > > On Mon, Apr 12, 2021 at 6:31 PM Eric Dumazet wrote: > > > > > &

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 2:57 PM Michael S. Tsirkin wrote: > > On Mon, Apr 12, 2021 at 06:47:07PM +0200, Eric Dumazet wrote: > > On Mon, Apr 12, 2021 at 6:31 PM Eric Dumazet wrote: > > > > > > On Mon, Apr 12, 2021 at 6:28 PM Linus Torvalds > > > wrote: >

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 12:43 PM Eric Dumazet wrote: > > On Tue, Apr 13, 2021 at 11:24 AM Eric Dumazet wrote: > > > > On Mon, Apr 12, 2021 at 10:05 PM Guenter Roeck wrote: > > > > > > On 4/12/21 10:38 AM, Eric Dumazet wrote: > > > [ ... ] > >

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 11:24 AM Eric Dumazet wrote: > > On Mon, Apr 12, 2021 at 10:05 PM Guenter Roeck wrote: > > > > On 4/12/21 10:38 AM, Eric Dumazet wrote: > > [ ... ] > > > > > Yes, I think this is the real issue here. This smells like some memory >

Re: Linux 5.12-rc7

2021-04-13 Thread Eric Dumazet
On Mon, Apr 12, 2021 at 10:05 PM Guenter Roeck wrote: > > On 4/12/21 10:38 AM, Eric Dumazet wrote: > [ ... ] > > > Yes, I think this is the real issue here. This smells like some memory > > corruption. > > > > In my traces, packet is correctly received in AF_

[PATCH 3/3] rseq: optimise for 64bit arches

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Commit ec9c82e03a74 ("rseq: uapi: Declare rseq_cs field as union, update includes") added regressions for our servers. Using copy_from_user() and clear_user() for 64bit values on 64bit arches is suboptimal. We might revisit this patch once all 32bit arches suppor

[PATCH 2/3] rseq: remove redundant access_ok()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet After commit 8f2817701492 ("rseq: Use get_user/put_user rather than __get_user/__put_user") we no longer need an access_ok() call from __rseq_handle_notify_resume() Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: "Paul E. McKenney&q

[PATCH 1/3] rseq: optimize rseq_update_cpu_id()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Two put_user() in rseq_update_cpu_id() are replaced by a pair of unsafe_put_user() with appropriate surroundings. This removes one stac/clac pair on x86 in fast path. Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: "Paul E. McKenney"

[PATCH 0/3] rseq: minor optimizations

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet rseq is a heavy user of copy to/from user data in fast paths. This series tries to reduce the cost. Eric Dumazet (3): rseq: optimize rseq_update_cpu_id() rseq: remove redundant access_ok() rseq: optimise for 64bit arches kernel/rseq.c | 26

Re: [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-12 Thread Eric Biggers
On Mon, Apr 12, 2021 at 03:04:58PM -0400, Chris von Recklinghausen wrote: > On 4/12/21 1:45 PM, Eric Biggers wrote: > > On Mon, Apr 12, 2021 at 10:09:32AM -0400, Chris von Recklinghausen wrote: > > > Suspend fails on a system in fips mode because md5 is used for the e820 >

Re: [PATCH v6 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-12 Thread Eric Biggers
gt;bump up RESTORE_MAGIC > v2 -> v3 >move embelishment from cover letter to commit comments (no code change) > v3 -> v4 >add note to comments that md5 isn't used for encryption here. > v4 -> v5 >reword comment per Simo's suggestion > v5 -> v6 >use

Re: Linux 5.12-rc7

2021-04-12 Thread Eric Dumazet
On Mon, Apr 12, 2021 at 7:31 PM Guenter Roeck wrote: > > On 4/12/21 9:31 AM, Eric Dumazet wrote: > > On Mon, Apr 12, 2021 at 6:28 PM Linus Torvalds > > wrote: > >> > >> On Sun, Apr 11, 2021 at 10:14 PM Guenter Roeck wrote: > >>> > >>>

Re: Linux 5.12-rc7

2021-04-12 Thread Eric Dumazet
On Mon, Apr 12, 2021 at 6:31 PM Eric Dumazet wrote: > > On Mon, Apr 12, 2021 at 6:28 PM Linus Torvalds > wrote: > > > > On Sun, Apr 11, 2021 at 10:14 PM Guenter Roeck wrote: > > > > > > Qemu test results: > > >

Re: Linux 5.12-rc7

2021-04-12 Thread Eric Dumazet
On Mon, Apr 12, 2021 at 6:28 PM Linus Torvalds wrote: > > On Sun, Apr 11, 2021 at 10:14 PM Guenter Roeck wrote: > > > > Qemu test results: > > total: 460 pass: 459 fail: 1 > > Failed tests: > > sh:rts7751r2dplus_defconfig:ata:net,virtio-net:rootfs > > > > The failure bisects to

[PATCH] KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read

2021-04-12 Thread Eric Auger
returns NULL if the list is empty. Fixes: dbd9733ab674 ("KVM: arm/arm64: Replace the single rdist region by a list") Cc: # v4.18+ Signed-off-by: Eric Auger Reported-by: Gavin Shan --- arch/arm64/kvm/vgic/vgic-kvm-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH net-next v2 2/3] net: use skb_for_each_frag() helper where possible

2021-04-12 Thread Eric Dumazet
On 4/12/21 2:38 AM, Matteo Croce wrote: > From: Matteo Croce > > use the new helper macro skb_for_each_frag() which allows to iterate > through all the SKB fragments. > > The patch was created with Coccinelle, this was the semantic patch: > > @@ > struct sk_buff *skb; > identifier i; >

Re: [syzbot] KMSAN: uninit-value in INET_ECN_decapsulate (2)

2021-04-12 Thread Eric Dumazet
On 3/30/21 3:26 PM, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:29ad81a1 arch/x86: add missing include to sparsemem.h > git tree: https://github.com/google/kmsan.git master > console output: https://syzkaller.appspot.com/x/log.txt?x=166fe481d0

Re: [PATCH] net: geneve: check skb is large enough for IPv4/IPv6 header

2021-04-11 Thread Eric Dumazet
On Sun, Apr 11, 2021 at 1:28 PM Phillip Potter wrote: > > Check within geneve_xmit_skb/geneve6_xmit_skb that sk_buff structure > is large enough to include IPv4 or IPv6 header, and reject if not. The > geneve_xmit_skb portion and overall idea was contributed by Eric Dumazet. > Fixe

Re: [PATCH v12 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-04-11 Thread Auger Eric
Hi Zenghui, On 4/7/21 11:33 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 5:06, Eric Auger wrote: >> +/* >> + * VFIO_IOMMU_SET_PASID_TABLE - _IOWR(VFIO_TYPE, VFIO_BASE + 18, >> + *    struct vfio_iommu_type1_set_pasid_table) >> + * >> + *

[PATCH v13 11/13] vfio: Document nested stage control

2021-04-11 Thread Eric Auger
The VFIO API was enhanced to support nested stage control: a bunch of new iotcls, one DMA FAULT region and an associated specific IRQ. Let's document the process to follow to set up nested mode. Signed-off-by: Eric Auger --- v11 -> v12: s/VFIO_REGION_INFO_CAP_PRODUCER_FA

[PATCH v13 13/13] vfio/pci: Inject page response upon response region fill

2021-04-11 Thread Eric Auger
When the userspace increments the head of the page response buffer ring, let's push the response into the iommu layer. This is done through a workqueue that pops the responses from the ring buffer and increment the tail. Signed-off-by: Eric Auger --- drivers/vfio/pci/vfio_pci.c | 40

[PATCH v13 12/13] vfio/pci: Register a DMA fault response region

2021-04-11 Thread Eric Auger
In preparation for vSVA, let's register a DMA fault response region, where the userspace will push the page responses and increment the head of the buffer. The kernel will pop those responses and inject them on iommu side. Signed-off-by: Eric Auger --- v11 -> v12: - use DMA_FAULT_RESPONSE

[PATCH v13 10/13] vfio/pci: Register and allow DMA FAULT IRQ signaling

2021-04-11 Thread Eric Auger
Register the VFIO_IRQ_TYPE_NESTED/VFIO_IRQ_SUBTYPE_DMA_FAULT IRQ that allows to signal a nested mode DMA fault. Signed-off-by: Eric Auger --- v10 -> v11: - the irq now is registered in vfio_pci_dma_fault_init() in case the domain is nested --- drivers/vfio/pci/vfio_pci.c |

[PATCH v13 08/13] vfio/pci: Add framework for custom interrupt indices

2021-04-11 Thread Eric Auger
Implement IRQ capability chain infrastructure. All interrupt indexes beyond VFIO_PCI_NUM_IRQS are handled as extended interrupts. They are registered with a specific type/subtype and supported flags. Signed-off-by: Eric Auger --- v11 -> v12: - check !vdev->num_ex

[PATCH v13 09/13] vfio: Add new IRQ for DMA fault reporting

2021-04-11 Thread Eric Auger
Add a new IRQ type/subtype to get notification on nested stage DMA faults. Signed-off-by: Eric Auger --- include/uapi/linux/vfio.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 0728b6f3f348..ad7c275b4074 100644 --- a/include

[PATCH v13 05/13] vfio/pci: Register an iommu fault handler

2021-04-11 Thread Eric Auger
Register an IOMMU fault handler which records faults in the DMA FAULT region ring buffer. In a subsequent patch, we will add the signaling of a specific eventfd to allow the userspace to be notified whenever a new fault has shown up. Signed-off-by: Eric Auger --- v11 -> v12: - t

[PATCH v13 07/13] vfio: Use capability chains to handle device specific irq

2021-04-11 Thread Eric Auger
From: Tina Zhang Caps the number of irqs with fixed indexes and uses capability chains to chain device specific irqs. Signed-off-by: Tina Zhang Signed-off-by: Eric Auger [Eric: Put cap_offset at the end of the vfio_irq_info struct, remove GFX IRQ at the moment and remove any reference

[PATCH v13 06/13] vfio/pci: Allow to mmap the fault queue

2021-04-11 Thread Eric Auger
The DMA FAULT region contains the fault ring buffer. There is benefit to let the userspace mmap this area. Expose this mmappable area through a sparse mmap entry and implement the mmap operation. Signed-off-by: Eric Auger --- v8 -> v9: - remove unused index local varia

[PATCH v13 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type

2021-04-11 Thread Eric Auger
, entry size). At the moment the region is dimensionned for 512 fault records. Signed-off-by: Eric Auger --- v11 -> v12: - set fault_pages to NULL after free - check new_tail >= header->nb_entries (Zenghui) - update value of VFIO_REGION_TYPE_NESTED - handle the case where the domain is NU

[PATCH v13 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING

2021-04-11 Thread Eric Auger
This patch adds the VFIO_IOMMU_SET_MSI_BINDING ioctl which aim to (un)register the guest MSI binding to the host. This latter then can use those stage 1 bindings to build a nested stage binding targeting the physical MSIs. Signed-off-by: Eric Auger --- v11 -> v12: - Share VFIO_BASE +

[PATCH v13 02/13] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2021-04-11 Thread Eric Auger
DATE ioctl with aims at propagating guest stage1 IOMMU cache invalidations to the host. Signed-off-by: Liu, Yi L Signed-off-by: Eric Auger --- v12 -> v13: - resolve minor conflict due to 898b9eaeb3fe ("vfio/type1: block on invalid vaddr") v11 -> v12: - share VFIO_BASE + 19 with VFI

[PATCH v13 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2021-04-11 Thread Eric Auger
From: "Liu, Yi L" This patch adds an VFIO_IOMMU_SET_PASID_TABLE ioctl which aims to pass the virtual iommu guest configuration to the host. This latter takes the form of the so-called PASID table. Signed-off-by: Jacob Pan Signed-off-by: Liu, Yi L Signed-off-by: Eric Auger ---

[PATCH v13 00/13] SMMUv3 Nested Stage Setup (VFIO part)

2021-04-11 Thread Eric Auger
two specific regions allow to - expose the fault records to the user space and - inject page responses. This latter functionality is not exercised in this series but is provided as a POC for further vSVA activities (Shameer's input). Best Regards Eric This series can be found at: https

[PATCH v15 12/12] iommu/smmuv3: report additional recoverable faults

2021-04-11 Thread Eric Auger
Up to now we have only reported translation faults. Now that the guest can induce some configuration faults, let's report them too. Add propagation for BAD_SUBSTREAMID, CD_FETCH, BAD_CD, WALK_EABT. We also fix the transcoding for some existing translation faults. Signed-off-by: Eric Auger

[PATCH v15 11/12] iommu/smmuv3: Implement bind/unbind_guest_msi

2021-04-11 Thread Eric Auger
The bind/unbind_guest_msi() callbacks check the domain is NESTED and redirect to the dma-iommu implementation. Signed-off-by: Eric Auger --- v6 -> v7: - remove device handle argument --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 + 1 file changed, 43 inserti

[PATCH v15 10/12] iommu/smmuv3: Enforce incompatibility between nested mode and HW MSI regions

2021-04-11 Thread Eric Auger
Nested mode currently is not compatible with HW MSI reserved regions. Indeed MSI transactions targeting this MSI doorbells bypass the SMMU. Let's check nested mode is not attempted in such configuration. Signed-off-by: Eric Auger --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 23

[PATCH v15 09/12] iommu/smmuv3: Nested mode single MSI doorbell per domain enforcement

2021-04-11 Thread Eric Auger
into the correct physical doorbell. So let's forbid this situation. Signed-off-by: Eric Auger --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 41 + 1 file changed, 41 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

[PATCH v15 08/12] dma-iommu: Implement NESTED_MSI cookie

2021-04-11 Thread Eric Auger
ectly mapped through both stages. Nested mode is not compatible with HW MSI regions as in that case gDB and hDB should have a 1-1 mapping. This check will be done when attaching each device to the IOMMU domain. Signed-off-by: Eric Auger --- v14 -> v15: Took into account Zenghui's comments - re

[PATCH v15 07/12] iommu/smmuv3: Implement cache_invalidate

2021-04-11 Thread Eric Auger
Implement domain-selective, pasid selective and page-selective IOTLB invalidations. Signed-off-by: Eric Auger --- v4 -> v15: - remove the redundant arm_smmu_cmdq_issue_sync(smmu) in IOMMU_INV_GRANU_ADDR case (Zenghui) - if RIL is not supported by the host, make sure the granule_s

[PATCH v15 06/12] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-11 Thread Eric Auger
With nested stage support, soon we will need to invalidate S1 contexts and ranges tagged with an unmanaged asid, this latter being managed by the guest. So let's introduce 2 helpers that allow to invalidate with externally managed ASIDs Signed-off-by: Eric Auger --- v14 -> v15: - Always s

[PATCH v15 05/12] iommu/smmuv3: Implement attach/detach_pasid_table

2021-04-11 Thread Eric Auger
. Signed-off-by: Eric Auger --- v14 -> v15: - add a comment before arm_smmu_get_cd_ptr to warn the developper this function must not be used in case of nested (Keqian) v13 -> v14: - on PASID table detach, reset the abort flag (Keqian) v7 -> v8: - remove smmu->features check, now do

[PATCH v15 04/12] iommu/smmuv3: Get prepared for nested stage support

2021-04-11 Thread Eric Auger
to write both stage fields in the STE and deal with the abort field. In nested mode, only stage 2 is "finalized" as the host does not own/configure the stage 1 context descriptor; guest does. Signed-off-by: Eric Auger --- v13 -> v14: - removed BUG_ON(ste_live && !nested)

[PATCH v15 03/12] iommu/smmuv3: Allow s1 and s2 configs to coexist

2021-04-11 Thread Eric Auger
oth stages are used and the S1 config is "set" when the guest passes its pasid table. No functional change intended. Signed-off-by: Eric Auger --- v13 -> v14: - slight reword of the commit message v12 -> v13: - does not dynamically allocate s1-cfg and s2_cfg anymore. Add the se

[PATCH v15 02/12] iommu: Introduce bind/unbind_guest_msi

2021-04-11 Thread Eric Auger
nd similarly a single virtual doorbell mapping gets registered (1 single virtual doorbell is used on guest as well). Signed-off-by: Eric Auger --- v13 -> v14: - s/iova/giova in iommu_unbind_guest_msi proto (Kequian) v7 -> v8: - dummy iommu_unbind_guest_msi turned into a void function

[PATCH v15 01/12] iommu: Introduce attach/detach_pasid_table API

2021-04-11 Thread Eric Auger
. A generic iommu_pasid_table_config struct is introduced in a new iommu.h uapi header. This is going to be used by the VFIO user API. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Liu, Yi L Signed-off-by: Ashok Raj Signed-off-by: Jacob Pan Signed-off-by: Eric Auger --- v13 ->

[PATCH v15 00/12] SMMUv3 Nested Stage Setup (IOMMU part)

2021-04-11 Thread Eric Auger
the VFIO user API which cascades them to the iommu subsystem. This allows the guest to own stage 1 tables and context descriptors (so-called PASID table) while the host owns stage 2 tables and main configuration structures (STE). Best Regards Eric This series can be found at: v5.12-rc6-jean-iopf-14

Re: [PATCH v14 08/13] dma-iommu: Implement NESTED_MSI cookie

2021-04-10 Thread Auger Eric
Hi Zenghui, On 4/7/21 9:39 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> Up to now, when the type was UNMANAGED, we used to >> allocate IOVA pages within a reserved IOVA MSI range. >> >> If both the host and the guest are exposed w

Re: [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function

2021-04-10 Thread Eric Dumazet
On Sat, Apr 10, 2021 at 12:12 PM Eric Dumazet wrote: > > On Sat, Apr 10, 2021 at 11:51 AM Phillip Potter wrote: > > > > Zero-fill skb->data in __alloc_skb function of net/core/skbuff.c, > > up to start of struct skb_shared_info bytes. Fixes a KMSAN-found > > un

Re: [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function

2021-04-10 Thread Eric Dumazet
On Sat, Apr 10, 2021 at 11:51 AM Phillip Potter wrote: > > Zero-fill skb->data in __alloc_skb function of net/core/skbuff.c, > up to start of struct skb_shared_info bytes. Fixes a KMSAN-found > uninit-value bug reported by syzbot at: >

Re: Problem in pfmemalloc skb handling in net/core/dev.c

2021-04-09 Thread Eric Dumazet
On 4/9/21 12:14 PM, Xie He wrote: > On Fri, Apr 9, 2021 at 3:04 AM Eric Dumazet wrote: >> >> Note that pfmemalloc skbs are normally dropped in sk_filter_trim_cap() >> >> Simply make sure your protocol use it. > > It seems "sk_filter_trim_cap" ne

Re: [PATCH] net/rds: Avoid potential use after free in rds_send_remove_from_sock

2021-04-09 Thread Eric Dumazet
On 4/7/21 2:09 AM, Aditya Pakki wrote: > In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource > is freed and later under spinlock, causing potential use-after-free. > Set the free pointer to NULL to avoid undefined behavior. > > Signed-off-by: Aditya Pakki > --- >

Re: Problem in pfmemalloc skb handling in net/core/dev.c

2021-04-09 Thread Eric Dumazet
On 4/9/21 11:14 AM, Xie He wrote: > On Fri, Apr 9, 2021 at 1:44 AM Mel Gorman wrote: >> >> That would imply that the tap was communicating with a swap device to >> allocate a pfmemalloc skb which shouldn't happen. Furthermore, it would >> require the swap device to be deactivated while

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-09 Thread Auger Eric
Hi Kunkun, On 4/9/21 6:48 AM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/8 20:30, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/1/21 2:37 PM, Kunkun Jiang wrote: >>> Hi Eric, >>> >>> On 2021/2/24 4:56, Eric Auger wrote: >>>>

Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-08 Thread Eric Biggers
On Thu, Apr 08, 2021 at 11:53:59AM -0400, Chris von Recklinghausen wrote: > On 4/8/21 11:30 AM, Eric Biggers wrote: > > On Thu, Apr 08, 2021 at 09:15:06AM -0400, Chris von Recklinghausen wrote: > > > Suspend fails on a system in fips mode because md5 is used for the e820 >

Re: 08ed4efad6: stress-ng.sigsegv.ops_per_sec -41.9% regression

2021-04-08 Thread Eric W. Biederman
signal we could skip the sigpending increment, skip the signal queue entirely, and deliver the signal to user-space immediately. The removal of all cache ping pongs might make it worth it. There is also Thomas Gleixner's recent optimization to cache one sigqueue entry per task to give more predictable behavior. That would remove the cost of the allocation. Eric

Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-08 Thread Eric Biggers
g magic; > - u8 e820_digest[MD5_DIGEST_SIZE]; > + u8 e820_digest[CRC32_DIGEST_SIZE]; > }; > > -#if IS_BUILTIN(CONFIG_CRYPTO_MD5) > +#if IS_BUILTIN(CONFIG_CRYPTO_CRC32) Should CONFIG_CRYPTO_CRC32 be getting selected from somewhere? If that is too hard because it would pull in too much of the crypto API, maybe using the library interface to CRC-32 (lib/crc32.c) would be a better fit? - Eric

Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-08 Thread Eric Biggers
f the hash value isn't stored separately). If you only need to detect non-malicious changes (normally these would be called "accidental" changes, but sure, it could be changes that are "intentionally" made provided that the other side can be trusted to not try to avoid detection...), then a non-cryptographic checksum would be sufficient. - Eric

Re: [PATCH] net: sched: sch_teql: fix null-pointer dereference

2021-04-08 Thread Eric Dumazet
imediately calls teql_destroy() which does not expect > zero master pointer and we get OOPS. > > Signed-off-by: Pavel Tikhomirov > --- This makes sense, thanks ! Reviewed-by: Eric Dumazet I would think bug origin is Fixes: 87b60cfacf9f ("net_sched: fix error recovery at qdisc creation") Can you confirm you have this backported to 3.10.0-1062.7.1.el7.x86_64 ?

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-08 Thread Auger Eric
Hi Kunkun, On 4/1/21 2:37 PM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> With nested stage support, soon we will need to invalidate >> S1 contexts and ranges tagged with an unmanaged asid, this >> latter being managed by the guest. S

Re: [PATCH v7 4/4] fs: unicode: Add utf8 module and a unicode layer

2021-04-07 Thread Eric Biggers
re.c b/fs/unicode/unicode-core.c > index 730dbaedf593..d9e9e410893d 100644 > --- a/fs/unicode/unicode-core.c > +++ b/fs/unicode/unicode-core.c > @@ -1,228 +1,132 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > #include > #include > -#include > #include > -#include > #include > #include > -#include > +#include > > -#include "utf8n.h" > +DEFINE_SPINLOCK(utf8mod_lock); This spinlock should be 'static'. - Eric

Re: [PATCH v7 1/4] fs: unicode: Use strscpy() instead of strncpy()

2021-04-07 Thread Eric Biggers
d53690f0d4e5 (unicode: implement higher level API for string handling) There should be quotes around the commit title here. - Eric

Re: [PATCH v3 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-07 Thread Eric Biggers
gt;by md5 digest") > > Tested-by: Dexuan Cui > Reviewed-by: Dexuan Cui > Signed-off-by: Chris von Recklinghausen Please include an explanation about whether this use case requires cryptographic security or not. - Eric

Re: [PATCH v9 4/8] Reimplement RLIMIT_NPROC on top of ucounts

2021-04-07 Thread Eric W. Biederman
Alexey Gladkov writes: > On Mon, Apr 05, 2021 at 11:56:35AM -0500, Eric W. Biederman wrote: >> >> Also when setting ns->ucount_max[] in create_user_ns because one value >> is signed and the other is unsigned. Care should be taken so that >> rlimit_infinity

Re: [PATCH net v4] atl1c: move tx cleanup processing out of interrupt

2021-04-07 Thread Eric Dumazet
On 4/6/21 4:49 PM, Gatis Peisenieks wrote: > Tx queue cleanup happens in interrupt handler on same core as rx queue > processing. Both can take considerable amount of processing in high > packet-per-second scenarios. > > Sending big amounts of packets can stall the rx processing which is

[PATCH] KVM: selftests: vgic_init kvm selftests fixup

2021-04-07 Thread Eric Auger
is checked by the caller - vm_gic struct is used whenever possible, as well as vm_gic_destroy - _kvm_create_device takes an addition fd parameter Signed-off-by: Eric Auger Suggested-by: Andrew Jones --- Applies on top of [PATCH v6 0/9] KVM/ARM: Some vgic fixes and init sequence KVM selftests,

Re: [PATCH v6 9/9] KVM: selftests: aarch64/vgic-v3 init sequence tests

2021-04-07 Thread Auger Eric
Hi Drew, On 4/6/21 5:09 PM, Andrew Jones wrote: > > Hi Eric, > > It looks like Marc already picked this patch up, but, FWIW, here's > a few more comments you may consider. I will send a fixup patch on top of the one taken my Marc. Few comments below. > > On Mon, Apr 0

Re: [PATCH 5.10 004/126] ext4: shrink race window in ext4_should_retry_alloc()

2021-04-06 Thread Eric Whitney
* Pavel Machek : > Hi! > > > From: Eric Whitney > > > A per filesystem percpu counter exported via sysfs is added to allow > > users or developers to track the number of times the retry limit is > > exceeded without resorting to debugging methods. Thi

Re: [PATCH v3] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Eric Dumazet
d uninit-value bug reported by syzbot at: > https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51 > > Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com > Diagnosed-by: Eric Dumazet > Signed-off-by: Phillip Potter > --- SGTM, thanks a lot. Reviewed-by: Eric Dumazet

Re: [PATCH] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-06 Thread Eric Dumazet
d uninit-value bug reported by syzbot at: > https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51 > > Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com > Signed-off-by: Phillip Potter > --- Please give credits to people who helped. You could h

Re: [tcp] 4ecc1baf36: ltp.proc01.fail

2021-04-06 Thread Eric Dumazet
On Tue, Apr 6, 2021 at 8:41 AM kernel test robot wrote: > > > > Greeting, > > FYI, we noticed the following commit (built with gcc-9): > > commit: 4ecc1baf362c5df2dcabe242511e38ee28486545 ("tcp: convert elligible > sysctls to u8") >

Re: [PATCH] crypto: fix CRYPTO_LIB_* dependencies on CRYPTO

2021-04-05 Thread Eric Biggers
O > +source "lib/crypto/Kconfig" > -- Actually some of the files in lib/crypto/ do depend on CRYPTO. For example, there are calls to crypto_xor_cpy() and crypto_memneq(), which call functions defined in crypto/algapi.c and crypto/memneq.c. These helper functions would need to be moved into lib/crypto/ for this to work. - Eric

Re: [PATCH v9 0/8] Count rlimits in each user namespace

2021-04-05 Thread Eric W. Biederman
er > but in this case we face a different problem of uid mapping when transferring > files from one container to another. > > Eric W. Biederman mentioned this issue [2][3]. > > Introduced changes > -- > To address the problem, we bind rlimit counters to user nam

Re: [PATCH v9 3/8] Use atomic_t for ucounts reference counting

2021-04-05 Thread Eric W. Biederman
want to change the hashtable. > > v9: > * Use a negative value to check that the ucounts->count is close to > overflow. Overall this looks good, one small issue below. Eric > diff --git a/kernel/ucount.c b/kernel/ucount.c > index 50cc1dfb7d28..7bac19bb3f1e 100644 > --- a/

Re: [PATCH v9 6/8] Reimplement RLIMIT_SIGPENDING on top of ucounts

2021-04-05 Thread Eric W. Biederman
A small bug below. Eric > diff --git a/kernel/signal.c b/kernel/signal.c > index f2a1b898da29..1b537d9de447 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -413,49 +413,44 @@ void task_join_group_stop(struct task_struct *task) > static struct sigqueue * >

Re: [PATCH v9 4/8] Reimplement RLIMIT_NPROC on top of ucounts

2021-04-05 Thread Eric W. Biederman
does. The functions inc_rlimit_ucounts and inc_rlimit_ucounts_test need to return overflow in the unlikely event the count values becomes negative. Also when setting ns->ucount_max[] in create_user_ns because one value is signed and the other is unsigned. Care should be taken so that rlimit_inf

[PATCH v6 8/9] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-05 Thread Eric Auger
istributor contributor pages. With this new implementation we do not need to have a uaccess read accessor anymore. Signed-off-by: Eric Auger --- v4 -> v5: - change the implementation according to Marc's understanding of the spec --- arch/arm64/kvm/vgic/vgic-m

[PATCH v6 9/9] KVM: selftests: aarch64/vgic-v3 init sequence tests

2021-04-05 Thread Eric Auger
. The goal was to test the case recently fixed by commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace"). The API under test can be found at Documentation/virt/kvm/devices/arm-vgic-v3.rst Signed-off-by: Eric Auger --- v4 -> v5: - simplify the l

[PATCH v6 7/9] kvm: arm64: vgic-v3: Introduce vgic_v3_free_redist_region()

2021-04-05 Thread Eric Auger
To improve the readability, we introduce the new vgic_v3_free_redist_region helper and also rename vgic_v3_insert_redist_region into vgic_v3_alloc_redist_region Signed-off-by: Eric Auger --- arch/arm64/kvm/vgic/vgic-init.c| 6 ++ arch/arm64/kvm/vgic/vgic-mmio-v3.c | 17

[PATCH v6 5/9] docs: kvm: devices/arm-vgic-v3: enhance KVM_DEV_ARM_VGIC_CTRL_INIT doc

2021-04-05 Thread Eric Auger
kvm_arch_vcpu_precreate() returns -EBUSY if the vgic is already initialized. So let's document that KVM_DEV_ARM_VGIC_CTRL_INIT must be called after all vcpu creations. Signed-off-by: Eric Auger --- v1 -> v2: - Must be called after all vcpu creations -> Must be called after all VCPU

[PATCH v6 6/9] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write]

2021-04-05 Thread Eric Auger
,write}. Signed-off-by: Eric Auger --- v1 -> v2: - reworded the commit message as suggested by Alexandru --- arch/arm64/kvm/vgic/vgic-mmio.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-mmio.c b/arch/arm64/kvm/vgic/vgic-mmio.c in

[PATCH v6 3/9] KVM: arm64: vgic-v3: Fix error handling in vgic_v3_set_redist_base()

2021-04-05 Thread Eric Auger
in vgic_register_redist_iodev(). In such a case, remove the newly added redistributor region and free it. Signed-off-by: Eric Auger --- v1 -> v2: - fix the commit message and split declaration/assignment of rdreg --- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 8 +++- 1 file changed, 7 insertions(+), 1 delet

[PATCH v6 4/9] KVM: arm/arm64: vgic: Reset base address on kvm_vgic_dist_destroy()

2021-04-05 Thread Eric Auger
On vgic_dist_destroy(), the addresses are not reset. However for kvm selftest purpose this would allow to continue the test execution even after a failure when running KVM_RUN. So let's reset the base addresses. Signed-off-by: Eric Auger --- v1 -> v2: - use dist-> in the else and add

[PATCH v6 2/9] KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read

2021-04-05 Thread Eric Auger
rm64: Implement KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION") Cc: sta...@vger.kernel.org#v4.17+ Signed-off-by: Eric Auger Reviewed-by: Alexandru Elisei --- v1 -> v2: - in the commit message, remove the statement that the index always is 0 - add Alexandru's R-b --- arch/arm64/kvm/vgic/vgic-kvm-device.c

[PATCH v6 1/9] KVM: arm64: vgic-v3: Fix some error codes when setting RDIST base

2021-04-05 Thread Eric Auger
by looking at the count field. Signed-off-by: Eric Auger --- v3 -> v4: - rewrite the test checking that we do not mix rdist region types v1 -> v2: - simplify the check sequence --- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-)

[PATCH v6 0/9] KVM/ARM: Some vgic fixes and init sequence KVM selftests

2021-04-05 Thread Eric Auger
they can be augmented with a lot more register access tests, but let's try to move forward incrementally ... Best Regards Eric This series can be found at: https://github.com/eauger/linux/tree/vgic_kvmselftests_v6 History: v5 -> v6: - Fix the note in "KVM: arm64: vgic-v3

Re: [PATCH v5 0/8] KVM/ARM: Some vgic fixes and init sequence KVM selftests

2021-04-05 Thread Auger Eric
Hi Marc, On 4/5/21 12:12 PM, Marc Zyngier wrote: > Hi Eric, > > On Sun, 04 Apr 2021 18:22:35 +0100, > Eric Auger wrote: >> >> While writting vgic v3 init sequence KVM selftests I noticed some >> relatively minor issues. This was also the opportunity to try to >

Re: [PATCH v5 7/8] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-05 Thread Auger Eric
Hi Marc, On 4/5/21 12:10 PM, Marc Zyngier wrote: > On Sun, 04 Apr 2021 18:22:42 +0100, > Eric Auger wrote: >> >> Commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the >> reporting of GICR_TYPER.Last for userspace") temporarily fixed >> a bug identified

[PATCH v5 4/8] docs: kvm: devices/arm-vgic-v3: enhance KVM_DEV_ARM_VGIC_CTRL_INIT doc

2021-04-04 Thread Eric Auger
kvm_arch_vcpu_precreate() returns -EBUSY if the vgic is already initialized. So let's document that KVM_DEV_ARM_VGIC_CTRL_INIT must be called after all vcpu creations. Signed-off-by: Eric Auger --- v1 -> v2: - Must be called after all vcpu creations -> Must be called after all VCPU

[PATCH v5 7/8] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-04 Thread Eric Auger
istributor contributor pages. With this new implementation we do not need to have a uaccess read accessor anymore. Signed-off-by: Eric Auger --- v4 -> v5: - redist region list now is sorted by @base - change the implementation according to Marc's understanding of the spec --- arch/arm64/

[PATCH v5 8/8] KVM: selftests: aarch64/vgic-v3 init sequence tests

2021-04-04 Thread Eric Auger
. The goal was to test the case recently fixed by commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace"). The API under test can be found at Documentation/virt/kvm/devices/arm-vgic-v3.rst Signed-off-by: Eric Auger --- v4 -> v5: - simplify the l

[PATCH v5 6/8] kvm: arm64: vgic-v3: Introduce vgic_v3_free_redist_region()

2021-04-04 Thread Eric Auger
To improve the readability, we introduce the new vgic_v3_free_redist_region helper and also rename vgic_v3_insert_redist_region into vgic_v3_alloc_redist_region Signed-off-by: Eric Auger --- arch/arm64/kvm/vgic/vgic-init.c| 6 ++ arch/arm64/kvm/vgic/vgic-mmio-v3.c | 17

[PATCH v5 5/8] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write]

2021-04-04 Thread Eric Auger
,write}. Signed-off-by: Eric Auger --- v1 -> v2: - reworded the commit message as suggested by Alexandru --- arch/arm64/kvm/vgic/vgic-mmio.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-mmio.c b/arch/arm64/kvm/vgic/vgic-mmio.c in

[PATCH v5 3/8] KVM: arm/arm64: vgic: Reset base address on kvm_vgic_dist_destroy()

2021-04-04 Thread Eric Auger
On vgic_dist_destroy(), the addresses are not reset. However for kvm selftest purpose this would allow to continue the test execution even after a failure when running KVM_RUN. So let's reset the base addresses. Signed-off-by: Eric Auger --- v1 -> v2: - use dist-> in the else and add

[PATCH v5 1/8] KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read

2021-04-04 Thread Eric Auger
rm64: Implement KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION") Cc: sta...@vger.kernel.org#v4.17+ Signed-off-by: Eric Auger Reviewed-by: Alexandru Elisei --- v1 -> v2: - in the commit message, remove the statement that the index always is 0 - add Alexandru's R-b --- arch/arm64/kvm/vgic/vgic-kvm-device.c

<    1   2   3   4   5   6   7   8   9   10   >