* [PATCH 0/6] Introduce struct __kernel_timex
@ 2018-07-03 5:44 Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
2018-07-03 5:44 ` [PATCH 3/6] timex: prepare compat helpers for y2038 changes Deepa Dinamani
0 siblings, 2 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-03 5:44 UTC (permalink / raw)
To: tglx, linux-kernel
Cc: linux-arch, arnd, y2038, catalin.marinas, linux-alpha, netdev,
linux-api, davem
The series introduces struct __kernel_timex as a substitute for
the non y2038 safe struct timex.
The series is based on the original series posted by Arnd Bergmann
in [1].
The overview of the series is as below:
1. Prepare for the compat timex interfaces to be used unconditionally.
2. Introduce struct __kernel_timex.
3. Use struct __kernel_timex in place of struct timex.
4. Switch syscalls to use struct __kernel_timex.
Deepa Dinamani (6):
arm64: Make basic compat_* types always available
sparc: Make thread_info.h available directly
timex: prepare compat helpers for y2038 changes
time: Add struct __kernel_timex
timex: use __kernel_timex internally
timex: change syscalls to use struct __kernel_timex
arch/alpha/kernel/osf_sys.c | 2 +-
arch/arm64/include/asm/compat.h | 22 ++++-----
arch/sparc/include/asm/compat.h | 2 +
drivers/ptp/ptp_clock.c | 2 +-
include/asm-generic/compat.h | 8 +++-
include/linux/compat.h | 33 --------------
include/linux/compat_time.h | 34 ++++++++++++++
include/linux/posix-clock.h | 2 +-
include/linux/syscalls.h | 5 +--
include/linux/timex.h | 9 +++-
include/uapi/linux/timex.h | 41 +++++++++++++++++
kernel/compat.c | 63 --------------------------
kernel/time/ntp.c | 12 ++---
kernel/time/ntp_internal.h | 2 +-
kernel/time/posix-clock.c | 2 +-
kernel/time/posix-timers.c | 14 ++----
kernel/time/posix-timers.h | 2 +-
kernel/time/time.c | 80 ++++++++++++++++++++++++++++++---
kernel/time/timekeeping.c | 4 +-
19 files changed, 198 insertions(+), 141 deletions(-)
base-commit: 69877f06915f1c7a9f1704442993bcc12c13ace2
--
2.17.1
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: linux-alpha@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: netdev@vger.kernel.org
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 0/6] Introduce struct __kernel_timex
2018-07-03 5:44 [PATCH 0/6] Introduce struct __kernel_timex Deepa Dinamani
@ 2018-07-03 5:44 ` Deepa Dinamani
2018-07-03 5:44 ` [PATCH 3/6] timex: prepare compat helpers for y2038 changes Deepa Dinamani
1 sibling, 0 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-03 5:44 UTC (permalink / raw)
To: tglx, linux-kernel
Cc: arnd, y2038, catalin.marinas, davem, linux-alpha, linux-api,
linux-arch, netdev
The series introduces struct __kernel_timex as a substitute for
the non y2038 safe struct timex.
The series is based on the original series posted by Arnd Bergmann
in [1].
The overview of the series is as below:
1. Prepare for the compat timex interfaces to be used unconditionally.
2. Introduce struct __kernel_timex.
3. Use struct __kernel_timex in place of struct timex.
4. Switch syscalls to use struct __kernel_timex.
Deepa Dinamani (6):
arm64: Make basic compat_* types always available
sparc: Make thread_info.h available directly
timex: prepare compat helpers for y2038 changes
time: Add struct __kernel_timex
timex: use __kernel_timex internally
timex: change syscalls to use struct __kernel_timex
arch/alpha/kernel/osf_sys.c | 2 +-
arch/arm64/include/asm/compat.h | 22 ++++-----
arch/sparc/include/asm/compat.h | 2 +
drivers/ptp/ptp_clock.c | 2 +-
include/asm-generic/compat.h | 8 +++-
include/linux/compat.h | 33 --------------
include/linux/compat_time.h | 34 ++++++++++++++
include/linux/posix-clock.h | 2 +-
include/linux/syscalls.h | 5 +--
include/linux/timex.h | 9 +++-
include/uapi/linux/timex.h | 41 +++++++++++++++++
kernel/compat.c | 63 --------------------------
kernel/time/ntp.c | 12 ++---
kernel/time/ntp_internal.h | 2 +-
kernel/time/posix-clock.c | 2 +-
kernel/time/posix-timers.c | 14 ++----
kernel/time/posix-timers.h | 2 +-
kernel/time/time.c | 80 ++++++++++++++++++++++++++++++---
kernel/time/timekeeping.c | 4 +-
19 files changed, 198 insertions(+), 141 deletions(-)
base-commit: 69877f06915f1c7a9f1704442993bcc12c13ace2
--
2.17.1
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: linux-alpha@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: netdev@vger.kernel.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-03 5:44 [PATCH 0/6] Introduce struct __kernel_timex Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
@ 2018-07-03 5:44 ` Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
2018-07-05 7:06 ` kbuild test robot
1 sibling, 2 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-03 5:44 UTC (permalink / raw)
To: tglx, linux-kernel; +Cc: arnd, y2038, linux-arch
Move struct compat_timex to compat_time.h.
This is in line with other compat time structures that are planned
to be deprecated eventually.
Also enable compat_get/put_timex helpers unconditionally.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: linux-arch@vger.kernel.org
---
include/asm-generic/compat.h | 8 ++++-
include/linux/compat.h | 33 -------------------
include/linux/compat_time.h | 34 +++++++++++++++++++
kernel/compat.c | 63 ------------------------------------
kernel/time/time.c | 63 ++++++++++++++++++++++++++++++++++++
5 files changed, 104 insertions(+), 97 deletions(-)
diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h
index 28819451b6d1..d2876f43484f 100644
--- a/include/asm-generic/compat.h
+++ b/include/asm-generic/compat.h
@@ -1,3 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
-/* This is an empty stub for 32-bit-only architectures */
+/* This is a stub for 32-bit-only architectures */
+
+#include <linux/types.h>
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index df45ee8413d6..2ee58590aeae 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -19,8 +19,6 @@
#include <linux/uaccess.h>
#include <linux/unistd.h>
-#include <asm/compat.h>
-
#ifdef CONFIG_COMPAT
#include <asm/siginfo.h>
#include <asm/signal.h>
@@ -136,37 +134,6 @@ struct compat_tms {
compat_clock_t tms_cstime;
};
-struct compat_timex {
- compat_uint_t modes;
- compat_long_t offset;
- compat_long_t freq;
- compat_long_t maxerror;
- compat_long_t esterror;
- compat_int_t status;
- compat_long_t constant;
- compat_long_t precision;
- compat_long_t tolerance;
- struct compat_timeval time;
- compat_long_t tick;
- compat_long_t ppsfreq;
- compat_long_t jitter;
- compat_int_t shift;
- compat_long_t stabil;
- compat_long_t jitcnt;
- compat_long_t calcnt;
- compat_long_t errcnt;
- compat_long_t stbcnt;
- compat_int_t tai;
-
- compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
- compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
- compat_int_t:32; compat_int_t:32; compat_int_t:32;
-};
-
-struct timex;
-int compat_get_timex(struct timex *, const struct compat_timex __user *);
-int compat_put_timex(struct compat_timex __user *, const struct timex *);
-
#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
typedef struct {
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
index e70bfd1d2c3f..f04454e1b863 100644
--- a/include/linux/compat_time.h
+++ b/include/linux/compat_time.h
@@ -7,6 +7,9 @@
typedef s32 compat_time_t;
+/* TODO: Move to linux/compat.h when this file is deleted. */
+#include <asm/compat.h>
+
struct compat_timespec {
compat_time_t tv_sec;
s32 tv_nsec;
@@ -22,11 +25,42 @@ struct compat_itimerspec {
struct compat_timespec it_value;
};
+struct compat_timex {
+ compat_uint_t modes;
+ compat_long_t offset;
+ compat_long_t freq;
+ compat_long_t maxerror;
+ compat_long_t esterror;
+ compat_int_t status;
+ compat_long_t constant;
+ compat_long_t precision;
+ compat_long_t tolerance;
+ struct compat_timeval time;
+ compat_long_t tick;
+ compat_long_t ppsfreq;
+ compat_long_t jitter;
+ compat_int_t shift;
+ compat_long_t stabil;
+ compat_long_t jitcnt;
+ compat_long_t calcnt;
+ compat_long_t errcnt;
+ compat_long_t stbcnt;
+ compat_int_t tai;
+
+ compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
+ compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
+ compat_int_t:32; compat_int_t:32; compat_int_t:32;
+};
+
+
extern int compat_get_timespec64(struct timespec64 *, const void __user *);
extern int compat_put_timespec64(const struct timespec64 *, void __user *);
extern int get_compat_itimerspec64(struct itimerspec64 *its,
const struct compat_itimerspec __user *uits);
extern int put_compat_itimerspec64(const struct itimerspec64 *its,
struct compat_itimerspec __user *uits);
+struct timex;
+int compat_get_timex(struct timex *, const struct compat_timex __user *);
+int compat_put_timex(struct compat_timex __user *, const struct timex *);
#endif /* _LINUX_COMPAT_TIME_H */
diff --git a/kernel/compat.c b/kernel/compat.c
index 8e40efc2928a..e1de768e5607 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -30,69 +30,6 @@
#include <linux/uaccess.h>
-int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
-{
- struct compat_timex tx32;
-
- memset(txc, 0, sizeof(struct timex));
- if (copy_from_user(&tx32, utp, sizeof(struct compat_timex)))
- return -EFAULT;
-
- txc->modes = tx32.modes;
- txc->offset = tx32.offset;
- txc->freq = tx32.freq;
- txc->maxerror = tx32.maxerror;
- txc->esterror = tx32.esterror;
- txc->status = tx32.status;
- txc->constant = tx32.constant;
- txc->precision = tx32.precision;
- txc->tolerance = tx32.tolerance;
- txc->time.tv_sec = tx32.time.tv_sec;
- txc->time.tv_usec = tx32.time.tv_usec;
- txc->tick = tx32.tick;
- txc->ppsfreq = tx32.ppsfreq;
- txc->jitter = tx32.jitter;
- txc->shift = tx32.shift;
- txc->stabil = tx32.stabil;
- txc->jitcnt = tx32.jitcnt;
- txc->calcnt = tx32.calcnt;
- txc->errcnt = tx32.errcnt;
- txc->stbcnt = tx32.stbcnt;
-
- return 0;
-}
-
-int compat_put_timex(struct compat_timex __user *utp, const struct timex *txc)
-{
- struct compat_timex tx32;
-
- memset(&tx32, 0, sizeof(struct compat_timex));
- tx32.modes = txc->modes;
- tx32.offset = txc->offset;
- tx32.freq = txc->freq;
- tx32.maxerror = txc->maxerror;
- tx32.esterror = txc->esterror;
- tx32.status = txc->status;
- tx32.constant = txc->constant;
- tx32.precision = txc->precision;
- tx32.tolerance = txc->tolerance;
- tx32.time.tv_sec = txc->time.tv_sec;
- tx32.time.tv_usec = txc->time.tv_usec;
- tx32.tick = txc->tick;
- tx32.ppsfreq = txc->ppsfreq;
- tx32.jitter = txc->jitter;
- tx32.shift = txc->shift;
- tx32.stabil = txc->stabil;
- tx32.jitcnt = txc->jitcnt;
- tx32.calcnt = txc->calcnt;
- tx32.errcnt = txc->errcnt;
- tx32.stbcnt = txc->stbcnt;
- tx32.tai = txc->tai;
- if (copy_to_user(utp, &tx32, sizeof(struct compat_timex)))
- return -EFAULT;
- return 0;
-}
-
static int __compat_get_timeval(struct timeval *tv, const struct compat_timeval __user *ctv)
{
return (!access_ok(VERIFY_READ, ctv, sizeof(*ctv)) ||
diff --git a/kernel/time/time.c b/kernel/time/time.c
index ccdb351277ee..c40cce820380 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -978,3 +978,66 @@ int put_compat_itimerspec64(const struct itimerspec64 *its,
return 0;
}
EXPORT_SYMBOL_GPL(put_compat_itimerspec64);
+
+int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
+{
+ struct compat_timex tx32;
+
+ memset(txc, 0, sizeof(struct timex));
+ if (copy_from_user(&tx32, utp, sizeof(struct compat_timex)))
+ return -EFAULT;
+
+ txc->modes = tx32.modes;
+ txc->offset = tx32.offset;
+ txc->freq = tx32.freq;
+ txc->maxerror = tx32.maxerror;
+ txc->esterror = tx32.esterror;
+ txc->status = tx32.status;
+ txc->constant = tx32.constant;
+ txc->precision = tx32.precision;
+ txc->tolerance = tx32.tolerance;
+ txc->time.tv_sec = tx32.time.tv_sec;
+ txc->time.tv_usec = tx32.time.tv_usec;
+ txc->tick = tx32.tick;
+ txc->ppsfreq = tx32.ppsfreq;
+ txc->jitter = tx32.jitter;
+ txc->shift = tx32.shift;
+ txc->stabil = tx32.stabil;
+ txc->jitcnt = tx32.jitcnt;
+ txc->calcnt = tx32.calcnt;
+ txc->errcnt = tx32.errcnt;
+ txc->stbcnt = tx32.stbcnt;
+
+ return 0;
+}
+
+int compat_put_timex(struct compat_timex __user *utp, const struct timex *txc)
+{
+ struct compat_timex tx32;
+
+ memset(&tx32, 0, sizeof(struct compat_timex));
+ tx32.modes = txc->modes;
+ tx32.offset = txc->offset;
+ tx32.freq = txc->freq;
+ tx32.maxerror = txc->maxerror;
+ tx32.esterror = txc->esterror;
+ tx32.status = txc->status;
+ tx32.constant = txc->constant;
+ tx32.precision = txc->precision;
+ tx32.tolerance = txc->tolerance;
+ tx32.time.tv_sec = txc->time.tv_sec;
+ tx32.time.tv_usec = txc->time.tv_usec;
+ tx32.tick = txc->tick;
+ tx32.ppsfreq = txc->ppsfreq;
+ tx32.jitter = txc->jitter;
+ tx32.shift = txc->shift;
+ tx32.stabil = txc->stabil;
+ tx32.jitcnt = txc->jitcnt;
+ tx32.calcnt = txc->calcnt;
+ tx32.errcnt = txc->errcnt;
+ tx32.stbcnt = txc->stbcnt;
+ tx32.tai = txc->tai;
+ if (copy_to_user(utp, &tx32, sizeof(struct compat_timex)))
+ return -EFAULT;
+ return 0;
+}
--
2.17.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-03 5:44 ` [PATCH 3/6] timex: prepare compat helpers for y2038 changes Deepa Dinamani
@ 2018-07-03 5:44 ` Deepa Dinamani
2018-07-05 7:06 ` kbuild test robot
1 sibling, 0 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-03 5:44 UTC (permalink / raw)
To: tglx, linux-kernel; +Cc: arnd, y2038, linux-arch
Move struct compat_timex to compat_time.h.
This is in line with other compat time structures that are planned
to be deprecated eventually.
Also enable compat_get/put_timex helpers unconditionally.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: linux-arch@vger.kernel.org
---
include/asm-generic/compat.h | 8 ++++-
include/linux/compat.h | 33 -------------------
include/linux/compat_time.h | 34 +++++++++++++++++++
kernel/compat.c | 63 ------------------------------------
kernel/time/time.c | 63 ++++++++++++++++++++++++++++++++++++
5 files changed, 104 insertions(+), 97 deletions(-)
diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h
index 28819451b6d1..d2876f43484f 100644
--- a/include/asm-generic/compat.h
+++ b/include/asm-generic/compat.h
@@ -1,3 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
-/* This is an empty stub for 32-bit-only architectures */
+/* This is a stub for 32-bit-only architectures */
+
+#include <linux/types.h>
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index df45ee8413d6..2ee58590aeae 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -19,8 +19,6 @@
#include <linux/uaccess.h>
#include <linux/unistd.h>
-#include <asm/compat.h>
-
#ifdef CONFIG_COMPAT
#include <asm/siginfo.h>
#include <asm/signal.h>
@@ -136,37 +134,6 @@ struct compat_tms {
compat_clock_t tms_cstime;
};
-struct compat_timex {
- compat_uint_t modes;
- compat_long_t offset;
- compat_long_t freq;
- compat_long_t maxerror;
- compat_long_t esterror;
- compat_int_t status;
- compat_long_t constant;
- compat_long_t precision;
- compat_long_t tolerance;
- struct compat_timeval time;
- compat_long_t tick;
- compat_long_t ppsfreq;
- compat_long_t jitter;
- compat_int_t shift;
- compat_long_t stabil;
- compat_long_t jitcnt;
- compat_long_t calcnt;
- compat_long_t errcnt;
- compat_long_t stbcnt;
- compat_int_t tai;
-
- compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
- compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
- compat_int_t:32; compat_int_t:32; compat_int_t:32;
-};
-
-struct timex;
-int compat_get_timex(struct timex *, const struct compat_timex __user *);
-int compat_put_timex(struct compat_timex __user *, const struct timex *);
-
#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
typedef struct {
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
index e70bfd1d2c3f..f04454e1b863 100644
--- a/include/linux/compat_time.h
+++ b/include/linux/compat_time.h
@@ -7,6 +7,9 @@
typedef s32 compat_time_t;
+/* TODO: Move to linux/compat.h when this file is deleted. */
+#include <asm/compat.h>
+
struct compat_timespec {
compat_time_t tv_sec;
s32 tv_nsec;
@@ -22,11 +25,42 @@ struct compat_itimerspec {
struct compat_timespec it_value;
};
+struct compat_timex {
+ compat_uint_t modes;
+ compat_long_t offset;
+ compat_long_t freq;
+ compat_long_t maxerror;
+ compat_long_t esterror;
+ compat_int_t status;
+ compat_long_t constant;
+ compat_long_t precision;
+ compat_long_t tolerance;
+ struct compat_timeval time;
+ compat_long_t tick;
+ compat_long_t ppsfreq;
+ compat_long_t jitter;
+ compat_int_t shift;
+ compat_long_t stabil;
+ compat_long_t jitcnt;
+ compat_long_t calcnt;
+ compat_long_t errcnt;
+ compat_long_t stbcnt;
+ compat_int_t tai;
+
+ compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
+ compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
+ compat_int_t:32; compat_int_t:32; compat_int_t:32;
+};
+
+
extern int compat_get_timespec64(struct timespec64 *, const void __user *);
extern int compat_put_timespec64(const struct timespec64 *, void __user *);
extern int get_compat_itimerspec64(struct itimerspec64 *its,
const struct compat_itimerspec __user *uits);
extern int put_compat_itimerspec64(const struct itimerspec64 *its,
struct compat_itimerspec __user *uits);
+struct timex;
+int compat_get_timex(struct timex *, const struct compat_timex __user *);
+int compat_put_timex(struct compat_timex __user *, const struct timex *);
#endif /* _LINUX_COMPAT_TIME_H */
diff --git a/kernel/compat.c b/kernel/compat.c
index 8e40efc2928a..e1de768e5607 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -30,69 +30,6 @@
#include <linux/uaccess.h>
-int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
-{
- struct compat_timex tx32;
-
- memset(txc, 0, sizeof(struct timex));
- if (copy_from_user(&tx32, utp, sizeof(struct compat_timex)))
- return -EFAULT;
-
- txc->modes = tx32.modes;
- txc->offset = tx32.offset;
- txc->freq = tx32.freq;
- txc->maxerror = tx32.maxerror;
- txc->esterror = tx32.esterror;
- txc->status = tx32.status;
- txc->constant = tx32.constant;
- txc->precision = tx32.precision;
- txc->tolerance = tx32.tolerance;
- txc->time.tv_sec = tx32.time.tv_sec;
- txc->time.tv_usec = tx32.time.tv_usec;
- txc->tick = tx32.tick;
- txc->ppsfreq = tx32.ppsfreq;
- txc->jitter = tx32.jitter;
- txc->shift = tx32.shift;
- txc->stabil = tx32.stabil;
- txc->jitcnt = tx32.jitcnt;
- txc->calcnt = tx32.calcnt;
- txc->errcnt = tx32.errcnt;
- txc->stbcnt = tx32.stbcnt;
-
- return 0;
-}
-
-int compat_put_timex(struct compat_timex __user *utp, const struct timex *txc)
-{
- struct compat_timex tx32;
-
- memset(&tx32, 0, sizeof(struct compat_timex));
- tx32.modes = txc->modes;
- tx32.offset = txc->offset;
- tx32.freq = txc->freq;
- tx32.maxerror = txc->maxerror;
- tx32.esterror = txc->esterror;
- tx32.status = txc->status;
- tx32.constant = txc->constant;
- tx32.precision = txc->precision;
- tx32.tolerance = txc->tolerance;
- tx32.time.tv_sec = txc->time.tv_sec;
- tx32.time.tv_usec = txc->time.tv_usec;
- tx32.tick = txc->tick;
- tx32.ppsfreq = txc->ppsfreq;
- tx32.jitter = txc->jitter;
- tx32.shift = txc->shift;
- tx32.stabil = txc->stabil;
- tx32.jitcnt = txc->jitcnt;
- tx32.calcnt = txc->calcnt;
- tx32.errcnt = txc->errcnt;
- tx32.stbcnt = txc->stbcnt;
- tx32.tai = txc->tai;
- if (copy_to_user(utp, &tx32, sizeof(struct compat_timex)))
- return -EFAULT;
- return 0;
-}
-
static int __compat_get_timeval(struct timeval *tv, const struct compat_timeval __user *ctv)
{
return (!access_ok(VERIFY_READ, ctv, sizeof(*ctv)) ||
diff --git a/kernel/time/time.c b/kernel/time/time.c
index ccdb351277ee..c40cce820380 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -978,3 +978,66 @@ int put_compat_itimerspec64(const struct itimerspec64 *its,
return 0;
}
EXPORT_SYMBOL_GPL(put_compat_itimerspec64);
+
+int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
+{
+ struct compat_timex tx32;
+
+ memset(txc, 0, sizeof(struct timex));
+ if (copy_from_user(&tx32, utp, sizeof(struct compat_timex)))
+ return -EFAULT;
+
+ txc->modes = tx32.modes;
+ txc->offset = tx32.offset;
+ txc->freq = tx32.freq;
+ txc->maxerror = tx32.maxerror;
+ txc->esterror = tx32.esterror;
+ txc->status = tx32.status;
+ txc->constant = tx32.constant;
+ txc->precision = tx32.precision;
+ txc->tolerance = tx32.tolerance;
+ txc->time.tv_sec = tx32.time.tv_sec;
+ txc->time.tv_usec = tx32.time.tv_usec;
+ txc->tick = tx32.tick;
+ txc->ppsfreq = tx32.ppsfreq;
+ txc->jitter = tx32.jitter;
+ txc->shift = tx32.shift;
+ txc->stabil = tx32.stabil;
+ txc->jitcnt = tx32.jitcnt;
+ txc->calcnt = tx32.calcnt;
+ txc->errcnt = tx32.errcnt;
+ txc->stbcnt = tx32.stbcnt;
+
+ return 0;
+}
+
+int compat_put_timex(struct compat_timex __user *utp, const struct timex *txc)
+{
+ struct compat_timex tx32;
+
+ memset(&tx32, 0, sizeof(struct compat_timex));
+ tx32.modes = txc->modes;
+ tx32.offset = txc->offset;
+ tx32.freq = txc->freq;
+ tx32.maxerror = txc->maxerror;
+ tx32.esterror = txc->esterror;
+ tx32.status = txc->status;
+ tx32.constant = txc->constant;
+ tx32.precision = txc->precision;
+ tx32.tolerance = txc->tolerance;
+ tx32.time.tv_sec = txc->time.tv_sec;
+ tx32.time.tv_usec = txc->time.tv_usec;
+ tx32.tick = txc->tick;
+ tx32.ppsfreq = txc->ppsfreq;
+ tx32.jitter = txc->jitter;
+ tx32.shift = txc->shift;
+ tx32.stabil = txc->stabil;
+ tx32.jitcnt = txc->jitcnt;
+ tx32.calcnt = txc->calcnt;
+ tx32.errcnt = txc->errcnt;
+ tx32.stbcnt = txc->stbcnt;
+ tx32.tai = txc->tai;
+ if (copy_to_user(utp, &tx32, sizeof(struct compat_timex)))
+ return -EFAULT;
+ return 0;
+}
--
2.17.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-03 5:44 ` [PATCH 3/6] timex: prepare compat helpers for y2038 changes Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
@ 2018-07-05 7:06 ` kbuild test robot
2018-07-05 7:06 ` kbuild test robot
2018-07-05 20:06 ` Deepa Dinamani
1 sibling, 2 replies; 14+ messages in thread
From: kbuild test robot @ 2018-07-05 7:06 UTC (permalink / raw)
To: Deepa Dinamani; +Cc: kbuild-all, tglx, linux-kernel, arnd, y2038, linux-arch
[-- Attachment #1: Type: text/plain, Size: 4651 bytes --]
Hi Deepa,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/timers/core]
[also build test ERROR on next-20180704]
[cannot apply to linus/master v4.18-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Deepa-Dinamani/arm64-Make-basic-compat_-types-always-available/20180703-151440
config: riscv-defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 8.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=riscv
All errors (new ones prefixed by >>):
In file included from include/linux/compat.h:10,
from include/linux/ethtool.h:17,
from include/linux/netdevice.h:41,
from drivers/net/mii.c:32:
>> include/linux/compat_time.h:29:2: error: unknown type name 'compat_uint_t'
compat_uint_t modes;
^~~~~~~~~~~~~
>> include/linux/compat_time.h:30:2: error: unknown type name 'compat_long_t'
compat_long_t offset;
^~~~~~~~~~~~~
include/linux/compat_time.h:31:2: error: unknown type name 'compat_long_t'
compat_long_t freq;
^~~~~~~~~~~~~
include/linux/compat_time.h:32:2: error: unknown type name 'compat_long_t'
compat_long_t maxerror;
^~~~~~~~~~~~~
include/linux/compat_time.h:33:2: error: unknown type name 'compat_long_t'
compat_long_t esterror;
^~~~~~~~~~~~~
>> include/linux/compat_time.h:34:2: error: unknown type name 'compat_int_t'
compat_int_t status;
^~~~~~~~~~~~
include/linux/compat_time.h:35:2: error: unknown type name 'compat_long_t'
compat_long_t constant;
^~~~~~~~~~~~~
include/linux/compat_time.h:36:2: error: unknown type name 'compat_long_t'
compat_long_t precision;
^~~~~~~~~~~~~
include/linux/compat_time.h:37:2: error: unknown type name 'compat_long_t'
compat_long_t tolerance;
^~~~~~~~~~~~~
include/linux/compat_time.h:39:2: error: unknown type name 'compat_long_t'
compat_long_t tick;
^~~~~~~~~~~~~
include/linux/compat_time.h:40:2: error: unknown type name 'compat_long_t'
compat_long_t ppsfreq;
^~~~~~~~~~~~~
include/linux/compat_time.h:41:2: error: unknown type name 'compat_long_t'
compat_long_t jitter;
^~~~~~~~~~~~~
include/linux/compat_time.h:42:2: error: unknown type name 'compat_int_t'
compat_int_t shift;
^~~~~~~~~~~~
include/linux/compat_time.h:43:2: error: unknown type name 'compat_long_t'
compat_long_t stabil;
^~~~~~~~~~~~~
include/linux/compat_time.h:44:2: error: unknown type name 'compat_long_t'
compat_long_t jitcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:45:2: error: unknown type name 'compat_long_t'
compat_long_t calcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:46:2: error: unknown type name 'compat_long_t'
compat_long_t errcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:47:2: error: unknown type name 'compat_long_t'
compat_long_t stbcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:48:2: error: unknown type name 'compat_int_t'
compat_int_t tai;
^~~~~~~~~~~~
>> include/linux/compat_time.h:50:2: error: expected specifier-qualifier-list before 'compat_int_t'
compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
^~~~~~~~~~~~
vim +/compat_uint_t +29 include/linux/compat_time.h
27
28 struct compat_timex {
> 29 compat_uint_t modes;
> 30 compat_long_t offset;
> 31 compat_long_t freq;
32 compat_long_t maxerror;
33 compat_long_t esterror;
> 34 compat_int_t status;
35 compat_long_t constant;
36 compat_long_t precision;
37 compat_long_t tolerance;
38 struct compat_timeval time;
39 compat_long_t tick;
40 compat_long_t ppsfreq;
41 compat_long_t jitter;
42 compat_int_t shift;
43 compat_long_t stabil;
44 compat_long_t jitcnt;
45 compat_long_t calcnt;
> 46 compat_long_t errcnt;
47 compat_long_t stbcnt;
48 compat_int_t tai;
49
> 50 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
51 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
52 compat_int_t:32; compat_int_t:32; compat_int_t:32;
53 };
54
55
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 16325 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 7:06 ` kbuild test robot
@ 2018-07-05 7:06 ` kbuild test robot
2018-07-05 20:06 ` Deepa Dinamani
1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2018-07-05 7:06 UTC (permalink / raw)
To: Deepa Dinamani; +Cc: kbuild-all, tglx, linux-kernel, arnd, y2038, linux-arch
[-- Attachment #1: Type: text/plain, Size: 4651 bytes --]
Hi Deepa,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/timers/core]
[also build test ERROR on next-20180704]
[cannot apply to linus/master v4.18-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Deepa-Dinamani/arm64-Make-basic-compat_-types-always-available/20180703-151440
config: riscv-defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 8.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=riscv
All errors (new ones prefixed by >>):
In file included from include/linux/compat.h:10,
from include/linux/ethtool.h:17,
from include/linux/netdevice.h:41,
from drivers/net/mii.c:32:
>> include/linux/compat_time.h:29:2: error: unknown type name 'compat_uint_t'
compat_uint_t modes;
^~~~~~~~~~~~~
>> include/linux/compat_time.h:30:2: error: unknown type name 'compat_long_t'
compat_long_t offset;
^~~~~~~~~~~~~
include/linux/compat_time.h:31:2: error: unknown type name 'compat_long_t'
compat_long_t freq;
^~~~~~~~~~~~~
include/linux/compat_time.h:32:2: error: unknown type name 'compat_long_t'
compat_long_t maxerror;
^~~~~~~~~~~~~
include/linux/compat_time.h:33:2: error: unknown type name 'compat_long_t'
compat_long_t esterror;
^~~~~~~~~~~~~
>> include/linux/compat_time.h:34:2: error: unknown type name 'compat_int_t'
compat_int_t status;
^~~~~~~~~~~~
include/linux/compat_time.h:35:2: error: unknown type name 'compat_long_t'
compat_long_t constant;
^~~~~~~~~~~~~
include/linux/compat_time.h:36:2: error: unknown type name 'compat_long_t'
compat_long_t precision;
^~~~~~~~~~~~~
include/linux/compat_time.h:37:2: error: unknown type name 'compat_long_t'
compat_long_t tolerance;
^~~~~~~~~~~~~
include/linux/compat_time.h:39:2: error: unknown type name 'compat_long_t'
compat_long_t tick;
^~~~~~~~~~~~~
include/linux/compat_time.h:40:2: error: unknown type name 'compat_long_t'
compat_long_t ppsfreq;
^~~~~~~~~~~~~
include/linux/compat_time.h:41:2: error: unknown type name 'compat_long_t'
compat_long_t jitter;
^~~~~~~~~~~~~
include/linux/compat_time.h:42:2: error: unknown type name 'compat_int_t'
compat_int_t shift;
^~~~~~~~~~~~
include/linux/compat_time.h:43:2: error: unknown type name 'compat_long_t'
compat_long_t stabil;
^~~~~~~~~~~~~
include/linux/compat_time.h:44:2: error: unknown type name 'compat_long_t'
compat_long_t jitcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:45:2: error: unknown type name 'compat_long_t'
compat_long_t calcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:46:2: error: unknown type name 'compat_long_t'
compat_long_t errcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:47:2: error: unknown type name 'compat_long_t'
compat_long_t stbcnt;
^~~~~~~~~~~~~
include/linux/compat_time.h:48:2: error: unknown type name 'compat_int_t'
compat_int_t tai;
^~~~~~~~~~~~
>> include/linux/compat_time.h:50:2: error: expected specifier-qualifier-list before 'compat_int_t'
compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
^~~~~~~~~~~~
vim +/compat_uint_t +29 include/linux/compat_time.h
27
28 struct compat_timex {
> 29 compat_uint_t modes;
> 30 compat_long_t offset;
> 31 compat_long_t freq;
32 compat_long_t maxerror;
33 compat_long_t esterror;
> 34 compat_int_t status;
35 compat_long_t constant;
36 compat_long_t precision;
37 compat_long_t tolerance;
38 struct compat_timeval time;
39 compat_long_t tick;
40 compat_long_t ppsfreq;
41 compat_long_t jitter;
42 compat_int_t shift;
43 compat_long_t stabil;
44 compat_long_t jitcnt;
45 compat_long_t calcnt;
> 46 compat_long_t errcnt;
47 compat_long_t stbcnt;
48 compat_int_t tai;
49
> 50 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
51 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
52 compat_int_t:32; compat_int_t:32; compat_int_t:32;
53 };
54
55
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 16325 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 7:06 ` kbuild test robot
2018-07-05 7:06 ` kbuild test robot
@ 2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:33 ` Thomas Gleixner
1 sibling, 2 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-05 20:06 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Thomas Gleixner, Linux Kernel Mailing List,
Arnd Bergmann, y2038 Mailman List, linux-arch, palmer,
linux-riscv
The error is fixed with the following patch that goes in before patch
3/6 above in the series.
Let me know if I should post a v2 instead.
Thanks,
Deepa
commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
Author: Deepa Dinamani <deepa.kernel@gmail.com>
Date: Thu Jul 5 11:47:25 2018 -0700
riscv: Include asm-generic/compat.h
riscv does not enable CONFIG_COMPAT in default configurations:
defconfig, allmodconfig and nomodconfig.
And hence does not inlude definitions for compat data types.
Now that time syscalls are being reused in non CONFIG_COMPAT
modes, include asm-generic definitions for riscv.
Alternative would be to make compat_time.h to be conditional on
CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
asm/compat.h include the generic version instead.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: palmer@sifive.com
Cc: linux-riscv@lists.infradead.org
diff --git a/arch/riscv/include/asm/compat.h b/arch/riscv/include/asm/compat.h
index 044aecff8854..e78c5054e178 100644
--- a/arch/riscv/include/asm/compat.h
+++ b/arch/riscv/include/asm/compat.h
@@ -15,6 +15,9 @@
*/
#ifndef __ASM_COMPAT_H
#define __ASM_COMPAT_H
+
+#include <asm-generic/compat.h>
+
#ifdef CONFIG_COMPAT
#if defined(CONFIG_64BIT)
On Thu, Jul 5, 2018 at 12:06 AM, kbuild test robot <lkp@intel.com> wrote:
> Hi Deepa,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on tip/timers/core]
> [also build test ERROR on next-20180704]
> [cannot apply to linus/master v4.18-rc3]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Deepa-Dinamani/arm64-Make-basic-compat_-types-always-available/20180703-151440
> config: riscv-defconfig (attached as .config)
> compiler: riscv64-linux-gcc (GCC) 8.1.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=8.1.0 make.cross ARCH=riscv
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/compat.h:10,
> from include/linux/ethtool.h:17,
> from include/linux/netdevice.h:41,
> from drivers/net/mii.c:32:
>>> include/linux/compat_time.h:29:2: error: unknown type name 'compat_uint_t'
> compat_uint_t modes;
> ^~~~~~~~~~~~~
>>> include/linux/compat_time.h:30:2: error: unknown type name 'compat_long_t'
> compat_long_t offset;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:31:2: error: unknown type name 'compat_long_t'
> compat_long_t freq;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:32:2: error: unknown type name 'compat_long_t'
> compat_long_t maxerror;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:33:2: error: unknown type name 'compat_long_t'
> compat_long_t esterror;
> ^~~~~~~~~~~~~
>>> include/linux/compat_time.h:34:2: error: unknown type name 'compat_int_t'
> compat_int_t status;
> ^~~~~~~~~~~~
> include/linux/compat_time.h:35:2: error: unknown type name 'compat_long_t'
> compat_long_t constant;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:36:2: error: unknown type name 'compat_long_t'
> compat_long_t precision;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:37:2: error: unknown type name 'compat_long_t'
> compat_long_t tolerance;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:39:2: error: unknown type name 'compat_long_t'
> compat_long_t tick;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:40:2: error: unknown type name 'compat_long_t'
> compat_long_t ppsfreq;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:41:2: error: unknown type name 'compat_long_t'
> compat_long_t jitter;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:42:2: error: unknown type name 'compat_int_t'
> compat_int_t shift;
> ^~~~~~~~~~~~
> include/linux/compat_time.h:43:2: error: unknown type name 'compat_long_t'
> compat_long_t stabil;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:44:2: error: unknown type name 'compat_long_t'
> compat_long_t jitcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:45:2: error: unknown type name 'compat_long_t'
> compat_long_t calcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:46:2: error: unknown type name 'compat_long_t'
> compat_long_t errcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:47:2: error: unknown type name 'compat_long_t'
> compat_long_t stbcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:48:2: error: unknown type name 'compat_int_t'
> compat_int_t tai;
> ^~~~~~~~~~~~
>>> include/linux/compat_time.h:50:2: error: expected specifier-qualifier-list before 'compat_int_t'
> compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> ^~~~~~~~~~~~
>
> vim +/compat_uint_t +29 include/linux/compat_time.h
>
> 27
> 28 struct compat_timex {
> > 29 compat_uint_t modes;
> > 30 compat_long_t offset;
> > 31 compat_long_t freq;
> 32 compat_long_t maxerror;
> 33 compat_long_t esterror;
> > 34 compat_int_t status;
> 35 compat_long_t constant;
> 36 compat_long_t precision;
> 37 compat_long_t tolerance;
> 38 struct compat_timeval time;
> 39 compat_long_t tick;
> 40 compat_long_t ppsfreq;
> 41 compat_long_t jitter;
> 42 compat_int_t shift;
> 43 compat_long_t stabil;
> 44 compat_long_t jitcnt;
> 45 compat_long_t calcnt;
> > 46 compat_long_t errcnt;
> 47 compat_long_t stbcnt;
> 48 compat_int_t tai;
> 49
> > 50 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 51 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 52 compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 53 };
> 54
> 55
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 20:06 ` Deepa Dinamani
@ 2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:33 ` Thomas Gleixner
1 sibling, 0 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-05 20:06 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Thomas Gleixner, Linux Kernel Mailing List,
Arnd Bergmann, y2038 Mailman List, linux-arch, palmer,
linux-riscv
The error is fixed with the following patch that goes in before patch
3/6 above in the series.
Let me know if I should post a v2 instead.
Thanks,
Deepa
commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
Author: Deepa Dinamani <deepa.kernel@gmail.com>
Date: Thu Jul 5 11:47:25 2018 -0700
riscv: Include asm-generic/compat.h
riscv does not enable CONFIG_COMPAT in default configurations:
defconfig, allmodconfig and nomodconfig.
And hence does not inlude definitions for compat data types.
Now that time syscalls are being reused in non CONFIG_COMPAT
modes, include asm-generic definitions for riscv.
Alternative would be to make compat_time.h to be conditional on
CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
asm/compat.h include the generic version instead.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: palmer@sifive.com
Cc: linux-riscv@lists.infradead.org
diff --git a/arch/riscv/include/asm/compat.h b/arch/riscv/include/asm/compat.h
index 044aecff8854..e78c5054e178 100644
--- a/arch/riscv/include/asm/compat.h
+++ b/arch/riscv/include/asm/compat.h
@@ -15,6 +15,9 @@
*/
#ifndef __ASM_COMPAT_H
#define __ASM_COMPAT_H
+
+#include <asm-generic/compat.h>
+
#ifdef CONFIG_COMPAT
#if defined(CONFIG_64BIT)
On Thu, Jul 5, 2018 at 12:06 AM, kbuild test robot <lkp@intel.com> wrote:
> Hi Deepa,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on tip/timers/core]
> [also build test ERROR on next-20180704]
> [cannot apply to linus/master v4.18-rc3]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Deepa-Dinamani/arm64-Make-basic-compat_-types-always-available/20180703-151440
> config: riscv-defconfig (attached as .config)
> compiler: riscv64-linux-gcc (GCC) 8.1.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=8.1.0 make.cross ARCH=riscv
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/compat.h:10,
> from include/linux/ethtool.h:17,
> from include/linux/netdevice.h:41,
> from drivers/net/mii.c:32:
>>> include/linux/compat_time.h:29:2: error: unknown type name 'compat_uint_t'
> compat_uint_t modes;
> ^~~~~~~~~~~~~
>>> include/linux/compat_time.h:30:2: error: unknown type name 'compat_long_t'
> compat_long_t offset;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:31:2: error: unknown type name 'compat_long_t'
> compat_long_t freq;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:32:2: error: unknown type name 'compat_long_t'
> compat_long_t maxerror;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:33:2: error: unknown type name 'compat_long_t'
> compat_long_t esterror;
> ^~~~~~~~~~~~~
>>> include/linux/compat_time.h:34:2: error: unknown type name 'compat_int_t'
> compat_int_t status;
> ^~~~~~~~~~~~
> include/linux/compat_time.h:35:2: error: unknown type name 'compat_long_t'
> compat_long_t constant;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:36:2: error: unknown type name 'compat_long_t'
> compat_long_t precision;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:37:2: error: unknown type name 'compat_long_t'
> compat_long_t tolerance;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:39:2: error: unknown type name 'compat_long_t'
> compat_long_t tick;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:40:2: error: unknown type name 'compat_long_t'
> compat_long_t ppsfreq;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:41:2: error: unknown type name 'compat_long_t'
> compat_long_t jitter;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:42:2: error: unknown type name 'compat_int_t'
> compat_int_t shift;
> ^~~~~~~~~~~~
> include/linux/compat_time.h:43:2: error: unknown type name 'compat_long_t'
> compat_long_t stabil;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:44:2: error: unknown type name 'compat_long_t'
> compat_long_t jitcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:45:2: error: unknown type name 'compat_long_t'
> compat_long_t calcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:46:2: error: unknown type name 'compat_long_t'
> compat_long_t errcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:47:2: error: unknown type name 'compat_long_t'
> compat_long_t stbcnt;
> ^~~~~~~~~~~~~
> include/linux/compat_time.h:48:2: error: unknown type name 'compat_int_t'
> compat_int_t tai;
> ^~~~~~~~~~~~
>>> include/linux/compat_time.h:50:2: error: expected specifier-qualifier-list before 'compat_int_t'
> compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> ^~~~~~~~~~~~
>
> vim +/compat_uint_t +29 include/linux/compat_time.h
>
> 27
> 28 struct compat_timex {
> > 29 compat_uint_t modes;
> > 30 compat_long_t offset;
> > 31 compat_long_t freq;
> 32 compat_long_t maxerror;
> 33 compat_long_t esterror;
> > 34 compat_int_t status;
> 35 compat_long_t constant;
> 36 compat_long_t precision;
> 37 compat_long_t tolerance;
> 38 struct compat_timeval time;
> 39 compat_long_t tick;
> 40 compat_long_t ppsfreq;
> 41 compat_long_t jitter;
> 42 compat_int_t shift;
> 43 compat_long_t stabil;
> 44 compat_long_t jitcnt;
> 45 compat_long_t calcnt;
> > 46 compat_long_t errcnt;
> 47 compat_long_t stbcnt;
> 48 compat_int_t tai;
> 49
> > 50 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 51 compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 52 compat_int_t:32; compat_int_t:32; compat_int_t:32;
> 53 };
> 54
> 55
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:06 ` Deepa Dinamani
@ 2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 21:45 ` Deepa Dinamani
1 sibling, 2 replies; 14+ messages in thread
From: Thomas Gleixner @ 2018-07-05 20:33 UTC (permalink / raw)
To: Deepa Dinamani
Cc: linux-arch, kbuild test robot, Arnd Bergmann, y2038 Mailman List,
palmer, Linux Kernel Mailing List, kbuild-all, linux-riscv
On Thu, 5 Jul 2018, Deepa Dinamani wrote:
> The error is fixed with the following patch that goes in before patch
> 3/6 above in the series.
> Let me know if I should post a v2 instead.
>
> Thanks,
> Deepa
>
>
> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
> Author: Deepa Dinamani <deepa.kernel@gmail.com>
> Date: Thu Jul 5 11:47:25 2018 -0700
>
> riscv: Include asm-generic/compat.h
>
> riscv does not enable CONFIG_COMPAT in default configurations:
> defconfig, allmodconfig and nomodconfig.
> And hence does not inlude definitions for compat data types.
>
> Now that time syscalls are being reused in non CONFIG_COMPAT
> modes, include asm-generic definitions for riscv.
>
> Alternative would be to make compat_time.h to be conditional on
> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
> asm/compat.h include the generic version instead.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: palmer@sifive.com
> Cc: linux-riscv@lists.infradead.org
Post a real patch please instead of something which I have to cleanup
manually. A V2 of the series is probably the simplest way.
Thanks,
tglx
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 20:33 ` Thomas Gleixner
@ 2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 21:45 ` Deepa Dinamani
1 sibling, 0 replies; 14+ messages in thread
From: Thomas Gleixner @ 2018-07-05 20:33 UTC (permalink / raw)
To: Deepa Dinamani
Cc: kbuild test robot, kbuild-all, Linux Kernel Mailing List,
Arnd Bergmann, y2038 Mailman List, linux-arch, palmer,
linux-riscv
On Thu, 5 Jul 2018, Deepa Dinamani wrote:
> The error is fixed with the following patch that goes in before patch
> 3/6 above in the series.
> Let me know if I should post a v2 instead.
>
> Thanks,
> Deepa
>
>
> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
> Author: Deepa Dinamani <deepa.kernel@gmail.com>
> Date: Thu Jul 5 11:47:25 2018 -0700
>
> riscv: Include asm-generic/compat.h
>
> riscv does not enable CONFIG_COMPAT in default configurations:
> defconfig, allmodconfig and nomodconfig.
> And hence does not inlude definitions for compat data types.
>
> Now that time syscalls are being reused in non CONFIG_COMPAT
> modes, include asm-generic definitions for riscv.
>
> Alternative would be to make compat_time.h to be conditional on
> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
> asm/compat.h include the generic version instead.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: palmer@sifive.com
> Cc: linux-riscv@lists.infradead.org
Post a real patch please instead of something which I have to cleanup
manually. A V2 of the series is probably the simplest way.
Thanks,
tglx
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 20:33 ` Thomas Gleixner
@ 2018-07-05 21:45 ` Deepa Dinamani
2018-07-05 21:45 ` Deepa Dinamani
2018-07-06 0:41 ` [kbuild-all] " Philip Li
1 sibling, 2 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-05 21:45 UTC (permalink / raw)
To: Thomas Gleixner, kernel test robot
Cc: kbuild test robot, kbuild-all, Linux Kernel Mailing List,
Arnd Bergmann, y2038 Mailman List, linux-arch, palmer,
linux-riscv
Posted v2 now.
Fengguang,
Also the make.cross script pointed to by the kernel test bot is broken
for riscv.
I applied the following fix to compile it.
Pull request: https://github.com/intel/lkp-tests/pull/11
Thanks,
Deepa
On Thu, Jul 5, 2018 at 1:33 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Thu, 5 Jul 2018, Deepa Dinamani wrote:
>
>> The error is fixed with the following patch that goes in before patch
>> 3/6 above in the series.
>> Let me know if I should post a v2 instead.
>>
>> Thanks,
>> Deepa
>>
>>
>> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
>> Author: Deepa Dinamani <deepa.kernel@gmail.com>
>> Date: Thu Jul 5 11:47:25 2018 -0700
>>
>> riscv: Include asm-generic/compat.h
>>
>> riscv does not enable CONFIG_COMPAT in default configurations:
>> defconfig, allmodconfig and nomodconfig.
>> And hence does not inlude definitions for compat data types.
>>
>> Now that time syscalls are being reused in non CONFIG_COMPAT
>> modes, include asm-generic definitions for riscv.
>>
>> Alternative would be to make compat_time.h to be conditional on
>> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
>> asm/compat.h include the generic version instead.
>>
>> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
>> Cc: palmer@sifive.com
>> Cc: linux-riscv@lists.infradead.org
>
> Post a real patch please instead of something which I have to cleanup
> manually. A V2 of the series is probably the simplest way.
>
> Thanks,
>
> tglx
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 21:45 ` Deepa Dinamani
@ 2018-07-05 21:45 ` Deepa Dinamani
2018-07-06 0:41 ` [kbuild-all] " Philip Li
1 sibling, 0 replies; 14+ messages in thread
From: Deepa Dinamani @ 2018-07-05 21:45 UTC (permalink / raw)
To: Thomas Gleixner, kernel test robot
Cc: kbuild test robot, kbuild-all, Linux Kernel Mailing List,
Arnd Bergmann, y2038 Mailman List, linux-arch, palmer,
linux-riscv
Posted v2 now.
Fengguang,
Also the make.cross script pointed to by the kernel test bot is broken
for riscv.
I applied the following fix to compile it.
Pull request: https://github.com/intel/lkp-tests/pull/11
Thanks,
Deepa
On Thu, Jul 5, 2018 at 1:33 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Thu, 5 Jul 2018, Deepa Dinamani wrote:
>
>> The error is fixed with the following patch that goes in before patch
>> 3/6 above in the series.
>> Let me know if I should post a v2 instead.
>>
>> Thanks,
>> Deepa
>>
>>
>> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
>> Author: Deepa Dinamani <deepa.kernel@gmail.com>
>> Date: Thu Jul 5 11:47:25 2018 -0700
>>
>> riscv: Include asm-generic/compat.h
>>
>> riscv does not enable CONFIG_COMPAT in default configurations:
>> defconfig, allmodconfig and nomodconfig.
>> And hence does not inlude definitions for compat data types.
>>
>> Now that time syscalls are being reused in non CONFIG_COMPAT
>> modes, include asm-generic definitions for riscv.
>>
>> Alternative would be to make compat_time.h to be conditional on
>> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
>> asm/compat.h include the generic version instead.
>>
>> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
>> Cc: palmer@sifive.com
>> Cc: linux-riscv@lists.infradead.org
>
> Post a real patch please instead of something which I have to cleanup
> manually. A V2 of the series is probably the simplest way.
>
> Thanks,
>
> tglx
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [kbuild-all] [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-05 21:45 ` Deepa Dinamani
2018-07-05 21:45 ` Deepa Dinamani
@ 2018-07-06 0:41 ` Philip Li
2018-07-06 0:41 ` Philip Li
1 sibling, 1 reply; 14+ messages in thread
From: Philip Li @ 2018-07-06 0:41 UTC (permalink / raw)
To: Deepa Dinamani
Cc: Thomas Gleixner, kernel test robot, linux-arch, kbuild test robot,
Arnd Bergmann, y2038 Mailman List, palmer,
Linux Kernel Mailing List, kbuild-all, linux-riscv
On Thu, Jul 05, 2018 at 02:45:05PM -0700, Deepa Dinamani wrote:
> Posted v2 now.
>
> Fengguang,
>
> Also the make.cross script pointed to by the kernel test bot is broken
> for riscv.
>
> I applied the following fix to compile it.
>
> Pull request: https://github.com/intel/lkp-tests/pull/11
thanks Deepa, i will follow up with the pull request to merge it.
>
> Thanks,
> Deepa
>
> On Thu, Jul 5, 2018 at 1:33 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Thu, 5 Jul 2018, Deepa Dinamani wrote:
> >
> >> The error is fixed with the following patch that goes in before patch
> >> 3/6 above in the series.
> >> Let me know if I should post a v2 instead.
> >>
> >> Thanks,
> >> Deepa
> >>
> >>
> >> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
> >> Author: Deepa Dinamani <deepa.kernel@gmail.com>
> >> Date: Thu Jul 5 11:47:25 2018 -0700
> >>
> >> riscv: Include asm-generic/compat.h
> >>
> >> riscv does not enable CONFIG_COMPAT in default configurations:
> >> defconfig, allmodconfig and nomodconfig.
> >> And hence does not inlude definitions for compat data types.
> >>
> >> Now that time syscalls are being reused in non CONFIG_COMPAT
> >> modes, include asm-generic definitions for riscv.
> >>
> >> Alternative would be to make compat_time.h to be conditional on
> >> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
> >> asm/compat.h include the generic version instead.
> >>
> >> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> >> Cc: palmer@sifive.com
> >> Cc: linux-riscv@lists.infradead.org
> >
> > Post a real patch please instead of something which I have to cleanup
> > manually. A V2 of the series is probably the simplest way.
> >
> > Thanks,
> >
> > tglx
> _______________________________________________
> kbuild-all mailing list
> kbuild-all@lists.01.org
> https://lists.01.org/mailman/listinfo/kbuild-all
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [kbuild-all] [PATCH 3/6] timex: prepare compat helpers for y2038 changes
2018-07-06 0:41 ` [kbuild-all] " Philip Li
@ 2018-07-06 0:41 ` Philip Li
0 siblings, 0 replies; 14+ messages in thread
From: Philip Li @ 2018-07-06 0:41 UTC (permalink / raw)
To: Deepa Dinamani
Cc: Thomas Gleixner, kernel test robot, linux-arch, kbuild test robot,
Arnd Bergmann, y2038 Mailman List, palmer,
Linux Kernel Mailing List, kbuild-all, linux-riscv
On Thu, Jul 05, 2018 at 02:45:05PM -0700, Deepa Dinamani wrote:
> Posted v2 now.
>
> Fengguang,
>
> Also the make.cross script pointed to by the kernel test bot is broken
> for riscv.
>
> I applied the following fix to compile it.
>
> Pull request: https://github.com/intel/lkp-tests/pull/11
thanks Deepa, i will follow up with the pull request to merge it.
>
> Thanks,
> Deepa
>
> On Thu, Jul 5, 2018 at 1:33 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Thu, 5 Jul 2018, Deepa Dinamani wrote:
> >
> >> The error is fixed with the following patch that goes in before patch
> >> 3/6 above in the series.
> >> Let me know if I should post a v2 instead.
> >>
> >> Thanks,
> >> Deepa
> >>
> >>
> >> commit bfe4b046ed7f01154aef44fcb77d3f172929ccc2
> >> Author: Deepa Dinamani <deepa.kernel@gmail.com>
> >> Date: Thu Jul 5 11:47:25 2018 -0700
> >>
> >> riscv: Include asm-generic/compat.h
> >>
> >> riscv does not enable CONFIG_COMPAT in default configurations:
> >> defconfig, allmodconfig and nomodconfig.
> >> And hence does not inlude definitions for compat data types.
> >>
> >> Now that time syscalls are being reused in non CONFIG_COMPAT
> >> modes, include asm-generic definitions for riscv.
> >>
> >> Alternative would be to make compat_time.h to be conditional on
> >> CONFIG_COMPAT_32BIT_TIME. But, since riscv is already has an
> >> asm/compat.h include the generic version instead.
> >>
> >> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> >> Cc: palmer@sifive.com
> >> Cc: linux-riscv@lists.infradead.org
> >
> > Post a real patch please instead of something which I have to cleanup
> > manually. A V2 of the series is probably the simplest way.
> >
> > Thanks,
> >
> > tglx
> _______________________________________________
> kbuild-all mailing list
> kbuild-all@lists.01.org
> https://lists.01.org/mailman/listinfo/kbuild-all
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-07-06 0:41 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 5:44 [PATCH 0/6] Introduce struct __kernel_timex Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
2018-07-03 5:44 ` [PATCH 3/6] timex: prepare compat helpers for y2038 changes Deepa Dinamani
2018-07-03 5:44 ` Deepa Dinamani
2018-07-05 7:06 ` kbuild test robot
2018-07-05 7:06 ` kbuild test robot
2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:06 ` Deepa Dinamani
2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 20:33 ` Thomas Gleixner
2018-07-05 21:45 ` Deepa Dinamani
2018-07-05 21:45 ` Deepa Dinamani
2018-07-06 0:41 ` [kbuild-all] " Philip Li
2018-07-06 0:41 ` Philip Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox