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

Commit 56b24d1b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Martin Schwidefsky:

 - four patches to get the new cputime code in shape for s390

 - add the new statx system call

 - a few bug fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: wire up statx system call
  KVM: s390: Fix guest migration for huge guests resulting in panic
  s390/ipl: always use load normal for CCW-type re-IPL
  s390/timex: micro optimization for tod_to_ns
  s390/cputime: provide archicture specific cputime_to_nsecs
  s390/cputime: reset all accounting fields on fork
  s390/cputime: remove last traces of cputime_t
  s390: fix in-kernel program checks
  s390/crypt: fix missing unlock in ctr_paes_crypt on error path
parents 5a45a5a8 8bd49ac8
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -474,10 +474,13 @@ static int ctr_paes_crypt(struct blkcipher_desc *desc, unsigned long modifier,
			ret = blkcipher_walk_done(desc, walk, nbytes - n);
			ret = blkcipher_walk_done(desc, walk, nbytes - n);
		}
		}
		if (k < n) {
		if (k < n) {
			if (__ctr_paes_set_key(ctx) != 0)
			if (__ctr_paes_set_key(ctx) != 0) {
				if (locked)
					spin_unlock(&ctrblk_lock);
				return blkcipher_walk_done(desc, walk, -EIO);
				return blkcipher_walk_done(desc, walk, -EIO);
			}
			}
		}
		}
	}
	if (locked)
	if (locked)
		spin_unlock(&ctrblk_lock);
		spin_unlock(&ctrblk_lock);
	/*
	/*
+8 −12
Original line number Original line Diff line number Diff line
@@ -8,31 +8,27 @@
#define _S390_CPUTIME_H
#define _S390_CPUTIME_H


#include <linux/types.h>
#include <linux/types.h>
#include <asm/div64.h>
#include <asm/timex.h>


#define CPUTIME_PER_USEC 4096ULL
#define CPUTIME_PER_USEC 4096ULL
#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
#define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)


/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */


typedef unsigned long long __nocast cputime_t;
typedef unsigned long long __nocast cputime64_t;

#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
#define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)


static inline unsigned long __div(unsigned long long n, unsigned long base)
{
	return n / base;
}

/*
/*
 * Convert cputime to microseconds and back.
 * Convert cputime to microseconds.
 */
 */
static inline unsigned int cputime_to_usecs(const cputime_t cputime)
static inline u64 cputime_to_usecs(const u64 cputime)
{
{
	return (__force unsigned long long) cputime >> 12;
	return cputime >> 12;
}
}


/*
 * Convert cputime to nanoseconds.
 */
#define cputime_to_nsecs(cputime) tod_to_ns(cputime)


u64 arch_cpu_idle_time(int cpu);
u64 arch_cpu_idle_time(int cpu);


+4 −8
Original line number Original line Diff line number Diff line
@@ -206,20 +206,16 @@ static inline unsigned long long get_tod_clock_monotonic(void)
 *    ns = (todval * 125) >> 9;
 *    ns = (todval * 125) >> 9;
 *
 *
 * In order to avoid an overflow with the multiplication we can rewrite this.
 * In order to avoid an overflow with the multiplication we can rewrite this.
 * With a split todval == 2^32 * th + tl (th upper 32 bits, tl lower 32 bits)
 * With a split todval == 2^9 * th + tl (th upper 55 bits, tl lower 9 bits)
 * we end up with
 * we end up with
 *
 *
 *    ns = ((2^32 * th + tl) * 125 ) >> 9;
 *    ns = ((2^9 * th + tl) * 125 ) >> 9;
 * -> ns = (2^23 * th * 125) + ((tl * 125) >> 9);
 * -> ns = (th * 125) + ((tl * 125) >> 9);
 *
 *
 */
 */
static inline unsigned long long tod_to_ns(unsigned long long todval)
static inline unsigned long long tod_to_ns(unsigned long long todval)
{
{
	unsigned long long ns;
	return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9);

	ns = ((todval >> 32) << 23) * 125;
	ns += ((todval & 0xffffffff) * 125) >> 9;
	return ns;
}
}


#endif
#endif
+3 −1
Original line number Original line Diff line number Diff line
@@ -313,7 +313,9 @@
#define __NR_copy_file_range	375
#define __NR_copy_file_range	375
#define __NR_preadv2		376
#define __NR_preadv2		376
#define __NR_pwritev2		377
#define __NR_pwritev2		377
#define NR_syscalls 378
/* Number 378 is reserved for guarded storage */
#define __NR_statx		379
#define NR_syscalls 380


/* 
/* 
 * There are some system calls that are not present on 64 bit, some
 * There are some system calls that are not present on 64 bit, some
+1 −0
Original line number Original line Diff line number Diff line
@@ -178,3 +178,4 @@ COMPAT_SYSCALL_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);
COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);
COMPAT_SYSCALL_WRAP6(copy_file_range, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags);
COMPAT_SYSCALL_WRAP6(copy_file_range, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags);
COMPAT_SYSCALL_WRAP5(statx, int, dfd, const char __user *, path, unsigned, flags, unsigned, mask, struct statx __user *, buffer);
Loading