The old rtc driver is getting in the way of some compat_ioctl
simplification. Looking up the loongson64 git history, it seems
that everyone uses the more modern but compatible RTC_CMOS driver
anyway, so let's remove the special case for loongson64.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
---
arch/mips/Kconfig | 2 +-
drivers/char/Kconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 35511999156a..c695825d9377 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -75,7 +75,7 @@ config MIPS
select MODULES_USE_ELF_RELA if MODULES && 64BIT
select MODULES_USE_ELF_REL if MODULES
select PERF_USE_VMALLOC
- select RTC_LIB if !MACH_LOONGSON64
+ select RTC_LIB
select SYSCTL_EXCEPTION_TRACE
select VIRT_TO_BUS
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index ce277ee0a28a..131b4c300050 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -268,7 +268,7 @@ if RTC_LIB=n
config RTC
tristate "Enhanced Real Time Clock Support (legacy PC RTC driver)"
- depends on ALPHA || (MIPS && MACH_LOONGSON64)
+ depends on ALPHA
---help---
If you say Y here and create a character special file /dev/rtc with
major number 10 and minor number 135 using mknod ("man mknod"), you
--
2.18.0
This is a note to let you know that I've just added the patch titled
posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME
to the 4.17-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
posix-timers-fix-nanosleep_copyout-for-config_compat_32bit_time.patch
and it can be found in the queue-4.17 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Wed Aug 22 09:16:55 CEST 2018
From: Arnd Bergmann <arnd(a)arndb.de>
Date: Mon, 18 Jun 2018 16:07:59 +0200
Subject: posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME
From: Arnd Bergmann <arnd(a)arndb.de>
[ Upstream commit 0fe2795516b9e1c59b58b02bdf8658698117ec4e ]
Commit b5793b0d92c9 added support for building the nanosleep compat system
call on 32-bit architectures, but missed one change in nanosleep_copyout(),
which would trigger a BUG() as soon as any architecture is switched over to
use it.
Use the proper config symbol to enable the code path.
Fixes: Commit b5793b0d92c9 ("posix-timers: Make compat syscalls depend on CONFIG_COMPAT_32BIT_TIME")
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: y2038(a)lists.linaro.org
Cc: Anna-Maria Gleixner <anna-maria(a)linutronix.de>
Cc: Deepa Dinamani <deepa.kernel(a)gmail.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
Link: https://lkml.kernel.org/r/20180618140811.2998503-1-arnd@arndb.de
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
kernel/time/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1659,7 +1659,7 @@ EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts)
{
switch(restart->nanosleep.type) {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_COMPAT_32BIT_TIME
case TT_COMPAT:
if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp))
return -EFAULT;
Patches currently in stable-queue which might be from arnd(a)arndb.de are
queue-4.17/posix-timers-fix-nanosleep_copyout-for-config_compat_32bit_time.patch
queue-4.17/ieee802154-mcr20a-add-missing-includes.patch
queue-4.17/drm-sun4i-link-in-front-end-code-if-needed.patch
As part of the system call rework for 64-bit time_t, we are restructuring
the way that compat syscalls deal with 32-bit time_t, reusing the
implementation for 32-bit architectures. Christoph Hellwig suggested
a rename of the associated types and interfaces to avoid the confusing
usage of the 'compat' prefix for 32-bit architectures.
To prepare for doing that in linux-4.20, this adds a set of macros
that lets us convert subsystems separately to the new names and
avoid some of the nastier merge conflicts.
Link: https://lore.kernel.org/lkml/20180713133204.3123939-1-arnd@arndb.de/
Cc: Christoph Hellwig <hch(a)lst.de>
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
---
The patch I posted originally was ready but didn't see proper linux-next
testing as I did not get to finalize it before my summer vacation,
so this is the minimal replacement I'd still like to get into 4.19-rc1,
in order to base patches for system calls, sound, networking, media
and file systems on top of.
I have put it into linux-next now after realizing that it would be
a problem to do all my other planned changes for the 4.20 merge
window. Please let me know if you have concerns about the approach,
or provide an Ack if this is ok with you.
---
include/linux/time32.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/linux/time32.h b/include/linux/time32.h
index 0b14f936100a..d1ae43c13e25 100644
--- a/include/linux/time32.h
+++ b/include/linux/time32.h
@@ -207,4 +207,19 @@ static inline s64 timeval_to_ns(const struct timeval *tv)
extern struct timeval ns_to_timeval(const s64 nsec);
extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec);
+/*
+ * New aliases for compat time functions. These will be used to replace
+ * the compat code so it can be shared between 32-bit and 64-bit builds
+ * both of which provide compatibility with old 32-bit tasks.
+ */
+#define old_time32_t compat_time_t
+#define old_timeval32 compat_timeval
+#define old_timespec32 compat_timespec
+#define old_itimerspec32 compat_itimerspec
+#define ns_to_old_timeval32 ns_to_compat_timeval
+#define get_old_itimerspec32 get_compat_itimerspec64
+#define put_old_itimerspec32 put_compat_itimerspec64
+#define get_old_timespec32 compat_get_timespec64
+#define put_old_timespec32 compat_put_timespec64
+
#endif
--
2.18.0
This is a note to let you know that I've just added the patch titled
posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
posix-timers-fix-nanosleep_copyout-for-config_compat_32bit_time.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Wed Aug 22 09:33:46 CEST 2018
From: Arnd Bergmann <arnd(a)arndb.de>
Date: Mon, 18 Jun 2018 16:07:59 +0200
Subject: posix-timers: Fix nanosleep_copyout() for CONFIG_COMPAT_32BIT_TIME
From: Arnd Bergmann <arnd(a)arndb.de>
[ Upstream commit 0fe2795516b9e1c59b58b02bdf8658698117ec4e ]
Commit b5793b0d92c9 added support for building the nanosleep compat system
call on 32-bit architectures, but missed one change in nanosleep_copyout(),
which would trigger a BUG() as soon as any architecture is switched over to
use it.
Use the proper config symbol to enable the code path.
Fixes: Commit b5793b0d92c9 ("posix-timers: Make compat syscalls depend on CONFIG_COMPAT_32BIT_TIME")
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: y2038(a)lists.linaro.org
Cc: Anna-Maria Gleixner <anna-maria(a)linutronix.de>
Cc: Deepa Dinamani <deepa.kernel(a)gmail.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
Link: https://lkml.kernel.org/r/20180618140811.2998503-1-arnd@arndb.de
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
kernel/time/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1450,7 +1450,7 @@ EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts)
{
switch(restart->nanosleep.type) {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_COMPAT_32BIT_TIME
case TT_COMPAT:
if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp))
return -EFAULT;
Patches currently in stable-queue which might be from arnd(a)arndb.de are
queue-4.14/posix-timers-fix-nanosleep_copyout-for-config_compat_32bit_time.patch
The goal of this patch series is to easily add/modify/delete a
system call by changing entry in syscall.tbl file. No need
to manually edit many files.
The another goal of this patch series is to to unify the system
call implementation across all the architectures. ARM, s390 and
x86 architecuture does have the similar support. I leverage their
implementation to come up with a generic solution.
I have done the same support for work for ia64, m68k, microblaze,
mips, parisc, powerpc, sh, sparc, and xtensa. But I started sending
the patch for one architecuture for review. Below mentioned git
repository contains more details.
Git repo:- https://github.com/frzkhn/system_call_table_generator/
Finally, this is the ground work for solving the Y2038 issue. We
need to change two dozen of system calls to solve Y2038 issue. So
this implementation will help to easily modify from existing system
call to Y2038 compatible system calls.
Firoz Khan (6):
alpha: Move __IGNORE* entries to non uapi header
alpha: Add CONFIG_OSF4_COMPAT for compat syscall support
alpha: Unify the not-implemented system call entry name
alpha: Replace NR_SYSCALLS macro from asm/unistd.h
alpha: Add system call table generation support
alpha: uapi header and system call table file generation
arch/alpha/Makefile | 3 +
arch/alpha/include/asm/Kbuild | 3 +-
arch/alpha/include/asm/unistd.h | 7 +-
arch/alpha/include/uapi/asm/Kbuild | 2 +
arch/alpha/include/uapi/asm/unistd.h | 489 ---------------------------
arch/alpha/kernel/Makefile | 2 +-
arch/alpha/kernel/entry.S | 4 +-
arch/alpha/kernel/osf_sys.c | 9 +-
arch/alpha/kernel/syscall.S | 20 ++
arch/alpha/kernel/syscalls/Makefile | 37 +++
arch/alpha/kernel/syscalls/syscall.tbl | 450 +++++++++++++++++++++++++
arch/alpha/kernel/syscalls/syscallhdr.sh | 33 ++
arch/alpha/kernel/syscalls/syscalltbl.sh | 28 ++
arch/alpha/kernel/systbls.S | 552 -------------------------------
14 files changed, 589 insertions(+), 1050 deletions(-)
delete mode 100644 arch/alpha/include/uapi/asm/unistd.h
create mode 100644 arch/alpha/kernel/syscall.S
create mode 100644 arch/alpha/kernel/syscalls/Makefile
create mode 100644 arch/alpha/kernel/syscalls/syscall.tbl
create mode 100644 arch/alpha/kernel/syscalls/syscallhdr.sh
create mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/alpha/kernel/systbls.S
--
2.7.4
current_time is the last remaining caller of current_kernel_time64(),
which is a wrapper around ktime_get_coarse_real_ts64(). This calls the
latter directly for consistency with the rest of the kernel that is
moving to the ktime_get_ family of time accessors, as now documented
in Documentation/core-api/timekeeping.rst.
An open questions is whether we may want to actually call the more
accurate ktime_get_real_ts64() for file systems that save high-resolution
timestamps in their on-disk format. This would add a small overhead to
each update of the inode stamps but lead to inode timestamps to actually
have a usable resolution better than one jiffy (1 to 10 milliseconds
normally). Experiments on a variety of hardware platforms show a typical
time of around 100 CPU cycles to read the cycle counter and calculate
the accurate time from that. On old platforms without a cycle counter,
this can be signiciantly higher, up to several microseconds to access
a hardware clock, but those have become very rare by now.
I traced the original addition of the current_kernel_time() call to set
the nanosecond fields back to linux-2.5.48, where Andi Kleen added a
patch with subject "nanosecond stat timefields". Andi explains that the
motivation was to introduce as little overhead as possible back then. At
this time, reading the clock hardware was also more expensive when most
architectures did not have a cycle counter.
One side effect of having more accurate inode timestamp would be having
to write out the inode every time that mtime/ctime/atime get touched on
most systems, whereas many file systems today only write it when the
timestamps have changed, i.e. at most once per jiffy unless something
else changes as well. That change would certainly be noticed in some
workloads, which is enough reason to not do it without a good reason,
regardless of the cost of reading the time.
One thing we could still consider however would be to round the timestamps
from current_time() to multiples of NSEC_PER_JIFFY, e.g. full milliseconds
rather than having six or seven meaningless but confusing digits at the
end of the timestamp.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
--
changes in v2:
* wait for Documentation to get merged first, as Dave Chinner requested
* rewrite changelog based on discussion
---
fs/inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index 462eb50b096f..c2dbab9a7cf5 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2105,7 +2105,9 @@ EXPORT_SYMBOL(timespec64_trunc);
*/
struct timespec64 current_time(struct inode *inode)
{
- struct timespec64 now = current_kernel_time64();
+ struct timespec64 now;
+
+ ktime_get_coarse_real_ts64(&now);
if (unlikely(!inode->i_sb)) {
WARN(1, "current_time() called with uninitialized super_block in the inode");
--
2.18.0