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

Commit 72ffaa48 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more s390 patches from Martin Schwidefsky:
 "A couple of bug fixes: one of the transparent huge page primitives is
  broken, the sched_clock function overflows after 417 days, the XFS
  module has grown too large for -fpic and the new pci code has broken
  normal channel subsystem notifications."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/chsc: fix SEI usage
  s390/time: fix sched_clock() overflow
  s390: use -fPIC for module compile
  s390/mm: fix pmd_pfn() for thp
parents dfdebc24 509d97b6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ CHECKFLAGS += -D__s390__ -msize-long
else
LD_BFD		:= elf64-s390
LDFLAGS		:= -m elf64_s390
KBUILD_AFLAGS_MODULE += -fpic -D__PIC__
KBUILD_CFLAGS_MODULE += -fpic -D__PIC__
KBUILD_AFLAGS_MODULE += -fPIC
KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_CFLAGS	+= -m64
KBUILD_AFLAGS	+= -m64
UTS_MACHINE	:= s390x
+1 −4
Original line number Diff line number Diff line
@@ -1387,9 +1387,6 @@ static inline int has_transparent_hugepage(void)

static inline unsigned long pmd_pfn(pmd_t pmd)
{
	if (pmd_trans_huge(pmd))
		return pmd_val(pmd) >> HPAGE_SHIFT;
	else
	return pmd_val(pmd) >> PAGE_SHIFT;
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+28 −0
Original line number Diff line number Diff line
@@ -128,4 +128,32 @@ static inline unsigned long long get_clock_monotonic(void)
	return get_clock_xt() - sched_clock_base_cc;
}

/**
 * tod_to_ns - convert a TOD format value to nanoseconds
 * @todval: to be converted TOD format value
 * Returns: number of nanoseconds that correspond to the TOD format value
 *
 * Converting a 64 Bit TOD format value to nanoseconds means that the value
 * must be divided by 4.096. In order to achieve that we multiply with 125
 * and divide by 512:
 *
 *    ns = (todval * 125) >> 9;
 *
 * 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)
 * we end up with
 *
 *    ns = ((2^32 * th + tl) * 125 ) >> 9;
 * -> ns = (2^23 * th * 125) + ((tl * 125) >> 9);
 *
 */
static inline unsigned long long tod_to_ns(unsigned long long todval)
{
	unsigned long long ns;

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

#endif
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
 */
unsigned long long notrace __kprobes sched_clock(void)
{
	return (get_clock_monotonic() * 125) >> 9;
	return tod_to_ns(get_clock_monotonic());
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
		return 0;
	}

	sltime = ((vcpu->arch.sie_block->ckc - now)*125)>>9;
	sltime = tod_to_ns(vcpu->arch.sie_block->ckc - now);

	hrtimer_start(&vcpu->arch.ckc_timer, ktime_set (0, sltime) , HRTIMER_MODE_REL);
	VCPU_EVENT(vcpu, 5, "enabled wait via clock comparator: %llx ns", sltime);
Loading