[PATCH v2 15/24] proc/fd: In proc_readfd_common use task_lookup_next_fd_rcu

2020-11-20 Thread Eric W. Biederman
a31...@redhat.com Suggested-by: Oleg Nesterov Tested-by: Andy Lavr v1: https://lkml.kernel.org/r/20200817220425.9389-10-ebied...@xmission.com Signed-off-by: Eric W. Biederman --- fs/proc/fd.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/proc/fd.c b/fs/proc/f

[PATCH v2 11/24] file: Implement task_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
As a companion to lookup_fd_rcu implement task_lookup_fd_rcu for querying an arbitrary process about a specific file. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200818103713.aw46m7vprsy4vlve@wittgenstein Signed-off-by: "Eric W. Biederman" --- fs/file.c

[PATCH v2 18/24] file: Merge __fd_install into fd_install

2020-11-20 Thread Eric W. Biederman
t->files. [1] f869e8a7f753 ("expose a low-level variant of fd_install() for binder") [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") Acked-by: Christian Brauner v1:https://lkml.kernel.org/r/20200817220425.9389-14-ebied...@xmission.com Signed-off-by: "Eric W. Bied

[PATCH v2 24/24] file: Remove get_files_struct

2020-11-20 Thread Eric W. Biederman
and fget_light remove get_files_struct so that it does not gain any new users. [1] https://lkml.kernel.org/r/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-13-ebied...@xmission.com Signed-off-by: "E

[PATCH v2 21/24] file: Rename __close_fd to close_fd and remove the files parameter

2020-11-20 Thread Eric W. Biederman
t;files. [1] 483ce1d4b8c3 ("take descriptor-related part of close() to file.c") [2] 44d8047f1d87 ("binder: use standard functions to allocate fds") Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-17-ebied...@xmission.com Signed-off-by: &qu

[PATCH v2 19/24] file: In f_dupfd read RLIMIT_NOFILE once.

2020-11-20 Thread Eric W. Biederman
. Further this causes alloc_fd to take all of the same arguments as __alloc_fd except for the files_struct argument. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-15-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 9 + 1 file

[PATCH v2 09/24] file: Replace fcheck_files with files_lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
und of discussion of this set of changes[1]. [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- Documentation/filesystems/files.rst | 6 +++--- fs/file.c | 4 ++--

[PATCH v2 10/24] file: Rename fcheck lookup_fd_rcu

2020-11-20 Thread Eric W. Biederman
] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- Documentation/filesystems/files.rst | 6 +++--- arch/powerpc/platforms/cell/spufs/coredump.c | 2 +- fs/notify/dnotify/dnotify.c

[PATCH v2 06/24] proc/fd: In proc_fd_link use fget_task

2020-11-20 Thread Eric W. Biederman
. [1] https://lkml.kernel.org/r/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov v1: https://lkml.kernel.org/r/20200817220425.9389-8-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/proc/fd.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletion

[PATCH v2 08/24] file: Factor files_lookup_fd_locked out of fcheck_files

2020-11-20 Thread Eric W. Biederman
il.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 2 +- fs/locks.c | 14 -- fs/proc/fd.c| 2 +- include/linux/fdtable.h | 7 +++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/fs/file.c b/fs/file.c in

[PATCH v2 07/24] file: Rename __fcheck_files to files_lookup_fd_raw

2020-11-20 Thread Eric W. Biederman
of this set of changes[1]. [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbrp...@mail.gmail.com Signed-off-by: "Eric W. Biederman" --- fs/file.c | 2 +- include/linux/fdtable.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 04/24] kcmp: In kcmp_epoll_target use fget_task

2020-11-20 Thread Eric W. Biederman
in fget_light having to fallback to fget reducing performance. Suggested-by: Oleg Nesterov Reviewed-by: Cyrill Gorcunov v1: https://lkml.kernel.org/r/20200817220425.9389-4-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- kernel/kcmp.c | 20 1 file

[PATCH v2 05/24] bpf: In bpf_task_fd_query use fget_task

2020-11-20 Thread Eric W. Biederman
/20180915160423.ga31...@redhat.com Suggested-by: Oleg Nesterov v1: https://lkml.kernel.org/r/20200817220425.9389-5-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- kernel/bpf/syscall.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/kernel/bpf

[PATCH v2 02/24] exec: Simplify unshare_files

2020-11-20 Thread Eric W. Biederman
/r/20200817220425.9389-2-ebied...@xmission.com Signed-off-by: "Eric W. Biederman" --- fs/coredump.c | 5 + fs/exec.c | 5 + include/linux/fdtable.h | 2 +- kernel/fork.c | 12 ++-- 4 files changed, 9 insertions(+), 15 deletions(-)

[PATCH v2 03/24] exec: Remove reset_files_struct

2020-11-20 Thread Eric W. Biederman
Now that exec no longer needs to restore the previous value of current->files on error there are no more callers of reset_files_struct so remove it. Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/20200817220425.9389-3-ebied...@xmission.com Signed-off-by: "Eric W. Biederman&q

[PATCH v2 01/24] exec: Move unshare_files to fix posix file locking during exec

2020-11-20 Thread Eric W. Biederman
23.21964-1-jlay...@kernel.org [16] https://lkml.kernel.org/r/20180914105310.6454-1-jlay...@kernel.org [17] https://lkml.kernel.org/r/87a7ohs5ow@xmission.com [18] https://lkml.kernel.org/r/87pn8c1uj6.fsf...@x220.int.ebiederm.org Acked-by: Christian Brauner v1: https://lkml.kernel.org/r/202008

Re: [PATCH] random: initialize ChaCha20 constants with correct endianness

2020-11-20 Thread Eric Biggers
On Mon, Oct 26, 2020 at 09:33:54AM -0700, Eric Biggers wrote: > On Tue, Oct 06, 2020 at 08:51:45PM -0700, Eric Biggers wrote: > > On Fri, Sep 18, 2020 at 02:57:05PM -0700, Eric Biggers wrote: > > > On Fri, Sep 18, 2020 at 04:42:07PM -0400, Theodore Y. Ts'o wrote: > > >

Re: [PATCH] random: remove dead code left over from blocking pool

2020-11-20 Thread Eric Biggers
On Mon, Oct 26, 2020 at 09:34:03AM -0700, Eric Biggers wrote: > On Tue, Oct 06, 2020 at 08:50:58PM -0700, Eric Biggers wrote: > > On Tue, Sep 15, 2020 at 09:36:52PM -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > Remove some dead code

Re: [PATCH] random: fix the RNDRESEEDCRNG ioctl

2020-11-20 Thread Eric Biggers
On Mon, Oct 26, 2020 at 09:33:43AM -0700, Eric Biggers wrote: > On Tue, Oct 06, 2020 at 08:50:21PM -0700, Eric Biggers wrote: > > On Tue, Sep 15, 2020 at 09:19:08PM -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > The RNDRESEEDCRNG ioctl reseeds

Re: [PATCH] random: avoid arch_get_random_seed_long() when collecting IRQ randomness

2020-11-19 Thread Eric Biggers
On Wed, Nov 11, 2020 at 09:19:37AM +0100, Ard Biesheuvel wrote: > (+ Eric) > > On Thu, 5 Nov 2020 at 16:29, Ard Biesheuvel wrote: > > > > When reseeding the CRNG periodically, arch_get_random_seed_long() is > > called to obtain entropy from an architec

Re: [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845

2020-11-19 Thread Eric Biggers
the performance of this hardware to ARMv8 CE? I thought that QCE (at least on other SoCs) isn't very useful because ARMv8 CE is faster. - Eric

Re: [PATCH v7] tcp: fix race condition when creating child sockets from syncookies

2020-11-19 Thread Eric Dumazet
gt; from thge syncookie. Instead of returning the existing socket in > tcp_(v4|v6)_syn_recv_sock and continue the protocol state machine > execution, tcp_(v4|v6)_syn_recv_sock signals that already exists a > socket, and tells tcp_(v4|v6)_rcv to lookup the socket again in the

Re: [PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2020-11-19 Thread Auger Eric
Hi Jacob, On 11/18/20 5:19 PM, Jacob Pan wrote: > Hi Eric, > > On Wed, 18 Nov 2020 12:21:37 +0100, Eric Auger > wrote: > >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the

Re: [PATCH v3 3/3] f2fs: Handle casefolding with Encryption

2020-11-18 Thread Eric Biggers
to force a checkpoint when a new > file is fsync'ed, store the dirhash on-disk appended to i_name. > > This patch incorporates work by Eric Biggers > and Jaegeuk Kim . > > Co-developed-by: Eric Biggers > Signed-off-by: Eric Biggers > Signed-off-by: Daniel Rosenberg

Re: [PATCH v3 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-18 Thread Eric Biggers
d be removed too. Otherwise this patch looks good; feel free to add: Acked-by: Eric Biggers - Eric

Re: [PATCH v3 1/3] libfs: Add generic function for setting dentry_ops

2020-11-18 Thread Eric Biggers
ings consistent. Otherwise, please feel free to add: Reviewed-by: Eric Biggers - Eric

Re: [RFC PATCH bpf-next 0/8] Socket migration for SO_REUSEPORT.

2020-11-18 Thread Eric Dumazet
On 11/17/20 10:40 AM, Kuniyuki Iwashima wrote: > The SO_REUSEPORT option allows sockets to listen on the same port and to > accept connections evenly. However, there is a defect in the current > implementation. When a SYN packet is received, the connection is tied to a > listening socket.

[PATCH v13 14/15] iommu/smmuv3: Accept configs with more than one context descriptor

2020-11-18 Thread Eric Auger
In preparation for vSVA, let's accept userspace provided configs with more than one CD. We check the max CD against the host iommu capability and also the format (linear versus 2 level). Signed-off-by: Eric Auger Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

[PATCH v13 13/15] iommu/smmuv3: Report non recoverable faults

2020-11-18 Thread Eric Auger
When a stage 1 related fault event is read from the event queue, let's propagate it to potential external fault listeners, ie. users who registered a fault handler. Signed-off-by: Eric Auger --- v8 -> v9: - adapt to the removal of IOMMU_FAULT_UNRECOV_PERM_VALID: only l

[PATCH v13 15/15] iommu/smmuv3: Add PASID cache invalidation per PASID

2020-11-18 Thread Eric Auger
In order to cascade guest CFGI_CD, let's add PASID cache invalidation per PASID. Signed-off-by: Eric Auger --- v12 -> v13: - Fix !(info->flags & IOMMU_INV_PASID_FLAGS_PASID) check --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 +--- 1 file changed, 13 insert

[PATCH v13 12/15] iommu/smmuv3: Implement bind/unbind_guest_msi

2020-11-18 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 v13 10/15] iommu/smmuv3: Nested mode single MSI doorbell per domain enforcement

2020-11-18 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 v13 11/15] iommu/smmuv3: Enforce incompatibility between nested mode and HW MSI regions

2020-11-18 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 v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2020-11-18 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 --- drivers/iommu/arm/arm-smmu

[PATCH v13 06/15] iommu/smmuv3: Implement attach/detach_pasid_table

2020-11-18 Thread Eric Auger
On attach_pasid_table() we program STE S1 related info set by the guest into the actual physical STEs. At minimum we need to program the context descriptor GPA and compute whether the stage1 is translated/bypassed or aborted. Signed-off-by: Eric Auger --- v7 -> v8: - remove smmu->features

[PATCH v13 08/15] iommu/smmuv3: Implement cache_invalidate

2020-11-18 Thread Eric Auger
Implement domain-selective and page-selective IOTLB invalidations. Signed-off-by: Eric Auger --- v7 -> v8: - ASID based invalidation using iommu_inv_pasid_info - check ARCHID/PASID flags in addr based invalidation - use __arm_smmu_tlb_inv_context and __arm_smmu_tlb_inv_range_nosync v6 -&

[PATCH v13 09/15] dma-iommu: Implement NESTED_MSI cookie

2020-11-18 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 --- v10 -> v11: - fix compilation if !CONFIG_IOMMU_DMA v7 -

[PATCH v13 03/15] iommu/arm-smmu-v3: Maintain a SID->device structure

2020-11-18 Thread Eric Auger
From: Jean-Philippe Brucker When handling faults from the event or PRI queue, we need to find the struct device associated to a SID. Add a rb_tree to keep track of SIDs. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 161

[PATCH v13 05/15] iommu/smmuv3: Get prepared for nested stage support

2020-11-18 Thread Eric Auger
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 --- v10 -> v11: - Fix an issue reported by Shameer when switching from with vSMMU to without vSMMU. Despite the spec does not seem to menti

[PATCH v13 04/15] iommu/smmuv3: Allow s1 and s2 configs to coexist

2020-11-18 Thread Eric Auger
quot;set" field will be set when the guest passes the pasid table. Signed-off-by: Eric Auger --- v12 -> v13: - does not dynamically allocate s1-cfg and s2_cfg anymore. Add the set field --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 + drivers/iommu/arm/arm-smm

[PATCH v13 02/15] iommu: Introduce bind/unbind_guest_msi

2020-11-18 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 --- v7 -> v8: - dummy iommu_unbind_guest_msi turned into a void function v6 -> v7: - remove the device handle parameter. - Add comments say

[PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2020-11-18 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 --- v12 ->

[PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2020-11-18 Thread Eric Auger
Regards Eric This series can be found at: https://github.com/eauger/linux/tree/5.10-rc4-2stage-v13 (including the VFIO part in his last version: v11) The series includes a patch from Jean-Philippe. It is better to review the original patch: [PATCH v8 2/9] iommu/arm-smmu-v3: Maintain a SID->dev

Re: [RFC, v1 0/3] msi support for platform devices

2020-11-18 Thread Auger Eric
Hi Vikas, On 11/17/20 5:36 PM, Vikas Gupta wrote: > Hi Eric, > > On Tue, Nov 17, 2020 at 1:55 PM Auger Eric wrote: >> >> Hi Vikas, >> >> On 11/17/20 9:05 AM, Auger Eric wrote: >>> Hi Vikas, >>> >>> On 11/17/20 7:25 AM, Vikas Gupta wr

Re: [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-17 Thread Eric Biggers
if (res < 0) > > > + return ERR_PTR(res); > > > + else if (res) > > > + goto found; > > > + } > > > > Overly long line here. Also 'else if' is unnecess

Re: [PATCH v7 0/8] add support for direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Eric Biggers
dy added to the ext4/encrypt and ext4/encrypt_1k exclusion lists by xfstests-bld commit 02e4bfe628b4. - Eric

Re: [PATCH v7 8/8] fscrypt: update documentation for direct I/O support

2020-11-17 Thread Eric Biggers
when using direct I/O on unencrypted files). Actually the position in the file the I/O is targeting must be fs-block aligned too, not just the length of the I/O. It's only the pointer to the user data buffer that no longer needs to be fs-block aligned (this changed between v6 and v7). - Eric

Re: [PATCH v7 2/8] blk-crypto: don't require user buffer alignment

2020-11-17 Thread Eric Biggers
un, 1); > + sg_idx = 0; > + du_filled = 0; This is leaking a bounce page if crypto_skcipher_encrypt() fails. This can be fixed either by keeping the 'i++' that was on the error path before, or by moving the i++ in the for statement to just below to where the bounce page was successfully allocated. - Eric

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-17 Thread Eric Biggers
before? > diff --git a/block/bounce.c b/block/bounce.c > index 162a6eee8999..b15224799008 100644 > --- a/block/bounce.c > +++ b/block/bounce.c > @@ -295,6 +295,7 @@ static void __blk_queue_bounce(struct request_queue *q, > struct bio **bio_orig, > bool bounce = false; > int sectors = 0; > bool passthrough = bio_is_passthrough(*bio_orig); > + unsigned int bio_sectors_alignment; > > bio_for_each_segment(from, *bio_orig, iter) { > if (i++ < BIO_MAX_PAGES) > @@ -305,6 +306,9 @@ static void __blk_queue_bounce(struct request_queue *q, > struct bio **bio_orig, > if (!bounce) > return; > > + bio_sectors_alignment = blk_crypto_bio_sectors_alignment(bio); > + sectors = round_down(sectors, bio_sectors_alignment); > + This can be one line: sectors = round_down(sectors, blk_crypto_bio_sectors_alignment(bio)); - Eric

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-17 Thread Eric W. Biederman
lities general debug facilities so that they can be used for cases other than crash dump. The crash dump kernel would always enable them because it can assume that the hardware is very likely in a wonky state. Eric

Re: [PATCH v2 0/3] Add support for Encryption and Casefolding in F2FS

2020-11-17 Thread Eric Biggers
b6cded: "ext4: use generic casefolding support"). - Eric

Re: [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-17 Thread Eric Biggers
to force a checkpoint when a new > file is fsync'ed, store the dirhash on-disk appended to i_name. > > This patch incorporates work by Eric Biggers > and Jaegeuk Kim . > > Co-developed-by: Eric Biggers > Signed-off-by: Eric Biggers > Signed-off-by:

Re: [f2fs-dev] [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 10:16:49AM -0800, Eric Biggers wrote: > > Here's a suggestion which I think explains it a lot better. It's still > possible > I'm misunderstanding something, though, so please check it carefully: > > /** > * generic_set_encrypted_ci_d_ops - hel

Re: [PATCH v2 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 04:03:14AM +, Daniel Rosenberg wrote: > diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h > index a8f7a43f031b..df2c66ca370e 100644 > --- a/include/linux/fscrypt.h > +++ b/include/linux/fscrypt.h > @@ -741,8 +741,9 @@ static inline int

Re: [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops

2020-11-17 Thread Eric Biggers
On Tue, Nov 17, 2020 at 04:03:13AM +, Daniel Rosenberg wrote: > > Currently the casefolding dentry operation are always set if the > filesystem defines an encoding because the features is toggleable on > empty directories. Since we don't know what set of functions we'll > eventually need, and

Re: [PATCH] KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace

2020-11-17 Thread Auger Eric
edistributor TYPER last bit > computation") > Reported-by: Keqian Zhu > Signed-off-by: Zenghui Yu Given the state of last bit, it looks sensible atm. Reviewed-by: Eric Auger Thanks Eric > --- > > This may be the easiest way to fix the issue and to get the fix backporte

Re: [PATCH 0/6] Enable Qualcomm Crypto Engine on sdm845

2020-11-17 Thread Eric Biggers
; algorithms on sdm845.The patch series has been tested using the kernel > crypto testing module tcrypto.ko. Did you do this testing with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled? Do all tests pass with it enabled? - Eric

Re: [PATCH v12 04/15] iommu/smmuv3: Dynamically allocate s1_cfg and s2_cfg

2020-11-17 Thread Auger Eric
Hi Shameer, On 11/17/20 12:39 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message----- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 10:43 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> io.

Re: [PATCH 1/2] KVM: arm64: vgic: Forbid invalid userspace Redistributor accesses

2020-11-17 Thread Auger Eric
D in the region, so we can never compute the address of the RD > even if the base address is set. > > Let's drop the reporting of Last for userspace for now, as it never > worked. If you post a patch addressing that quickly, I'll get it to > Paolo by the end of the week (there's

Re: [PATCH v6] tcp: fix race condition when creating child sockets from syncookies

2020-11-17 Thread Eric Dumazet
On 11/17/20 8:29 AM, Ricardo Dias wrote: > When the TCP stack is in SYN flood mode, the server child socket is > created from the SYN cookie received in a TCP packet with the ACK flag > set. > ... > > @@ -1374,6 +1381,13 @@ static struct sock *tcp_v6_syn_recv_sock(const struct > sock *sk,

Re: [PATCH 1/2] KVM: arm64: vgic: Forbid invalid userspace Redistributor accesses

2020-11-17 Thread Auger Eric
D in the region, so we can never compute the address of the RD > even if the base address is set. > > Let's drop the reporting of Last for userspace for now, as it never > worked. If you post a patch addressing that quickly, I'll get it to > Paolo by the end of the week (there's another fix that needs merging). > > Eric: do we have any test covering the userspace API? No, there are no KVM selftests for that yet. Thanks Eric > > Thanks, > >     M.

Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2020-11-17 Thread Auger Eric
Hi Shameer, On 5/13/20 5:57 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 13 May 2020 14:29 >> To: Shameerali Kolothum Thodi ; >> Zhangfei Gao ; eric.auger

Re: [RFC, v1 0/3] msi support for platform devices

2020-11-17 Thread Auger Eric
Hi Vikas, On 11/17/20 9:05 AM, Auger Eric wrote: > Hi Vikas, > > On 11/17/20 7:25 AM, Vikas Gupta wrote: >> Hi Eric, >> >> On Mon, Nov 16, 2020 at 6:44 PM Auger Eric wrote: >>> >>> Hi Vikas, >>> >>> On 11/13/20 6:24 PM, Vikas Gupta

Re: [RFC, v1 0/3] msi support for platform devices

2020-11-17 Thread Auger Eric
Hi Vikas, On 11/17/20 7:25 AM, Vikas Gupta wrote: > Hi Eric, > > On Mon, Nov 16, 2020 at 6:44 PM Auger Eric wrote: >> >> Hi Vikas, >> >> On 11/13/20 6:24 PM, Vikas Gupta wrote: >>> Hi Eric, >>> >>> On Fri, Nov 13, 2020 at 12:10 AM Au

Re: [f2fs-dev] [PATCH 1/2] f2fs: add disable_auto_compr mount option

2020-11-16 Thread Eric Biggers
rstand. How is this different from just not specifying the compress_extension mount option? And how can a file have compression both enabled and disabled at the same time? - Eric

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-16 Thread Eric W. Biederman
are. Systems where people care about kdump the most. Eric

Re: [PATCH 1/3] x86/quirks: Scan all busses for early PCI quirks

2020-11-16 Thread Eric W. Biederman
ed > callbacks in the PCI hotplug add/del path to update this information). > > [a] > https://lore.kernel.org/lkml/1588812129-8596-1-git-send-email-anthony.yzn...@oracle.com/ > > Below, inline reply to Eric's last message. > > > On 15/11/2020 17:46, Eric W. Bi

Re: [RFC, v1 0/3] msi support for platform devices

2020-11-16 Thread Auger Eric
Hi Vikas, On 11/13/20 6:24 PM, Vikas Gupta wrote: > Hi Eric, > > On Fri, Nov 13, 2020 at 12:10 AM Auger Eric wrote: >> >> Hi Vikas, >> >> On 11/12/20 6:58 PM, Vikas Gupta wrote: >>> This RFC adds support for MSI for platform devices. >>&g

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

2020-11-16 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 v11 13/13] vfio/pci: Inject page response upon response region fill

2020-11-16 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 v11 12/13] vfio/pci: Register a DMA fault response region

2020-11-16 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 --- drivers/vfio/pci/vfio_pci.c | 114

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

2020-11-16 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 0e2bfbeccd08..1e5c82f9d14d 100644 --- a/include

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

2020-11-16 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 as shown up. Signed-off-by: Eric Auger --- v11 -> v12: - t

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

2020-11-16 Thread Eric Auger
is detected at physical level. Also 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

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

2020-11-16 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 v11 01/13] vfio: VFIO_IOMMU_SET_PASID_TABLE

2020-11-16 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 v11 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type

2020-11-16 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) v10 -> v11: - rename vfio_pci_init_dma_fault_region into vfio_pci_dma_fault

[PATCH v11 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING

2020-11-16 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 --- v10 -> v11: - renamed ustr

[PATCH v11 02/13] vfio: VFIO_IOMMU_CACHE_INVALIDATE

2020-11-16 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 --- v10 -> v11: - renamed ustruct into cache_inv v8 -> v9: - change the ioctl ID v6 -> v7: - Use iommu_capsule struct - renamed vfio_iommu_for_each_d

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

2020-11-16 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 v11 08/13] vfio/pci: Add framework for custom interrupt indices

2020-11-16 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 --- drivers/vfio/pci/vfio_pci.c | 99

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

2020-11-16 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 |

Re: [PATCH v4] tcp: fix race condition when creating child sockets from syncookies

2020-11-16 Thread Eric Dumazet
On 11/13/20 8:09 PM, Ricardo Dias wrote: > When the TCP stack is in SYN flood mode, the server child socket is > created from the SYN cookie received in a TCP packet with the ACK flag > set. > > The child socket is created when the server receives the first TCP > packet with a valid SYN cookie

[PATCH v12 14/15] iommu/smmuv3: Accept configs with more than one context descriptor

2020-11-16 Thread Eric Auger
In preparation for vSVA, let's accept userspace provided configs with more than one CD. We check the max CD against the host iommu capability and also the format (linear versus 2 level). Signed-off-by: Eric Auger Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

[PATCH v12 13/15] iommu/smmuv3: Report non recoverable faults

2020-11-16 Thread Eric Auger
When a stage 1 related fault event is read from the event queue, let's propagate it to potential external fault listeners, ie. users who registered a fault handler. Signed-off-by: Eric Auger --- v8 -> v9: - adapt to the removal of IOMMU_FAULT_UNRECOV_PERM_VALID: only l

[PATCH v12 04/15] iommu/smmuv3: Dynamically allocate s1_cfg and s2_cfg

2020-11-16 Thread Eric Auger
-by: Eric Auger --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 83 - drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 6 +- 2 files changed, 48 insertions(+), 41 deletions(-) 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 v12 11/15] iommu/smmuv3: Enforce incompatibility between nested mode and HW MSI regions

2020-11-16 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 v12 06/15] iommu/smmuv3: Implement attach/detach_pasid_table

2020-11-16 Thread Eric Auger
On attach_pasid_table() we program STE S1 related info set by the guest into the actual physical STEs. At minimum we need to program the context descriptor GPA and compute whether the stage1 is translated/bypassed or aborted. Signed-off-by: Eric Auger --- v7 -> v8: - remove smmu->features

[PATCH v12 03/15] iommu/arm-smmu-v3: Maintain a SID->device structure

2020-11-16 Thread Eric Auger
When handling faults from the event or PRI queue, we need to find the struct device associated to a SID. Add a rb_tree to keep track of SIDs. Signed-off-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 99 + drivers/iommu

[PATCH v12 12/15] iommu/smmuv3: Implement bind/unbind_guest_msi

2020-11-16 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 v12 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2020-11-16 Thread Eric Auger
Regards Eric This series can be found at: https://github.com/eauger/linux/tree/5.10-rc4-2stage-v12 (including the VFIO part) The series includes a patch from Jean-Philippe. It is better to review the original patch: [PATCH v8 2/9] iommu/arm-smmu-v3: Maintain a SID->device structure The VFIO ser

[PATCH v12 10/15] iommu/smmuv3: Nested mode single MSI doorbell per domain enforcement

2020-11-16 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 v12 15/15] iommu/smmuv3: Add PASID cache invalidation per PASID

2020-11-16 Thread Eric Auger
In order to cascade guest CFGI_CD, let's add PASID cache invalidation per PASID. Signed-off-by: Eric Auger --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers

[PATCH v12 05/15] iommu/smmuv3: Get prepared for nested stage support

2020-11-16 Thread Eric Auger
. 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 --- v10 -> v11: - Fix an issue reported by Shameer when switching from with vSMMU to without vSMMU. Despite the spec does not seem to menti

[PATCH v12 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2020-11-16 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 --- drivers/iommu/arm/arm-smmu

[PATCH v12 08/15] iommu/smmuv3: Implement cache_invalidate

2020-11-16 Thread Eric Auger
Implement domain-selective and page-selective IOTLB invalidations. Signed-off-by: Eric Auger --- v7 -> v8: - ASID based invalidation using iommu_inv_pasid_info - check ARCHID/PASID flags in addr based invalidation - use __arm_smmu_tlb_inv_context and __arm_smmu_tlb_inv_range_nosync v6 -&

[PATCH v12 02/15] iommu: Introduce bind/unbind_guest_msi

2020-11-16 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 --- v7 -> v8: - dummy iommu_unbind_guest_msi turned into a void function v6 -> v7: - remove the device handle parameter. - Add comments say

[PATCH v12 09/15] dma-iommu: Implement NESTED_MSI cookie

2020-11-16 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 --- v10 -> v11: - fix compilation if !CONFIG_IOMMU_DMA v7 -

[PATCH v12 01/15] iommu: Introduce attach/detach_pasid_table API

2020-11-16 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 --- v11 ->

Re: [PATCH v9 3/3] mm/madvise: introduce process_madvise() syscall: an external memory hinting API

2020-11-16 Thread Eric Dumazet
On 9/21/20 7:55 PM, Minchan Kim wrote: > On Mon, Sep 21, 2020 at 07:56:33AM +0100, Christoph Hellwig wrote: >> On Mon, Aug 31, 2020 at 05:06:33PM -0700, Minchan Kim wrote: >>> There is usecase that System Management Software(SMS) want to give a >>> memory hint like MADV_[COLD|PAGEEOUT] to other

<    4   5   6   7   8   9   10   11   12   13   >