09 Nov, 2015
3 commits
-
Improve debugging to find out what went wrong during a failed
dma map/unmap operation.Signed-off-by: Sebastian Ott
Reviewed-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky -
We use lazy allocation for translation table entries but don't handle
allocation (and other) failures during translation table updates.Handle these failures and undo translation table updates when it's
meaningful.Signed-off-by: Sebastian Ott
Reviewed-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky -
Newly allocated translation table entries are flagged as invalid
and protected. If an existing translation table entry is invalidated,
the protection flag is left unchanged.If a page (with invalid and protection flag set) is accessed it's
undefined which type of exception we'll receive.Make sure to always set the invalid flag only.
Signed-off-by: Sebastian Ott
Reviewed-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky
06 Nov, 2015
1 commit
-
Pull iommu updates from Joerg Roedel:
"This time including:- A new IOMMU driver for s390 pci devices
- Common dma-ops support based on iommu-api for ARM64. The plan is
to use this as a basis for ARM32 and hopefully other architectures
as well in the future.- MSI support for ARM-SMMUv3
- Cleanups and dead code removal in the AMD IOMMU driver
- Better RMRR handling for the Intel VT-d driver
- Various other cleanups and small fixes"
* tag 'iommu-updates-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (41 commits)
iommu/vt-d: Fix return value check of parse_ioapics_under_ir()
iommu/vt-d: Propagate error-value from ir_parse_ioapic_hpet_scope()
iommu/vt-d: Adjust the return value of the parse_ioapics_under_ir
iommu: Move default domain allocation to iommu_group_get_for_dev()
iommu: Remove is_pci_dev() fall-back from iommu_group_get_for_dev
iommu/arm-smmu: Switch to device_group call-back
iommu/fsl: Convert to device_group call-back
iommu: Add device_group call-back to x86 iommu drivers
iommu: Add generic_device_group() function
iommu: Export and rename iommu_group_get_for_pci_dev()
iommu: Revive device_group iommu-ops call-back
iommu/amd: Remove find_last_devid_on_pci()
iommu/amd: Remove first/last_device handling
iommu/amd: Initialize amd_iommu_last_bdf for DEV_ALL
iommu/amd: Cleanup buffer allocation
iommu/amd: Remove cmd_buf_size and evt_buf_size from struct amd_iommu
iommu/amd: Align DTE flag definitions
iommu/amd: Remove old alias handling code
iommu/amd: Set alias DTE in do_attach/do_detach
iommu/amd: WARN when __[attach|detach]_device are called with irqs enabled
...
14 Oct, 2015
1 commit
-
zpci_err_insn writes stale stack content to the debugfs.
Ensure that the struct in zpci_err_insn is ordered in a way that
we don't have uninitialized holes in it. In addition to that
add the packed attribute.Fixes: 3d8258e (s390/pci: move debug messages to debugfs)
Signed-off-by: Sebastian Ott
Reviewed-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky
06 Oct, 2015
1 commit
-
This adds an IOMMU API implementation for s390 PCI devices.
Reviewed-by: Sebastian Ott
Signed-off-by: Gerald Schaefer
Signed-off-by: Joerg Roedel
11 Sep, 2015
1 commit
-
Almost everyone implements dma_set_mask the same way, although some time
that's hidden in ->set_dma_mask methods.This patch consolidates those into a common implementation that either
calls ->set_dma_mask if present or otherwise uses the default
implementation. Some architectures used to only call ->set_dma_mask
after the initial checks, and those instance have been fixed to do the
full work. h8300 implemented dma_set_mask bogusly as a no-ops and has
been fixed.Unfortunately some architectures overload unrelated semantics like changing
the dma_ops into it so we still need to allow for an architecture override
for now.[jcmvbkbc@gmail.com: fix xtensa]
Signed-off-by: Christoph Hellwig
Cc: Arnd Bergmann
Cc: Russell King
Cc: Catalin Marinas
Cc: Will Deacon
Cc: Yoshinori Sato
Cc: Michal Simek
Cc: Jonas Bonn
Cc: Chris Metcalf
Cc: Guan Xuetao
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: "H. Peter Anvin"
Cc: Andy Shevchenko
Signed-off-by: Max Filippov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Sep, 2015
1 commit
-
Pull irq updates from Thomas Gleixner:
"This updated pull request does not contain the last few GIC related
patches which were reported to cause a regression. There is a fix
available, but I let it breed for a couple of days first.The irq departement provides:
- new infrastructure to support non PCI based MSI interrupts
- a couple of new irq chip drivers
- the usual pile of fixlets and updates to irq chip drivers
- preparatory changes for removal of the irq argument from interrupt
flow handlers
- preparatory changes to remove IRQF_VALID"* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (129 commits)
irqchip/imx-gpcv2: IMX GPCv2 driver for wakeup sources
irqchip: Add bcm2836 interrupt controller for Raspberry Pi 2
irqchip: Add documentation for the bcm2836 interrupt controller
irqchip/bcm2835: Add support for being used as a second level controller
irqchip/bcm2835: Refactor handle_IRQ() calls out of MAKE_HWIRQ
PCI: xilinx: Fix typo in function name
irqchip/gic: Ensure gic_cpu_if_up/down() programs correct GIC instance
irqchip/gic: Only allow the primary GIC to set the CPU map
PCI/MSI: pci-xgene-msi: Consolidate chained IRQ handler install/remove
unicore32/irq: Prepare puv3_gpio_handler for irq argument removal
tile/pci_gx: Prepare trio_handle_level_irq for irq argument removal
m68k/irq: Prepare irq handlers for irq argument removal
C6X/megamode-pic: Prepare megamod_irq_cascade for irq argument removal
blackfin: Prepare irq handlers for irq argument removal
arc/irq: Prepare idu_cascade_isr for irq argument removal
sparc/irq: Use access helper irq_data_get_affinity_mask()
sparc/irq: Use helper irq_data_get_irq_handler_data()
parisc/irq: Use access helper irq_data_get_affinity_mask()
mn10300/irq: Use access helper irq_data_get_affinity_mask()
irqchip/i8259: Prepare i8259_irq_dispatch for irq argument removal
...
19 Aug, 2015
1 commit
-
The error messages in pci_insn are for debug purposes only. Move
them to the debugfs.Reviewed-by: Gerald Schaefer
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
29 Jul, 2015
3 commits
-
Make sure that we use the pci_rescan_remove_lock when we remove
or add functions from/to the bus.Reviewed-by: Gerald Schaefer
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky -
Receiving error events for a pci function that's currently not in use
will crash the kernel. For example the procedure for FW upgrades might
include:
* remove the function from Linux
* apply FW upgrade
* rescan for new functionsReceiving an event during the FW upgrade will result in a use after free
when printing the functions name. Just print "n/a" in such cases.Reviewed-by: Gerald Schaefer
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky -
Free bus resources when the allocation/registration of the bus failed.
Reviewed-by: Gerald Schaefer
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
23 Jul, 2015
1 commit
-
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could
easily move msi_list from struct pci_dev into struct device later.Signed-off-by: Jiang Liu
Acked-by: Sebastian Ott
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Cc: Gerald Schaefer
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Cc: linux390@de.ibm.com
Link: http://lkml.kernel.org/r/1436428847-8886-5-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner
22 Jul, 2015
1 commit
-
Inline get_zdev to save ~200 bytes of kernel text for CONFIG_PCI=y.
Also rename the function to to_zpci to make clear that we don't do
reference counting here.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
18 Jun, 2015
1 commit
-
Hypervisors may deliver event 0x301 not only for standby
but also for reserved devices.
Just handle event 0x301 regardless of the device's state.Reviewed-by: Gerald Schaefer
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
21 Apr, 2015
1 commit
-
Pull more s390 updates from Martin Schwidefsky:
"The big thing in this second merge for s390 is the new eBPF JIT from
Michael which replaces the old 32-bit backend.The remaining commits are bug fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/pci: add locking for fmb access
s390/pci: extract software counters from fmb
s390/dasd: Fix unresumed device after suspend/resume having no paths
s390/dasd: fix unresumed device after suspend/resume
s390/dasd: fix inability to set a DASD device offline
s390/mm: Fix memory hotplug for unaligned standby memory
s390/bpf: Add s390x eBPF JIT compiler backend
s390: Use bool function return values of true/false not 1/0
16 Apr, 2015
1 commit
-
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")Signed-off-by: Joe Perches
Acked-by: Sebastian Ott
Cc: Gerald Schaefer
Cc: Peter Oberparleiter
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Signed-off-by: Linus Torvalds
15 Apr, 2015
3 commits
-
Function measurement can be toggled at runtime. Make sure that
all access to the fmb is protected via a mutex.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky -
The software counters are not a part of the function measurement
block. Also we do not check for zdev->fmb != NULL when using these
counters (function measurement can be toggled at runtime). Just move
the software counters to struct zpci_dev.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky -
Pull s390 updates from Martin Schwidefsky:
"The major change in this merge is the removal of the support for
31-bit kernels. Naturally 31-bit user space will continue to work via
the compat layer.And then some cleanup, some improvements and bug fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (23 commits)
s390/smp: wait until secondaries are active & online
s390/hibernate: fix save and restore of kernel text section
s390/cacheinfo: add missing facility check
s390/syscalls: simplify syscall_get_arch()
s390/irq: enforce correct irqclass_sub_desc array size
s390: remove "64" suffix from mem64.S and swsusp_asm64.S
s390/ipl: cleanup macro usage
s390/ipl: cleanup shutdown_action attributes
s390/ipl: cleanup bin attr usage
s390/uprobes: fix address space annotation
s390: add missing arch_release_task_struct() declaration
s390: make couple of functions and variables static
s390/maccess: improve s390_kernel_write()
s390/maccess: remove potentially broken probe_kernel_write()
s390/watchdog: support for KVM hypervisors and delete pr_info messages
s390/watchdog: enable KEEPALIVE for /dev/watchdog
s390/dasd: remove setting of scheduler from driver
s390/traps: panic() instead of die() on translation exception
s390: remove test_facility(2) (== z/Architecture mode active) checks
s390/cmpxchg: simplify cmpxchg_double
...
25 Mar, 2015
1 commit
-
Given that the kernel now always runs in 64 bit mode, it is
pointless to check if the z/Architecture mode is active.
Remove the checks.Signed-off-by: Heiko Carstens
Signed-off-by: Martin Schwidefsky
24 Mar, 2015
1 commit
-
* pci/enumeration:
PCI: Cleanup control flow
sparc/PCI: Claim bus resources before pci_bus_add_devices()
PCI: Assign resources before drivers claim devices (pci_scan_root_bus())
PCI: Assign resources before drivers claim devices (pci_scan_bus())* pci/virtualization:
PCI: Add ACS quirks for Intel 1G NICs
19 Mar, 2015
1 commit
-
Previously, pci_scan_root_bus() created a root PCI bus, enumerated the
devices on it, and called pci_bus_add_devices(), which made the devices
available for drivers to claim them.Most callers assigned resources to devices after pci_scan_root_bus()
returns, which may be after drivers have claimed the devices. This is
incorrect; the PCI core should not change device resources while a driver
is managing the device.Remove pci_bus_add_devices() from pci_scan_root_bus() and do it after any
resource assignment in the callers.Note that ARM's pci_common_init_dev() already called pci_bus_add_devices()
after pci_scan_root_bus(), so we only need to remove the first call:pci_common_init_dev
pcibios_init_hw
pci_scan_root_bus
pci_bus_add_devices # first call
pci_bus_assign_resources
pci_bus_add_devices # second call[bhelgaas: changelog, drop "root_bus" var in alpha common_init_pci(),
return failure earlier in mn10300, add "return" in x86 pcibios_scan_root(),
return early if xtensa platform_pcibios_fixup() fails]
Signed-off-by: Yijing Wang
Signed-off-by: Bjorn Helgaas
CC: Richard Henderson
CC: Ivan Kokshaysky
CC: Matt Turner
CC: David Howells
CC: Tony Luck
CC: Michal Simek
CC: Ralf Baechle
CC: Koichi Yasutake
CC: Sebastian Ott
CC: "David S. Miller"
CC: Chris Metcalf
CC: Chris Zankel
CC: Max Filippov
CC: Thomas Gleixner
28 Feb, 2015
2 commits
-
Since commit 8cfc99b58366 ("s390: add pci_iomap_range") we use
EXPORT_SYMBOL for pci_iomap but EXPORT_SYMBOL_GPL for pci_iounmap.
Change the related functions to use EXPORT_SYMBOL like the asm-generic
variants do.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky -
Commit 8cfc99b58366 ("s390: add pci_iomap_range") introduced counters
to keep track of the number of mappings created. This revealed that
we don't have our internal mappings in order when using hotunplug or
resume from hibernate. This patch addresses both issues.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
26 Feb, 2015
1 commit
-
Make sure that even in error situations we do not use copy_to_user
on uninitialized kernel memory.Cc: stable@vger.kernel.org # 3.19+
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
19 Feb, 2015
1 commit
-
Pull virtio updates from Rusty Russell:
"OK, this has the big virtio 1.0 implementation, as specified by OASIS.On top of tht is the major rework of lguest, to use PCI and virtio
1.0, to double-check the implementation.Then comes the inevitable fixes and cleanups from that work"
* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (80 commits)
virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.
virtio_net: unconditionally define struct virtio_net_hdr_v1.
tools/lguest: don't use legacy definitions for net device in example launcher.
virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined.
tools/lguest: use common error macros in the example launcher.
tools/lguest: give virtqueues names for better error messages
tools/lguest: more documentation and checking of virtio 1.0 compliance.
lguest: don't look in console features to find emerg_wr.
tools/lguest: don't start devices until DRIVER_OK status set.
tools/lguest: handle indirect partway through chain.
tools/lguest: insert driver references from the 1.0 spec (4.1 Virtio Over PCI)
tools/lguest: insert device references from the 1.0 spec (4.1 Virtio Over PCI)
tools/lguest: rename virtio_pci_cfg_cap field to match spec.
tools/lguest: fix features_accepted logic in example launcher.
tools/lguest: handle device reset correctly in example launcher.
virtual: Documentation: simplify and generalize paravirt_ops.txt
lguest: remove NOTIFY call and eventfd facility.
lguest: remove NOTIFY facility from demonstration launcher.
lguest: use the PCI console device's emerg_wr for early boot messages.
lguest: always put console in PCI slot #1.
...
21 Jan, 2015
1 commit
-
Virtio drivers should map the part of the range they need, not
necessarily all of it.
To this end, support mapping ranges within BAR on s390.
Since multiple ranges can now be mapped within a BAR, we keep track of
the number of mappings created, and only clear out the mapping for a BAR
when this number reaches 0.Cc: Bjorn Helgaas
Cc: linux-pci@vger.kernel.org
Tested-by: Sebastian Ott
Signed-off-by: Michael S. Tsirkin
Signed-off-by: Rusty Russell
08 Jan, 2015
1 commit
-
Signed-off-by: Heiko Carstens
12 Dec, 2014
1 commit
-
Pull s390 updates from Martin Schwidefsky:
"The most notable change for this pull request is the ftrace rework
from Heiko. It brings a small performance improvement and the ground
work to support a new gcc option to replace the mcount blocks with a
single nop.Two new s390 specific system calls are added to emulate user space
mmio for PCI, an artifact of the how PCI memory is accessed.Two patches for the memory management with changes to common code.
For KVM mm_forbids_zeropage is added which disables the empty zero
page for an mm that is used by a KVM process. And an optimization,
pmdp_get_and_clear_full is added analog to ptep_get_and_clear_full.Some micro optimization for the cmpxchg and the spinlock code.
And as usual bug fixes and cleanups"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (46 commits)
s390/cputime: fix 31-bit compile
s390/scm_block: make the number of reqs per HW req configurable
s390/scm_block: handle multiple requests in one HW request
s390/scm_block: allocate aidaw pages only when necessary
s390/scm_block: use mempool to manage aidaw requests
s390/eadm: change timeout value
s390/mm: fix memory leak of ptlock in pmd_free_tlb
s390: use local symbol names in entry[64].S
s390/ptrace: always include vector registers in core files
s390/simd: clear vector register pointer on fork/clone
s390: translate cputime magic constants to macros
s390/idle: convert open coded idle time seqcount
s390/idle: add missing irq off lockdep annotation
s390/debug: avoid function call for debug_sprintf_*
s390/kprobes: fix instruction copy for out of line execution
s390: remove diag 44 calls from cpu_relax()
s390/dasd: retry partition detection
s390/dasd: fix list corruption for sleep_on requests
s390/dasd: fix infinite term I/O loop
s390/dasd: remove unused code
...
28 Nov, 2014
1 commit
-
The debug_unregister() function performs also input parameter validation.
Thus the test around the call is not needed.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
23 Nov, 2014
3 commits
-
The PCI/MSI irq chip callbacks mask/unmask_msi_irq have been renamed
to pci_msi_mask/unmask_irq to mark them PCI specific. Rename all usage
sites. The conversion helper functions are kept around to avoid
conflicts in next and will be removed after merging into mainline.Coccinelle assisted conversion. No functional change.
Signed-off-by: Thomas Gleixner
Cc: Bjorn Helgaas
Cc: Russell King
Cc: Ralf Baechle
Cc: Benjamin Herrenschmidt
Cc: Heiko Carstens
Cc: "David S. Miller"
Cc: Chris Metcalf
Cc: x86@kernel.org
Cc: Jiang Liu
Cc: Jason Cooper
Cc: Murali Karicheri
Cc: Thierry Reding
Cc: Mohit Kumar
Cc: Simon Horman
Cc: Michal Simek
Cc: Yijing Wang -
mask/unmask_msi_irq and __mask_msi/msix_irq are PCI/MSI specific
functions and should be named accordingly. This is a preparatory patch
to support MSI on non PCI devices.Rename mask/unmask_msi_irq to pci_msi_mask/unmask_irq and document the
functions. Provide conversion helpers.Rename __mask_msi/msix_irq to __pci_msi/msix_desc_mask so its clear
that they operated on msi_desc. Fixup the only user outside of
pci/msi.Signed-off-by: Thomas Gleixner
Cc: Bjorn Helgaas
Cc: Jiang Liu
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Yijing Wang
Cc: Heiko Carstens -
Rename write_msi_msg() to pci_write_msi_msg() to mark it as PCI
specific.Signed-off-by: Jiang Liu
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Yingjoe Chen
Cc: Yijing Wang
Signed-off-by: Thomas Gleixner
19 Nov, 2014
1 commit
-
Add the new __NR_s390_pci_mmio_write and __NR_s390_pci_mmio_read
system calls to allow user space applications to access device PCI I/O
memory pages on s390x platform.[ Martin Schwidefsky: some code beautification ]
Signed-off-by: Alexey Ishchuk
Signed-off-by: Martin Schwidefsky
12 Nov, 2014
1 commit
-
Now only s390/MSI use default_msi_mask_irq() and default_msix_mask_irq(),
replace them with the common MSI mask IRQ functions __msi_mask_irq() and
__msix_mask_irq(). Remove default_msi_mask_irq() and
default_msix_mask_irq().Signed-off-by: Yijing Wang
Signed-off-by: Bjorn Helgaas
Acked-by: Sebastian Ott
CC: linux-s390@vger.kernel.org
03 Nov, 2014
2 commits
-
Fix the following warnings from the sparse code checker:
arch/s390/include/asm/pci_io.h:165:49: warning: cast removes address space of expression
arch/s390/pci/pci.c:476:44: warning: cast removes address space of expression
arch/s390/pci/pci.c:491:36: warning: incorrect type in argument 2 (different address spaces)
arch/s390/pci/pci.c:491:36: expected void [noderef] *addr
arch/s390/pci/pci.c:491:36: got void *Signed-off-by: Martin Schwidefsky
-
s390s arch_setup_msi_irqs function ensures that we don't return with
more irqs than the PCI architecture allows and that a single PCI
function doesn't consume more irqs than the kernel is configured for.At least the last check doesn't help much and should take the sum of
all irqs into account. Since that's already done by irq_alloc_desc
we can remove this check.As for the first check we should use the value provided by the
firmware which can be less than what the PCI architecture allows.Signed-off-by: Sebastian Ott
Signed-off-by: Martin Schwidefsky
22 Jul, 2014
2 commits
-
This changes the default IOTLB flushing method to lazy flushing, which
means that there will be no direct flush after each DMA unmap operation.
Instead, the iommu bitmap pointer will be adjusted after unmap, so that
no DMA address will be re-used until after an iommu bitmap wrap-around.
The only IOTLB flush will then happen after each wrap-around.A new kernel parameter "s390_iommu=" is also introduced, to allow changing
the flushing behaviour to the old strict method.Reviewed-by: Sebastian Ott
Signed-off-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky -
KMSG_COMPONENT has to be defined instead of COMPONENT.
Signed-off-by: Gerald Schaefer
Signed-off-by: Martin Schwidefsky