Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-10 Thread Thiago Jung Bauermann
Hello Samuel, Samuel Holland writes: > On 2024-04-10 8:02 PM, Thiago Jung Bauermann wrote: >> Samuel Holland writes: >>> On 2024-04-10 5:21 PM, Thiago Jung Bauermann wrote: >>>> >>>> Unfortunately this patch causes build failures on arm with allye

Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-10 Thread Thiago Jung Bauermann
Hello Samuel, Thank you for the quick reply! Samuel Holland writes: > On 2024-04-10 5:21 PM, Thiago Jung Bauermann wrote: >> >> Unfortunately this patch causes build failures on arm with allyesconfig >> and allmodconfig. Tested with next-20240410. > In both case

Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-10 Thread Thiago Jung Bauermann
Hello, Samuel Holland writes: > Now that all previously-supported architectures select > ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead > of the existing list of architectures. It can also take advantage of the > common kernel-mode FPU API and method of adjusting CFLA

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-02-23 Thread Thiago Jung Bauermann
+++++++ > include/linux/of.h | 5 + > 3 files changed, 276 insertions(+) > create mode 100644 drivers/of/kexec.c With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 04/13] x86: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
arch/x86/kernel/kexec-bzimage64.c | 2 +- > arch/x86/kernel/machine_kexec_64.c | 4 ++-- > 4 files changed, 10 insertions(+), 15 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 04/13] x86: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
--- > arch/x86/kernel/kexec-bzimage64.c | 2 +- > arch/x86/kernel/machine_kexec_64.c | 4 ++-- > 4 files changed, 10 insertions(+), 15 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 03/13] powerpc: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
and the commit id is meaningless. > Reported-by: kernel test robot > --- > arch/powerpc/include/asm/kexec.h | 4 > arch/powerpc/kexec/file_load.c| 6 +++--- > arch/powerpc/kexec/file_load_64.c | 14 +++--- > 3 files changed, 10 insertions(+), 14 deletions(-)

Re: [PATCH v19 02/13] arm64: Use ELF fields defined in 'struct kimage'

2021-02-23 Thread Thiago Jung Bauermann
and the commit id is meaningless. > Reported-by: kernel test robot > --- > arch/arm64/include/asm/kexec.h | 4 > arch/arm64/kernel/machine_kexec_file.c | 18 +- > 2 files changed, 9 insertions(+), 13 deletions(-) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v19 01/13] kexec: Move ELF fields to struct kimage

2021-02-23 Thread Thiago Jung Bauermann
; 1 file changed, 5 insertions(+) With that fixed: Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-19 Thread Thiago Jung Bauermann
space needed by the kdump kernel, and change the function name so that it better reflects what the function is now doing. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/elf_64.c | 2 +- arch/powerp

Re: [PATCH] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-19 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/19/21 6:25 AM, Thiago Jung Bauermann wrote: > > One small nit in the function header (please see below), but otherwise the > change looks good. > > Reviewed-by: Lakshmi Ramasubramanian Thanks for your review. I incorporated your sugges

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-19 Thread Thiago Jung Bauermann
bramanian >> > > wrote: >> > >> >> > >> On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: >> > >>> >> > >>> Lakshmi Ramasubramanian writes: >> > >>> >> > >>

[PATCH] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-19 Thread Thiago Jung Bauermann
space needed by the kdump kernel, and change the function name so that it better reflects what the function is now doing. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/elf_64.c | 2 +- arch/powerpc/kexec/file_load_64.c | 26 -

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-19 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: >> Lakshmi Ramasubramanian writes: >> >>> On 2/18/21 4:07 PM, Mimi Zohar wrote: >>> >>> Hi Mimi, >>> >>>> On Thu, 2021-02-18 at 14:33 -0800, La

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-18 Thread Thiago Jung Bauermann
reusing CONFIG_HAVE_IMA_KEXEC for ppc. > > But for arm64, CONFIG_HAVE_IMA_KEXEC is enabled in the final patch in the > patch > set (the one for carrying forward IMA log across kexec for arm64). arm64 calls > of_kexec_alloc_and_setup_fdt() prior to enabling CONFIG_HAVE_IMA_KEXEC and > hence > breaks the build for arm64. One problem is that I believe that this patch won't placate the robot, because IIUC it generates config files at random and this change still allows hppa and s390 to enable CONFIG_OF_KEXEC. Perhaps a new CONFIG_HAVE_KIMAGE_ARCH option? Not having that option would still allow building kexec.o, but would be used inside kexec.c to avoid accessing kimage.arch members. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 03/11] of: Add a common kexec FDT setup function

2021-02-15 Thread Thiago Jung Bauermann
amasubramanian > --- > drivers/of/Makefile | 6 + > drivers/of/kexec.c | 265 ++++++++ > include/linux/of.h | 5 + > 3 files changed, 276 insertions(+) > create mode 100644 drivers/of/kexec.c Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 06/11] powerpc: Move ima buffer fields to struct kimage

2021-02-15 Thread Thiago Jung Bauermann
a/ima_kexec.c | 8 ++-- > 5 files changed, 11 insertions(+), 37 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 05/11] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-15 Thread Thiago Jung Bauermann
c/elf_64.c | 30 --- > arch/powerpc/kexec/file_load.c| 132 +- > arch/powerpc/kexec/file_load_64.c | 3 + > 4 files changed, 26 insertions(+), 140 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 04/11] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-15 Thread Thiago Jung Bauermann
> 1 file changed, 8 insertions(+), 172 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 01/11] powerpc: Rename kexec elfcorehdr_addr to elf_load_addr

2021-02-15 Thread Thiago Jung Bauermann
h/powerpc/include/asm/kexec.h | 2 +- > arch/powerpc/kexec/file_load.c| 4 ++-- > arch/powerpc/kexec/file_load_64.c | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v18 02/11] arm64: Rename kexec elf_headers_mem to elf_load_addr

2021-02-15 Thread Thiago Jung Bauermann
for setting up the device tree for > kexec system call. > > Rename elf_headers_mem to elf_load_addr to align with powerpc name so > common code can use it. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/arm64/include/a

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-12 Thread Thiago Jung Bauermann
nian >>>> wrote: >>>>> >>>>> On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: >>>>>> >>>>>> There's actually a complication that I just noticed and needs to be >>>>>> addressed. More below. &g

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/11/21 6:11 PM, Thiago Jung Bauermann wrote: >> Lakshmi Ramasubramanian writes: >> >>> On 2/11/21 3:59 PM, Thiago Jung Bauermann wrote: >>>> Lakshmi Ramasubramanian writes: >>>> >>>>> O

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/11/21 3:59 PM, Thiago Jung Bauermann wrote: >> Lakshmi Ramasubramanian writes: >> >>> On 2/11/21 9:42 AM, Lakshmi Ramasubramanian wrote: >>>> Hi Rob, >>>> [PATCH] powerpc: Rename kexec elfcorehdr_addr

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: >> There's actually a complication that I just noticed and needs to be >> addressed. More below. >> > > <...> > >>> + >>> +/* >>> + * o

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
4 KB to initial_boot_params won't be enough for crash kernels on ppc64. The current powerpc code doubles the size of initial_boot_params (which is normally larger than 4 KB) and even that isn't enough. A patch was added to powerpc/next today which uses a more precise (but arch-specific) formula: https://lore.kernel.org/linuxppc-dev/161243826811.119001.14083048209224609814.stgit@hbathini/ So I believe we need a hook here where architectures can provide their own specific calculation for the size of the fdt. Perhaps a weakly defined function providing a default implementation which an arch-specific file can override (a la arch_kexec_kernel_image_load())? Then the powerpc specific hook would be the kexec_fdt_totalsize_ppc64() function from the patch I linked above. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Thiago Jung Bauermann
ld be better than adding an #if condition. >> void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, >> unsigned long initrd_load_addr, >> unsigned long initrd_len, >> const char *cmdline) >> { >>

Re: [PATCH v17 10/10] arm64: Enable passing IMA log to next kernel on kexec

2021-02-10 Thread Thiago Jung Bauermann
Prakhar Srivastava > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/arm64/Kconfig | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 09/10] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-10 Thread Thiago Jung Bauermann
uot;. > > Co-developed-by: Prakhar Srivastava > Signed-off-by: Prakhar Srivastava > Signed-off-by: Lakshmi Ramasubramanian > --- > arch/powerpc/include/asm/kexec.h | 1 - > arch/powerpc/kexec/file_load.c | 32 -------- > 2 files changed,

Re: [PATCH v17 07/10] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-10 Thread Thiago Jung Bauermann
es changed, 241 insertions(+), 272 deletions(-) > delete mode 100644 arch/powerpc/include/asm/ima.h > delete mode 100644 arch/powerpc/kexec/ima.c Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 06/10] powerpc: Enable passing IMA log to next kernel on kexec

2021-02-10 Thread Thiago Jung Bauermann
CONFIG_IMA > is enabled, to indicate that the IMA measurement log information is > present in the device tree for powerpc. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Thiago Jung Bauermann > --- > arch/powerpc/Kconfig | 2 +- > 1 file changed, 1 insertion(+),

Re: [PATCH v17 04/10] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Thiago Jung Bauermann
initrd_len, cmdline); > if (!fdt) { > pr_err("Not enough memory for the device tree.\n"); This error string can be a bit misleading now, since of_kexec_alloc_and_setup_fdt() can fail for reasons other than lack of memory. I suggest changing it to the error st

Re: [PATCH v17 03/10] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Thiago Jung Bauermann
> 1 file changed, 8 insertions(+), 172 deletions(-) Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-10 Thread Thiago Jung Bauermann
masubramanian > --- > drivers/of/Makefile | 6 ++ > drivers/of/kexec.c | 258 ++++++++ > include/linux/of.h | 13 +++ > 3 files changed, 277 insertions(+) > create mode 100644 drivers/of/kexec.c Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v2 2/2] memblock: do not start bottom-up allocations with kernel_end

2021-02-08 Thread Thiago Jung Bauermann
Mike Rapoport writes: > On Sat, Jan 23, 2021 at 06:09:11PM -0800, Andrew Morton wrote: >> On Fri, 22 Jan 2021 01:37:14 -0300 Thiago Jung Bauermann >> wrote: >> >> > Mike Rapoport writes: >> > >> > > > Signed-off-by: Rom

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-02-01 Thread Thiago Jung Bauermann
Joe Perches writes: > On Thu, 2021-01-28 at 00:52 -0300, Thiago Jung Bauermann wrote: >> The problem is that this patch implements only part of the suggestion, >> which isn't useful in itself. So the patch series should either drop >> this patch or consolidate the

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-29 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: >> > struct module *find_module(const char *name) >> > { >> > - module_assert_mutex(); >> >> Does it make sense to replace the asse

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Thiago Jung Bauermann
len, > > struct module *find_module(const char *name) > { > - module_assert_mutex(); Does it make sense to replace the assert above with the warn below (untested)? RCU_LOCKDEP_WARN(rcu_read_lock_sched_held()); > return find_module_all(name, strlen(name), false); &g

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-01-27 Thread Thiago Jung Bauermann
Lakshmi Ramasubramanian writes: > On 1/27/21 7:52 PM, Thiago Jung Bauermann wrote: >> Will Deacon writes: >> >>> On Wed, Jan 27, 2021 at 09:59:38AM -0800, Lakshmi Ramasubramanian wrote: >>>> On 1/27/21 8:52 AM, Will Deacon wrote: >>>> >&g

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-01-27 Thread Thiago Jung Bauermann
m this suggestion by Rob Herring: > This could be taken a step further and do the allocation of the new > FDT. The difference is arm64 uses vmalloc and powerpc uses kmalloc. The > arm64 version also retries with a bigger allocation. That seems > unnecessary. in https://lore.kernel.org/linux-integrity/20201211221006.1052453-3-r...@kernel.org/ The problem is that this patch implements only part of the suggestion, which isn't useful in itself. So the patch series should either drop this patch or consolidate the FDT allocation between the arches. I just tested on powernv and pseries platforms and powerpc can use vmalloc for the FDT buffer. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines

2021-01-25 Thread Thiago Jung Bauermann
Konrad Rzeszutek Wilk writes: > On Fri, Jan 08, 2021 at 09:27:01PM -0300, Thiago Jung Bauermann wrote: >> >> Ram Pai writes: >> >> > On Wed, Dec 23, 2020 at 09:06:01PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Hi Ram, >> >

Re: [PATCH v2 2/2] memblock: do not start bottom-up allocations with kernel_end

2021-01-25 Thread Thiago Jung Bauermann
Mike Rapoport writes: > On Sat, Jan 23, 2021 at 06:09:11PM -0800, Andrew Morton wrote: >> On Fri, 22 Jan 2021 01:37:14 -0300 Thiago Jung Bauermann >> wrote: >> >> > Mike Rapoport writes: >> > >> > > > Signed-off-by: Rom

Re: [PATCH 2/2] ima: Free IMA measurement buffer after kexec syscall

2021-01-22 Thread Thiago Jung Bauermann
> Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Tyler Hicks > Fixes: 7b8589cc29e7 ("ima: on soft reboot, save the measurement list") Good catch. Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH 1/2] ima: Free IMA measurement buffer on error

2021-01-22 Thread Thiago Jung Bauermann
gest just accepting the leak in this case. Fortunately, the current implementations of arch_ima_add_kexec_buffer() are very simple and cannot fail, so this is a theoretical problem. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v2 2/2] memblock: do not start bottom-up allocations with kernel_end

2021-01-21 Thread Thiago Jung Bauermann
xes: 8fabc623238e ("powerpc: Ensure that swiotlb buffer is allocated from low memory") This is because reverting the commit above also solves the problem on the machines where I've seen this issue. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines

2021-01-08 Thread Thiago Jung Bauermann
Ram Pai writes: > On Wed, Dec 23, 2020 at 09:06:01PM -0300, Thiago Jung Bauermann wrote: >> >> Hi Ram, >> >> Thanks for reviewing this patch. >> >> Ram Pai writes: >> >> > On Fri, Dec 18, 2020 at 03:21:03AM -0300, Thiago Jung Bauermann

Re: [PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines

2020-12-23 Thread Thiago Jung Bauermann
Hi Ram, Thanks for reviewing this patch. Ram Pai writes: > On Fri, Dec 18, 2020 at 03:21:03AM -0300, Thiago Jung Bauermann wrote: >> On server-class POWER machines, we don't need the SWIOTLB unless we're a >> secure VM. Nevertheless, if CONFIG_SWIOTLB is e

[PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines

2020-12-17 Thread Thiago Jung Bauermann
e, let's avoid the SWIOTLB in those cases. Fixes: eae9eec476d1 ("powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory") Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/mm/mem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/power

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Konrad Rzeszutek Wilk writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't nee

[PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
instead of memblock_alloc_low(). Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 4 arch/powerpc/mm/mem.c| 6 +- arch/powerpc/platforms/pseries/svm.c | 26 ++ 3 files changed, 35 insertions(+), 1 deletion(-) Chang

Re: [PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Mon, Aug 17, 2020 at 06:46:58PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't nee

Re: [PATCH] swiotlb: Allow allocating buffer anywhere in memory

2020-08-17 Thread Thiago Jung Bauermann
Hello Christoph, Christoph Hellwig writes: > On Sat, Aug 15, 2020 at 05:45:36PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >>

[PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-17 Thread Thiago Jung Bauermann
instead of memblock_alloc_low(). We also need to add swiotlb_set_no_iotlb_memory() in order to set the no_iotlb_memory flag if initialization fails. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 4 arch/powerpc/mm/mem.c| 6 +- arch/powerpc

[PATCH] swiotlb: Allow allocating buffer anywhere in memory

2020-08-15 Thread Thiago Jung Bauermann
a SWIOTLB initialization problem we are seeing in secure guests with 128 GB of RAM: they are configured with 4 GB of crashkernel reserved memory, which leaves no space for SWIOTLB in low addresses. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/mm/mem.c | 7 ++- include/linux/swio

Re: [PATCH v2] powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death

2020-08-11 Thread Thiago Jung Bauermann
XIVE cleanup code executed by the unplugged CPU. > > Fix this by waiting indefinitely, but also making an effort to avoid > spurious lockup messages by allowing for rescheduling after polling > the CPU status and printing a warning if we wait for longer than 120s. > > Fixes: eac1e731b59ee ("powerpc/xive: guest exploitation of the XIVE interrupt > controller") > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1856588 > Suggested-by: Michael Ellerman > Cc: Thiago Jung Bauermann > Cc: Michael Ellerman > Cc: Cedric Le Goater > Cc: Greg Kurz > Cc: Nathan Lynch > Signed-off-by: Michael Roth Thanks for fixing this! Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-04 Thread Thiago Jung Bauermann
e time was to make the "Querying >> DEAD?" >> messages to disappear and to avoid potentially concurrent calls to >> rtas-stop-self >> which is prohibited by PAPR... not fixing actual crashes. > > I'm pretty sure at one point we were triggering crashes *in* RTAS via > this path, I think that got resolved. Yes, pHyp's RTAS now tolerates concurrent calls to stop-self. The original bug that was reported when I worked on this ended in an RTAS crash because of this timeout. The crash was fixed then. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RESEND PATCH v5 08/11] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-27 Thread Thiago Jung Bauermann
with backup region and > crashed kernel's memory to avoid kdump kernel from accidentially using > that memory. > > Signed-off-by: Hari Bathini Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RESEND PATCH v5 07/11] ppc64/kexec_file: enable early kernel's OPAL calls

2020-07-27 Thread Thiago Jung Bauermann
igned-off-by: Hari Bathini Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RESEND PATCH v5 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-27 Thread Thiago Jung Bauermann
Bathini > Tested-by: Pingfan Liu I liked the new versions of get_node_path_size() and get_node_path(). Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-24 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 24/07/20 5:36 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> >>> Kdump kernel, used for capturing the kernel core image, is supposed >>> to use only specific memory regions to avoid corrupting the image to >&

Re: [PATCH v4 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-23 Thread Thiago Jung Bauermann
m > being stomped on while booting. > > Signed-off-by: Hari Bathini > Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-23 Thread Thiago Jung Bauermann
ackup region and > crashed kernel's memory to avoid kdump kernel from accidentially > using that memory. > > Reported-by: kernel test robot > [lkp: In v1, purgatory() declaration was missing] > Signed-off-by: Hari Bathini Reviewed-by: Thiago Jung Bauermann Just one

Re: [PATCH v4 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-23 Thread Thiago Jung Bauermann
ere, idx is pointing to the supposed '/' at the end of the node path ... > + end_char = '\0'; > + while (dn->parent) { > + path[--idx] = end_char; .. and in the first ireation, this is writing '\0' at a place which will be overwritten by the memcpy() below wi

Re: [PATCH v4 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-23 Thread Thiago Jung Bauermann
different kdump segments. > Override arch_kexec_locate_mem_hole() to locate a memory hole taking > these ranges into account. > > Signed-off-by: Hari Bathini Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-23 Thread Thiago Jung Bauermann
; Tested-by: Pingfan Liu Just one comment below, but regardless: Reviewed-by: Thiago Jung Bauermann > +/** > + * add_htab_mem_range - Adds htab range to the given memory ranges list, > + * if it exists > + * @mem_ranges: Range list to add th

Re: [PATCH v3 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-17 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 16/07/20 7:19 am, Thiago Jung Bauermann wrote: >> >> I didn't forget about this patch. I just wanted to see more of the >> changes before comenting on it. >> >> Hari Bathini writes: >> >>> Some of the

Re: [PATCH v3 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 16/07/20 5:50 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> >>> So, add support to relocate purgatory in kexec_file_load system call >>> by setting up TOC pointer and applying RELA relocations as needed. &g

Re: [PATCH v3 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 16/07/20 7:08 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> >>> @@ -968,7 +1040,7 @@ int setup_new_fdt_ppc64(const struct kimage *image, >>> void *fdt, >>> >>> /* >>> * Rest

Re: [PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 16/07/20 4:22 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> > > > >>> +/** >>> + * get_node_path - Get the full path of the given node. >>> + * @dn:Node. >&

Re: [PATCH v3 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 15/07/20 9:20 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> >>> @@ -534,7 +537,7 @@ static int __init >>> early_init_dt_scan_memory_ppc(unsigned long node, >>> #ifdef CONFIG_PPC_PSERIES >>

Re: [PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 15/07/20 8:09 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> > > > >>> +/** >>> + * __locate_mem_hole_top_down - Looks top down for a large enough memory >>> hole >>> + *

Re: [PATCH v3 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-16 Thread Thiago Jung Bauermann
Hari Bathini writes: > On 16/07/20 7:52 am, Thiago Jung Bauermann wrote: >> >> Hari Bathini writes: >> >>> /** >>> + * get_crash_memory_ranges - Get crash memory ranges. This list includes >>> + *

Re: [V2 PATCH 1/3] Refactoring powerpc code for carrying over IMA measurement logs, to move non architecture specific code to security/ima.

2020-07-16 Thread Thiago Jung Bauermann
Hello Prakhar, Prakhar Srivastava writes: > On 6/19/20 5:19 PM, Thiago Jung Bauermann wrote: >> >> Prakhar Srivastava writes: >> >>> Powerpc has support to carry over the IMA measurement logs. Refatoring the >>> non-architecture specific code ou

Re: [PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-15 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > Hari Bathini writes: > >> diff --git a/arch/powerpc/include/asm/crashdump-ppc64.h >> b/arch/powerpc/include/asm/crashdump-ppc64.h >> new file mode 100644 >> index 000..90deb46 >> --- /dev/null >> +++ b/arch/powerp

Re: [PATCH v3 12/12] ppc64/kexec_file: fix kexec load failure with lack of memory hole

2020-07-15 Thread Thiago Jung Bauermann
#x27;t be both booted at the same time, it's not a problem if both plan to use the same region of memory. > > Signed-off-by: Hari Bathini > Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann > --- > > v2 -> v3: > * Unchanged. Added Tested-by tag from Ping

Re: [PATCH v3 11/12] ppc64/kexec_file: add appropriate regions for memory reserve map

2020-07-15 Thread Thiago Jung Bauermann
aim likewise. > > Signed-off-by: Hari Bathini > Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann Just one oinor nit below. > --- > > v2 -> v3: > * Unchanged. Added Tested-by tag from Pingfan. > > v1 -> v2: > * Updated add_rtas_mem_range() & add_opal_mem_

Re: [PATCH v3 10/12] ppc64/kexec_file: prepare elfcore header for crashing kernel

2020-07-15 Thread Thiago Jung Bauermann
orehdr segment */ > + ret = prepare_elf_headers(image, cmem, &headers, &headers_sz); > + if (ret) { > + pr_err("Failed to prepare elf headers for the core\n"); > + goto out; > + } > + > + kbuf->buffer = headers; > + k

Re: [PATCH v3 02/12] powerpc/kexec_file: mark PPC64 specific code

2020-07-15 Thread Thiago Jung Bauermann
ory/trampoline.S to purgatory/trampoline_64.S in the > same spirit. There's only a 64 bit implementation of kexec_file_load() so this is a somewhat theoretical exercise, but there's no harm in getting the code organized, so: Reviewed-by: Thiago Jung Bauermann I have just one questi

Re: [PATCH v3 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-15 Thread Thiago Jung Bauermann
erty_read_u64(dn, "opal-entry-address", &val); > + ret = kexec_purgatory_get_set_symbol(image, "opal_entry", &val, > + sizeof(val), false); You need to call of_node_put(dn) here and in the if (ret) case above. > + } > out: > if (ret) > pr_err("Failed to setup purgatory symbols"); -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 09/12] ppc64/kexec_file: setup backup region for kdump kernel

2020-07-15 Thread Thiago Jung Bauermann
est, *src; > + > + src = (void *)BACKUP_SRC_START; > + if (backup_start) { > + dest = (void *)backup_start; > + __memcpy(dest, src, BACKUP_SRC_SIZE); > + } > +} In general I'm in favor of using C code over assembly, but having to bring in that relocation support just for the above makes me wonder if it's worth it in this case. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 08/12] ppc64/kexec_file: setup the stack for purgatory

2020-07-15 Thread Thiago Jung Bauermann
igned-off-by: Hari Bathini > Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann > --- > > v2 -> v3: > * Unchanged. Added Tested-by tag from Pingfan. > > v1 -> v2: > * Setting up opal base & entry values in r8 & r9 for early OPAL debug. > > >

Re: [PATCH v3 07/12] ppc64/kexec_file: add support to relocate purgatory

2020-07-15 Thread Thiago Jung Bauermann
n local_entry_offset() as > reported by lkp. lkp report for reference: > - https://lore.kernel.org/patchwork/patch/1264421/ > > > arch/powerpc/kexec/file_load_64.c | 337 > ++++++++ > arch/powerpc/purgatory/trampoline_64.S |8 + > 2 files changed, 345 insertions(+) -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel

2020-07-15 Thread Thiago Jung Bauermann
base = of_read_number(prop, n_mem_addr_cells); > + prop += n_mem_addr_cells; > + end = base + of_read_number(prop, n_mem_size_cells) - 1; You need to `prop += n_mem_size_cells` here. > + > + ret = add_usable_mem(um_info, base, end, &cnt); > +

Re: [PATCH v3 05/12] powerpc/drmem: make lmb walk a bit more flexible

2020-07-14 Thread Thiago Jung Bauermann
lk_drmem_lmbs(memory, NULL, numa_setup_drmem_lmb); Similarly here. Now that this call can fail, should parse_numa_properties() handle or propagate the failure? > of_node_put(memory); > } > -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 04/12] ppc64/kexec_file: avoid stomping memory used by special regions

2020-07-14 Thread Thiago Jung Bauermann
if (end < buf_min) > + continue; > + > + /* Memory hole not found */ > + if (start > buf_max) > + break; > + > + /* Adjust memory region based on the given range */ > + if (start < buf_min) > + start = buf_min; > + if (end > buf_max) > + end = buf_max; buf_max is an inclusive end address, right? Then this should read `end = buf_max + 1`. Same thing in the top-down version above. > + > + start = ALIGN(start, kbuf->buf_align); > + if (start < end && (end - start + 1) >= kbuf->memsz) { Same off-by-one problem. There shouldn't be a `+ 1` here. > + /* Suitable memory range found. Set kbuf->mem */ > + kbuf->mem = start; > + ret = 0; > + break; > + } > + } > + > + return ret; > +} -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 03/12] powerpc/kexec_file: add helper functions for getting memory ranges

2020-07-14 Thread Thiago Jung Bauermann
rt. > + * @merge: If true, merge the list after sorting. > + * > + * Returns nothing. > + */ > +void sort_memory_ranges(struct crash_mem *mrngs, bool merge) > +{ > + struct crash_mem_range *rngs; > + struct crash_mem_range rng; > + int i, j, idx; > + > + if (!mrngs) > + return; > + > + /* Sort the ranges in-place */ > + rngs = &mrngs->ranges[0]; > + for (i = 0; i < mrngs->nr_ranges; i++) { > + idx = i; > + for (j = (i + 1); j < mrngs->nr_ranges; j++) { > + if (rngs[idx].start > rngs[j].start) > + idx = j; > + } > + if (idx != i) { > + rng = rngs[idx]; > + rngs[idx] = rngs[i]; > + rngs[i] = rng; > + } > + } Would it work using sort() from lib/sort.c here? > + > + if (merge) > + __merge_memory_ranges(mrngs); > +} -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v3 01/12] kexec_file: allow archs to handle special regions while locating memory hole

2020-07-14 Thread Thiago Jung Bauermann
In v1, arch_kimage_file_post_load_cleanup() declaration was missing] > Signed-off-by: Hari Bathini > Acked-by: Dave Young > Tested-by: Pingfan Liu Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [V2 PATCH 2/3] dt-bindings: chosen: Document ima-kexec-buffer

2020-06-19 Thread Thiago Jung Bauermann
t; + chosen { > + linux,ima-kexec-buffer = <0x9 0x8200 0x0 0x8000>; > + }; > +}; > + > +This porperty does not represent real hardware, but the memory allocated for > +carrying the IMA measurement logs. The address and the suze are expressed in > +#address-cells and #size-cells, respectively of the root node. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [V2 PATCH 1/3] Refactoring powerpc code for carrying over IMA measurement logs, to move non architecture specific code to security/ima.

2020-06-19 Thread Thiago Jung Bauermann
ith IMA kexec buffers, there are two kernels (and thus their two respective, separate device trees) to be concerned about: 1. the currently running kernel, which uses the live device tree (accessed with the of_* functions) and the memblock subsystem; 2. the kernel which is being loaded by kexec, which will use the FDT blob being passed around as argument to these functions, and the memory reservations in the memory reservation table of the FDT blob. ima_free_kexec_buffer() is used by IMA in the currently running kernel. Therefore the device tree it is concerned about is the live one, and thus uses the of_* functions to access it. And uses memblock to change the memory reservation. remove_ima_buffer() on the other hand is used by the kexec code to prepare an FDT blob for the kernel that is being loaded. It should not make any changes to live device tree, nor to memblock allocations. It should only make changes to the FDT blob. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc/pseries/svm: Fixup align argument in alloc_shared_lppaca() function

2020-06-09 Thread Thiago Jung Bauermann
Satheesh Rajendran writes: > Argument "align" in alloc_shared_lppaca() function was unused inside the > function. Let's fix it and update code comment. > > Cc: linux-ker...@vger.kernel.org > Cc: Thiago Jung Bauermann > Cc: Ram Pai > Cc: Sukadev Bhattiprolu

Re: [PATCH] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

2020-06-09 Thread Thiago Jung Bauermann
, sig: 5 [#1] > [0.00] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries > > which is not necessary, let's remove it. > > Cc: linux-ker...@vger.kernel.org > Cc: Thiago Jung Bauermann > Cc: Ram Pai > Cc: Sukadev Bhattiprolu > Cc: Laurent Dufour >

Re: [RFC][PATCH 0/2] Add support for using reserved memory for ima buffer pass

2020-05-22 Thread Thiago Jung Bauermann
e the signers of the kernel and initrd. Such a > support exits only in powerpc. > This patch makes the carry over of logs architecture independent and puts the > complexity in a driver. If I'm not mistaken, the code at arch/powerpc/kexec/ima.c isn't actually powerpc-specific. It could be moved to an arch-independent directory and used by any other architecture which supports device trees. I think that's the simplest way forward. And to be honest I'm still trying to understand why you didn't take that approach. Did you try it and hit some obstacle or noticed a disadvantage for your use case? -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-04-03 Thread Thiago Jung Bauermann
Ram Pai writes: > On Tue, Mar 31, 2020 at 08:53:07PM -0300, Thiago Jung Bauermann wrote: >> >> Hi Ram, >> >> Ram Pai writes: >> >> > diff --git a/arch/powerpc/sysdev/xive/spapr.c >> > b/arch/powerpc/sysdev/xive/spapr.c >> > index

Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-03-31 Thread Thiago Jung Bauermann
rder(xive_queue_shift); > + if (is_secure_guest()) > + uv_unshare_page(PHYS_PFN(__pa(q->qpage)), 1 << alloc_order); > free_pages((unsigned long)q->qpage, alloc_order); > q->qpage = NULL; > } Same problem here. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH kernel v2 2/4] powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW

2019-12-16 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > On 17/12/2019 10:07, Thiago Jung Bauermann wrote: >> >> Alexey Kardashevskiy writes: >> >>> By default a pseries guest supports a H_PUT_TCE hypercall which maps >>> a single IOMMU page in a DMA window. Addi

Re: [PATCH kernel v2 4/4] powerpc/pseries/svm: Allow IOMMU to work in SVM

2019-12-16 Thread Thiago Jung Bauermann
atching! > [3.727965] WARNING: CPU: 0 PID: 1 at > (...)arch/powerpc/lib/feature-fixups.c:466 check_features+0xa4/0xc0 > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH kernel v2 3/4] powerpc/pseries/iommu: Separate FW_FEATURE_MULTITCE to put/stuff features

2019-12-16 Thread Thiago Jung Bauermann
tas/ibm,hypertas-functions" device tree property sets both; > the "multitce=off" kernel command line parameter disables both. > > This should not cause behavioural change. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH kernel v2 2/4] powerpc/pseries: Allow not having ibm, hypertas-functions::hcall-multi-tce for DDW

2019-12-16 Thread Thiago Jung Bauermann
to store these numbers. > > Fixes: 4e8b0cf46b25 ("powerpc/pseries: Add support for dynamic dma windows") > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann Some minor nits below. Feel free to ignore. > @@ -146,25 +

Re: [PATCH kernel v2 1/4] Revert "powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests"

2019-12-16 Thread Thiago Jung Bauermann
: added "revert" and "fixes:"] > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

  1   2   3   4   5   6   7   8   9   >