From mboxrd@z Thu Jan 1 00:00:00 1970 References: <20210327095417.2289913-1-rpm@xenomai.org> <20210327095417.2289913-3-rpm@xenomai.org> <12f269c4-cd8f-3235-60a9-6f5029fe1529@siemens.com> From: Philippe Gerum Subject: Re: [PATCH 2/8] cobalt/mutex: Bring back ia32 support for mutex_timedwait In-reply-to: <12f269c4-cd8f-3235-60a9-6f5029fe1529@siemens.com> Date: Wed, 07 Apr 2021 18:57:07 +0200 Message-ID: <87v98ynicc.fsf@xenomai.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org, Florian Bezdeka Jan Kiszka writes: > On 27.03.21 10:54, Philippe Gerum wrote: >> From: Florian Bezdeka >> >> The helper used for copying the timeout values (=mutex_fetch_timeout()) >> was always copying sizeof(struct timespec64) from user to kernel space. >> For applications with time_t being 4 bytes only (like for native 32 bit >> applications) that is simply too much. >> >> Signed-off-by: Florian Bezdeka >> --- >> kernel/cobalt/posix/mutex.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/kernel/cobalt/posix/mutex.c b/kernel/cobalt/posix/mutex.c >> index d43a747b3..70fe7960a 100644 >> --- a/kernel/cobalt/posix/mutex.c >> +++ b/kernel/cobalt/posix/mutex.c >> @@ -349,8 +349,7 @@ COBALT_SYSCALL(mutex_lock, primary, >> static inline int mutex_fetch_timeout(struct timespec64 *ts, >> const void __user *u_ts) >> { >> - return u_ts == NULL ? -EFAULT : >> - cobalt_copy_from_user(ts, u_ts, sizeof(*ts)); >> + return u_ts == NULL ? -EFAULT : cobalt_get_u_timespec(ts, u_ts); >> } >> >> COBALT_SYSCALL(mutex_timedlock, primary, >> > > Also here: Can we please avoid introducing a regression first and then > fixing it in the same series? To my understanding, this belongs into > patch 1, right? > > Same for patch 3 and 8 likely. > > Philippe, you can preserve Florian's fix-up credit simply in the commit > message, if that was the concern. That was the concern. -- Philippe.