Re: [PATCH v3 2/2] powerpc/pseries: increase timeout value for plpks_signed_update_var() H_CALL

2024-04-01 Thread Andrew Donnellan
1000; > + > + fsleep(delay_us); > + timeout += delay_us; >   } >   rc = pseries_status_to_err(rc); >   } while (rc == -EBUSY && timeout < PLPKS_MAX_TIMEOUT); -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

[PATCH 1/2] MAINTAINERS: Make cxlflash obsolete

2024-04-08 Thread Andrew Donnellan
list. Signed-off-by: Andrew Donnellan --- MAINTAINERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index aea47e04c3a5..34f605498873 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5780,10 +5780,9 @@ F: include/uapi/misc/cxl.h CXLFLASH

[PATCH 2/2] MAINTAINERS: Make cxl obsolete

2024-04-08 Thread Andrew Donnellan
The cxl driver is no longer actively maintained and we intend to remove it in a future kernel release. Change its status to obsolete, and update the sysfs ABI documentation accordingly. Signed-off-by: Andrew Donnellan --- Documentation/ABI/{testing => obsolete}/sysfs-class-cxl

Re: [PATCH v4] powerpc/pseries: make max polling consistent for longer H_CALLs

2024-04-22 Thread Andrew Donnellan
ep() everywhere to > insert delay. > > Reported-by: Nageswara R Sastry > Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform > KeyStore") > Signed-off-by: Nayna Jain > Tested-by: Nageswara R Sastry Reviewed-by: Andrew Donnellan > --- > v

Re: [PATCH 2/2] MAINTAINERS: Make cxl obsolete

2024-05-02 Thread Andrew Donnellan
>   help > +   The cxl driver is no longer actively maintained and we > intend to > +   remove it in a future kernel release. > + >     Select this option to enable driver support for IBM > Coherent >     Accelerators (CXL).  CXL is otherwise known as Coherent > Accelerator >     Processor Interface (CAPI).  CAPI allows accelerators in > FPGAs to be -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH 2/2] MAINTAINERS: Make cxl obsolete

2024-05-03 Thread Andrew Donnellan
On Fri, 2024-05-03 at 13:15 +1000, Andrew Donnellan wrote: > This doesn't seem quite right to me, I don't think we can just > redefine > CONFIG_CXL as a bool, but I'll do something like this. Probably won't > bother for CXLFLASH since they'll see it for CX

Re: [PATCH v1 1/9] selftests/powerpc/dexcr: Add -no-pie to hashchk tests

2024-05-07 Thread Andrew Donnellan
urselves and be using the same addresses in the child. > > While -fno-pie is already added, -no-pie is also required. > > Fixes: ca64da7574f8 ("selftests/powerpc/dexcr: Add hashst/hashchk > test") > Signed-off-by: Benjamin Gray This matches the gcc documentation

Re: [PATCH -next] ocxl: simplify the return expression of free_function_dev()

2020-09-27 Thread Andrew Donnellan
On 21/9/20 11:10 pm, Qinglang Miao wrote: Simplify the return expression. Signed-off-by: Qinglang Miao Looks good Acked-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH v2 1/2] powerpc/rtas: Restrict RTAS requests from userspace

2020-10-06 Thread Andrew Donnellan
On 26/8/20 11:53 pm, Sasha Levin wrote: How should we proceed with this patch? mpe: I believe we came to the conclusion that we shouldn't put this in stable just yet? -- Andrew Donnellan OzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Linux kernel: powerpc: RTAS calls can be used to compromise kernel integrity

2020-10-08 Thread Andrew Donnellan
tion exists, the filtering can be disabled by a Kconfig option specified during kernel build. Credit == Thanks to Daniel Axtens (IBM) for initial discovery of this issue. [0] https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=bd59380c5ba41

Re: [PATCH 02/29] powerpc/rtas: prevent suspend-related sys_rtas use on LE

2020-10-29 Thread Andrew Donnellan
attempting the subsequent ibm,update-nodes call. drmgr is the only known (or plausible) user of these ibm,suspend-me, ibm,update-nodes, and ibm,update-properties, so allow them only in big-endian configurations. And there's a zero chance that drmgr will ever be fixed on LE? -- Andrew Donn

Re: [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description

2020-11-02 Thread Andrew Donnellan
7;device' description in 'get_function_0' Cc: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones Thanks! Acked-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra a...

Re: [PATCH 02/29] powerpc/rtas: prevent suspend-related sys_rtas use on LE

2020-11-06 Thread Andrew Donnellan
Okay. librtas should handle the error fine, so I don't have any huge objection to this, though perhaps a documentation patch to librtas to mention that these calls are BE-only would be in order. -- Andrew Donnellan OzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH] powerpc/powernv/sriov: fix unsigned int win compared to less than zero

2020-11-10 Thread Andrew Donnellan
ion compared with zero: win < 0 Reported-by: Tosk Robot Signed-off-by: Kaixu Xia This seems like the right fix, the value assigned to win can indeed be -1 so it should be signed. Thanks for sending the patch. Reviewed-by: Andrew Donnellan --- arch/powerpc/platforms/powernv/pci-sriov

Re: [PATCH v9 5/7] powerpc/tlb: Add local flush for page given mm_struct and psize

2022-11-02 Thread Andrew Donnellan
gt; to use modern style, then I would be happy to include a patch that > modernises the surrounding code first. This series would be a good opportunity to clean the rest of that file up; either way, as Christophe says we should avoid adding new uses given that people have started actively trying

[RFC PATCH 1/6] powerpc/64s: Fix assembly to support larger values of THREAD_SIZE

2022-11-04 Thread Andrew Donnellan
Fix these spots to use a scratch register or use two immediate mode instructions instead, so we can later enable VMAP_STACK. Signed-off-by: Andrew Donnellan --- arch/powerpc/include/asm/asm-compat.h | 2 ++ arch/powerpc/kernel/entry_64.S | 4 +++- arch/powerpc/kernel/irq.c

[RFC PATCH 0/6] VMAP_STACK support for book3s64

2022-11-04 Thread Andrew Donnellan
ing 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 swit

[RFC PATCH 3/6] powerpc/powernv: Keep MSR in register across OPAL entry/return path

2022-11-04 Thread Andrew Donnellan
k - we can restore the MSR first, then restore the PACA into r13. Signed-off-by: Andrew Donnellan --- .../powerpc/platforms/powernv/opal-wrappers.S | 43 +++ 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc

[RFC PATCH 2/6] powerpc/64s: Helpers to switch between linear and vmapped stack pointers

2022-11-04 Thread Andrew Donnellan
linear map and the vmalloc space in the PACA, and add some helper macros/functions to swap between them. Signed-off-by: Andrew Donnellan --- Some of the helpers that are currently unused will be used in the next version of the series for the KVM real mode handling --- arch/powerpc/include/asm

[RFC PATCH 5/6] powerpc/powernv/idle: Convert stack pointer to physical address

2022-11-04 Thread Andrew Donnellan
to a physical address using stack_pa() before going into idle, and restore the original pointer on the way back out. Signed-off-by: Andrew Donnellan --- This currently doesn't boot on my POWER9. I'm also going to clean this up to use the helpers from earlier in this series. --- ar

[RFC PATCH 6/6] powerpc/64s: Enable CONFIG_VMAP_STACK

2022-11-04 Thread Andrew Donnellan
Enable CONFIG_VMAP_STACK for book3s64. To do this, we need to make some slight adjustments to set the stack SLB entry up for vmalloc rather than linear. For now, only enable if KVM_BOOK3S_64_HV is disabled (there's some real mode handlers we need to fix there). Signed-off-by: Andrew Donn

[RFC PATCH 4/6] powerpc/powernv: Convert pointers to physical addresses in OPAL call args

2022-11-04 Thread Andrew Donnellan
and __pa() for linear map addresses. Add it to all the existing callsites where we pass pointers to OPAL. Signed-off-by: Andrew Donnellan --- arch/powerpc/kvm/book3s_hv_builtin.c | 2 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 20 ++- arch/powerpc/platforms/powernv/ocxl

Re: [PATCH 1/2] cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()

2022-11-20 Thread Andrew Donnellan
-off-by: Yang Yingliang Thanks for the fix! Acked-by: Andrew Donnellan > --- >  drivers/misc/cxl/guest.c | 24 ++-- >  1 file changed, 14 insertions(+), 10 deletions(-) > > diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c > index 375f692ae9d6..fb95

Re: [PATCH 2/2] cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()

2022-11-20 Thread Andrew Donnellan
powernv PCIe based cards > for userspace access") > Signed-off-by: Yang Yingliang See reply to patch #1. This patch puts a few things between the device_del() call and the put_device() call, but that looks fine - we don't touch afu->dev in the middle. Thanks for the fix! Acked

Re: [PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-20 Thread Andrew Donnellan
s for the fix - as you point out, put_device() should clean everything up that needs cleaning up. Acked-by: Andrew Donnellan > --- >  drivers/misc/ocxl/file.c | 7 +-- >  1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/oc

Re: [PATCH] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-20 Thread Andrew Donnellan
reset_reload &= ~BIT(0); > pci_write_config_dword(dev0, pos + > OCXL_DVSEC_VENDOR_RESET_RELOAD, >    reset_reload); > +   if (PCI_FUNC(dev->devfn) != 0) > +   pci_dev_put(dev0); > return 0; >  } >   -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH v2] ocxl: fix pci device refcount leak when calling get_function_0()

2022-11-21 Thread Andrew Donnellan
) is not called, so > pci_dev_put() can be called in the error path and callers > unconditionally. And add comment above get_dvsec_vendor0() to tell > callers to call pci_dev_put(). > > Fixes: 87db7579ebd5 ("ocxl: control via sysfs whether the FPGA is > reloaded on a link re

Re: [PATCH 02/13] powerpc/rtasd: use correct OF API for event scan rate

2022-11-21 Thread Andrew Donnellan
ax which I see you clean up later in the series. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtasd.c | 7 +-- >  1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/rtasd.c > b/arch/powerpc/kernel/rtasd.c > index 5270b450

Re: [PATCH 01/13] powerpc/rtas: document rtas_call()

2022-11-21 Thread Andrew Donnellan
I'm not overly familiar with some of the RTAS internal stuff you describe, but I've checked the status codes against my copy of PAPR and they concur, so I'll give this a: Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/include/asm/rtas.h | 15 - >

Re: [PATCH 03/13] powerpc/rtas: avoid device tree lookups in rtas_os_term()

2022-11-21 Thread Andrew Donnellan
() since > it is a boolean property, not a RTAS function token. > > Signed-off-by: Nathan Lynch This seems sensible, minor comment below. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtas.c | 14 +++--- >  1 file changed, 11 insertions(+), 3 deletions(-) &

Re: [PATCH 04/13] powerpc/rtas: avoid scheduling in rtas_os_term()

2022-11-21 Thread Andrew Donnellan
effects > whether to attempt the ibm,os-term RTAS call again. > > Signed-off-by: Nathan Lynch Makes sense. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtas.c | 7 ++- >  1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/r

Re: [PATCH 05/13] powerpc/pseries/eeh: use correct API for error log size

2022-11-21 Thread Andrew Donnellan
VICE) { This is now impossible, and the whole block makes little sense after the next patch >         pr_info("%s: unknown EEH error log size\n", > __func__); -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH 06/13] powerpc/rtas: clean up rtas_error_log_max initialization

2022-11-21 Thread Andrew Donnellan
not the name of > an > RTAS function. Convert use of printk() to pr_warn() and distinguish > the possible error cases. > > Signed-off-by: Nathan Lynch Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtas.c | 37 ++-- > - >  1

Re: [PATCH 08/13] powerpc/rtas: define pr_fmt and convert printk call sites

2022-11-21 Thread Andrew Donnellan
s_halt() all > currently use printk() without specifying a log level. These have > been > changed to use pr_emerg(), which matches the behavior of > rtas_os_term(). > > Signed-off-by: Nathan Lynch Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtas.c | 19 +

Re: [PATCH 09/13] powerpc/rtas: mandate RTAS syscall filtering

2022-11-21 Thread Andrew Donnellan
revents harmful abuses of the rtas syscall. > > Let's make it unconditional. > > Signed-off-by: Nathan Lynch Agreed. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/Kconfig   | 13 - >  arch/powerpc/kernel/rtas.c | 16 >  2

Re: [PATCH 07/13] powerpc/rtas: clean up includes

2022-11-21 Thread Andrew Donnellan
es that have been rendered unnecessary. Sort the > remainder (with linux/ before asm/) to impose some order on where > future additions go. > > Signed-off-by: Nathan Lynch Compiles for me. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/kernel/rtas.c | 42 +++-

Re: [PATCH] cxl: Fix refcount leak in cxl_calc_capp_routing

2022-11-21 Thread Andrew Donnellan
On Mon, 2022-11-14 at 12:42 +, Christophe Leroy wrote: > Should this be applied by Bjorn as most recent changes to that file ? We usually take cxl patches through powerpc, though sometimes Greg picks them up through char-misc. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-22 Thread Andrew Donnellan
for the userspace API, and switch kernel users over to using rtas_function_index directly? > +enum rtas_function_flags { > +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), > +}; This seems to be new, what's the justification? -- Andrew DonnellanOzLabs, ADL Ca

Re: [PATCH 11/13] powerpc/rtas: strengthen do_enter_rtas() type safety, drop inline

2022-11-22 Thread Andrew Donnellan
tas_args struct fields. > > There's no apparent reason to force inlining of do_enter_rtas() > either, and it seems to bloat the code a bit. Let the compiler > decide. > > Signed-off-by: Nathan Lynch Makes sense! Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/ker

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-23 Thread Andrew Donnellan
On Wed, 2022-11-23 at 13:32 -0600, Nick Child wrote: > On 11/22/22 20:51, Andrew Donnellan wrote: > > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > > > +enum rtas_function_flags { > > > +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), > &

Re: [PATCH v2 1/7] selftests/powerpc: Use mfspr/mtspr macros

2022-11-24 Thread Andrew Donnellan
On Wed, 2022-11-23 at 10:10 +1100, Benjamin Gray wrote: > No need to write inline asm for mtspr/mfspr, we have macros for this > in reg.h > > Signed-off-by: Benjamin Gray Good cleanup. Reviewed-by: Andrew Donnellan > --- >  tools/testing/selftests/powerpc/ds

Re: [PATCH v10 5/9] cxl: Use radix__flush_all_mm instead of generic flush_all_mm

2022-11-24 Thread Andrew Donnellan
b in > the first place. > > Signed-off-by: Benjamin Gray [+ Fred] This seems fine to me. Reviewed-by: Andrew Donnellan > --- > v10:* New in v10 to remove hash__flush_all_mm, > hash__local_flush_all_mm > --- >  arch/powerpc/include/asm/mmu_context.h | 6 +++--- >  1 file c

Re: [PATCH v10 3/9] powerpc/mm: Remove extern from function prototypes

2022-11-24 Thread Andrew Donnellan
On Wed, 2022-11-09 at 15:51 +1100, Benjamin Gray wrote: > Remove the extern keyword from function declarations. It is redundant > and would cause inconsistent style when new functions are added > without > it. > > Signed-off-by: Benjamin Gray Reviewed-by: Andrew Donne

Re: [PATCH 5/6] powerpc/pseries: replace kmalloc with kzalloc in PLPKS driver

2022-11-24 Thread Andrew Donnellan
  > -   if (consumer == PKS_FW_OWNER || consumer == > PKS_BOOTLOADER_OWNER) { > -   auth->passwordlength = 0; > +   if (consumer == PKS_FW_OWNER || consumer == > PKS_BOOTLOADER_OWNER) > return auth; > -   } This bit seems spurious. >   >  

Re: [PATCH 1/6] powerpc/pseries: fix the object owners enum value in plpks driver

2022-11-24 Thread Andrew Donnellan
@@ -17,7 +17,7 @@ >  #define WORLDREADABLE 0x0800 >  #define SIGNEDUPDATE 0x0100 >   > -#define PLPKS_VAR_LINUX0x01 > +#define PLPKS_VAR_LINUX    0x02 >  #define PLPKS_VAR_COMMON   0x04 >   >  struct plpks_var { -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH 2/6] powerpc/pseries: Fix the H_CALL error code in PLPKS driver

2022-11-24 Thread Andrew Donnellan
for Platform > KeyStore") > Signed-off-by: Nayna Jain This does indeed match my understanding of the PAPR spec. Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/include/asm/hvcall.h  | 3 +-- >  arch/powerpc/platforms/pseries/plpks.c | 2 +- >  2 files changed, 2 insert

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Andrew Donnellan
On Mon, 2022-11-28 at 18:08 -0600, Nathan Lynch wrote: > Andrew Donnellan writes: > > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > > > Convert rtas_token() to use a lockless binary search on the > > > function > > > table. Fall back to the ol

Re: [PATCH 3/6] powerpc/pseries: Return -EIO instead of -EINTR for H_ABORTED error

2022-11-29 Thread Andrew Donnellan
2a ("powerpc/pseries: define driver for Platform > KeyStore") > Signed-off-by: Nayna Jain The interface spec states that, for PKS-related hcalls, H_Aborted means "error occurred processing request" rather than something that would specifically map to EINTR, so I think E

Re: [PATCH v3 2/7] selftests/powerpc: Add ptrace setup_core_pattern() null-terminator

2022-12-01 Thread Andrew Donnellan
ations on the buffer is risky. Explicitly add a > null > character to the end to make it safer. > > Signed-off-by: Benjamin Gray Reviewed-by: Andrew Donnellan > --- >  tools/testing/selftests/powerpc/ptrace/core-pkey.c | 4 +++- >  1 file changed, 3 insertions(+), 1

Re: [PATCH 2/4] fs: define a firmware security filesystem named fwsecurityfs

2022-12-11 Thread Andrew Donnellan
ful > before we develop the next patch. Ping - it would be helpful for us to know your thoughts on this. Andrew -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

[PATCH 0/4] PLPKS bugfixes and enhancements

2022-12-19 Thread Andrew Donnellan
-2-na...@linux.ibm.com/ Many thanks to Russell Currey and Ben Gray for their help on this series. Andrew Donnellan (2): powerpc/pseries: Fix handling of PLPKS object flushing timeout powerpc/pseries: Fix alignment of PLPKS structures and buffers Nayna Jain (2): powerpc/pseries: Expose PLPKS c

[PATCH 1/4] powerpc/pseries: Fix handling of PLPKS object flushing timeout

2022-12-19 Thread Andrew Donnellan
urned to the user. Handle the timeout case separately and return ETIMEDOUT if triggered. Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore") Reported-by: Benjamin Gray Signed-off-by: Andrew Donnellan --- arch/powerpc/platforms/pseries/plpks.c | 11 +--

[PATCH 4/4] powerpc/pseries: Implement signed update for PLPKS objects

2022-12-19 Thread Andrew Donnellan
ommit message, add timeout handling] Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan --- arch/powerpc/include/asm/hvcall.h | 3 +- arch/powerpc/platforms/pseries/plpks.c | 81 +++--- arch/powerpc/platforms/pseries/plpks.h | 5 ++ 3 files changed, 79 inser

[PATCH 3/4] powerpc/pseries: Expose PLPKS config values, support additional fields

2022-12-19 Thread Andrew Donnellan
Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan --- arch/powerpc/platforms/pseries/plpks.c | 118 ++--- arch/powerpc/platforms/pseries/plpks.h | 58 2 files changed, 164 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/platforms/pseries/

[PATCH 2/4] powerpc/pseries: Fix alignment of PLPKS structures and buffers

2022-12-19 Thread Andrew Donnellan
not cross page boundaries Round up the allocations of these structures/buffers to the next power of 2 to make sure this happens. Reported-by: Benjamin Gray Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore") Signed-off-by: Andrew Donnellan --- arch/powerpc

Re: [PATCH v2 1/7] powerpc/pseries: Log hcall return codes for PLPKS debug

2023-01-03 Thread Andrew Donnellan
e don't lose information from the conversion. > > Signed-off-by: Russell Currey This is indeed useful to have. Reviewed-by: Andrew Donnellan Tested-by: Andrew Donnellan > --- >  arch/powerpc/platforms/pseries/plpks.c | 2 ++ >  1 file changed, 2 insertions(+) > > diff

Re: [PATCH] drivers/misc/ocxl/context.c : eliminate unnecessary type conversions

2023-01-03 Thread Andrew Donnellan
On Mon, 2022-12-26 at 10:51 +0800, Dong Chuanjian wrote: > remove unnecessary void* type casting. > > Signed-off-by: Dong Chuanjian [+linuxppc-dev, which was misspelled in the original email] Acked-by: Andrew Donnellan > > diff --git a/drivers/misc/ocxl/context.c > b

Re: [PATCH v2 2/7] powerpc/secvar: WARN_ON_ONCE() if multiple secvar ops are set

2023-01-03 Thread Andrew Donnellan
t; +const struct secvar_operations *secvar_ops __ro_after_init = NULL; I think this is implicitly NULL, but it's fine to make it explicit. Reviewed-by: Andrew Donnellan >   >  void set_secvar_ops(const struct secvar_operations *ops) >  { > +   WARN_ON_ONCE(secvar_ops);

Re: [PATCH v2 3/7] powerpc/secvar: Use sysfs_emit() instead of sprintf()

2023-01-03 Thread Andrew Donnellan
On Fri, 2022-12-30 at 15:20 +1100, Russell Currey wrote: > The secvar format string and object size sysfs files are both ASCII > text, and should use sysfs_emit().  No functional change. > > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Russell Currey LGTM Reviewed-by: A

Re: [PATCH v2 4/7] powerpc/secvar: Handle format string in the consumer

2023-01-03 Thread Andrew Donnellan
igned-off-by: Russell Currey LGTM Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/include/asm/secvar.h    |  1 + >  arch/powerpc/kernel/secvar-sysfs.c   | 21 +--- >  arch/powerpc/platforms/powernv/opal-secvar.c | 25 > >  3

Re: [PATCH 4/4] powerpc/pseries: Implement signed update for PLPKS objects

2023-01-03 Thread Andrew Donnellan
> friendly > error code?  If I'm reading this right, we'd be replacing any non- > zero > return code with -EINVAL. Good catch, will fix. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH 3/4] powerpc/pseries: Expose PLPKS config values, support additional fields

2023-01-03 Thread Andrew Donnellan
ocumentation also says this value must be at least 255, if we sanity > check that we don't have to worry about underflow. Agreed, and it makes more sense for the value that we return to the user to be the same as the number we actually get from the hypervisor. I'll fix it in the next

Re: [PATCH v2 5/7] powerpc/secvar: Handle max object size in the consumer

2023-01-03 Thread Andrew Donnellan
hould > be > no functional change. > > Signed-off-by: Russell Currey LGTM Reviewed-by: Andrew Donnellan > --- >  arch/powerpc/include/asm/secvar.h    |  1 + >  arch/powerpc/kernel/secvar-sysfs.c   | 17 +++-- >  arch/powerpc/platforms/powernv/opal-s

Re: [PATCH v2 6/7] powerpc/secvar: Extend sysfs to include config vars

2023-01-04 Thread Andrew Donnellan
t; they need to. > > This is not being used by the OPAL secvar implementation at present, > and > the config directory will not be created if no attributes are set. > > Signed-off-by: Russell Currey Minor comments below, but regardless: Reviewed-by: Andrew Donnellan > --- >

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-05 Thread Andrew Donnellan
he hypervisor will give you anyway). In a previous internal version, we printed a message when PAGE_SIZE < plpks_get_maxobjectsize(), might be worth still doing that? > > Co-developed-by: Nayna Jain > Signed-off-by: Nayna Jain > Co-developed-by: Andrew Donnellan > Signed-off-by:

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-08 Thread Andrew Donnellan
e shortly we need to wire plpks up with the integrity subsystem to load keys into kernel keyrings. > > > diff --git a/arch/powerpc/platforms/pseries/plpks-secvar.c > > b/arch/powerpc/platforms/pseries/plpks-secvar.c > > new file mode 100644 > > index ..829

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-08 Thread Andrew Donnellan
ll make the > other multi-line comments similarly old-fashioned for consistency. Sigh, I was trying to encourage you to move into the future... -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH 4/4] powerpc/pseries: Implement signed update for PLPKS objects

2023-01-08 Thread Andrew Donnellan
On Fri, 2023-01-06 at 21:54 +1100, Michael Ellerman wrote: > > +int plpks_signed_update_var(struct plpks_var var, u64 flags) > > +{ > > I don't see a reason why var is passed by value here? A pointer would > be > more typical. Will change. -- Andrew Donnel

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-08 Thread Andrew Donnellan
both pseries and powernv support, in which case plpks_secvar_init() will be called unconditionally even when booting on a powernv machine. I can confirm that as it is, booting this on powernv qemu causes a panic. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-09 Thread Andrew Donnellan
into "buf". Maybe we want to avoid writing into "buf" > directly > in case the hcall fails or something, but the other 3 copies seem > unnecessary. In the general case, I don't like passing buffer pointers straight from parameters into hcalls, since the address has to be in the linear map, and that's a detail I'd rather hide from callers. But otherwise, yes I think we can probably shift to having the caller allocate the buffers. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-10 Thread Andrew Donnellan
x27;t think we need that config option at all, or if we do it > should > not be user selectable and just enabled automatically by > PSERIES_PLPKS. I actually think we should get rid of both PSERIES_PLPKS_SECVAR and PSERIES_PLPKS, and just use PPC_SECURE_BOOT / PPC_SECVAR_SYSFS. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH] powerpc/secvar: Use u64 in secvar_operations

2023-01-11 Thread Andrew Donnellan
> Change all the secvar related routines to use u64. > > Signed-off-by: Michael Ellerman Reviewed-by: Andrew Donnellan -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH] powerpc/secvar: Use u64 in secvar_operations

2023-01-16 Thread Andrew Donnellan
> Change all the secvar related routines to use u64. > > Signed-off-by: Michael Ellerman We're going to include this patch in the next revision of our dynamic key management series. -- Andrew DonnellanOzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

[PATCH v3 03/24] powerpc/secvar: Use sysfs_emit() instead of sprintf()

2023-01-17 Thread Andrew Donnellan
From: Russell Currey The secvar format string and object size sysfs files are both ASCII text, and should use sysfs_emit(). No functional change. Suggested-by: Greg Kroah-Hartman Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- v2: New patch (gregkh) --- arch/powerpc

[PATCH v3 01/24] powerpc/secvar: Use u64 in secvar_operations

2023-01-17 Thread Andrew Donnellan
chael Ellerman Reviewed-by: Russell Currey Reviewed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan --- v3: Include new patch --- arch/powerpc/include/asm/secvar.h| 9 +++-- arch/powerpc/kernel/secvar-sysfs.c | 8 arch/powerpc/platforms/powernv

[PATCH v3 02/24] powerpc/secvar: WARN_ON_ONCE() if multiple secvar ops are set

2023-01-17 Thread Andrew Donnellan
From: Russell Currey The secvar code only supports one consumer at a time. Multiple consumers aren't possible at this point in time, but we'd want it to be obvious if it ever could happen. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- arch/powerpc/kernel/secvar

[PATCH v3 00/24] pSeries dynamic secure boot secvar interface + platform keyring loading

2023-01-17 Thread Andrew Donnellan
later and update the docs. Use sysfs_emit() instead of sprintf() for all sysfs strings Change the size of the sysfs binary attributes to include the 8-byte flags header, preventing truncation of large writes. Andrew Donnellan (8): powerpc/secvar: Clean up init error message

[PATCH v3 04/24] powerpc/secvar: Handle format string in the consumer

2023-01-17 Thread Andrew Donnellan
From: Russell Currey The code that handles the format string in secvar-sysfs.c is entirely OPAL specific, so create a new "format" op in secvar_operations to make the secvar code more generic. No functional change. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --

[PATCH v3 06/24] powerpc/secvar: Clean up init error messages

2023-01-17 Thread Andrew Donnellan
Remove unnecessary prefixes from error messages in secvar_sysfs_init() (the file defines pr_fmt, so putting "secvar:" in every message is unnecessary). Make capitalisation and punctuation more consistent. Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: New

[PATCH v3 13/24] powerpc/pseries: Fix handling of PLPKS object flushing timeout

2023-01-17 Thread Andrew Donnellan
urned to the user. Handle the timeout case separately and return ETIMEDOUT if triggered. Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore") Reported-by: Benjamin Gray Signed-off-by: Andrew Donnellan Tested-by: Russell Currey Reviewed-by: Russell Currey

[PATCH v3 11/24] powerpc/pseries: Move plpks.h to include directory

2023-01-17 Thread Andrew Donnellan
From: Russell Currey Move plpks.h from platforms/pseries/ to include/asm/. This is necessary for later patches to make use of the PLPKS from code in other subsystems. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- v3: New patch --- .../powerpc/{platforms/pseries

[PATCH v3 08/24] powerpc/secvar: Allow backend to populate static list of variable names

2023-01-17 Thread Andrew Donnellan
ead, let the backend put a NULL-terminated array of variable names into secvar_ops->var_names, which will be used if get_next() is undefined. Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: New patch (ajd/mpe) --- arch/powerpc/include/asm/secvar.h | 4 ++ arch/powerpc/

[PATCH v3 09/24] powerpc/secvar: Warn when PAGE_SIZE is smaller than max object size

2023-01-17 Thread Andrew Donnellan
Due to sysfs constraints, when writing to a variable, we can only handle writes of up to PAGE_SIZE. It's possible that the maximum object size is larger than PAGE_SIZE, in which case, print a warning on boot so that the user is aware. Signed-off-by: Andrew Donnellan Signed-off-by: Ru

[PATCH v3 10/24] powerpc/secvar: Don't print error on ENOENT when reading variables

2023-01-17 Thread Andrew Donnellan
: Sudhakar Kuppusamy Signed-off-by: Andrew Donnellan --- v3: New patch --- arch/powerpc/kernel/secvar-sysfs.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 68fb0b857442..2499bfd04fad 100644

[PATCH v3 05/24] powerpc/secvar: Handle max object size in the consumer

2023-01-17 Thread Andrew Donnellan
Signed-off-by: Andrew Donnellan --- v3: Change uint64_t type to u64 (mpe) --- arch/powerpc/include/asm/secvar.h| 1 + arch/powerpc/kernel/secvar-sysfs.c | 17 +++-- arch/powerpc/platforms/powernv/opal-secvar.c | 19 +++ 3 files changed, 23

[PATCH v3 12/24] powerpc/pseries: Move PLPKS constants to header file

2023-01-17 Thread Andrew Donnellan
From: Russell Currey Move the constants defined in plpks.c to plpks.h, and standardise their naming, so that PLPKS consumers can make use of them later on. Signed-off-by: Russell Currey Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan --- v3: New patch --- arch/powerpc

[PATCH v3 17/24] powerpc/pseries: Log hcall return codes for PLPKS debug

2023-01-17 Thread Andrew Donnellan
ff-by: Russell Currey Signed-off-by: Andrew Donnellan --- arch/powerpc/platforms/pseries/plpks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c index 796ed5544ee5..96a026a37285 100644 --- a/arch/powerpc/plat

[PATCH v3 19/24] powerpc/pseries: Turn PSERIES_PLPKS into a hidden option

2023-01-17 Thread Andrew Donnellan
e keyrings. However, we can't get of the separate option completely, because it will also be used for SED Opal purposes. Change PSERIES_PLPKS into a hidden option, which is selected by PPC_SECURE_BOOT. Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: New patch --

[PATCH v3 14/24] powerpc/pseries: Fix alignment of PLPKS structures and buffers

2023-01-17 Thread Andrew Donnellan
not cross page boundaries Round up the allocations of these structures/buffers to the next power of 2 to make sure this happens. Reported-by: Benjamin Gray Fixes: 2454a7af0f2a ("powerpc/pseries: define driver for Platform KeyStore") Signed-off-by: Andrew Donnellan Reviewed-by: Russ

[PATCH v3 18/24] powerpc/pseries: Make caller pass buffer to plpks_read_var()

2023-01-17 Thread Andrew Donnellan
data to NULL and var->datalen will be populated. Update header file to document this. Suggested-by: Michael Ellerman Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: New patch (mpe) --- arch/powerpc/include/asm/plpks.h | 12 arch/powerpc/platforms/p

[PATCH v3 15/24] powerpc/pseries: Expose PLPKS config values, support additional fields

2023-01-17 Thread Andrew Donnellan
lit patch, extend to support additional v3 API fields, minor fixes] Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: Merge plpks fixes and signed update series with secvar series Refresh config values in plpks_get_usedspace() (ajd)

[PATCH v3 24/24] integrity/powerpc: Support loading keys from pseries secvar

2023-01-17 Thread Andrew Donnellan
format is expected to be the same, so there shouldn't be any functional differences between objects retrieved from powernv and pseries. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- v3: New patch --- .../integrity/platform_certs/load_powerpc.c | 17 ++

[PATCH v3 20/24] powerpc/pseries: Add helpers to get PLPKS password

2023-01-17 Thread Andrew Donnellan
From: Russell Currey Add helper functions to get the PLPKS password. This will be used in a later patch to support passing the password between kernels over kexec. Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- v3: New patch --- arch/powerpc/include/asm/plpks.h

[PATCH v3 22/24] powerpc/pseries: Implement secvars for dynamic secure boot

2023-01-17 Thread Andrew Donnellan
ue to the underlying implementation of sysfs binary attributes, as is the case for the OPAL secvar implementation - partial writes are unsupported and writes cannot be larger than PAGE_SIZE. Co-developed-by: Nayna Jain Signed-off-by: Nayna Jain Co-developed-by: Andrew Donnellan Signed-off-by: A

[PATCH v3 16/24] powerpc/pseries: Implement signed update for PLPKS objects

2023-01-17 Thread Andrew Donnellan
dling and misc cleanups] Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan Signed-off-by: Russell Currey --- v3: Merge plpks fixes and signed update series with secvar series Fix error code handling in plpks_confirm_object_flushed() (ruscur) Pass plpks_var stru

[PATCH v3 23/24] integrity/powerpc: Improve error handling & reporting when loading certs

2023-01-17 Thread Andrew Donnellan
From: Russell Currey A few improvements to load_powerpc.c: - include integrity.h for the pr_fmt() - move all error reporting out of get_cert_list() - use ERR_PTR() to better preserve error detail - don't use pr_err() for missing keys Signed-off-by: Russell Currey Signed-off-by: A

[PATCH v3 07/24] powerpc/secvar: Extend sysfs to include config vars

2023-01-17 Thread Andrew Donnellan
implementation at present, and the config directory will not be created if no attributes are set. Signed-off-by: Russell Currey Co-developed-by: Andrew Donnellan Signed-off-by: Andrew Donnellan --- v3: Remove unnecessary "secvar:" prefix from error messages (ajd) Merge config attri

[PATCH v3 21/24] powerpc/pseries: Pass PLPKS password on kexec

2023-01-17 Thread Andrew Donnellan
-off-by: Andrew Donnellan --- v3: New patch --- arch/powerpc/kexec/file_load_64.c | 17 - arch/powerpc/platforms/pseries/plpks.c | 18 +- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec

Re: [PATCH v3 21/24] powerpc/pseries: Pass PLPKS password on kexec

2023-01-18 Thread Andrew Donnellan
On Wed, 2023-01-18 at 17:10 +1100, Andrew Donnellan wrote: > >  struct umem_info { > u64 *buf;   /* data buffer for usable-memory > property */ > @@ -1155,7 +1156,7 @@ int setup_new_fdt_ppc64(const struct kimage > *image, void *fdt, >

[PATCH] docs: powerpc: Fix tables in syscall64-abi.rst

2021-02-24 Thread Andrew Donnellan
to separate the registers into different rows and add headings. Fixes: 209b44c804c ("docs: powerpc: syscall64-abi.rst: fix a malformed table") Signed-off-by: Andrew Donnellan --- Documentation/powerpc/syscall64-abi.rst | 51 - 1 file changed, 32 insertions(+), 19 d

<    1   2   3   4   5   6   7   8   9   10   >