]> Git Repo - linux.git/log
linux.git
4 years agokvm: x86/mmu: Separate making SPTEs from set_spte
Ben Gardon [Wed, 14 Oct 2020 18:26:41 +0000 (20:26 +0200)]
kvm: x86/mmu: Separate making SPTEs from set_spte

Separate the functions for generating leaf page table entries from the
function that inserts them into the paging structure. This refactoring
will facilitate changes to the MMU sychronization model to use atomic
compare / exchanges (which are not guaranteed to succeed) instead of a
monolithic MMU lock.

No functional change expected.

Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
machine. This commit introduced no new failures.

This series can be viewed in Gerrit at:
https://linux-review.googlesource.com/c/virt/kvm/kvm/+/2538

Signed-off-by: Ben Gardon <[email protected]>
Reviewed-by: Peter Shier <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agokvm: mmu: Separate making non-leaf sptes from link_shadow_page
Ben Gardon [Fri, 25 Sep 2020 21:22:48 +0000 (14:22 -0700)]
kvm: mmu: Separate making non-leaf sptes from link_shadow_page

The TDP MMU page fault handler will need to be able to create non-leaf
SPTEs to build up the paging structures. Rather than re-implementing the
function, factor the SPTE creation out of link_shadow_page.

Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
machine. This series introduced no new failures.

This series can be viewed in Gerrit at:
https://linux-review.googlesource.com/c/virt/kvm/kvm/+/2538

Signed-off-by: Ben Gardon <[email protected]>
Message-Id: <20200925212302.3979661[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoMerge branch 'kvm-fixes' into 'next'
Paolo Bonzini [Wed, 21 Oct 2020 22:05:58 +0000 (18:05 -0400)]
Merge branch 'kvm-fixes' into 'next'

Pick up bugfixes from 5.9, otherwise various tests fail.

4 years agoKVM: PPC: Book3S HV: Make struct kernel_param_ops definition const
Joe Perches [Sun, 4 Oct 2020 00:18:06 +0000 (17:18 -0700)]
KVM: PPC: Book3S HV: Make struct kernel_param_ops definition const

This should be const, so make it so.

Signed-off-by: Joe Perches <[email protected]>
Message-Id: <d130e88dd4c82a12d979da747cc0365c72c3ba15.1601770305[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: Let the guest own CR4.FSGSBASE
Lai Jiangshan [Wed, 30 Sep 2020 04:16:59 +0000 (21:16 -0700)]
KVM: x86: Let the guest own CR4.FSGSBASE

Add FSGSBASE to the set of possible guest-owned CR4 bits, i.e. let the
guest own it on VMX.  KVM never queries the guest's CR4.FSGSBASE value,
thus there is no reason to force VM-Exit on FSGSBASE being toggled.

Note, because FSGSBASE is conditionally available, this is dependent on
recent changes to intercept reserved CR4 bits and to update the CR4
guest/host mask in response to guest CPUID changes.

Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Lai Jiangshan <[email protected]>
[sean: added justification in changelog]
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20200930041659[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: VMX: Intercept guest reserved CR4 bits to inject #GP fault
Sean Christopherson [Wed, 30 Sep 2020 04:16:58 +0000 (21:16 -0700)]
KVM: VMX: Intercept guest reserved CR4 bits to inject #GP fault

Intercept CR4 bits that are guest reserved so that KVM correctly injects
a #GP fault if the guest attempts to set a reserved bit.  If a feature
is supported by the CPU but is not exposed to the guest, and its
associated CR4 bit is not intercepted by KVM by default, then KVM will
fail to inject a #GP if the guest sets the CR4 bit without triggering
an exit, e.g. by toggling only the bit in question.

Note, KVM doesn't give the guest direct access to any CR4 bits that are
also dependent on guest CPUID.  Yet.

Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20200930041659[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: Move call to update_exception_bitmap() into VMX code
Sean Christopherson [Wed, 30 Sep 2020 04:16:57 +0000 (21:16 -0700)]
KVM: x86: Move call to update_exception_bitmap() into VMX code

Now that vcpu_after_set_cpuid() and update_exception_bitmap() are called
back-to-back, subsume the exception bitmap update into the common CPUID
update.  Drop the SVM invocation entirely as SVM's exception bitmap
doesn't vary with respect to guest CPUID.

Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20200930041659[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: Invoke vendor's vcpu_after_set_cpuid() after all common updates
Sean Christopherson [Wed, 30 Sep 2020 04:16:56 +0000 (21:16 -0700)]
KVM: x86: Invoke vendor's vcpu_after_set_cpuid() after all common updates

Move the call to kvm_x86_ops.vcpu_after_set_cpuid() to the very end of
kvm_vcpu_after_set_cpuid() to allow the vendor implementation to react
to changes made by the common code.  In the near future, this will be
used by VMX to update its CR4 guest/host masks to account for reserved
bits.  In the long term, SGX support will update the allowed XCR0 mask
for enclaves based on the vCPU's allowed XCR0.

vcpu_after_set_cpuid() (nee kvm_update_cpuid()) was originally added by
commit 2acf923e38fb ("KVM: VMX: Enable XSAVE/XRSTOR for guest"), and was
called separately after kvm_x86_ops.vcpu_after_set_cpuid() (nee
kvm_x86_ops->cpuid_update()).  There is no indication that the placement
of the common code updates after the vendor updates was anything more
than a "new function at the end" decision.

Inspection of the current code reveals no dependency on kvm_x86_ops'
vcpu_after_set_cpuid() in kvm_vcpu_after_set_cpuid() or any of its
helpers.  The bulk of the common code depends only on the guest's CPUID
configuration, kvm_mmu_reset_context() does not consume dynamic vendor
state, and there are no collisions between kvm_pmu_refresh() and VMX's
update of PT state.

Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20200930041659[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: Intercept LA57 to inject #GP fault when it's reserved
Lai Jiangshan [Wed, 30 Sep 2020 04:16:55 +0000 (21:16 -0700)]
KVM: x86: Intercept LA57 to inject #GP fault when it's reserved

Unconditionally intercept changes to CR4.LA57 so that KVM correctly
injects a #GP fault if the guest attempts to set CR4.LA57 when it's
supported in hardware but not exposed to the guest.

Long term, KVM needs to properly handle CR4 bits that can be under guest
control but also may be reserved from the guest's perspective.  But, KVM
currently sets the CR4 guest/host mask only during vCPU creation, and
reworking flows to change that will take a bit of elbow grease.

Even if/when generic support for intercepting reserved bits exists, it's
probably not worth letting the guest set CR4.LA57 directly.  LA57 can't
be toggled while long mode is enabled, thus it's all but guaranteed to
be set once (maybe twice, e.g. by BIOS and kernel) during boot and never
touched again.  On the flip side, letting the guest own CR4.LA57 may
incur extra VMREADs.  In other words, this temporary "hack" is probably
also the right long term fix.

Fixes: fd8cb433734e ("KVM: MMU: Expose the LA57 feature to VM.")
Cc: [email protected]
Cc: Lai Jiangshan <[email protected]>
Signed-off-by: Lai Jiangshan <[email protected]>
[sean: rewrote changelog]
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20200930041659[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: SVM: Initialize prev_ga_tag before use
Suravee Suthikulpanit [Sat, 3 Oct 2020 23:27:07 +0000 (23:27 +0000)]
KVM: SVM: Initialize prev_ga_tag before use

The function amd_ir_set_vcpu_affinity makes use of the parameter struct
amd_iommu_pi_data.prev_ga_tag to determine if it should delete struct
amd_iommu_pi_data from a list when not running in AVIC mode.

However, prev_ga_tag is initialized only when AVIC is enabled. The non-zero
uninitialized value can cause unintended code path, which ends up making
use of the struct vcpu_svm.ir_list and ir_list_lock without being
initialized (since they are intended only for the AVIC case).

This triggers NULL pointer dereference bug in the function vm_ir_list_del
with the following call trace:

    svm_update_pi_irte+0x3c2/0x550 [kvm_amd]
    ? proc_create_single_data+0x41/0x50
    kvm_arch_irq_bypass_add_producer+0x40/0x60 [kvm]
    __connect+0x5f/0xb0 [irqbypass]
    irq_bypass_register_producer+0xf8/0x120 [irqbypass]
    vfio_msi_set_vector_signal+0x1de/0x2d0 [vfio_pci]
    vfio_msi_set_block+0x77/0xe0 [vfio_pci]
    vfio_pci_set_msi_trigger+0x25c/0x2f0 [vfio_pci]
    vfio_pci_set_irqs_ioctl+0x88/0xb0 [vfio_pci]
    vfio_pci_ioctl+0x2ea/0xed0 [vfio_pci]
    ? alloc_file_pseudo+0xa5/0x100
    vfio_device_fops_unl_ioctl+0x26/0x30 [vfio]
    ? vfio_device_fops_unl_ioctl+0x26/0x30 [vfio]
    __x64_sys_ioctl+0x96/0xd0
    do_syscall_64+0x37/0x80
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

Therefore, initialize prev_ga_tag to zero before use. This should be safe
because ga_tag value 0 is invalid (see function avic_vm_init).

Fixes: dfa20099e26e ("KVM: SVM: Refactor AVIC vcpu initialization into avic_init_vcpu()")
Signed-off-by: Suravee Suthikulpanit <[email protected]>
Message-Id: <20201003232707[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: nSVM: implement on demand allocation of the nested state
Maxim Levitsky [Thu, 1 Oct 2020 11:29:54 +0000 (14:29 +0300)]
KVM: nSVM: implement on demand allocation of the nested state

This way we don't waste memory on VMs which don't use nesting
virtualization even when the host enabled it for them.

Signed-off-by: Maxim Levitsky <[email protected]>
Message-Id: <20201001112954[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: allow kvm_x86_ops.set_efer to return an error value
Maxim Levitsky [Thu, 1 Oct 2020 11:29:53 +0000 (14:29 +0300)]
KVM: x86: allow kvm_x86_ops.set_efer to return an error value

This will be used to signal an error to the userspace, in case
the vendor code failed during handling of this msr. (e.g -ENOMEM)

Signed-off-by: Maxim Levitsky <[email protected]>
Message-Id: <20201001112954[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agodrm/amd/swsmu: correct wrong feature bit mapping
Kevin Wang [Fri, 16 Oct 2020 08:59:25 +0000 (16:59 +0800)]
drm/amd/swsmu: correct wrong feature bit mapping

1. when smc feature bit isn't mapped,
the feature state isn't showed on sysfs node of pp_features.
2. add pp_features table title

Signed-off-by: Kevin Wang <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
4 years agoKVM: x86: report negative values from wrmsr emulation to userspace
Maxim Levitsky [Thu, 1 Oct 2020 11:29:52 +0000 (14:29 +0300)]
KVM: x86: report negative values from wrmsr emulation to userspace

This will allow the KVM to report such errors (e.g -ENOMEM)
to the userspace.

Signed-off-by: Maxim Levitsky <[email protected]>
Message-Id: <20201001112954[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: xen_hvm_config: cleanup return values
Maxim Levitsky [Thu, 1 Oct 2020 11:29:51 +0000 (14:29 +0300)]
KVM: x86: xen_hvm_config: cleanup return values

Return 1 on errors that are caused by wrong guest behavior
(which will inject #GP to the guest)

And return a negative error value on issues that are
the kernel's fault (e.g -ENOMEM)

Signed-off-by: Maxim Levitsky <[email protected]>
Message-Id: <20201001112954[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agokvm x86/mmu: Make struct kernel_param_ops definitions const
Joe Perches [Sun, 4 Oct 2020 00:18:07 +0000 (17:18 -0700)]
kvm x86/mmu: Make struct kernel_param_ops definitions const

These should be const, so make it so.

Signed-off-by: Joe Perches <[email protected]>
Message-Id: <ed95eef4f10fc1317b66936c05bc7dd8f943a6d5.1601770305[email protected]>
Reviewed-by: Ben Gardon <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: bump KVM_MAX_CPUID_ENTRIES
Vitaly Kuznetsov [Thu, 1 Oct 2020 13:05:41 +0000 (15:05 +0200)]
KVM: x86: bump KVM_MAX_CPUID_ENTRIES

As vcpu->arch.cpuid_entries is now allocated dynamically, the only
remaining use for KVM_MAX_CPUID_ENTRIES is to check KVM_SET_CPUID/
KVM_SET_CPUID2 input for sanity. Since it was reported that the
current limit (80) is insufficient for some CPUs, bump
KVM_MAX_CPUID_ENTRIES and use an arbitrary value '256' as the new
limit.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20201001130541.1398392[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: x86: allocate vcpu->arch.cpuid_entries dynamically
Vitaly Kuznetsov [Thu, 1 Oct 2020 13:05:40 +0000 (15:05 +0200)]
KVM: x86: allocate vcpu->arch.cpuid_entries dynamically

The current limit for guest CPUID leaves (KVM_MAX_CPUID_ENTRIES, 80)
is reported to be insufficient but before we bump it let's switch to
allocating vcpu->arch.cpuid_entries[] array dynamically. Currently,
'struct kvm_cpuid_entry2' is 40 bytes so vcpu->arch.cpuid_entries is
3200 bytes which accounts for 1/4 of the whole 'struct kvm_vcpu_arch'
but having it pre-allocated (for all vCPUs which we also pre-allocate)
gives us no real benefits.

Another plus of the dynamic allocation is that we now do kvm_check_cpuid()
check before we assign anything to vcpu->arch.cpuid_nent/cpuid_entries so
no changes are made in case the check fails.

Opportunistically remove unneeded 'out' labels from
kvm_vcpu_ioctl_set_cpuid()/kvm_vcpu_ioctl_set_cpuid2() and return
directly whenever possible.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20201001130541.1398392[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Maxim Levitsky <[email protected]>
4 years agoKVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entries
Vitaly Kuznetsov [Thu, 1 Oct 2020 13:05:39 +0000 (15:05 +0200)]
KVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entries

As a preparatory step to allocating vcpu->arch.cpuid_entries dynamically
make kvm_check_cpuid() check work with an arbitrary 'struct kvm_cpuid_entry2'
array.

Currently, when kvm_check_cpuid() fails we reset vcpu->arch.cpuid_nent to
0 and this is kind of weird, i.e. one would expect CPUIDs to remain
unchanged when KVM_SET_CPUID[2] call fails.

No functional change intended. It would've been possible to move the updated
kvm_check_cpuid() in kvm_vcpu_ioctl_set_cpuid2() and check the supplied
input before we start updating vcpu->arch.cpuid_entries/nent but we
can't do the same in kvm_vcpu_ioctl_set_cpuid() as we'll have to copy
'struct kvm_cpuid_entry' entries first. The change will be made when
vcpu->arch.cpuid_entries[] array becomes allocated dynamically.

Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20201001130541.1398392[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoDocumentation: kvm: fix some typos in cpuid.rst
Oliver Upton [Tue, 18 Aug 2020 15:24:29 +0000 (15:24 +0000)]
Documentation: kvm: fix some typos in cpuid.rst

Reviewed-by: Jim Mattson <[email protected]>
Reviewed-by: Peter Shier <[email protected]>
Signed-off-by: Oliver Upton <[email protected]>
Change-Id: I0c6355b09fedf8f9cc4cc5f51be418e2c1c82b7b
Message-Id: <20200818152429.1923996[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agokvm: x86: only provide PV features if enabled in guest's CPUID
Oliver Upton [Tue, 18 Aug 2020 15:24:28 +0000 (15:24 +0000)]
kvm: x86: only provide PV features if enabled in guest's CPUID

KVM unconditionally provides PV features to the guest, regardless of the
configured CPUID. An unwitting guest that doesn't check
KVM_CPUID_FEATURES before use could access paravirt features that
userspace did not intend to provide. Fix this by checking the guest's
CPUID before performing any paravirtual operations.

Introduce a capability, KVM_CAP_ENFORCE_PV_FEATURE_CPUID, to gate the
aforementioned enforcement. Migrating a VM from a host w/o this patch to
a host with this patch could silently change the ABI exposed to the
guest, warranting that we default to the old behavior and opt-in for
the new one.

Reviewed-by: Jim Mattson <[email protected]>
Reviewed-by: Peter Shier <[email protected]>
Signed-off-by: Oliver Upton <[email protected]>
Change-Id: I202a0926f65035b872bfe8ad15307c026de59a98
Message-Id: <20200818152429.1923996[email protected]>
Reviewed-by: Wanpeng Li <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agokvm: x86: set wall_clock in kvm_write_wall_clock()
Oliver Upton [Tue, 18 Aug 2020 15:24:27 +0000 (15:24 +0000)]
kvm: x86: set wall_clock in kvm_write_wall_clock()

Small change to avoid meaningless duplication in the subsequent patch.
No functional change intended.

Reviewed-by: Jim Mattson <[email protected]>
Reviewed-by: Peter Shier <[email protected]>
Signed-off-by: Oliver Upton <[email protected]>
Change-Id: I77ab9cdad239790766b7a49d5cbae5e57a3005ea
Message-Id: <20200818152429.1923996[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agokvm: x86: encapsulate wrmsr(MSR_KVM_SYSTEM_TIME) emulation in helper fn
Oliver Upton [Tue, 18 Aug 2020 15:24:26 +0000 (15:24 +0000)]
kvm: x86: encapsulate wrmsr(MSR_KVM_SYSTEM_TIME) emulation in helper fn

No functional change intended.

Reviewed-by: Jim Mattson <[email protected]>
Reviewed-by: Peter Shier <[email protected]>
Reviewed-by: Wanpeng Li <[email protected]>
Signed-off-by: Oliver Upton <[email protected]>
Change-Id: I7cbe71069db98d1ded612fd2ef088b70e7618426
Message-Id: <20200818152429.1923996[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agox86/kvm: Update the comment about asynchronous page fault in exc_page_fault()
Vitaly Kuznetsov [Fri, 2 Oct 2020 15:43:13 +0000 (17:43 +0200)]
x86/kvm: Update the comment about asynchronous page fault in exc_page_fault()

KVM was switched to interrupt-based mechanism for 'page ready' event
delivery in Linux-5.8 (see commit 2635b5c4a0e4 ("KVM: x86: interrupt based
APF 'page ready' event delivery")) and #PF (ab)use for 'page ready' event
delivery was removed. Linux guest switched to this new mechanism
exclusively in 5.9 (see commit b1d405751cd5 ("KVM: x86: Switch KVM guest to
using interrupts for page ready APF delivery")) so it is not possible to
get #PF for a 'page ready' event even when the guest is running on top
of an older KVM (APF mechanism won't be enabled). Update the comment in
exc_page_fault() to reflect the new reality.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20201002154313.1505327[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agox86/kvm: hide KVM options from menuconfig when KVM is not compiled
Matteo Croce [Thu, 1 Oct 2020 11:20:14 +0000 (13:20 +0200)]
x86/kvm: hide KVM options from menuconfig when KVM is not compiled

Let KVM_WERROR depend on KVM, so it doesn't show in menuconfig alone.

Signed-off-by: Matteo Croce <[email protected]>
Message-Id: <20201001112014[email protected]>
Fixes: 4f337faf1c55e ("KVM: allow disabling -Werror")
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoDocumentation: kvm: fix a typo
Li Qiang [Thu, 1 Oct 2020 09:53:33 +0000 (02:53 -0700)]
Documentation: kvm: fix a typo

Fixes: e287d6de62f74 ("Documentation: kvm: Convert cpuid.txt to .rst")
Signed-off-by: Li Qiang <[email protected]>
Message-Id: <20201001095333[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: VMX: Forbid userspace MSR filters for x2APIC
Paolo Bonzini [Tue, 20 Oct 2020 14:57:01 +0000 (10:57 -0400)]
KVM: VMX: Forbid userspace MSR filters for x2APIC

Allowing userspace to intercept reads to x2APIC MSRs when APICV is
fully enabled for the guest simply can't work.   But more in general,
the LAPIC could be set to in-kernel after the MSR filter is setup
and allowing accesses by userspace would be very confusing.

We could in principle allow userspace to intercept reads and writes to TPR,
and writes to EOI and SELF_IPI, but while that could be made it work, it
would still be silly.

Cc: Alexander Graf <[email protected]>
Cc: Aaron Lewis <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Sean Christopherson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agoKVM: VMX: Ignore userspace MSR filters for x2APIC
Sean Christopherson [Mon, 5 Oct 2020 19:55:32 +0000 (12:55 -0700)]
KVM: VMX: Ignore userspace MSR filters for x2APIC

Rework the resetting of the MSR bitmap for x2APIC MSRs to ignore userspace
filtering.  Allowing userspace to intercept reads to x2APIC MSRs when
APICV is fully enabled for the guest simply can't work; the LAPIC and thus
virtual APIC is in-kernel and cannot be directly accessed by userspace.
To keep things simple we will in fact forbid intercepting x2APIC MSRs
altogether, independent of the default_allow setting.

Cc: Alexander Graf <[email protected]>
Cc: Aaron Lewis <[email protected]>
Cc: Peter Xu <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <20201005195532[email protected]>
[Modified to operate even if APICv is disabled, adjust documentation. - Paolo]
Signed-off-by: Paolo Bonzini <[email protected]>
4 years agodrm/amd/psp: Fix sysfs: cannot create duplicate filename
Andrey Grodzovsky [Fri, 16 Oct 2020 14:50:44 +0000 (10:50 -0400)]
drm/amd/psp: Fix sysfs: cannot create duplicate filename

psp sysfs not cleaned up on driver unload for sienna_cichlid

Fixes: ce87c98db428e7 ("drm/amdgpu: Include sienna_cichlid in USBC PD FW support.")
Signed-off-by: Andrey Grodzovsky <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected] # 5.9.x
4 years agodrm/amd/display: Avoid MST manager resource leak.
Andrey Grodzovsky [Wed, 14 Oct 2020 17:12:30 +0000 (13:12 -0400)]
drm/amd/display: Avoid MST manager resource leak.

On connector destruction call drm_dp_mst_topology_mgr_destroy
to release resources allocated in drm_dp_mst_topology_mgr_init.
Do it only if MST manager was initilized before otherwsie a crash
is seen on driver unload/device unplug.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Andrey Grodzovsky <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
4 years agodrm/amd/display: Revert "drm/amd/display: Fix a list corruption"
Andrey Grodzovsky [Wed, 14 Oct 2020 17:10:06 +0000 (13:10 -0400)]
drm/amd/display: Revert "drm/amd/display: Fix a list corruption"

This fixes regression on device unplug and/or driver unload.

[   65.681501 <    0.000004>] BUG: kernel NULL pointer dereference, address: 0000000000000008
[   65.681504 <    0.000003>] #PF: supervisor write access in kernel mode
[   65.681506 <    0.000002>] #PF: error_code(0x0002) - not-present page
[   65.681507 <    0.000001>] PGD 7c9437067 P4D 7c9437067 PUD 7c9db7067 PMD 0
[   65.681511 <    0.000004>] Oops: 0002 [#1] SMP NOPTI
[   65.681512 <    0.000001>] CPU: 8 PID: 127 Comm: kworker/8:1 Tainted: G        W  O      5.9.0-rc2-dev+ #59
[   65.681514 <    0.000002>] Hardware name: System manufacturer System Product Name/PRIME X470-PRO, BIOS 4406 02/28/2019
[   65.681525 <    0.000011>] Workqueue: events drm_connector_free_work_fn [drm]
[   65.681535 <    0.000010>] RIP: 0010:drm_atomic_private_obj_fini+0x11/0x60 [drm]
[   65.681537 <    0.000002>] Code: de 4c 89 e7 e8 70 f2 ba f8 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 90 0f 1f 44 00 00 48 8b 47 08 48 8b 17 55 48 89 e5 53 <48> 89 42 08 48 89 10 48 b8 00 01 00 00 00 00 ad de 48 89 fb 48 89
[   65.681541 <    0.000004>] RSP: 0018:ffffa5fa805efdd8 EFLAGS: 00010246
[   65.681542 <    0.000001>] RAX: 0000000000000000 RBX: ffff9a4b094654d8 RCX: 0000000000000000
[   65.681544 <    0.000002>] RDX: 0000000000000000 RSI: ffffffffba197bc2 RDI: ffff9a4b094654d8
[   65.681545 <    0.000001>] RBP: ffffa5fa805efde0 R08: ffffffffba197b82 R09: 0000000000000040
[   65.681547 <    0.000002>] R10: ffffa5fa805efdc8 R11: 000000000000007f R12: ffff9a4b09465888
[   65.681549 <    0.000002>] R13: ffff9a4b36f20010 R14: ffff9a4b36f20290 R15: ffff9a4b3a692840
[   65.681551 <    0.000002>] FS:  0000000000000000(0000) GS:ffff9a4b3ea00000(0000) knlGS:0000000000000000
[   65.681553 <    0.000002>] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   65.681554 <    0.000001>] CR2: 0000000000000008 CR3: 00000007c9c82000 CR4: 00000000003506e0
[   65.681556 <    0.000002>] Call Trace:
[   65.681561 <    0.000005>]  drm_dp_mst_topology_mgr_destroy+0xc4/0xe0 [drm_kms_helper]
[   65.681612 <    0.000051>]  amdgpu_dm_connector_destroy+0x3d/0x110 [amdgpu]
[   65.681622 <    0.000010>]  drm_connector_free_work_fn+0x78/0x90 [drm]
[   65.681624 <    0.000002>]  process_one_work+0x164/0x410
[   65.681626 <    0.000002>]  worker_thread+0x4d/0x450
[   65.681628 <    0.000002>]  ? rescuer_thread+0x390/0x390
[   65.681630 <    0.000002>]  kthread+0x10a/0x140
[   65.681632 <    0.000002>]  ? kthread_unpark+0x70/0x70
[   65.681634 <    0.000002>]  ret_from_fork+0x22/0x30

This reverts commit 1545fbf97eafc1dbdc2923e58b4186b16a834784.

Signed-off-by: Andrey Grodzovsky <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
4 years agodrm/amdgpu: update golden setting for sienna_cichlid
Likun Gao [Thu, 15 Oct 2020 02:48:15 +0000 (10:48 +0800)]
drm/amdgpu: update golden setting for sienna_cichlid

Update golden setting for sienna_cichlid.

Signed-off-by: Likun Gao <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected] # 5.9.x
4 years agodrm/amd/swsmu: add missing feature map for sienna_cichlid
Kevin Wang [Fri, 16 Oct 2020 03:07:47 +0000 (11:07 +0800)]
drm/amd/swsmu: add missing feature map for sienna_cichlid

it will cause smu sysfs node of "pp_features" show error.

Signed-off-by: Kevin Wang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected] # 5.9.x
4 years agodrm/amdgpu: correct the gpu reset handling for job != NULL case
Evan Quan [Thu, 15 Oct 2020 06:57:46 +0000 (14:57 +0800)]
drm/amdgpu: correct the gpu reset handling for job != NULL case

Current code wrongly treat all cases as job == NULL.

Signed-off-by: Evan Quan <[email protected]>
Reviewed-and-tested-by: Jane Jian <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
4 years agodrm/amdgpu: add rlc iram and dram firmware support
Likun Gao [Wed, 30 Sep 2020 06:34:08 +0000 (14:34 +0800)]
drm/amdgpu: add rlc iram and dram firmware support

Support to load RLC iram and dram ucode when RLC firmware struct use v2.2

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
4 years agodrm/amdgpu: add function to program pbb mode for sienna cichlid
Likun Gao [Wed, 14 Oct 2020 06:05:18 +0000 (14:05 +0800)]
drm/amdgpu: add function to program pbb mode for sienna cichlid

Add function for sienna_cichlid to force PBB workload mode to zero by
checking whether there have SE been harvested.

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected] # 5.9.x
4 years agodocs: submitting-patches: describe preserving review/test tags
Krzysztof Kozlowski [Tue, 13 Oct 2020 16:27:25 +0000 (18:27 +0200)]
docs: submitting-patches: describe preserving review/test tags

From time to time, the novice kernel contributors do not add Reviewed-by
or Tested-by tags to the next versions of the patches.  Mostly because
they are unaware that responsibility of adding these tags in next
version is on submitter, not maintainer.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agoDocumentation: Chinese translation of Documentation/arm64/hugetlbpage.rst
Bailu Lin [Wed, 14 Oct 2020 02:20:03 +0000 (19:20 -0700)]
Documentation: Chinese translation of Documentation/arm64/hugetlbpage.rst

This is a Chinese translated version of
 Documentation/arm64/hugetlbpage.rst

Signed-off-by: Bailu Lin <[email protected]>
Reviewed-by: Alex Shi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agoDocumentation: x86: fix a missing word in x86_64/mm.rst.
Wei Lin Chang [Thu, 15 Oct 2020 06:22:42 +0000 (14:22 +0800)]
Documentation: x86: fix a missing word in x86_64/mm.rst.

This patch adds a missing word in x86/x86_64/mm.rst, without which
the note reads awkwardly.

Signed-off-by: Wei Lin Chang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agodocs: driver-api: remove a duplicated index entry
Mauro Carvalho Chehab [Thu, 15 Oct 2020 09:12:06 +0000 (11:12 +0200)]
docs: driver-api: remove a duplicated index entry

The ipmb file was added twice at index.rst. That
sounds to be because the same patch was applied twice,
via different git trees:

commit f6ae22d64433fd8e08654adad7966299da931bb9
Author: Mauro Carvalho Chehab <[email protected]>
Commit: Jonathan Corbet <[email protected]>

    docs: ipmb: place it at driver-api and convert to ReST

commit ac499fba98c3c65078fd84fa0a62cd6f6d5837ed
Author: Mauro Carvalho Chehab <[email protected]>
Commit: Corey Minyard <[email protected]>

    docs: ipmb: place it at driver-api and convert to ReST

With Sphinx 4.0.0 development tree, a new warning is produced
due to that:

.../Documentation/driver-api/index.rst:14: WARNING: duplicated entry found in toctree: driver-api/ipmb

The fix is trivial: just drop the duplicated line.

Fixes: f6ae22d64433 ("docs: ipmb: place it at driver-api and convert to ReST")
Fixes: ac499fba98c3 ("docs: ipmb: place it at driver-api and convert to ReST")
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Link: https://lore.kernel.org/r/623fb26a8409a7b002e45bdbb6f517ac08fd508a.1602753121.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agodocs: lkdtm: Modernize and improve details
Kees Cook [Thu, 15 Oct 2020 22:45:59 +0000 (15:45 -0700)]
docs: lkdtm: Modernize and improve details

The details on using LKDTM were overly obscure. Modernize the details
and expand examples to better illustrate how to use the interfaces.
Additionally add missing SPDX header.

Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agodocs: deprecated.rst: Expand str*cpy() replacement notes
Kees Cook [Thu, 15 Oct 2020 23:17:31 +0000 (16:17 -0700)]
docs: deprecated.rst: Expand str*cpy() replacement notes

The notes on replacing the deprecated str*cpy() functions didn't call
enough attention to the change in return type. Add these details and
clean up the language a bit more.

Signed-off-by: Kees Cook <[email protected]>
Acked-by: Gustavo A. R. Silva <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agodocs/cpu-load: format the example code.
Hui Su [Sun, 18 Oct 2020 17:05:57 +0000 (01:05 +0800)]
docs/cpu-load: format the example code.

format the example code.

Signed-off-by: Hui Su <[email protected]>
Link: https://lore.kernel.org/r/20201018170557.GA7670@rlk
Signed-off-by: Jonathan Corbet <[email protected]>
4 years agoMerge tag 'linux-watchdog-5.10-rc1' of git://www.linux-watchdog.org/linux-watchdog
Linus Torvalds [Wed, 21 Oct 2020 18:28:43 +0000 (11:28 -0700)]
Merge tag 'linux-watchdog-5.10-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - Add Toshiba Visconti watchdog driver

 - it87_wdt: add IT8772 + IT8784

 - several fixes and improvements

* tag 'linux-watchdog-5.10-rc1' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: Add Toshiba Visconti watchdog driver
  watchdog: bindings: Add binding documentation for Toshiba Visconti watchdog device
  watchdog: it87_wdt: add IT8784 ID
  watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
  watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3
  watchdog: renesas_wdt: support handover from bootloader
  watchdog: imx7ulp: Watchdog should continue running for wait/stop mode
  watchdog: rti: Simplify with dev_err_probe()
  watchdog: davinci: Simplify with dev_err_probe()
  watchdog: cadence: Simplify with dev_err_probe()
  watchdog: remove unneeded inclusion of <uapi/linux/sched/types.h>
  watchdog: Use put_device on error
  watchdog: Fix memleak in watchdog_cdev_register
  watchdog: imx7ulp: Strictly follow the sequence for wdog operations
  watchdog: it87_wdt: add IT8772 ID
  watchdog: pcwd_usb: Avoid GFP_ATOMIC where it is not needed
  drivers: watchdog: rdc321x_wdt: Fix race condition bugs

4 years agoMerge tag 'rtc-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Linus Torvalds [Wed, 21 Oct 2020 18:22:08 +0000 (11:22 -0700)]
Merge tag 'rtc-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:
 "A new driver this cycle is making the bulk of the changes and the
  rx8010 driver has been rework to use the modern APIs.

  Summary:

  Subsystem:
   - new generic DT properties: aux-voltage-chargeable,
     trickle-voltage-millivolt

  New driver:
   - Microcrystal RV-3032

  Drivers:
   - ds1307: use aux-voltage-chargeable
   - r9701, rx8010: modernization of the driver
   - rv3028: fix clock output, trickle resistor values, RAM
     configuration registers"

* tag 'rtc-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (50 commits)
  rtc: r9701: set range
  rtc: r9701: convert to devm_rtc_allocate_device
  rtc: r9701: stop setting RWKCNT
  rtc: r9701: remove useless memset
  rtc: r9701: stop setting a default time
  rtc: r9701: remove leftover comment
  rtc: rv3032: Add a driver for Microcrystal RV-3032
  dt-bindings: rtc: rv3032: add RV-3032 bindings
  dt-bindings: rtc: add trickle-voltage-millivolt
  rtc: rv3028: ensure ram configuration registers are saved
  rtc: rv3028: factorize EERD bit handling
  rtc: rv3028: fix trickle resistor values
  rtc: rv3028: fix clock output support
  rtc: mt6397: Remove unused member dev
  rtc: rv8803: simplify the return expression of rv8803_nvram_write
  rtc: meson: simplify the return expression of meson_vrtc_probe
  rtc: rx8010: rename rx8010_init_client() to rx8010_init()
  rtc: ds1307: enable rx8130's backup battery, make it chargeable optionally
  rtc: ds1307: consider aux-voltage-chargeable
  rtc: ds1307: store previous charge default per chip
  ...

4 years agoMerge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Wed, 21 Oct 2020 18:15:42 +0000 (11:15 -0700)]
Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull dmi update from Jean Delvare.

* 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  Replace HTTP links with HTTPS ones: DMI/SMBIOS SUPPORT

4 years agoMerge branch 'i2c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Wed, 21 Oct 2020 17:54:05 +0000 (10:54 -0700)]
Merge branch 'i2c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:

 - if a host can be a client, too, the I2C core can now use it to
   emulate SMBus HostNotify support (STM32 and R-Car added this so far)

 - also for client mode, a testunit has been added. It can create rare
   situations on the bus, so host controllers can be tested

 - a binding has been added to mark the bus as "single-master". This
   allows for better timeout detections

 - new driver for Mellanox Bluefield

 - massive refactoring of the Tegra driver

 - EEPROMs recognized by the at24 driver can now have custom names

 - rest is driver updates

* 'i2c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (80 commits)
  Documentation: i2c: add testunit docs to index
  i2c: tegra: Improve driver module description
  i2c: tegra: Clean up whitespaces, newlines and indentation
  i2c: tegra: Clean up and improve comments
  i2c: tegra: Clean up printk messages
  i2c: tegra: Clean up variable names
  i2c: tegra: Improve formatting of variables
  i2c: tegra: Check errors for both positive and negative values
  i2c: tegra: Factor out hardware initialization into separate function
  i2c: tegra: Factor out register polling into separate function
  i2c: tegra: Factor out packet header setup from tegra_i2c_xfer_msg()
  i2c: tegra: Factor out error recovery from tegra_i2c_xfer_msg()
  i2c: tegra: Rename wait/poll functions
  i2c: tegra: Remove "dma" variable from tegra_i2c_xfer_msg()
  i2c: tegra: Remove redundant check in tegra_i2c_issue_bus_clear()
  i2c: tegra: Remove likely/unlikely from the code
  i2c: tegra: Remove outdated barrier()
  i2c: tegra: Clean up variable types
  i2c: tegra: Reorder location of functions in the code
  i2c: tegra: Clean up probe function
  ...

4 years agoMerge tag 'ceph-for-5.10-rc1' of git://github.com/ceph/ceph-client
Linus Torvalds [Wed, 21 Oct 2020 17:34:10 +0000 (10:34 -0700)]
Merge tag 'ceph-for-5.10-rc1' of git://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:

 - a patch that removes crush_workspace_mutex (myself). CRUSH
   computations are no longer serialized and can run in parallel.

 - a couple new filesystem client metrics for "ceph fs top" command
   (Xiubo Li)

 - a fix for a very old messenger bug that affected the filesystem,
   marked for stable (myself)

 - assorted fixups and cleanups throughout the codebase from Jeff and
   others.

* tag 'ceph-for-5.10-rc1' of git://github.com/ceph/ceph-client: (27 commits)
  libceph: clear con->out_msg on Policy::stateful_server faults
  libceph: format ceph_entity_addr nonces as unsigned
  libceph: fix ENTITY_NAME format suggestion
  libceph: move a dout in queue_con_delay()
  ceph: comment cleanups and clarifications
  ceph: break up send_cap_msg
  ceph: drop separate mdsc argument from __send_cap
  ceph: promote to unsigned long long before shifting
  ceph: don't SetPageError on readpage errors
  ceph: mark ceph_fmt_xattr() as printf-like for better type checking
  ceph: fold ceph_update_writeable_page into ceph_write_begin
  ceph: fold ceph_sync_writepages into writepage_nounlock
  ceph: fold ceph_sync_readpages into ceph_readpage
  ceph: don't call ceph_update_writeable_page from page_mkwrite
  ceph: break out writeback of incompatible snap context to separate function
  ceph: add a note explaining session reject error string
  libceph: switch to the new "osd blocklist add" command
  libceph, rbd, ceph: "blacklist" -> "blocklist"
  ceph: have ceph_writepages_start call pagevec_lookup_range_tag
  ceph: use kill_anon_super helper
  ...

4 years agoxfs: fix fallocate functions when rtextsize is larger than 1
Darrick J. Wong [Fri, 9 Oct 2020 23:42:59 +0000 (16:42 -0700)]
xfs: fix fallocate functions when rtextsize is larger than 1

In commit fe341eb151ec, I forgot that xfs_free_file_space isn't strictly
a "remove mapped blocks" function.  It is actually a function to zero
file space by punching out the middle and writing zeroes to the
unaligned ends of the specified range.  Therefore, putting a rtextsize
alignment check in that function is wrong because that breaks unaligned
ZERO_RANGE on the realtime volume.

Furthermore, xfs_file_fallocate already has alignment checks for the
functions require the file range to be aligned to the size of a
fundamental allocation unit (which is 1 FSB on the data volume and 1 rt
extent on the realtime volume).  Create a new helper to check fallocate
arguments against the realtiem allocation unit size, fix the fallocate
frontend to use it, fix free_file_space to delete the correct range, and
remove a now redundant check from insert_file_space.

NOTE: The realtime extent size is not required to be a power of two!

Fixes: fe341eb151ec ("xfs: ensure that fpunch, fcollapse, and finsert operations are aligned to rt extent size")
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Chandan Babu R <[email protected]>
4 years agomptcp: depends on IPV6 but not as a module
Matthieu Baerts [Wed, 21 Oct 2020 10:51:53 +0000 (12:51 +0200)]
mptcp: depends on IPV6 but not as a module

Like TCP, MPTCP cannot be compiled as a module. Obviously, MPTCP IPv6'
support also depends on CONFIG_IPV6. But not all functions from IPv6
code are exported.

To simplify the code and reduce modifications outside MPTCP, it was
decided from the beginning to support MPTCP with IPv6 only if
CONFIG_IPV6 was built inlined. That's also why CONFIG_MPTCP_IPV6 was
created. More modifications are needed to support CONFIG_IPV6=m.

Even if it was not explicit, until recently, we were forcing CONFIG_IPV6
to be built-in because we had "select IPV6" in Kconfig. Now that we have
"depends on IPV6", we have to explicitly set "IPV6=y" to force
CONFIG_IPV6 not to be built as a module.

In other words, we can now only have CONFIG_MPTCP_IPV6=y if
CONFIG_IPV6=y.

Note that the new dependency might hide the fact IPv6 is not supported
in MPTCP even if we have CONFIG_IPV6=m. But selecting IPV6 like we did
before was forcing it to be built-in while it was maybe not what the
user wants.

Reported-by: Geert Uytterhoeven <[email protected]>
Fixes: 010b430d5df5 ("mptcp: MPTCP_IPV6 should depend on IPV6 instead of selecting it")
Signed-off-by: Matthieu Baerts <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
4 years agoMerge branch 'remotes/lorenzo/pci/xilinx'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:44 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/xilinx'

- Remove leftover bridge initialization (Lorenzo Pieralisi)

* remotes/lorenzo/pci/xilinx:
  PCI: xilinx-cpm: Remove leftover bridge initialization

4 years agoMerge branch 'remotes/lorenzo/pci/xgene'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:44 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/xgene'

- Remove unused assignment (Krzysztof Wilczyński)

* remotes/lorenzo/pci/xgene:
  PCI: xgene: Remove unused assignment to variable msi_val

4 years agoMerge branch 'pci/vmd'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:44 +0000 (09:58 -0500)]
Merge branch 'pci/vmd'

- Add physical offset helper (Jon Derrick)

- Add bus offset configuration helper (Jon Derrick)

- Add IRQ domain configuration helper (Jon Derrick)

- Add IRQ allocation helper (Jon Derrick)

- Drop pci_save_state()/pci_restore_state() in favor of the PCI core PM
  (Jon Derrick)

* pci/vmd:
  PCI: vmd: Update VMD PM to correctly use generic PCI PM
  PCI: vmd: Create IRQ allocation helper
  PCI: vmd: Create IRQ Domain configuration helper
  PCI: vmd: Create bus offset configuration helper
  PCI: vmd: Create physical offset helper

4 years agoMerge branch 'remotes/lorenzo/pci/tegra'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:43 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/tegra'

- Drop return value checking for debugfs_create() calls (Greg
  Kroah-Hartman)

- Convert debugfs "ports" file to use DEFINE_SEQ_ATTRIBUTE() (Liu Shixin)

* remotes/lorenzo/pci/tegra:
  PCI: tegra: Convert to use DEFINE_SEQ_ATTRIBUTE macro
  PCI: tegra: No need to check return value of debugfs_create() functions

4 years agoMerge branch 'remotes/lorenzo/pci/rcar'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:43 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/rcar'

- Document R8A774A1, R8A774B1, R8A774E1 endpoint support in DT (Lad
  Prabhakar)

- Add R8A774A1, R8A774B1, R8A774E1 (RZ/G2M, RZ/G2N, RZ/G2H) IDs to endpoint
  test (Lad Prabhakar)

- Add device tree support for R8A7742 (Lad Prabhakar)

- Use "fallthrough" pseudo-keyword (Gustavo A. R. Silva)

* remotes/lorenzo/pci/rcar:
  dt-bindings: PCI: rcar: Add device tree support for r8a7742
  PCI: rcar-gen2: Use fallthrough pseudo-keyword
  misc: pci_endpoint_test: Add Device ID for RZ/G2H PCIe controller
  dt-bindings: pci: rcar-pci-ep: Document r8a774e1
  misc: pci_endpoint_test: Add Device ID for RZ/G2M and RZ/G2N PCIe controllers
  dt-bindings: pci: rcar-pci-ep: Document r8a774a1 and r8a774b1

4 years agoMerge branch 'remotes/lorenzo/pci/qcom'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:43 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/qcom'

- Make sure PCIe is reset before init to work around QSDK U-Boot issue
  (Ansuel Smith)

- Set iproc affinity mask on MSI interrupts (Mark Tomlinson)

* remotes/lorenzo/pci/qcom:
  PCI: qcom: Make sure PCIe is reset before init for rev 2.1.0

4 years agoMerge branch 'remotes/lorenzo/pci/mvebu'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:42 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/mvebu'

- Remove useless msi_controller pointer allocation (Lorenzo Pieralisi)

* remotes/lorenzo/pci/mvebu:
  PCI: mvebu: Remove useless msi_controller pointer allocation

4 years agoMerge branch 'remotes/lorenzo/pci/mobiveil'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:42 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/mobiveil'

- Simplify mobiveil_pcie_init_irq_domain() (Liu Shixin)

* remotes/lorenzo/pci/mobiveil:
  PCI: mobiveil: Simplify mobiveil_pcie_init_irq_domain() return expression

4 years agoMerge branch 'remotes/lorenzo/pci/meson'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:41 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/meson'

- Add pci-meson module support and enable by default on ARCH_MESON (Kevin
  Hilman)

* remotes/lorenzo/pci/meson:
  PCI: meson: Build as module by default

4 years agoMerge branch 'remotes/lorenzo/pci/loongson'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:41 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/loongson'

* remotes/lorenzo/pci/loongson:
  PCI: loongson: Simplify loongson_pci_probe() return expression

4 years agoMerge branch 'remotes/lorenzo/pci/kirin'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:41 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/kirin'

- Return -EPROBE_DEFER in case the gpio isn't ready (Bean Huo)

* remotes/lorenzo/pci/kirin:
  PCI: kirin: Return -EPROBE_DEFER in case the gpio isn't ready

4 years agoMerge branch 'remotes/lorenzo/pci/iproc'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:40 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/iproc'

- Set affinity mask on MSI interrupts (Mark Tomlinson)

- Simplify by using module_bcma_driver (Liu Shixin)

- Fix 'using integer as NULL pointer' warning (Krzysztof Wilczyński)

* remotes/lorenzo/pci/iproc:
  PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe
  PCI: iproc: Use module_bcma_driver to simplify the code
  PCI: iproc: Set affinity mask on MSI interrupts

4 years agoMerge branch 'remotes/lorenzo/pci/imx6'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:40 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/imx6'

- Use "fallthrough" pseudo-keyword (Gustavo A. R. Silva)

- Drop redundant error messages after devm_clk_get() (Anson Huang)

* remotes/lorenzo/pci/imx6:
  PCI: imx6: Do not output error message when devm_clk_get() failed with -EPROBE_DEFER
  PCI: imx6: Use fallthrough pseudo-keyword

4 years agoMerge branch 'remotes/lorenzo/pci/hv'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:39 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/hv'

- Fix hibernation in case interrupts are not re-created (Dexuan Cui)

* remotes/lorenzo/pci/hv:
  PCI: hv: Fix hibernation in case interrupts are not re-created

4 years agoMerge branch 'remotes/lorenzo/pci/dwc'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:39 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/dwc'

- Fix designware-ep Header Type check (Hou Zhiqiang)

- Use DBI accessors instead of own config accessors (Rob Herring)

- Allow overriding bridge pci_ops (Rob Herring)

- Allow root and child buses to have different pci_ops (Rob Herring)

- Add default dwc pci_ops.map_bus (Rob Herring)

- Use pci_ops for root config space accessors in al, exynos, histb,
  keystone, kirin, meson, tegra (Rob Herring)

- Remove dwc own/other config accessor ops (Rob Herring)

- Use generic config accessors in dwc (Rob Herring)

- Also call .add_bus() callback for root bus (Rob Herring)

- Convert keystone .scan_bus() callback to use pci_ops.add_bus (Rob
  Herring)

- Convert dwc to use pci_host_probe() (Rob Herring)

- Remove dwc root_bus pointer (Rob Herring)

- Remove storing of PCI resources in dwc-specific structs (Rob Herring)

- Simplify config space handling (Rob Herring)

- Drop keystone duplicated DT num-viewport handling (Rob Herring)

- Check CONFIG_PCI_MSI in dw_pcie_msi_init() instead of duplicating it in
  all the drivers (Rob Herring)

- Remove imx6 duplicate PCIE_LINK_WIDTH_SPEED_CONTROL definition (Rob
  Herring)

- Add dwc num_lanes for use when it's lacking from DT (Rob Herring)

- Ensure "Fast Link Mode" simulation environment setting is cleared (Rob
  Herring)

- Drop meson duplicate number of lanes setup (Rob Herring)

- Drop meson unnecessary RC config space init (Rob Herring)

- Rework meson config and dwc port logic register accesses (Rob Herring)

- Use common PCI register definitions in imx6 and qcom (Rob Herring)

- Search for DesignWare PCIe Capability instead of hard-coding its location
  (Rob Herring)

- Use common DesignWare register definitions in tegra (Rob Herring)

- Drop keystone unused DBI2 code (Rob Herring)

- Make dwc ATU accessors private (Rob Herring)

- Centralize link gen setting in dwc (Rob Herring)

- Set PORT_LINK_DLL_LINK_EN in common dwc setup code (Rob Herring)

- Drop intel-gw unnecessary DT 'device_type' checking (Rob Herring)

- Move intel-gw PCI_CAP_ID_EXP discovery to the single place it's used (Rob
  Herring)

- Drop intel-gw unused max_width (Rob Herring)

- Move N_FTS (fast training sequence) setup to common dwc setup (Rob
  Herring)

- Convert spear13xx, tegra194 to use DBI accessors (Rob Herring)

- Add multiple PFs support for DWC (Xiaowei Bao)

- Add MSI-X doorbell mode for endpoint mode (Xiaowei Bao)

- Update MSI/MSI-X capability management for endpoints (Xiaowei Bao)

- Add layerscape ls1088a and ls2088a compatible strings (Xiaowei Bao)

- Update layerscape MSI/MSI-X management (Xiaowei Bao)

- Use doorbell to support MSI-X on layerscape (Xiaowei Bao)

- Add layerscape endpoint mode support for ls1088a and ls2088a (Xiaowei
  Bao)

- Add layerscape ls1088a node to DT (Xiaowei Bao)

- Add Freescale/Layerscape ls1088a to endpoint test (Xiaowei Bao)

- Add endpoint test driver data for Layerscape PCIe controllers (Hou
  Zhiqiang)

- Fix 'cast truncates bits from constant value' warning (Gustavo Pimentel)

- Add uniphier iATU register description (Kunihiko Hayashi)

- Add common iATU register support (Kunihiko Hayashi)

- Remove keystone iATU register mapping in favor of generic dwc support
  (Kunihiko Hayashi)

- Skip PCIE_MSI_INTR0* programming if MSI is disabled (Jisheng Zhang)

- Fix MSI page leakage in suspend/resume (Jisheng Zhang)

- Check whether link is up before attempting config access (best-effort fix
  even though it's racy) (Hou Zhiqiang)

* remotes/lorenzo/pci/dwc:
  PCI: dwc: Add link up check in dw_child_pcie_ops.map_bus()
  PCI: dwc: Fix MSI page leakage in suspend/resume
  PCI: dwc: Skip PCIE_MSI_INTR0* programming if MSI is disabled
  PCI: keystone: Remove iATU register mapping
  PCI: dwc: Add common iATU register support
  dt-bindings: PCI: uniphier-ep: Add iATU register description
  dt-bindings: PCI: uniphier: Add iATU register description
  PCI: dwc: Fix 'cast truncates bits from constant value'
  misc: pci_endpoint_test: Add driver data for Layerscape PCIe controllers
  misc: pci_endpoint_test: Add LS1088a in pci_device_id table
  PCI: layerscape: Add EP mode support for ls1088a and ls2088a
  PCI: layerscape: Modify the MSIX to the doorbell mode
  PCI: layerscape: Modify the way of getting capability with different PEX
  PCI: layerscape: Fix some format issue of the code
  dt-bindings: pci: layerscape-pci: Add compatible strings for ls1088a and ls2088a
  PCI: designware-ep: Modify MSI and MSIX CAP way of finding
  PCI: designware-ep: Move the function of getting MSI capability forward
  PCI: designware-ep: Add the doorbell mode of MSI-X in EP mode
  PCI: designware-ep: Add multiple PFs support for DWC
  PCI: dwc: Use DBI accessors
  PCI: dwc: Move N_FTS setup to common setup
  PCI: dwc/intel-gw: Drop unused max_width
  PCI: dwc/intel-gw: Move getting PCI_CAP_ID_EXP offset to intel_pcie_link_setup()
  PCI: dwc/intel-gw: Drop unnecessary checking of DT 'device_type' property
  PCI: dwc: Set PORT_LINK_DLL_LINK_EN in common setup code
  PCI: dwc: Centralize link gen setting
  PCI: dwc: Make ATU accessors private
  PCI: dwc: Remove read_dbi2 code
  PCI: dwc/tegra: Use common Designware port logic register definitions
  PCI: dwc: Remove hardcoded PCI_CAP_ID_EXP offset
  PCI: dwc/qcom: Use common PCI register definitions
  PCI: dwc/imx6: Use common PCI register definitions
  PCI: dwc/meson: Rework PCI config and DW port logic register accesses
  PCI: dwc/meson: Drop unnecessary RC config space initialization
  PCI: dwc/meson: Drop the duplicate number of lanes setup
  PCI: dwc: Ensure FAST_LINK_MODE is cleared
  PCI: dwc: Add a 'num_lanes' field to struct dw_pcie
  PCI: dwc/imx6: Remove duplicate define PCIE_LINK_WIDTH_SPEED_CONTROL
  PCI: dwc: Check CONFIG_PCI_MSI inside dw_pcie_msi_init()
  PCI: dwc/keystone: Drop duplicated 'num-viewport'
  PCI: dwc: Simplify config space handling
  PCI: dwc: Remove storing of PCI resources
  PCI: dwc: Remove root_bus pointer
  PCI: dwc: Convert to use pci_host_probe()
  PCI: dwc: keystone: Convert .scan_bus() callback to use add_bus
  PCI: Also call .add_bus() callback for root bus
  PCI: dwc: Use generic config accessors
  PCI: dwc: Remove dwc specific config accessor ops
  PCI: dwc: histb: Use pci_ops for root config space accessors
  PCI: dwc: exynos: Use pci_ops for root config space accessors
  PCI: dwc: kirin: Use pci_ops for root config space accessors
  PCI: dwc: meson: Use pci_ops for root config space accessors
  PCI: dwc: tegra: Use pci_ops for root config space accessors
  PCI: dwc: keystone: Use pci_ops for config space accessors
  PCI: dwc: al: Use pci_ops for child config space accessors
  PCI: dwc: Add a default pci_ops.map_bus for root port
  PCI: dwc: Allow overriding bridge pci_ops
  PCI: dwc: Use DBI accessors instead of own config accessors
  PCI: Allow root and child buses to have different pci_ops
  PCI: designware-ep: Fix the Header Type check

4 years agoMerge branch 'remotes/lorenzo/pci/cadence'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:38 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/cadence'

- Remove obsolete path from comment (Flavio Suligoi)

- Simplify cdns_pcie_host_init_address_translation() (Qinglang Miao)

* remotes/lorenzo/pci/cadence:
  PCI: cadence: Simplify cdns_pcie_host_init_address_translation() return expression
  PCI: cadence-ep: Remove obsolete path from comment

4 years agoMerge branch 'remotes/lorenzo/pci/brcmstb'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:38 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/brcmstb'

- Make PCIE_BRCMSTB depend on and default to ARCH_BRCMSTB (Jim Quinlan)

- Add DT bindings for 7278, 7216, 7211, and new properties (Jim Quinlan)

- Add bcm7278 register info (Jim Quinlan)

- Add suspend and resume pm_ops (Jim Quinlan)

- Add bcm7278 PERST# support (Jim Quinlan)

- Add control of RESCAL reset (Jim Quinlan)

- Set additional internal memory DMA viewport sizes (Jim Quinlan)

- Accommodate MSI for older chips (Jim Quinlan)

- Set bus max burst size by chip type (Jim Quinlan)

- Add bcm7211, bcm7216, bcm7445, bcm7278 to match list (Jim Quinlan)

* remotes/lorenzo/pci/brcmstb:
  PCI: brcmstb: Add bcm7211, bcm7216, bcm7445, bcm7278 to match list
  PCI: brcmstb: Set bus max burst size by chip type
  PCI: brcmstb: Accommodate MSI for older chips
  PCI: brcmstb: Set additional internal memory DMA viewport sizes
  PCI: brcmstb: Add control of rescal reset
  PCI: brcmstb: Add bcm7278 PERST# support
  PCI: brcmstb: Add suspend and resume pm_ops
  PCI: brcmstb: Add bcm7278 register info
  dt-bindings: PCI: Add bindings for more Brcmstb chips
  PCI: brcmstb: PCIE_BRCMSTB depends on ARCH_BRCMSTB

4 years agoMerge branch 'remotes/lorenzo/pci/aardvark'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:37 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/aardvark'

- Fix s390 build error (Pali Rohár)

- Check for errors from pci_bridge_emul_init() (Pali Rohár)

- Export pci-bridge-emul functions for use by modules (Pali Rohár)

- Make aardvark driver modular (Pali Rohár)

- Move PCIe reset code to advk_pcie_train_link() (Pali Rohár)

- Convert internal SMCC firmware return codes to errno (Pali Rohár)

- Fix initialization with old Marvell's Arm Trusted Firmware (Pali Rohár)

* remotes/lorenzo/pci/aardvark:
  PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
  phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
  PCI: aardvark: Move PCIe reset card code to advk_pcie_train_link()
  PCI: aardvark: Implement driver 'remove' function and allow to build it as module
  PCI: pci-bridge-emul: Export API functions
  PCI: aardvark: Check for errors from pci_bridge_emul_init() call
  PCI: aardvark: Fix compilation on s390

4 years agoMerge branch 'remotes/lorenzo/pci/arm'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:37 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/arm'

- Remove unused msi_ctrl, io_optional and align_resource fields from ARM
  struct hw_pci (Lorenzo Pieralisi)

* remotes/lorenzo/pci/arm:
  ARM/PCI: Remove unused fields from struct hw_pci

4 years agoMerge branch 'remotes/lorenzo/pci/pci-iomap'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:37 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/pci-iomap'

- Remove useless __KERNEL__ preprocessor guard in sparc io_32.h (Lorenzo
  Pieralisi)

- Move ioremap/iounmap declaration so it's visible in asm-generic/io.h
  (Lorenzo Pieralisi)

- Fix memory leak in generic !CONFIG_GENERIC_IOMAP pci_iounmap()
  implementation (Lorenzo Pieralisi)

* remotes/lorenzo/pci/pci-iomap:
  asm-generic/io.h: Fix !CONFIG_GENERIC_IOMAP pci_iounmap() implementation
  sparc32: Move ioremap/iounmap declaration before asm-generic/io.h include
  sparc32: Remove useless io_32.h __KERNEL__ preprocessor guard

4 years agoMerge branch 'remotes/lorenzo/pci/apei'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:36 +0000 (09:58 -0500)]
Merge branch 'remotes/lorenzo/pci/apei'

- Add ACPI APEI notifier chain for unknown (vendor) CPER records (Shiju
  Jose)

- Add handling of HiSilicon HIP PCIe controller errors (Yicong Yang)

* remotes/lorenzo/pci/apei:
  PCI: hip: Add handling of HiSilicon HIP PCIe controller errors
  ACPI / APEI: Add a notifier chain for unknown (vendor) CPER records

4 years agoMerge branch 'pci/misc'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:36 +0000 (09:58 -0500)]
Merge branch 'pci/misc'

- Remove unnecessary #includes (Gustavo Pimentel)

- Fix intel_mid_pci.c build error when !CONFIG_ACPI (Randy Dunlap)

- Use scnprintf(), not snprintf(), in sysfs "show" functions (Krzysztof
  Wilczyński)

- Simplify pci-pf-stub by using module_pci_driver() (Liu Shixin)

- Print IRQ used by Link Bandwidth Notification (Dongdong Liu)

- Update sysfs mmap-related #ifdef comments (Clint Sbisa)

- Simplify pci_dev_reset_slot_function() (Lukas Wunner)

- Use "NULL" instead of "0" to fix sparse warnings (Gustavo Pimentel)

- Simplify bool comparisons (Krzysztof Wilczyński)

- Drop double zeroing for P2PDMA sg_init_table() (Julia Lawall)

* pci/misc:
  PCI: v3-semi: Remove unneeded break
  PCI/P2PDMA: Drop double zeroing for sg_init_table()
  PCI: Simplify bool comparisons
  PCI: endpoint: Use "NULL" instead of "0" as a NULL pointer
  PCI: Simplify pci_dev_reset_slot_function()
  PCI: Update mmap-related #ifdef comments
  PCI/LINK: Print IRQ number used by port
  PCI/IOV: Simplify pci-pf-stub with module_pci_driver()
  PCI: Use scnprintf(), not snprintf(), in sysfs "show" functions
  x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled
  PCI: Remove unnecessary header includes

4 years agoMerge branch 'pci/pm'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:35 +0000 (09:58 -0500)]
Merge branch 'pci/pm'

- Remove unused pcibios_pm_ops (Vaibhav Gupta)

- Rename pci_dev.d3_delay to d3hot_delay (Krzysztof Wilczyński)

- Apply D2 transition delay as microseconds, not milliseconds (Bjorn
  Helgaas)

* pci/pm:
  PCI/PM: Revert "PCI/PM: Apply D2 delay as milliseconds, not microseconds"
  PCI/PM: Remove unused PCI_PM_BUS_WAIT
  PCI/PM: Rename pci_dev.d3_delay to d3hot_delay
  PCI/PM: Remove unused pcibios_pm_ops

4 years agoMerge branch 'pci/hotplug'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:35 +0000 (09:58 -0500)]
Merge branch 'pci/hotplug'

- Use for_each_child_of_node() and for_each_node_by_name() instead of
  open-coding them (Qinglang Miao)

- Reduce pciehp noisiness on hot removal (Lukas Wunner)

- Remove unused assignment in shpchp (Krzysztof Wilczyński)

* pci/hotplug:
  PCI: shpchp: Remove unused 'rc' assignment
  PCI: pciehp: Reduce noisiness on hot removal
  PCI: rpadlpar: Use for_each_child_of_node() and for_each_node_by_name()

4 years agoMerge branch 'pci/enumeration'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:34 +0000 (09:58 -0500)]
Merge branch 'pci/enumeration'

- Tone down message about missing optional MCFG (Jeremy Linton)

- Add schedule point in pci_read_config() (Jiang Biao)

- Add Ampere Altra SOC MCFG quirk (Tuan Phan)

- Add Kconfig options for MPS/MRRS strategy (Jim Quinlan)

* pci/enumeration:
  PCI: Add Kconfig options for MPS/MRRS strategy
  PCI/ACPI: Add Ampere Altra SOC MCFG quirk
  PCI: Add schedule point in pci_read_config()
  PCI/ACPI: Tone down missing MCFG message

4 years agoMerge branch 'pci/aspm'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:34 +0000 (09:58 -0500)]
Merge branch 'pci/aspm'

- Remove struct aspm_register_info (Saheed O. Bolarinwa)

- Remove struct pcie_link_state.l1ss (Saheed O. Bolarinwa)

* pci/aspm:
  PCI/ASPM: Remove struct pcie_link_state.l1ss
  PCI/ASPM: Remove struct aspm_register_info.l1ss_cap
  PCI/ASPM: Pass L1SS Capabilities value, not struct aspm_register_info
  PCI/ASPM: Remove struct aspm_register_info.l1ss_ctl1
  PCI/ASPM: Remove struct aspm_register_info.l1ss_ctl2 (unused)
  PCI/ASPM: Remove struct aspm_register_info.l1ss_cap_ptr
  PCI/ASPM: Remove struct aspm_register_info.latency_encoding
  PCI/ASPM: Remove struct aspm_register_info.enabled
  PCI/ASPM: Remove struct aspm_register_info.support
  PCI/ASPM: Use 'parent' and 'child' for readability
  PCI/ASPM: Move LTR path check to where it's used
  PCI/ASPM: Move pci_clear_and_set_dword() earlier

4 years agoMerge branch 'pci/acs'
Bjorn Helgaas [Wed, 21 Oct 2020 14:58:34 +0000 (09:58 -0500)]
Merge branch 'pci/acs'

- Enable Translation Blocking for external devices (Rajat Jain)

* pci/acs:
  PCI/ACS: Enable Translation Blocking for external devices

4 years agoPCI: vmd: Update VMD PM to correctly use generic PCI PM
Jon Derrick [Thu, 6 Aug 2020 21:00:17 +0000 (17:00 -0400)]
PCI: vmd: Update VMD PM to correctly use generic PCI PM

The pci_save_state() call in vmd_suspend() can be performed by
pci_pm_suspend_irq(). This also allows VMD to benefit from the call into
pci_prepare_to_sleep().

The pci_restore_state() call in vmd_resume() was restoring state after
pci_pm_resume()::pci_restore_standard_config() had already restored state.
It's also been suspected that the config state should have been restored
before re-requesting IRQs instead of afterwards.

Remove the pci_save_state()/pci_restore_state() calls in
vmd_suspend()/vmd_resume() to allow proper flow through generic PCI core
Power Management code.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jon Derrick <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Cc: Kai-Heng Feng <[email protected]>
Cc: You-Sheng Yang <[email protected]>
4 years agoMAINTAINERS: add URL for virtio-mem
David Hildenbrand [Wed, 17 Jun 2020 10:47:56 +0000 (12:47 +0200)]
MAINTAINERS: add URL for virtio-mem

Let's add the status/info page, which is still under construction, however,
already contains valuable documentation/information.

Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Pankaj Gupta <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
4 years agovhost_vdpa: remove unnecessary spin_lock in vhost_vring_call
Zhu Lingshan [Wed, 9 Sep 2020 06:52:34 +0000 (14:52 +0800)]
vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call

This commit removed unnecessary spin_locks in vhost_vring_call
and related operations. Because we manipulate irq offloading
contents in vhost_vdpa ioctl code path which is already
protected by dev mutex and vq mutex.

Signed-off-by: Zhu Lingshan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
4 years agovringh: fix __vringh_iov() when riov and wiov are different
Stefano Garzarella [Thu, 8 Oct 2020 20:42:56 +0000 (22:42 +0200)]
vringh: fix __vringh_iov() when riov and wiov are different

If riov and wiov are both defined and they point to different
objects, only riov is initialized. If the wiov is not initialized
by the caller, the function fails returning -EINVAL and printing
"Readable desc 0x... after writable" error message.

This issue happens when descriptors have both readable and writable
buffers (eg. virtio-blk devices has virtio_blk_outhdr in the readable
buffer and status as last byte of writable buffer) and we call
__vringh_iov() to get both type of buffers in two different iovecs.

Let's replace the 'else if' clause with 'if' to initialize both
riov and wiov if they are not NULL.

As checkpatch pointed out, we also avoid crashing the kernel
when riov and wiov are both NULL, replacing BUG() with WARN_ON()
and returning -EINVAL.

Fixes: f87d0fbb5798 ("vringh: host-side implementation of virtio rings.")
Cc: [email protected]
Signed-off-by: Stefano Garzarella <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
4 years agovdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
Eli Cohen [Tue, 8 Sep 2020 12:33:46 +0000 (15:33 +0300)]
vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK

set_map() is used by mlx5 vdpa to create a memory region based on the
address map passed by the iotlb argument. If we get successive calls, we
will destroy the current memory region and build another one based on
the new address mapping. We also need to setup the hardware resources
since they depend on the memory region.

If these calls happen before DRIVER_OK, It means that driver VQs may
also not been setup and we may not create them yet. In this case we want
to avoid setting up the other resources and defer this till we get
DRIVER OK.

Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Eli Cohen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
4 years agos390: virtio: PV needs VIRTIO I/O device protection
Pierre Morel [Thu, 10 Sep 2020 08:53:50 +0000 (10:53 +0200)]
s390: virtio: PV needs VIRTIO I/O device protection

If protected virtualization is active on s390, VIRTIO has only retricted
access to the guest memory.
Define CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS and export
arch_has_restricted_virtio_memory_access to advertize VIRTIO if that's
the case.

Signed-off-by: Pierre Morel <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Halil Pasic <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
4 years agovirtio: let arch advertise guest's memory access restrictions
Pierre Morel [Thu, 10 Sep 2020 08:53:49 +0000 (10:53 +0200)]
virtio: let arch advertise guest's memory access restrictions

An architecture may restrict host access to guest memory,
e.g. IBM s390 Secure Execution or AMD SEV.

Provide a new Kconfig entry the architecture can select,
CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, when it provides
the arch_has_restricted_virtio_memory_access callback to advertise
to VIRTIO common code when the architecture restricts memory access
from the host.

The common code can then fail the probe for any device where
VIRTIO_F_ACCESS_PLATFORM is required, but not set.

Signed-off-by: Pierre Morel <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Halil Pasic <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
4 years agovhost_vdpa: Fix duplicate included kernel.h
Tian Tao [Tue, 15 Sep 2020 00:51:42 +0000 (08:51 +0800)]
vhost_vdpa: Fix duplicate included kernel.h

linux/kernel.h is included more than once, Remove the one that isn't
necessary.

Signed-off-by: Tian Tao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
4 years agovhost: reduce stack usage in log_used
Li Wang [Mon, 14 Sep 2020 18:08:09 +0000 (02:08 +0800)]
vhost: reduce stack usage in log_used

Fix the warning: [-Werror=-Wframe-larger-than=]

drivers/vhost/vhost.c: In function log_used:
drivers/vhost/vhost.c:1906:1:
warning: the frame size of 1040 bytes is larger than 1024 bytes

Signed-off-by: Li Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
4 years agovirtio-mem: Constify mem_id_table
Rikard Falkeborn [Fri, 11 Sep 2020 20:35:09 +0000 (22:35 +0200)]
virtio-mem: Constify mem_id_table

mem_id_table is not modified, so make it const to allow the compiler to
put it in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
4 years agovirtio_input: Constify id_table
Rikard Falkeborn [Fri, 11 Sep 2020 20:35:08 +0000 (22:35 +0200)]
virtio_input: Constify id_table

id_table is not modified, so make it const to allow the compiler to put
it in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
4 years agovirtio-balloon: Constify id_table
Rikard Falkeborn [Fri, 11 Sep 2020 20:35:07 +0000 (22:35 +0200)]
virtio-balloon: Constify id_table

id_table is not modified, so make it const to allow the compiler to put
it in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
4 years agovdpa/mlx5: Fix failure to bring link up
Eli Cohen [Thu, 17 Sep 2020 12:15:40 +0000 (15:15 +0300)]
vdpa/mlx5: Fix failure to bring link up

Set VIRTIO_NET_S_LINK_UP in config status to allow the get the bring the
net device's link up.

Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Eli Cohen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
4 years agovdpa/mlx5: Make use of a specific 16 bit endianness API
Eli Cohen [Thu, 17 Sep 2020 12:14:25 +0000 (15:14 +0300)]
vdpa/mlx5: Make use of a specific 16 bit endianness API

Introduce a dedicated function to be used for setting 16 bit fields per
virio endianness requirements and use it to set the mtu field.

Signed-off-by: Eli Cohen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
4 years agoNFSv4.2: Fix NFS4ERR_STALE error when doing inter server copy
Dai Ngo [Mon, 19 Oct 2020 03:42:49 +0000 (23:42 -0400)]
NFSv4.2: Fix NFS4ERR_STALE error when doing inter server copy

NFS_FS=y as dependency of CONFIG_NFSD_V4_2_INTER_SSC still have
build errors and some configs with NFSD=m to get NFS4ERR_STALE
error when doing inter server copy.

Added ops table in nfs_common for knfsd to access NFS client modules.

Fixes: 3ac3711adb88 ("NFSD: Fix NFS server build errors")
Signed-off-by: Dai Ngo <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
4 years agodrm/i915: Drop runtime-pm assert from vgpu io accessors
Chris Wilson [Tue, 11 Aug 2020 09:25:32 +0000 (10:25 +0100)]
drm/i915: Drop runtime-pm assert from vgpu io accessors

The "mmio" writes into vgpu registers are simple memory traps from the
guest into the host. We do not need to assert in the guest that the
device is awake for the io as we do not write to the device itself.

However, over time we have refactored all the mmio accessors with the
result that the vgpu reuses the gen2 accessors and so inherits the
assert for runtime-pm of the native device. The assert though has
actually been there since commit 3be0bf5acca6 ("drm/i915: Create vGPU
specific MMIO operations to reduce traps").

References: 3be0bf5acca6 ("drm/i915: Create vGPU specific MMIO operations to reduce traps")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Yan Zhao <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 0e65ce24a33c1d37da4bf43c34e080334ec6cb60)
Signed-off-by: Rodrigo Vivi <[email protected]>
4 years agodrm/i915: Force VT'd workarounds when running as a guest OS
Chris Wilson [Mon, 19 Oct 2020 10:15:23 +0000 (11:15 +0100)]
drm/i915: Force VT'd workarounds when running as a guest OS

If i915.ko is being used as a passthrough device, it does not know if
the host is using intel_iommu. Mixing the iommu and gfx causes a few
issues (such as scanout overfetch) which we need to workaround inside
the driver, so if we detect we are running under a hypervisor, also
assume the device access is being virtualised.

Reported-by: Stefan Fritsch <[email protected]>
Suggested-by: Stefan Fritsch <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: Zhenyu Wang <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Stefan Fritsch <[email protected]>
Cc: [email protected]
Tested-by: Stefan Fritsch <[email protected]>
Reviewed-by: Zhenyu Wang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit f566fdcd6cc49a9d5b5d782f56e3e7cb243f01b8)
Signed-off-by: Rodrigo Vivi <[email protected]>
4 years agodrm/i915: Exclude low pages (128KiB) of stolen from use
Chris Wilson [Mon, 19 Oct 2020 16:50:05 +0000 (17:50 +0100)]
drm/i915: Exclude low pages (128KiB) of stolen from use

The GPU is trashing the low pages of its reserved memory upon reset. If
we are using this memory for ringbuffers, then we will dutiful resubmit
the trashed rings after the reset causing further resets, and worse. We
must exclude this range from our own use. The value of 128KiB was found
by empirical measurement (and verified now with a selftest) on gen9.

Signed-off-by: Chris Wilson <[email protected]>
Cc: [email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit d3606757e611fbd48bb239e8c2fe9779b3f50035)
Signed-off-by: Rodrigo Vivi <[email protected]>
4 years agodrm/i915/gt: Onion unwind for scratch page allocation failure
Chris Wilson [Mon, 19 Oct 2020 08:34:44 +0000 (09:34 +0100)]
drm/i915/gt: Onion unwind for scratch page allocation failure

In switching to using objects for our ppGTT scratch pages, care was not
taken to avoid trying to unref NULL objects on failure. And for gen6
ppGTT, it appears we forgot entirely to unwind after a partial allocation
failure.

Fixes: 89351925a477 ("drm/i915/gt: Switch to object allocations for page directories")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Matthew Auld <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit fa812ce96a46efc27cae4dcad866aaee9cb25d28)
Signed-off-by: Rodrigo Vivi <[email protected]>
4 years agoxen-blkfront: Apply changed parameter name to the document
SeongJae Park [Wed, 23 Sep 2020 06:18:41 +0000 (08:18 +0200)]
xen-blkfront: Apply changed parameter name to the document

Commit 14e710fe7897 ("xen-blkfront: rename indirect descriptor
parameter") changed the name of the module parameter for the maximum
amount of segments in indirect requests but missed updating the
document.  This commit updates the document.

Signed-off-by: SeongJae Park <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Acked-by: Roger Pau Monné <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
4 years agoxen-blkfront: add a parameter for disabling of persistent grants
SeongJae Park [Wed, 23 Sep 2020 06:18:40 +0000 (08:18 +0200)]
xen-blkfront: add a parameter for disabling of persistent grants

Persistent grants feature provides high scalability.  On some small
systems, however, it could incur data copy overheads[1] and thus it is
required to be disabled.  It can be disabled from blkback side using a
module parameter, 'feature_persistent'.  But, it is impossible from
blkfront side.  For the reason, this commit adds a blkfront module
parameter for disabling of the feature.

[1] https://wiki.xen.org/wiki/Xen_4.3_Block_Protocol_Scalability

Signed-off-by: SeongJae Park <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Acked-by: Roger Pau Monné <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
4 years agoxen-blkback: add a parameter for disabling of persistent grants
SeongJae Park [Wed, 23 Sep 2020 06:18:39 +0000 (08:18 +0200)]
xen-blkback: add a parameter for disabling of persistent grants

Persistent grants feature provides high scalability.  On some small
systems, however, it could incur data copy overheads[1] and thus it is
required to be disabled.  But, there is no option to disable it.  For
the reason, this commit adds a module parameter for disabling of the
feature.

[1] https://wiki.xen.org/wiki/Xen_4.3_Block_Protocol_Scalability

Signed-off-by: Anthony Liguori <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Acked-by: Roger Pau Monné <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
4 years agoarm64: proton-pack: Update comment to reflect new function name
Stephen Boyd [Tue, 20 Oct 2020 21:45:44 +0000 (14:45 -0700)]
arm64: proton-pack: Update comment to reflect new function name

The function detect_harden_bp_fw() is gone after commit d4647f0a2ad7
("arm64: Rewrite Spectre-v2 mitigation code"). Update this comment to
reflect the new state of affairs.

Fixes: d4647f0a2ad7 ("arm64: Rewrite Spectre-v2 mitigation code")
Signed-off-by: Stephen Boyd <[email protected]>
Cc: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
This page took 0.128483 seconds and 4 git commands to generate.