From: Greentime Hu <green.hu@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-arch <linux-arch@vger.kernel.org>,
Nick Hu <nickhu@andestech.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vincent Chen <deanbo422@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH 4/6] uaccess: remove segment_eq
Date: Mon, 13 Jul 2020 18:05:10 +0800 [thread overview]
Message-ID: <CAEbi=3dSkAcTey8WeRuxN7oYq_O47QAZffLwruQRbpGpmqT-yA@mail.gmail.com> (raw)
In-Reply-To: <20200710135706.537715-5-hch@lst.de>
Christoph Hellwig <hch@lst.de> 於 2020年7月10日 週五 下午9:57寫道:
>
> segment_eq is only used to implement uaccess_kernel. Just open code
> uaccess_kernel in the arch uaccess headers and remove one layer of
> indirection.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/alpha/include/asm/uaccess.h | 2 +-
> arch/arc/include/asm/segment.h | 3 +--
> arch/arm/include/asm/uaccess.h | 4 ++--
> arch/arm64/include/asm/uaccess.h | 2 +-
> arch/csky/include/asm/segment.h | 2 +-
> arch/h8300/include/asm/segment.h | 2 +-
> arch/ia64/include/asm/uaccess.h | 2 +-
> arch/m68k/include/asm/segment.h | 2 +-
> arch/microblaze/include/asm/uaccess.h | 2 +-
> arch/mips/include/asm/uaccess.h | 2 +-
> arch/nds32/include/asm/uaccess.h | 2 +-
> arch/nios2/include/asm/uaccess.h | 2 +-
> arch/openrisc/include/asm/uaccess.h | 2 +-
> arch/parisc/include/asm/uaccess.h | 2 +-
> arch/powerpc/include/asm/uaccess.h | 3 +--
> arch/riscv/include/asm/uaccess.h | 4 +---
> arch/s390/include/asm/uaccess.h | 2 +-
> arch/sh/include/asm/segment.h | 3 +--
> arch/sparc/include/asm/uaccess_32.h | 2 +-
> arch/sparc/include/asm/uaccess_64.h | 2 +-
> arch/x86/include/asm/uaccess.h | 2 +-
> arch/xtensa/include/asm/uaccess.h | 2 +-
> include/asm-generic/uaccess.h | 4 ++--
> include/linux/uaccess.h | 2 --
> 24 files changed, 25 insertions(+), 32 deletions(-)
>
[...]
> diff --git a/arch/nds32/include/asm/uaccess.h b/arch/nds32/include/asm/uaccess.h
> index 3a9219f53ee0d8..010ba5f1d7dd6b 100644
> --- a/arch/nds32/include/asm/uaccess.h
> +++ b/arch/nds32/include/asm/uaccess.h
> @@ -44,7 +44,7 @@ static inline void set_fs(mm_segment_t fs)
> current_thread_info()->addr_limit = fs;
> }
>
> -#define segment_eq(a, b) ((a) == (b))
> +#define uaccess_kernel() (get_fs() == KERNEL_DS)
>
> #define __range_ok(addr, size) (size <= get_fs() && addr <= (get_fs() -size))
>
Hi Christoph, Thank you.
Acked-by: Greentime Hu <green.hu@gmail.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2020-07-13 10:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 13:57 clean up address limit helpers Christoph Hellwig
2020-07-10 13:57 ` [PATCH 1/6] syscalls: use uaccess_kernel in addr_limit_user_check Christoph Hellwig
2020-07-10 13:57 ` [PATCH 2/6] nds32: use uaccess_kernel in show_regs Christoph Hellwig
2020-07-13 10:02 ` Greentime Hu
2020-07-10 13:57 ` [PATCH 3/6] riscv: include <asm/pgtable.h> in <asm/uaccess.h> Christoph Hellwig
2020-07-21 23:02 ` Palmer Dabbelt
2020-07-10 13:57 ` [PATCH 4/6] uaccess: remove segment_eq Christoph Hellwig
2020-07-13 9:16 ` Geert Uytterhoeven
2020-07-13 10:05 ` Greentime Hu [this message]
2020-07-10 13:57 ` [PATCH 5/6] uaccess: add force_uaccess_{begin,end} helpers Christoph Hellwig
2020-07-13 9:12 ` Geert Uytterhoeven
2020-07-13 10:06 ` Greentime Hu
2020-07-13 12:21 ` Mark Rutland
2020-07-13 13:19 ` Geert Uytterhoeven
2020-07-14 7:12 ` Christoph Hellwig
2020-07-13 12:26 ` Mark Rutland
2020-07-10 13:57 ` [PATCH 6/6] exec: use force_uaccess_begin during exec and exit Christoph Hellwig
2020-07-10 15:25 ` clean up address limit helpers Linus Torvalds
2020-07-14 7:09 ` Christoph Hellwig
2020-07-14 15:33 ` Linus Torvalds
2020-07-14 10:54 clean up address limit helpers v2 Christoph Hellwig
2020-07-14 10:55 ` [PATCH 4/6] uaccess: remove segment_eq Christoph Hellwig
2020-07-14 15:27 ` Linus Torvalds
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='CAEbi=3dSkAcTey8WeRuxN7oYq_O47QAZffLwruQRbpGpmqT-yA@mail.gmail.com' \
--to=green.hu@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=deanbo422@gmail.com \
--cc=hch@lst.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nickhu@andestech.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).