linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: linux-hardening@vger.kernel.org, cmr@bluescreens.de
Subject: [RFC PATCH 0/6] VMAP_STACK support for book3s64
Date: Sat,  5 Nov 2022 04:27:31 +1100	[thread overview]
Message-ID: <20221104172737.391978-1-ajd@linux.ibm.com> (raw)

This series begins implementing VMAP_STACK support for book3s64 platforms,
building on the existing 32-bit work that Christophe Leroy has done.

Right now, it doesn't boot on my POWER9 machine - I'm sending this as is because
I'm about to go on holidays for a couple of weeks, and I'll pick it up once I'm
back.

The primary issue is the amount of arch code that has to run in real mode for
some reason or another - this includes OPAL, the cpu idle driver, KVM, and a
few other bits and pieces.

Right now, VMAP_STACK is only enabled if KVM_BOOK3S_64_HV=n - I'm working on
patches for KVM support but they're not quite ready yet.

If anyone has better suggestions for the extremely ugly approach to fixing
OPAL calls, suggest away!

Andrew Donnellan (6):
  powerpc/64s: Fix assembly to support larger values of THREAD_SIZE
  powerpc/64s: Helpers to switch between linear and vmapped stack
    pointers
  powerpc/powernv: Keep MSR in register across OPAL entry/return path
  powerpc/powernv: Convert pointers to physical addresses in OPAL call
    args
  powerpc/powernv/idle: Convert stack pointer to physical address
  powerpc/64s: Enable CONFIG_VMAP_STACK

 arch/powerpc/include/asm/asm-compat.h         |  2 +
 arch/powerpc/include/asm/book3s/64/stack.h    | 71 +++++++++++++++++++
 arch/powerpc/include/asm/opal.h               |  1 +
 arch/powerpc/include/asm/paca.h               |  4 ++
 arch/powerpc/include/asm/processor.h          |  6 ++
 arch/powerpc/kernel/asm-offsets.c             |  8 +++
 arch/powerpc/kernel/entry_64.S                | 11 ++-
 arch/powerpc/kernel/irq.c                     |  8 ++-
 arch/powerpc/kernel/misc_64.S                 |  4 +-
 arch/powerpc/kernel/process.c                 |  8 +++
 arch/powerpc/kernel/smp.c                     |  7 ++
 arch/powerpc/kvm/book3s_hv_builtin.c          |  2 +-
 arch/powerpc/kvm/book3s_hv_rmhandlers.S       |  3 +-
 arch/powerpc/mm/book3s64/slb.c                | 11 ++-
 arch/powerpc/platforms/Kconfig.cputype        |  1 +
 arch/powerpc/platforms/powernv/eeh-powernv.c  | 20 +++---
 arch/powerpc/platforms/powernv/idle.c         | 47 +++++++++++-
 arch/powerpc/platforms/powernv/ocxl.c         |  3 +-
 arch/powerpc/platforms/powernv/opal-core.c    |  4 +-
 arch/powerpc/platforms/powernv/opal-dump.c    |  6 +-
 arch/powerpc/platforms/powernv/opal-elog.c    | 10 +--
 arch/powerpc/platforms/powernv/opal-fadump.c  | 12 ++--
 arch/powerpc/platforms/powernv/opal-flash.c   |  5 +-
 arch/powerpc/platforms/powernv/opal-hmi.c     |  3 +-
 arch/powerpc/platforms/powernv/opal-irqchip.c |  4 +-
 arch/powerpc/platforms/powernv/opal-lpc.c     |  8 +--
 arch/powerpc/platforms/powernv/opal-nvram.c   |  4 +-
 arch/powerpc/platforms/powernv/opal-power.c   |  4 +-
 .../powerpc/platforms/powernv/opal-powercap.c |  2 +-
 arch/powerpc/platforms/powernv/opal-prd.c     |  6 +-
 arch/powerpc/platforms/powernv/opal-psr.c     |  2 +-
 arch/powerpc/platforms/powernv/opal-rtc.c     |  2 +-
 arch/powerpc/platforms/powernv/opal-secvar.c  |  9 ++-
 arch/powerpc/platforms/powernv/opal-sensor.c  |  4 +-
 .../powerpc/platforms/powernv/opal-sysparam.c |  4 +-
 .../powerpc/platforms/powernv/opal-wrappers.S | 43 ++++++-----
 arch/powerpc/platforms/powernv/opal-xscom.c   |  2 +-
 arch/powerpc/platforms/powernv/opal.c         | 16 ++---
 arch/powerpc/platforms/powernv/pci-ioda.c     | 14 ++--
 arch/powerpc/platforms/powernv/pci.c          | 25 ++++---
 arch/powerpc/platforms/powernv/setup.c        |  2 +-
 arch/powerpc/platforms/powernv/smp.c          |  2 +-
 arch/powerpc/sysdev/xics/icp-opal.c           |  2 +-
 arch/powerpc/sysdev/xics/ics-opal.c           |  8 +--
 arch/powerpc/sysdev/xive/native.c             | 33 +++++----
 arch/powerpc/xmon/xmon.c                      |  4 ++
 drivers/char/ipmi/ipmi_powernv.c              |  6 +-
 drivers/char/powernv-op-panel.c               |  2 +-
 drivers/i2c/busses/i2c-opal.c                 |  2 +-
 drivers/leds/leds-powernv.c                   |  6 +-
 drivers/mtd/devices/powernv_flash.c           |  4 +-
 drivers/rtc/rtc-opal.c                        |  4 +-
 52 files changed, 347 insertions(+), 134 deletions(-)
 create mode 100644 arch/powerpc/include/asm/book3s/64/stack.h

-- 
2.38.1


             reply	other threads:[~2022-11-04 17:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 17:27 Andrew Donnellan [this message]
2022-11-04 17:27 ` [RFC PATCH 1/6] powerpc/64s: Fix assembly to support larger values of THREAD_SIZE Andrew Donnellan
2022-11-04 17:51   ` Christophe Leroy
2023-04-26  7:03     ` Andrew Donnellan
2022-11-04 17:27 ` [RFC PATCH 2/6] powerpc/64s: Helpers to switch between linear and vmapped stack pointers Andrew Donnellan
2022-11-05  8:00   ` Christophe Leroy
2022-11-05 19:28     ` Christophe Leroy
2022-11-07 12:38     ` Nicholas Piggin
2022-11-04 17:27 ` [RFC PATCH 3/6] powerpc/powernv: Keep MSR in register across OPAL entry/return path Andrew Donnellan
2022-11-04 18:00   ` Christophe Leroy
2022-11-04 17:27 ` [RFC PATCH 4/6] powerpc/powernv: Convert pointers to physical addresses in OPAL call args Andrew Donnellan
2022-11-07  0:00   ` Russell Currey
2022-11-08 16:21   ` Christophe Leroy
2022-11-04 17:27 ` [RFC PATCH 5/6] powerpc/powernv/idle: Convert stack pointer to physical address Andrew Donnellan
2022-11-08 16:17   ` Christophe Leroy
2022-11-04 17:27 ` [RFC PATCH 6/6] powerpc/64s: Enable CONFIG_VMAP_STACK Andrew Donnellan
2022-11-05 17:07   ` Christophe Leroy

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=20221104172737.391978-1-ajd@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=cmr@bluescreens.de \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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).