[RFC PATCH] mm: fork: Prevent a NULL deref by getting mm only if the refcount isn't 0

2021-03-10 Thread Filippo Sironi
race where the process that's exiting drops the last reference on the mm (with mmput) while the other increases it (with mmget). By only increasing when the reference isn't 0 to begin with, we prevent this from happening. Signed-off-by: Filippo Sironi --- kernel/fork.c | 4 +--- 1

Re: [PATCH v2] nvme: Add 48-bit DMA address quirk for Amazon NVMe controllers

2021-02-10 Thread Filippo Sironi
On 2/10/21 8:37 AM, Christoph Hellwig wrote: On Wed, Feb 10, 2021 at 01:39:42AM +0100, Filippo Sironi wrote: Amazon NVMe controllers do not support 64-bit DMA addresses; they are limited to 48-bit DMA addresses. Let's add a quirk to ensure that we make use of 48-bit DMA addresses to

[PATCH v2] nvme: Add 48-bit DMA address quirk for Amazon NVMe controllers

2021-02-09 Thread Filippo Sironi
local instance storage (0xcd00, 0xcd01, 0xcd02). Signed-off-by: Filippo Sironi --- drivers/nvme/host/nvme.h | 5 + drivers/nvme/host/pci.c | 17 - 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 88a6b97

Re: [PATCH] nvme: Add 48-bit DMA address quirk

2021-02-03 Thread Filippo Sironi
On 2/3/21 12:15 PM, Christoph Hellwig wrote: On Wed, Feb 03, 2021 at 12:12:31PM +0100, Filippo Sironi wrote: I don't disagree on the first part of your sentence, this is a big oversight. But it is not what your commit log suggests. I can definitely rephrase the commit. On the other

Re: [PATCH] nvme: Add 48-bit DMA address quirk

2021-02-03 Thread Filippo Sironi
On 2/3/21 10:51 AM, Christoph Hellwig wrote: On Wed, Feb 03, 2021 at 10:43:38AM +0100, Filippo Sironi wrote: Certain NVMe controllers don't support 64-bit DMA addresses. Instead, they are limited to 48-bit DMA addresses. Let's add a quirk to use them properly. WTF? This is su

[PATCH] nvme: Add 48-bit DMA address quirk

2021-02-03 Thread Filippo Sironi
Certain NVMe controllers don't support 64-bit DMA addresses. Instead, they are limited to 48-bit DMA addresses. Let's add a quirk to use them properly. Signed-off-by: Filippo Sironi --- drivers/nvme/host/nvme.h | 5 + drivers/nvme/host/pci.c | 12 +++- 2 files c

Re: [PATCH 2/2] KVM: x86: Fix split-irqchip vs interrupt injection window request

2020-11-27 Thread Filippo Sironi
injection(vcpu) && kvm_cpu_accept_dm_intr(vcpu); } -- 2.28.0 Reviewed-by: Filippo Sironi Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879

Re: [PATCH 1/2] KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint

2020-11-27 Thread Filippo Sironi
kvm_apic_has_interrupt(struct kvm_vcpu *vcpu) struct kvm_lapic *apic = vcpu->arch.apic; u32 ppr; - if (!kvm_apic_hw_enabled(apic)) + if (!kvm_apic_present(vcpu)) return -1; __apic_update_ppr(apic, &ppr); -- 2.28.0 Reviewed-by:

[PATCH v2 2/2] KVM: x86: Implement the arch-specific hook to report the VM UUID

2019-05-14 Thread Filippo Sironi
On x86, we report the UUID in DMI System Information (i.e., DMI Type 1) as VM UUID. Signed-off-by: Filippo Sironi --- arch/x86/kernel/kvm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 5c93a65ee1e5..441cab08a09d 100644 --- a/arch

[PATCH v2 1/2] KVM: Start populating /sys/hypervisor with KVM entries

2019-05-14 Thread Filippo Sironi
virtual machine, since it's also available when running on Xen HVM and on Xen PV and, on top of that doesn't require root privileges by default. Let's create arch-specific hooks so that different architectures can provide different implementations. Signed-off-by: Filippo Sironi --- v2:

KVM: Start populating /sys/hypervisor with KVM entries

2019-05-14 Thread Filippo Sironi
r work can be done by consolidating the creation of the basic /sys/hypervisor across hypervisors. Filippo Sironi (2): KVM: Start populating /sys/hypervisor with KVM entries KVM: x86: Implement the arch-specific hook to report the VM UUID

[PATCH] KVM: Start populating /sys/hypervisor with KVM entries

2018-10-09 Thread Filippo Sironi
recognize a virtual machine, since it's also available when running on Xen HVM and on Xen PV and, on top of that doesn't require root privileges by default. Signed-off-by: Filippo Sironi --- drivers/Kconfig | 2 ++ drivers/Makefile | 2 ++ dri

[tip:x86/urgent] x86/microcode: Update the new microcode revision unconditionally

2018-09-02 Thread tip-bot for Filippo Sironi
Commit-ID: 8da38ebaad23fe1b0c4a205438676f6356607cfc Gitweb: https://git.kernel.org/tip/8da38ebaad23fe1b0c4a205438676f6356607cfc Author: Filippo Sironi AuthorDate: Tue, 31 Jul 2018 17:29:30 +0200 Committer: Thomas Gleixner CommitDate: Sun, 2 Sep 2018 14:10:54 +0200 x86/microcode

[PATCH] x86/microcode: Don't duplicate code to update ucode cpu info and cpu info

2018-07-31 Thread Filippo Sironi
... on late microcode loading when handling a CPU that's already been updated and a CPU that's yet to be updated. Signed-off-by: Filippo Sironi --- arch/x86/kernel/cpu/microcode/amd.c | 15 +-- arch/x86/kernel/cpu/microcode/intel.c | 10 ++ 2 files changed, 15

[PATCH] x86/MCE: Get microcode revision from cpu_info instead of boot_cpu_data

2018-06-01 Thread Filippo Sironi
pu_info instead, which is updated on late microcode loading. Fixes: fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check records") Signed-off-by: Filippo Sironi Cc: Tony Luck Cc: Borislav Petkov Cc: linux-e...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- arch/x86/ke

[PATCH] vfio/type1: Search for a fitting iommu_domain before attaching the iommu_group

2018-03-05 Thread Filippo Sironi
omain already exists. Signed-off-by: Filippo Sironi Cc: Alex Williamson Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/vfio/vfio_iommu_type1.c | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type

[PATCH] sched/fair: Prevent a division by 0 in scale_rt_capacity()

2017-12-09 Thread Filippo Sironi
off-by: Filippo Sironi --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4037e19bbca2..04b6f847a241 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7517,7 +7517,7 @@ static unsigned long scale_rt_ca

[PATCH 2/2] KVM: x86: Allow userspace to define what's the microcode version

2017-11-26 Thread Filippo Sironi
having userspace specifying the microcode version, rather than having the kernel picking it, is to ensure consistency for live-migrated instances; we don't want them to see a microcode version increase without a reset. Signed-off-by: Filippo Sironi --- arch/x86/kvm/x86.c

[PATCH 1/2] KVM: x86: Store the microcode version in struct kvm_arch

2017-11-26 Thread Filippo Sironi
... and read it from there when emulating accesses to MSR_IA32_UCODE_REV. This is the first step to allow userspace to define what's the microcode version that the guest should see. Signed-off-by: Filippo Sironi --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/x86.c

[PATCH v2] pci: Expose offset, stride, and VF device ID via sysfs

2017-10-08 Thread Filippo Sironi
... to make it easier for userspace applications to consume them. Signed-off-by: Filippo Sironi Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- v2: * follow up with the rename of vf_did to vf_device drivers/pci/pci-sysfs.c | 33

[PATCH v2] pci: Expose offset, stride, and VF device ID via sysfs

2017-10-08 Thread Filippo Sironi
dor $ cat /sys/bus/pci/devices/\:03\:00.0/sriov_offset 128 $ cat /sys/bus/pci/devices/\:03\:00.0/sriov_stride 2 $ cat /sys/bus/pci/devices/\:03\:00.0/sriov_vf_device 10ca Filippo Sironi (1): pci: Expose offset, stride, and VF device ID via sysfs drivers/pci/pci-sys

[PATCH v2] iommu/vt-d: Don't be too aggressive when clearing one context entry

2017-08-31 Thread Filippo Sironi
Previously, we were invalidating context cache and IOTLB globally when clearing one context entry. This is a tad too aggressive. Invalidate the context cache and IOTLB for the interested device only. Signed-off-by: Filippo Sironi Cc: David Woodhouse Cc: David Woodhouse Cc: Joerg Roedel Cc

[PATCH] intel-iommu: Don't be too aggressive when clearing one context entry

2017-08-28 Thread Filippo Sironi
Previously, we were invalidating context cache and IOTLB globally when clearing one context entry. This is a tad too aggressive. Invalidate the context cache and IOTLB for the interested device only. Signed-off-by: Filippo Sironi Cc: David Woodhouse Cc: David Woodhouse Cc: Joerg Roedel Cc

[PATCH 1/2] pci: Cache the VF device ID in the SR-IOV structure

2017-08-28 Thread Filippo Sironi
... and use it instead of reading it over and over from the PF config space capability. Signed-off-by: Filippo Sironi Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/iov.c | 5 +++-- drivers/pci/pci.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 2/2] pci: Expose offset, stride, and VF device ID via sysfs

2017-08-28 Thread Filippo Sironi
... to make it easier for userspace applications consumption. Signed-off-by: Filippo Sironi Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/pci-sysfs.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/pci/pci-sysfs.c b

[PATCH] x86, kvm: Handle PFNs outside of kernel reach when touching GPTEs

2017-04-13 Thread Filippo Sironi
). Signed-off-by: Filippo Sironi Cc: Anthony Liguori Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- arch/x86/kvm/paging_tmpl.h | 42 +- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/ar

[PATCH] x86, kvm: Handle PFNs outside of kernel reach when touching GPTEs

2017-04-05 Thread Filippo Sironi
). Signed-off-by: Filippo Sironi Cc: Anthony Liguori Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- arch/x86/kvm/paging_tmpl.h | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/pag