Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17eb3d8f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Martin Schwidefsky:
 "Just a bunch of bugfixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/mm: provide emtpy check_pgt_cache() function
  s390/uaccess: fix page table walk
  s390/3270: fix minor_start issue
  s390/uaccess: fix clear_user_pt()
  s390/scm_blk: fix error return code in scm_blk_init()
  s390/scm_block: fix printk format string
  drivers/Kconfig: add several missing GENERIC_HARDIRQS dependencies
parents da241efc 765a0cac
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -344,6 +344,7 @@ extern unsigned long MODULES_END;
#define _REGION3_ENTRY_CO	0x100	/* change-recording override	    */

/* Bits in the segment table entry */
#define _SEGMENT_ENTRY_ORIGIN_LARGE ~0xfffffUL /* large page address	    */
#define _SEGMENT_ENTRY_ORIGIN	~0x7ffUL/* segment table origin		    */
#define _SEGMENT_ENTRY_RO	0x200	/* page protection bit		    */
#define _SEGMENT_ENTRY_INV	0x20	/* invalid segment table entry	    */
@@ -1531,7 +1532,8 @@ extern int s390_enable_sie(void);
/*
 * No page table caches to initialise
 */
#define pgtable_cache_init()	do { } while (0)
static inline void pgtable_cache_init(void) { }
static inline void check_pgt_cache(void) { }

#include <asm-generic/pgtable.h>

+55 −28
Original line number Diff line number Diff line
@@ -77,42 +77,69 @@ static size_t copy_in_kernel(size_t count, void __user *to,
 * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address
 * contains the (negative) exception code.
 */
static __always_inline unsigned long follow_table(struct mm_struct *mm,
						  unsigned long addr, int write)
#ifdef CONFIG_64BIT
static unsigned long follow_table(struct mm_struct *mm,
				  unsigned long address, int write)
{
	pgd_t *pgd;
	pud_t *pud;
	pmd_t *pmd;
	pte_t *ptep;

	pgd = pgd_offset(mm, addr);
	if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
	unsigned long *table = (unsigned long *)__pa(mm->pgd);

	switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
	case _ASCE_TYPE_REGION1:
		table = table + ((address >> 53) & 0x7ff);
		if (unlikely(*table & _REGION_ENTRY_INV))
			return -0x39UL;
		table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
	case _ASCE_TYPE_REGION2:
		table = table + ((address >> 42) & 0x7ff);
		if (unlikely(*table & _REGION_ENTRY_INV))
			return -0x3aUL;

	pud = pud_offset(pgd, addr);
	if (pud_none(*pud) || unlikely(pud_bad(*pud)))
		table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
	case _ASCE_TYPE_REGION3:
		table = table + ((address >> 31) & 0x7ff);
		if (unlikely(*table & _REGION_ENTRY_INV))
			return -0x3bUL;

	pmd = pmd_offset(pud, addr);
	if (pmd_none(*pmd))
		table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
	case _ASCE_TYPE_SEGMENT:
		table = table + ((address >> 20) & 0x7ff);
		if (unlikely(*table & _SEGMENT_ENTRY_INV))
			return -0x10UL;
	if (pmd_large(*pmd)) {
		if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO))
		if (unlikely(*table & _SEGMENT_ENTRY_LARGE)) {
			if (write && (*table & _SEGMENT_ENTRY_RO))
				return -0x04UL;
		return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK);
			return (*table & _SEGMENT_ENTRY_ORIGIN_LARGE) +
				(address & ~_SEGMENT_ENTRY_ORIGIN_LARGE);
		}
	if (unlikely(pmd_bad(*pmd)))
		return -0x10UL;

	ptep = pte_offset_map(pmd, addr);
	if (!pte_present(*ptep))
		table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
	}
	table = table + ((address >> 12) & 0xff);
	if (unlikely(*table & _PAGE_INVALID))
		return -0x11UL;
	if (write && (!pte_write(*ptep) || !pte_dirty(*ptep)))
	if (write && (*table & _PAGE_RO))
		return -0x04UL;
	return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
}

	return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK);
#else /* CONFIG_64BIT */

static unsigned long follow_table(struct mm_struct *mm,
				  unsigned long address, int write)
{
	unsigned long *table = (unsigned long *)__pa(mm->pgd);

	table = table + ((address >> 20) & 0x7ff);
	if (unlikely(*table & _SEGMENT_ENTRY_INV))
		return -0x10UL;
	table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
	table = table + ((address >> 12) & 0xff);
	if (unlikely(*table & _PAGE_INVALID))
		return -0x11UL;
	if (write && (*table & _PAGE_RO))
		return -0x04UL;
	return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
}

#endif /* CONFIG_64BIT */

static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr,
					     size_t n, int write_user)
{
@@ -197,7 +224,7 @@ size_t copy_to_user_pt(size_t n, void __user *to, const void *from)

static size_t clear_user_pt(size_t n, void __user *to)
{
	void *zpage = &empty_zero_page;
	void *zpage = (void *) empty_zero_page;
	long done, size, ret;

	done = 0;
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ config INTEL_IOP_ADMA

config DW_DMAC
	tristate "Synopsys DesignWare AHB DMA support"
	depends on GENERIC_HARDIRQS
	select DMA_ENGINE
	default y if CPU_AT32AP7000
	help
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ config VIDEO_SAMSUNG_EXYNOS_GSC

config VIDEO_SH_VEU
	tristate "SuperH VEU mem2mem video processing driver"
	depends on VIDEO_DEV && VIDEO_V4L2
	depends on VIDEO_DEV && VIDEO_V4L2 && GENERIC_HARDIRQS
	select VIDEOBUF2_DMA_CONTIG
	select V4L2_MEM2MEM_DEV
	help
+7 −4
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ static void scm_blk_handle_error(struct scm_request *scmrq)
	case EQC_WR_PROHIBIT:
		spin_lock_irqsave(&bdev->lock, flags);
		if (bdev->state != SCM_WR_PROHIBIT)
			pr_info("%lu: Write access to the SCM increment is suspended\n",
			pr_info("%lx: Write access to the SCM increment is suspended\n",
				(unsigned long) bdev->scmdev->address);
		bdev->state = SCM_WR_PROHIBIT;
		spin_unlock_irqrestore(&bdev->lock, flags);
@@ -445,7 +445,7 @@ void scm_blk_set_available(struct scm_blk_dev *bdev)

	spin_lock_irqsave(&bdev->lock, flags);
	if (bdev->state == SCM_WR_PROHIBIT)
		pr_info("%lu: Write access to the SCM increment is restored\n",
		pr_info("%lx: Write access to the SCM increment is restored\n",
			(unsigned long) bdev->scmdev->address);
	bdev->state = SCM_OPER;
	spin_unlock_irqrestore(&bdev->lock, flags);
@@ -463,12 +463,15 @@ static int __init scm_blk_init(void)
		goto out;

	scm_major = ret;
	if (scm_alloc_rqs(nr_requests))
	ret = scm_alloc_rqs(nr_requests);
	if (ret)
		goto out_unreg;

	scm_debug = debug_register("scm_log", 16, 1, 16);
	if (!scm_debug)
	if (!scm_debug) {
		ret = -ENOMEM;
		goto out_free;
	}

	debug_register_view(scm_debug, &debug_hex_ascii_view);
	debug_set_level(scm_debug, 2);
Loading