All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	Guillaume Tucker <guillaume.tucker@collabora.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Nicolas Pitre <nico@fluxnic.net>,
	Kees Cook <keescook@chromium.org>,
	Keith Packard <keithpac@amazon.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	"kernelci@groups.io" <kernelci@groups.io>
Subject: Re: [PATCH v3 7/7] ARM: implement support for vmap'ed stacks
Date: Wed, 17 Nov 2021 13:12:53 +0200	[thread overview]
Message-ID: <YZTjtY463f2HQwL6@atomide.com> (raw)
In-Reply-To: <CAMj1kXHRBCmNXVPjhe7KOGnf7j2-uOm94XjkSSQ844H6_QROFw@mail.gmail.com>

* Ard Biesheuvel <ardb@kernel.org> [211117 10:49]:
> On Wed, 17 Nov 2021 at 10:08, Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > On Wed, 17 Nov 2021 at 10:07, Arnd Bergmann <arnd@arndb.de> wrote:
> > >
> > > On Wed, Nov 17, 2021 at 10:03 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > >
> > > > On Wed, Nov 17, 2021 at 9:36 AM Tony Lindgren <tony@atomide.com> wrote:
> > > > > * Ard Biesheuvel <ardb@kernel.org> [211117 08:29]:
> > > > > >
> > > > > > Thanks Tony, that is very helpful. I have a Beaglebone white somewhere
> > > > > > so I'll try and reproduce it locally as well.
> > > > >
> > > > > I think with Beaglebone you may hit this only with suspend/resume if at
> > > > > all. On am335x cpuidle is not shutting down the CPU. And only some models
> > > > > will suspend to deeper idle states as it depends on the PMIC.
> > > > >
> > > > > If you have some test patch to try, just let me know.
> > > >
> > > > I looked at how the sleep code is called and found that cpu_suspend()/
> > > > __cpu_suspend() has interesting manipulation of the stack pointer to
> > > > call the platform specific function with a simple 1:1 page table,
> > > > I would expect the problem somewhere in there, haven't pinpointed
> > > > the exact line yet, but if any of that code tries to local the physical
> > > > address of the stack using virt_to_phys or its asm equivalent, this
> > > > fails for a vmap stack.
> > >
> > > and just after sending this I see
> > >
> > > void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
> > > {
> > >         *save_ptr = virt_to_phys(ptr);
> > >
> > > 'ptr' is a pointer to the stack here. It might not be the only place that
> > > needs fixing, but this clearly has to do a page table walk like
> > > vmalloc_to_page() does to get to the correct physical address.
> > >
> >
> > I had just arrived at the same conclusion. I'll fix this up and drop
> > it in kernelci.
> 
> Updated branch here:
> https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?h=arm-vmap-stacks-v4

Great that branch boots for me!

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>,
	Guillaume Tucker <guillaume.tucker@collabora.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Nicolas Pitre <nico@fluxnic.net>,
	Kees Cook <keescook@chromium.org>,
	Keith Packard <keithpac@amazon.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	"kernelci@groups.io" <kernelci@groups.io>
Subject: Re: [PATCH v3 7/7] ARM: implement support for vmap'ed stacks
Date: Wed, 17 Nov 2021 13:12:53 +0200	[thread overview]
Message-ID: <YZTjtY463f2HQwL6@atomide.com> (raw)
In-Reply-To: <CAMj1kXHRBCmNXVPjhe7KOGnf7j2-uOm94XjkSSQ844H6_QROFw@mail.gmail.com>

* Ard Biesheuvel <ardb@kernel.org> [211117 10:49]:
> On Wed, 17 Nov 2021 at 10:08, Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > On Wed, 17 Nov 2021 at 10:07, Arnd Bergmann <arnd@arndb.de> wrote:
> > >
> > > On Wed, Nov 17, 2021 at 10:03 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > > >
> > > > On Wed, Nov 17, 2021 at 9:36 AM Tony Lindgren <tony@atomide.com> wrote:
> > > > > * Ard Biesheuvel <ardb@kernel.org> [211117 08:29]:
> > > > > >
> > > > > > Thanks Tony, that is very helpful. I have a Beaglebone white somewhere
> > > > > > so I'll try and reproduce it locally as well.
> > > > >
> > > > > I think with Beaglebone you may hit this only with suspend/resume if at
> > > > > all. On am335x cpuidle is not shutting down the CPU. And only some models
> > > > > will suspend to deeper idle states as it depends on the PMIC.
> > > > >
> > > > > If you have some test patch to try, just let me know.
> > > >
> > > > I looked at how the sleep code is called and found that cpu_suspend()/
> > > > __cpu_suspend() has interesting manipulation of the stack pointer to
> > > > call the platform specific function with a simple 1:1 page table,
> > > > I would expect the problem somewhere in there, haven't pinpointed
> > > > the exact line yet, but if any of that code tries to local the physical
> > > > address of the stack using virt_to_phys or its asm equivalent, this
> > > > fails for a vmap stack.
> > >
> > > and just after sending this I see
> > >
> > > void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
> > > {
> > >         *save_ptr = virt_to_phys(ptr);
> > >
> > > 'ptr' is a pointer to the stack here. It might not be the only place that
> > > needs fixing, but this clearly has to do a page table walk like
> > > vmalloc_to_page() does to get to the correct physical address.
> > >
> >
> > I had just arrived at the same conclusion. I'll fix this up and drop
> > it in kernelci.
> 
> Updated branch here:
> https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?h=arm-vmap-stacks-v4

Great that branch boots for me!

Regards,

Tony

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

  reply	other threads:[~2021-11-17 11:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 11:18 [PATCH v3 0/7] ARM: add vmap'ed stack support Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 1/7] ARM: memcpy: use frame pointer as unwind anchor Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 2/7] ARM: memmove: " Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 3/7] ARM: memset: clean up unwind annotations Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 4/7] ARM: unwind: disregard unwind info before stack frame is set up Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 5/7] ARM: switch_to: clean up Thumb2 code path Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 6/7] ARM: entry: rework stack realignment code in svc_entry Ard Biesheuvel
2021-11-15 11:18 ` [PATCH v3 7/7] ARM: implement support for vmap'ed stacks Ard Biesheuvel
2021-11-16  9:22   ` Guillaume Tucker
2021-11-16  9:22     ` Guillaume Tucker
2021-11-16 19:28     ` Ard Biesheuvel
2021-11-16 19:28       ` Ard Biesheuvel
2021-11-16 20:06       ` Russell King (Oracle)
2021-11-16 20:06         ` Russell King (Oracle)
2021-11-16 22:02         ` Ard Biesheuvel
2021-11-16 22:02           ` Ard Biesheuvel
2021-11-17  7:59           ` Tony Lindgren
2021-11-17  7:59             ` Tony Lindgren
2021-11-17  8:28             ` Ard Biesheuvel
2021-11-17  8:28               ` Ard Biesheuvel
2021-11-17  8:36               ` Tony Lindgren
2021-11-17  8:36                 ` Tony Lindgren
2021-11-17  9:03                 ` Arnd Bergmann
2021-11-17  9:03                   ` Arnd Bergmann
2021-11-17  9:07                   ` Arnd Bergmann
2021-11-17  9:07                     ` Arnd Bergmann
2021-11-17  9:08                     ` Ard Biesheuvel
2021-11-17  9:08                       ` Ard Biesheuvel
2021-11-17 10:48                       ` Ard Biesheuvel
2021-11-17 10:48                         ` Ard Biesheuvel
2021-11-17 11:12                         ` Tony Lindgren [this message]
2021-11-17 11:12                           ` Tony Lindgren
2021-11-17 11:13                           ` Ard Biesheuvel
2021-11-17 11:13                             ` Ard Biesheuvel
2021-11-17 14:03                             ` Guillaume Tucker
2021-11-17 14:03                               ` Guillaume Tucker

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=YZTjtY463f2HQwL6@atomide.com \
    --to=tony@atomide.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=guillaume.tucker@collabora.com \
    --cc=keescook@chromium.org \
    --cc=keithpac@amazon.com \
    --cc=kernelci@groups.io \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ndesaulniers@google.com \
    --cc=nico@fluxnic.net \
    /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.