linux-um archives
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: anton ivanov <anton.ivanov@cambridgegreys.com>
Cc: linux-um <linux-um@lists.infradead.org>
Subject: Re: [PATCH v5 3/4] um: add a UML specific futex implementation
Date: Tue, 15 Dec 2020 10:46:54 +0100 (CET)	[thread overview]
Message-ID: <480679445.130046.1608025614425.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <140a74e6-29e0-5bee-1df0-d40fb25a146d@cambridgegreys.com>

Anton,

----- Ursprüngliche Mail -----
> Von: "anton ivanov" <anton.ivanov@cambridgegreys.com>
> An: "linux-um" <linux-um@lists.infradead.org>
> CC: "richard" <richard@nod.at>
> Gesendet: Dienstag, 15. Dezember 2020 10:43:48
> Betreff: Re: [PATCH v5 3/4] um: add a UML specific futex implementation

> On 14/12/2020 18:14, anton.ivanov@cambridgegreys.com wrote:
>> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>
>> The generic asm futex implementation emulates atomic access to
>> memory by doing a get_user followed by put_user. These translate
>> to two mapping operations on UML with paging enabled in the
>> meantime. This, in turn may end up changing interrupts,
>> invoking the signal loop, etc.
>>
>> This replaces the generic implementation by a mapping followed
>> by an operation on the mapped segment.
>>
>> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>> ---
>>   arch/um/include/asm/Kbuild    |   1 -
>>   arch/um/include/asm/futex.h   |  14 ++++
>>   arch/um/kernel/skas/uaccess.c | 130 ++++++++++++++++++++++++++++++++++
>>   3 files changed, 144 insertions(+), 1 deletion(-)
>>   create mode 100644 arch/um/include/asm/futex.h
>>
>> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
>> index 1c63b260ecc4..873e6815bc50 100644
>> --- a/arch/um/include/asm/Kbuild
>> +++ b/arch/um/include/asm/Kbuild
>> @@ -8,7 +8,6 @@ generic-y += emergency-restart.h
>>   generic-y += exec.h
>>   generic-y += extable.h
>>   generic-y += ftrace.h
>> -generic-y += futex.h
>>   generic-y += hw_irq.h
>>   generic-y += irq_regs.h
>>   generic-y += irq_work.h
>> diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h
>> new file mode 100644
>> index 000000000000..0a01f1f60de0
>> --- /dev/null
>> +++ b/arch/um/include/asm/futex.h
>> @@ -0,0 +1,14 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _ASM_GENERIC_FUTEX_H
>> +#define _ASM_GENERIC_FUTEX_H
> 
> ^^^^ Uggghhh
> 
>> +
>> +#include <linux/futex.h>
>> +#include <linux/uaccess.h>
>> +#include <asm/errno.h>
>> +
>> +
>> +extern int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user
>> *uaddr);
>> +extern int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
>> +			      u32 oldval, u32 newval);
> ^^^^ Did not address Johannes comments, will do in v6

No need to hurry. This has to wait anyway for 5.12. :-)

Thanks,
//richard

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

  reply	other threads:[~2020-12-15  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 18:14 Updated performance patch series anton.ivanov
2020-12-14 18:14 ` [PATCH v5 1/4] um: Add support for host CPU flags and alignment anton.ivanov
2020-12-14 18:14 ` [PATCH v5 2/4] um: enable the use of optimized xor routines in UML anton.ivanov
2020-12-14 18:14 ` [PATCH v5 3/4] um: add a UML specific futex implementation anton.ivanov
2020-12-15  9:43   ` Anton Ivanov
2020-12-15  9:46     ` Richard Weinberger [this message]
2020-12-15  9:56       ` Anton Ivanov
2020-12-14 18:14 ` [PATCH v5 4/4] um: allow the use of glibc functions instead of builtins anton.ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480679445.130046.1608025614425.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=linux-um@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox