All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Miles Chen <miles.chen@mediatek.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Minchan Kim <minchan@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	wsd_upstream@mediatek.com, Suren Baghdasaryan <surenb@google.com>
Subject: Re: [PATCH v2 4/4] arm: replace vector mem type with read-only type
Date: Fri, 23 Oct 2020 11:12:58 +0100	[thread overview]
Message-ID: <20201023101257.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20201023091437.8225-5-miles.chen@mediatek.com>

On Fri, Oct 23, 2020 at 05:14:37PM +0800, Miles Chen wrote:
> Since kernel no longer writes to the vector, try to replace
> the vector mem type with read-only type and remove L_PTE_MT_VECTORS.
> 
> from Catalin in [1]:
> "
> > I don't think this matters since the kernel no longer writes to the
> > vectors page at run-time but it needs cleaning up a bit (and testing in
> > case I missed something). IOW, do we still need a dedicated mapping type
> > for the vectors or we can simply use the read-only user page attributes?
> "

Catalin is incorrect. If CONFIG_KUSER_HELPERS is enabled, then the
vectors page is definitely written to - it's a user interface, so
it's not going to change:

#ifdef CONFIG_KUSER_HELPERS
                        /*
                         * User space must never try to access this
                         * directly.  Expect your app to break
                         * eventually if you do so.  The user helper
                         * at 0xffff0fe0 must be used instead.  (see
                         * entry-armv.S for details)
                         */
                        *((unsigned int *)0xffff0ff0) = val;
#endif

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Miles Chen <miles.chen@mediatek.com>
Cc: wsd_upstream@mediatek.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-kernel@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Suren Baghdasaryan <surenb@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/4] arm: replace vector mem type with read-only type
Date: Fri, 23 Oct 2020 11:12:58 +0100	[thread overview]
Message-ID: <20201023101257.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20201023091437.8225-5-miles.chen@mediatek.com>

On Fri, Oct 23, 2020 at 05:14:37PM +0800, Miles Chen wrote:
> Since kernel no longer writes to the vector, try to replace
> the vector mem type with read-only type and remove L_PTE_MT_VECTORS.
> 
> from Catalin in [1]:
> "
> > I don't think this matters since the kernel no longer writes to the
> > vectors page at run-time but it needs cleaning up a bit (and testing in
> > case I missed something). IOW, do we still need a dedicated mapping type
> > for the vectors or we can simply use the read-only user page attributes?
> "

Catalin is incorrect. If CONFIG_KUSER_HELPERS is enabled, then the
vectors page is definitely written to - it's a user interface, so
it's not going to change:

#ifdef CONFIG_KUSER_HELPERS
                        /*
                         * User space must never try to access this
                         * directly.  Expect your app to break
                         * eventually if you do so.  The user helper
                         * at 0xffff0fe0 must be used instead.  (see
                         * entry-armv.S for details)
                         */
                        *((unsigned int *)0xffff0ff0) = val;
#endif

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Miles Chen <miles.chen@mediatek.com>
Cc: wsd_upstream@mediatek.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-kernel@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Suren Baghdasaryan <surenb@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/4] arm: replace vector mem type with read-only type
Date: Fri, 23 Oct 2020 11:12:58 +0100	[thread overview]
Message-ID: <20201023101257.GZ1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20201023091437.8225-5-miles.chen@mediatek.com>

On Fri, Oct 23, 2020 at 05:14:37PM +0800, Miles Chen wrote:
> Since kernel no longer writes to the vector, try to replace
> the vector mem type with read-only type and remove L_PTE_MT_VECTORS.
> 
> from Catalin in [1]:
> "
> > I don't think this matters since the kernel no longer writes to the
> > vectors page at run-time but it needs cleaning up a bit (and testing in
> > case I missed something). IOW, do we still need a dedicated mapping type
> > for the vectors or we can simply use the read-only user page attributes?
> "

Catalin is incorrect. If CONFIG_KUSER_HELPERS is enabled, then the
vectors page is definitely written to - it's a user interface, so
it's not going to change:

#ifdef CONFIG_KUSER_HELPERS
                        /*
                         * User space must never try to access this
                         * directly.  Expect your app to break
                         * eventually if you do so.  The user helper
                         * at 0xffff0fe0 must be used instead.  (see
                         * entry-armv.S for details)
                         */
                        *((unsigned int *)0xffff0ff0) = val;
#endif

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

  reply	other threads:[~2020-10-23 10:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  9:14 [PATCH v2 0/4] arm: support get_user_pages_fast Miles Chen
2020-10-23  9:14 ` Miles Chen
2020-10-23  9:14 ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 1/4] arm: mm: use strict p[gum]d types Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 2/4] arm: mm: reordering memory type table Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:16   ` Russell King - ARM Linux admin
2020-10-23 10:16     ` Russell King - ARM Linux admin
2020-10-23 10:16     ` Russell King - ARM Linux admin
2020-10-27  8:03     ` Miles Chen
2020-10-27  8:03       ` Miles Chen
2020-10-27  8:03       ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:08   ` Russell King - ARM Linux admin
2020-10-23 10:08     ` Russell King - ARM Linux admin
2020-10-23 10:08     ` Russell King - ARM Linux admin
2020-10-27  7:45     ` Miles Chen
2020-10-27  7:45       ` Miles Chen
2020-10-27  7:45       ` Miles Chen
2020-10-27  9:11       ` Russell King - ARM Linux admin
2020-10-27  9:11         ` Russell King - ARM Linux admin
2020-10-27  9:11         ` Russell King - ARM Linux admin
2020-11-01 12:48         ` Miles Chen
2020-11-01 12:48           ` Miles Chen
2020-11-01 12:48           ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 4/4] arm: replace vector mem type with read-only type Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:12   ` Russell King - ARM Linux admin [this message]
2020-10-23 10:12     ` Russell King - ARM Linux admin
2020-10-23 10:12     ` Russell King - ARM Linux admin
2020-10-27  7:41     ` Miles Chen
2020-10-27  7:41       ` Miles Chen
2020-10-27  7:41       ` Miles Chen

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=20201023101257.GZ1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=miles.chen@mediatek.com \
    --cc=minchan@kernel.org \
    --cc=surenb@google.com \
    --cc=wsd_upstream@mediatek.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.