From: Thomas Gleixner <tglx@linutronix.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Ryosuke Yasuoka <ryasuoka@redhat.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Wei Yang <richard.weiyang@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
John Ogness <john.ogness@linutronix.de>,
linux-mm@kvack.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: Jocelyn Falempe <jfalempe@redhat.com>,
Simona Vetter <simona.vetter@ffwll.ch>
Subject: Re: [PATCH v2 1/2] mm/kmap: Add kmap_local_page_try_from_panic()
Date: Fri, 04 Apr 2025 09:33:35 +0200 [thread overview]
Message-ID: <87mscwv0s0.ffs@tglx> (raw)
In-Reply-To: <20250321112436.1739876-2-jfalempe@redhat.com>
On Fri, Mar 21 2025 at 12:16, Jocelyn Falempe wrote:
> kmap_local_page() can be unsafe to call from a panic handler, if
> CONFIG_HIGHMEM is set, and the page is in the highmem zone.
> So add kmap_local_page_try_from_panic() to handle this case.
I think this is a reasonable solution and the highmem case can suffer
from not getting the reliable panic output.
> Suggested-by: Simona Vetter <simona.vetter@ffwll.ch>
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
> include/linux/highmem-internal.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h
> index dd100e849f5e0..5d089b0ca56de 100644
> --- a/include/linux/highmem-internal.h
> +++ b/include/linux/highmem-internal.h
> @@ -73,6 +73,13 @@ static inline void *kmap_local_page(struct page *page)
> return __kmap_local_page_prot(page, kmap_prot);
> }
>
> +static inline void *kmap_local_page_try_from_panic(struct page *page)
> +{
> + if (!PageHighMem(page))
> + return page_address(page);
> + return NULL;
A comment explaining the reason why the highmem mapping cannot work here
would be appreciated.
Aside of that:
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Thanks,
tglx
next prev parent reply other threads:[~2025-04-04 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 11:16 [PATCH v2 0/2] drm/panic: Add support to scanout buffer as array of pages Jocelyn Falempe
2025-03-21 11:16 ` [PATCH v2 1/2] mm/kmap: Add kmap_local_page_try_from_panic() Jocelyn Falempe
2025-04-04 7:33 ` Thomas Gleixner [this message]
2025-03-21 11:16 ` [PATCH v2 2/2] drm/panic: Add support to scanout buffer as array of pages Jocelyn Falempe
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=87mscwv0s0.ffs@tglx \
--to=tglx@linutronix.de \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=jfalempe@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=richard.weiyang@gmail.com \
--cc=ryasuoka@redhat.com \
--cc=simona.vetter@ffwll.ch \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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.