[RFC PATCH] KVM: PPC: Update MAINTAINERS

2023-04-07 Thread Nicholas Piggin
Michael is maintaining KVM PPC with the powerpc tree at the moment, just doesn't necessarily have time to be across all of KVM. But I think that's okay, from mechanics of how patches flow upstream he is maintainer. And it probably makes a bit more sense to people who need to look at the

[PATCH v2 4/4] KVM: PPC: selftests: add selftests sanity tests

2023-04-07 Thread Nicholas Piggin
Add tests that exercise very basic functions of the kvm selftests framework, guest creation, ucalls, hcalls, copying data between guest and host, interrupts and page faults. These don't stress KVM so much as being useful when developing support for powerpc. Acked-by: Michael Ellerman (powerpc)

[PATCH v2 3/4] KVM: PPC: selftests: add support for powerpc

2023-04-07 Thread Nicholas Piggin
Implement KVM selftests support for powerpc (Book3S-64). ucalls are implemented with an unsuppored PAPR hcall number which causes KVM to exit to userspace. For now virtual memory is only implemented for the radix MMU, and only the base page size is supported. Guest interrupts are taken in

[PATCH v2 2/4] KVM: selftests: Add aligned guest physical page allocator

2023-04-07 Thread Nicholas Piggin
powerpc will require this to allocate MMU tables in guest memory that are aligned and larger than the base page size. Signed-off-by: Nicholas Piggin --- .../selftests/kvm/include/kvm_util_base.h | 2 + tools/testing/selftests/kvm/lib/kvm_util.c| 44 --- 2 files changed,

[PATCH v2 1/4] KVM: selftests: Move pgd_created check into virt_pgd_alloc

2023-04-07 Thread Nicholas Piggin
virt_arch_pgd_alloc all do the same test and set of pgd_created. Move this into common code. Signed-off-by: Nicholas Piggin --- tools/testing/selftests/kvm/include/kvm_util_base.h | 5 + tools/testing/selftests/kvm/lib/aarch64/processor.c | 4

[PATCH v2 0/4] KVM: selftests: add powerpc support

2023-04-07 Thread Nicholas Piggin
This series adds initial KVM selftests support for powerpc (64-bit, BookS, radix MMU). Since v1: - Update MAINTAINERS KVM PPC entry to include kvm selftests. - Fixes and cleanups from Sean's review including new patch 1. - Add 4K guest page support requiring new patch 2. Thanks, Nick Nicholas

Re: [PATCH] powerpc/boot: Fix crt0.S current address branch form

2023-04-07 Thread Michael Ellerman
Nicholas Piggin writes: > Use the preferred form of branch-and-link for finding the current > address so objtool doesn't think it is an unannotated intra-function > call. We don't run objtool on this code in mainline AFAIK. Because BOOTAS doesn't call it. Did you actually see a warning, or are

[PATCH 6/6] powerpc/64: modules support building with PCREL addresing

2023-04-07 Thread Nicholas Piggin
Build modules using PCREL addressing when CONFIG_PPC_KERNEL_PCREL=y. - The module loader must handle several new relocation types: * R_PPC64_REL24_NOTOC is a function call handled like R_PPC_REL24, but does not restore r2 upon return. The external function call stub is changed to use

[PATCH 5/6] powerpc/64: vmlinux support building with PCREL addresing

2023-04-07 Thread Nicholas Piggin
PC-Relative or PCREL addressing is an extension to the ELF ABI which uses Power ISA v3.1 PC-relative instructions to calculate addresses, rather than the traditional TOC scheme. Add an option to build vmlinux using pcrel addressing. Modules continue to use TOC addressing. - TOC address helpers

[PATCH 4/6] powerpc: add CFUNC assembly label annotation

2023-04-07 Thread Nicholas Piggin
This macro is to be used in assembly where C functions are called. pcrel addressing mode requires branches to functions with a localentry value of 1 to have either a trailing nop or @notoc. This macro permits the latter without changing callers. Signed-off-by: Nicholas Piggin ---

[PATCH 3/6] powerpc/64: Add support to build with prefixed instructions

2023-04-07 Thread Nicholas Piggin
Add an option to build kernel and module with prefixed instructions if the CPU and toolchain support it. This is not related to kernel support for userspace execution of prefixed instructions. Building with prefixed instructions breaks some extended inline asm memory addressing, for example it

[PATCH 2/6] powerpc/64s: Run at the kernel virtual address earlier in boot

2023-04-07 Thread Nicholas Piggin
This mostly consolidates the Book3E and Book3S behaviour in boot WRT executing from the physical or virtual address. Book3E sets up kernel virtual linear map in start_initialization_book3e and runs from the virtual linear alias after that. This change makes Book3S begin to execute from the

[PATCH 0/6] powerpc/64: Build with PC-Relative addressing

2023-04-07 Thread Nicholas Piggin
This won't see a lot of real use until POWER10 is the oldest supported CPU for distros, but being as we're quite a unique user of toolchain I'd like to start ironing things out earlier rather than later. I'm making a list of observations here, https://github.com/linuxppc/issues/issues/455 and will

[PATCH 1/6] powerpc/64: Move initial base and TOC pointer calculation

2023-04-07 Thread Nicholas Piggin
A later change moves the non-prom case to run at the virtual address earlier, which calls for virtual TOC and kernel base. Split these two calculations for prom and non-prom to make that change simpler. Signed: Nicholas Piggin --- arch/powerpc/kernel/head_64.S | 28 +++-

Re: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors

2023-04-07 Thread Grant Grundler
[reposting in plain text mode] On Fri, Apr 7, 2023 at 12:46 PM Bjorn Helgaas wrote: > > On Fri, Apr 07, 2023 at 11:53:27AM -0700, Grant Grundler wrote: > > On Thu, Apr 6, 2023 at 12:50 PM Bjorn Helgaas wrote: > > > On Fri, Mar 17, 2023 at 10:51:09AM -0700, Grant Grundler wrote: > > > > From:

Re: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors

2023-04-07 Thread Grant Grundler
[reposting in plain text mode] On Fri, Apr 7, 2023 at 12:46 PM Bjorn Helgaas wrote: > > On Fri, Apr 07, 2023 at 11:53:27AM -0700, Grant Grundler wrote: > > On Thu, Apr 6, 2023 at 12:50 PM Bjorn Helgaas wrote: > > > On Fri, Mar 17, 2023 at 10:51:09AM -0700, Grant Grundler wrote: > > > > From:

Re: [PATCH v2 0/4] KVM: Refactor KVM stats macros and enable custom stat names

2023-04-07 Thread Sean Christopherson
On Mon, Mar 06, 2023, David Matlack wrote: > David Matlack (4): > KVM: Refactor stats descriptor generation macros > KVM: Refactor designated initializer macros for struct _kvm_stats_desc > KVM: Allow custom names for KVM_STAT() > KVM: x86: Drop union for pages_{4k,2m,1g} stats > >

Re: [PATCH] powerpc/32: Include thread_info.h in head_booke.h

2023-04-07 Thread Nick Desaulniers
On Thu, Apr 06, 2023 at 10:51:30AM -0700, Nathan Chancellor wrote: > When building with W=1 after commit 80b6093b55e3 ("kbuild: add -Wundef > to KBUILD_CPPFLAGS for W=1 builds"), the following warning occurs. > > In file included from arch/powerpc/kvm/bookehv_interrupts.S:26: >

Re: arch/powerpc/kvm/../kernel/head_booke.h:20:6: warning: "THREAD_SHIFT" is not defined, evaluates to 0

2023-04-07 Thread Nathan Chancellor
On Fri, Apr 07, 2023 at 04:08:43PM -0700, Nick Desaulniers wrote: > On Tue, Apr 4, 2023 at 6:29 PM kernel test robot wrote: > > > > Hi Masahiro, > > > > FYI, the error/warning still remains. > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head:

Re: arch/powerpc/kvm/../kernel/head_booke.h:20:6: warning: "THREAD_SHIFT" is not defined, evaluates to 0

2023-04-07 Thread Nick Desaulniers
On Tue, Apr 4, 2023 at 6:29 PM kernel test robot wrote: > > Hi Masahiro, > > FYI, the error/warning still remains. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: 76f598ba7d8e2bfb4855b5298caedd5af0c374a8 > commit:

Re: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors

2023-04-07 Thread Bjorn Helgaas
On Fri, Apr 07, 2023 at 11:53:27AM -0700, Grant Grundler wrote: > On Thu, Apr 6, 2023 at 12:50 PM Bjorn Helgaas wrote: > > On Fri, Mar 17, 2023 at 10:51:09AM -0700, Grant Grundler wrote: > > > From: Rajat Khandelwal > > > > > > There are many instances where correctable errors tend to inundate >

Re: [PATCHv2 pci-next 2/2] PCI/AER: Rate limit the reporting of the correctable errors

2023-04-07 Thread Grant Grundler
On Thu, Apr 6, 2023 at 12:50 PM Bjorn Helgaas wrote: > > On Fri, Mar 17, 2023 at 10:51:09AM -0700, Grant Grundler wrote: > > From: Rajat Khandelwal > > > > There are many instances where correctable errors tend to inundate > > the message buffer. We observe such instances during thunderbolt PCIe

Re: [PATCH] KVM: PPC: BOOK3S: book3s_hv_nested.c: improve branch prediction for k.alloc

2023-04-07 Thread Sean Christopherson
On Fri, Apr 07, 2023, Bagas Sanjaya wrote: > On Fri, Apr 07, 2023 at 05:31:47AM -0400, Kautuk Consul wrote: > > I used the unlikely() macro on the return values of the k.alloc > > calls and found that it changes the code generation a bit. > > Optimize all return paths of k.alloc calls by improving

Re: [PATCH] KVM: PPC: BOOK3S: book3s_hv_nested.c: improve branch prediction for k.alloc

2023-04-07 Thread Bagas Sanjaya
On Fri, Apr 07, 2023 at 05:31:47AM -0400, Kautuk Consul wrote: > I used the unlikely() macro on the return values of the k.alloc > calls and found that it changes the code generation a bit. > Optimize all return paths of k.alloc calls by improving > branch prediction on return value of k.alloc.

[PATCH] KVM: PPC: BOOK3S: book3s_hv_nested.c: improve branch prediction for k.alloc

2023-04-07 Thread Kautuk Consul
I used the unlikely() macro on the return values of the k.alloc calls and found that it changes the code generation a bit. Optimize all return paths of k.alloc calls by improving branch prediction on return value of k.alloc. Signed-off-by: Kautuk Consul --- arch/powerpc/kvm/book3s_hv_nested.c |

Re: [PATCH] powerpc/bpf: populate extable entries only during the last pass

2023-04-07 Thread Christophe Leroy
Le 06/04/2023 à 09:35, Hari Bathini a écrit : > Since commit 85e031154c7c ("powerpc/bpf: Perform complete extra passes > to update addresses"), two additional passes are performed to avoid > space and CPU time wastage on powerpc. But these extra passes led to > WARN_ON_ONCE() hits in