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

Commit 69f39c57 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Martin Schwidefsky:
 "Nine bug fixes for s390:

   - Three fixes for the expoline code, one of them is strictly speaking
     a cleanup but as it relates to code added with 4.16 I would like to
     include the patch.

   - Three timer related fixes in the common I/O layer

   - A fix for the handling of internal DASD request which could cause
     panics.

   - One correction in regard to the accounting of pud page tables vs.
     compat tasks.

   - The register scrubbing in entry.S caused spurious crashes, this is
     fixed now as well"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/entry.S: fix spurious zeroing of r0
  s390: Fix runtime warning about negative pgtables_bytes
  s390: do not bypass BPENTER for interrupt system calls
  s390/cio: clear timer when terminating driver I/O
  s390/cio: fix return code after missing interrupt
  s390/cio: fix ccw_device_start_timeout API
  s390/clean-up: use CFI_* macros in entry.S
  s390: Replace IS_ENABLED(EXPOLINE_*) with IS_ENABLED(CONFIG_EXPOLINE_*)
  s390/dasd: fix handling of internal requests
parents b910a918 d3f46896
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,7 @@ static inline int init_new_context(struct task_struct *tsk,
				   _ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
				   _ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
		/* pgd_alloc() did not account this pmd */
		/* pgd_alloc() did not account this pmd */
		mm_inc_nr_pmds(mm);
		mm_inc_nr_pmds(mm);
		mm_inc_nr_puds(mm);
	}
	}
	crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
	crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
	return 0;
	return 0;
+6 −4
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
#include <asm/processor.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <asm/cache.h>
#include <asm/ctl_reg.h>
#include <asm/ctl_reg.h>
#include <asm/dwarf.h>
#include <asm/errno.h>
#include <asm/errno.h>
#include <asm/ptrace.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
@@ -230,7 +231,7 @@ _PIF_WORK = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART)
	.hidden \name
	.hidden \name
	.type \name,@function
	.type \name,@function
\name:
\name:
	.cfi_startproc
	CFI_STARTPROC
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
	exrl	0,0f
	exrl	0,0f
#else
#else
@@ -239,7 +240,7 @@ _PIF_WORK = (_PIF_PER_TRAP | _PIF_SYSCALL_RESTART)
#endif
#endif
	j	.
	j	.
0:	br	\reg
0:	br	\reg
	.cfi_endproc
	CFI_ENDPROC
	.endm
	.endm


	GEN_BR_THUNK __s390x_indirect_jump_r1use_r9,%r9,%r1
	GEN_BR_THUNK __s390x_indirect_jump_r1use_r9,%r9,%r1
@@ -426,13 +427,13 @@ ENTRY(system_call)
	UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER
	UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER
	BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP
	BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP
	stmg	%r0,%r7,__PT_R0(%r11)
	stmg	%r0,%r7,__PT_R0(%r11)
	# clear user controlled register to prevent speculative use
	xgr	%r0,%r0
	mvc	__PT_R8(64,%r11),__LC_SAVE_AREA_SYNC
	mvc	__PT_R8(64,%r11),__LC_SAVE_AREA_SYNC
	mvc	__PT_PSW(16,%r11),__LC_SVC_OLD_PSW
	mvc	__PT_PSW(16,%r11),__LC_SVC_OLD_PSW
	mvc	__PT_INT_CODE(4,%r11),__LC_SVC_ILC
	mvc	__PT_INT_CODE(4,%r11),__LC_SVC_ILC
	stg	%r14,__PT_FLAGS(%r11)
	stg	%r14,__PT_FLAGS(%r11)
.Lsysc_do_svc:
.Lsysc_do_svc:
	# clear user controlled register to prevent speculative use
	xgr	%r0,%r0
	# load address of system call table
	# load address of system call table
	lg	%r10,__THREAD_sysc_table(%r13,%r12)
	lg	%r10,__THREAD_sysc_table(%r13,%r12)
	llgh	%r8,__PT_INT_CODE+2(%r11)
	llgh	%r8,__PT_INT_CODE+2(%r11)
@@ -1439,6 +1440,7 @@ cleanup_critical:
	stg	%r15,__LC_SYSTEM_TIMER
	stg	%r15,__LC_SYSTEM_TIMER
0:	# update accounting time stamp
0:	# update accounting time stamp
	mvc	__LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
	mvc	__LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
	BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP
	# set up saved register r11
	# set up saved register r11
	lg	%r15,__LC_KERNEL_STACK
	lg	%r15,__LC_KERNEL_STACK
	la	%r9,STACK_FRAME_OVERHEAD(%r15)
	la	%r9,STACK_FRAME_OVERHEAD(%r15)
+2 −2
Original line number Original line Diff line number Diff line
@@ -2,8 +2,8 @@
#include <linux/module.h>
#include <linux/module.h>
#include <asm/nospec-branch.h>
#include <asm/nospec-branch.h>


int nospec_call_disable = IS_ENABLED(EXPOLINE_OFF);
int nospec_call_disable = IS_ENABLED(CONFIG_EXPOLINE_OFF);
int nospec_return_disable = !IS_ENABLED(EXPOLINE_FULL);
int nospec_return_disable = !IS_ENABLED(CONFIG_EXPOLINE_FULL);


static int __init nospectre_v2_setup_early(char *str)
static int __init nospectre_v2_setup_early(char *str)
{
{
+7 −14
Original line number Original line Diff line number Diff line
@@ -2581,8 +2581,6 @@ int dasd_cancel_req(struct dasd_ccw_req *cqr)
	case DASD_CQR_QUEUED:
	case DASD_CQR_QUEUED:
		/* request was not started - just set to cleared */
		/* request was not started - just set to cleared */
		cqr->status = DASD_CQR_CLEARED;
		cqr->status = DASD_CQR_CLEARED;
		if (cqr->callback_data == DASD_SLEEPON_START_TAG)
			cqr->callback_data = DASD_SLEEPON_END_TAG;
		break;
		break;
	case DASD_CQR_IN_IO:
	case DASD_CQR_IN_IO:
		/* request in IO - terminate IO and release again */
		/* request in IO - terminate IO and release again */
@@ -3902,9 +3900,12 @@ static int dasd_generic_requeue_all_requests(struct dasd_device *device)
		wait_event(dasd_flush_wq,
		wait_event(dasd_flush_wq,
			   (cqr->status != DASD_CQR_CLEAR_PENDING));
			   (cqr->status != DASD_CQR_CLEAR_PENDING));


		/* mark sleepon requests as ended */
		/*
		if (cqr->callback_data == DASD_SLEEPON_START_TAG)
		 * requeue requests to blocklayer will only work
			cqr->callback_data = DASD_SLEEPON_END_TAG;
		 * for block device requests
		 */
		if (_dasd_requeue_request(cqr))
			continue;


		/* remove requests from device and block queue */
		/* remove requests from device and block queue */
		list_del_init(&cqr->devlist);
		list_del_init(&cqr->devlist);
@@ -3917,13 +3918,6 @@ static int dasd_generic_requeue_all_requests(struct dasd_device *device)
			cqr = refers;
			cqr = refers;
		}
		}


		/*
		 * requeue requests to blocklayer will only work
		 * for block device requests
		 */
		if (_dasd_requeue_request(cqr))
			continue;

		if (cqr->block)
		if (cqr->block)
			list_del_init(&cqr->blocklist);
			list_del_init(&cqr->blocklist);
		cqr->block->base->discipline->free_cp(
		cqr->block->base->discipline->free_cp(
@@ -3940,8 +3934,7 @@ static int dasd_generic_requeue_all_requests(struct dasd_device *device)
		list_splice_tail(&requeue_queue, &device->ccw_queue);
		list_splice_tail(&requeue_queue, &device->ccw_queue);
		spin_unlock_irq(get_ccwdev_lock(device->cdev));
		spin_unlock_irq(get_ccwdev_lock(device->cdev));
	}
	}
	/* wake up generic waitqueue for eventually ended sleepon requests */
	dasd_schedule_device_bh(device);
	wake_up(&generic_waitq);
	return rc;
	return rc;
}
}


+5 −2
Original line number Original line Diff line number Diff line
@@ -795,6 +795,7 @@ ccw_device_online_timeout(struct ccw_device *cdev, enum dev_event dev_event)


	ccw_device_set_timeout(cdev, 0);
	ccw_device_set_timeout(cdev, 0);
	cdev->private->iretry = 255;
	cdev->private->iretry = 255;
	cdev->private->async_kill_io_rc = -ETIMEDOUT;
	ret = ccw_device_cancel_halt_clear(cdev);
	ret = ccw_device_cancel_halt_clear(cdev);
	if (ret == -EBUSY) {
	if (ret == -EBUSY) {
		ccw_device_set_timeout(cdev, 3*HZ);
		ccw_device_set_timeout(cdev, 3*HZ);
@@ -871,7 +872,7 @@ ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
	/* OK, i/o is dead now. Call interrupt handler. */
	/* OK, i/o is dead now. Call interrupt handler. */
	if (cdev->handler)
	if (cdev->handler)
		cdev->handler(cdev, cdev->private->intparm,
		cdev->handler(cdev, cdev->private->intparm,
			      ERR_PTR(-EIO));
			      ERR_PTR(cdev->private->async_kill_io_rc));
}
}


static void
static void
@@ -888,14 +889,16 @@ ccw_device_killing_timeout(struct ccw_device *cdev, enum dev_event dev_event)
	ccw_device_online_verify(cdev, 0);
	ccw_device_online_verify(cdev, 0);
	if (cdev->handler)
	if (cdev->handler)
		cdev->handler(cdev, cdev->private->intparm,
		cdev->handler(cdev, cdev->private->intparm,
			      ERR_PTR(-EIO));
			      ERR_PTR(cdev->private->async_kill_io_rc));
}
}


void ccw_device_kill_io(struct ccw_device *cdev)
void ccw_device_kill_io(struct ccw_device *cdev)
{
{
	int ret;
	int ret;


	ccw_device_set_timeout(cdev, 0);
	cdev->private->iretry = 255;
	cdev->private->iretry = 255;
	cdev->private->async_kill_io_rc = -EIO;
	ret = ccw_device_cancel_halt_clear(cdev);
	ret = ccw_device_cancel_halt_clear(cdev);
	if (ret == -EBUSY) {
	if (ret == -EBUSY) {
		ccw_device_set_timeout(cdev, 3*HZ);
		ccw_device_set_timeout(cdev, 3*HZ);
Loading