[PATCH v2 1/4] bug: Remove redundant condition check in report_bug

2021-02-23 Thread Andrew Scull
report_bug() will return early if it cannot find a bug corresponding to the provided address. The subsequent test for the bug will always be true so remove it. Signed-off-by: Andrew Scull Cc: Peter Zijlstra Cc: "Steven Rostedt (VMware)" --- lib/bug.c | 33 +++---

[PATCH v2 4/4] KVM: arm64: Log source when panicking from nVHE hyp

2021-02-23 Thread Andrew Scull
metadata to log the file and line, if available, otherwise log the kimg address that can be looked up in vmlinux. __hyp_panic_string is now inlined since it no longer needs to be references as a symbol and message is free to diverge between VHE and nVHE. Signed-off-by: Andrew Scull --- arch/arm64

[PATCH v2 3/4] KVM: arm64: Use BUG and BUG_ON in nVHE hyp

2021-02-23 Thread Andrew Scull
e the hyp_panic() declaration from the header file to avoid accidental misuse. Signed-off-by: Andrew Scull --- arch/arm64/include/asm/kvm_hyp.h | 1 - arch/arm64/kvm/hyp/nvhe/hyp-main.c | 2 +- arch/arm64/kvm/hyp/nvhe/hyp-smp.c | 6 ++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --

[PATCH v2 2/4] bug: Factor out a getter for a bug's file line

2021-02-23 Thread Andrew Scull
There is some non-trivial config-based logic to get the file name and line number associated with a bug. Factor this out to a getter that can be resused. Signed-off-by: Andrew Scull Cc: Peter Zijlstra Cc: "Steven Rostedt (VMware)" --- include/linux/bug.h | 3 +++ lib/bug.c

[PATCH v2 0/4] Debug info for nVHE hyp panics

2021-02-23 Thread Andrew Scull
1 (https://lore.kernel.org/r/20210223094927.766572-1-asc...@google.com/): - keeping struct bug details in bug.c - using SPSR to distinguish hyp from host - inlined __hyp_panic_string Andrew Scull (4): bug: Remove redundant condition check in report_bug bug: Factor out a getter for a bug

Re: [PATCH 07/14] KVM: arm64: Enable UBSAN_BOUNDS for the both the kernel and hyp/nVHE

2020-10-01 Thread Andrew Scull
On Mon, Sep 14, 2020 at 05:27:43PM +, George-Aurelian Popescu wrote: > From: George Popescu > > If an out of bounds happens inside the hyp/nVHE code, the > ubsan_out_of_bounds handler stores the logging data inside the > kvm_ubsan_buffer. The one responsible for printing is the kernel > ubsan

Re: [PATCH 05/14] KVM: arm64: Define a buffer that can pass UBSan data from hyp/nVHE to kernel

2020-10-01 Thread Andrew Scull
On Mon, Sep 14, 2020 at 05:27:41PM +, George-Aurelian Popescu wrote: > From: George Popescu > > Store data, which is collected from UBSan handlers that lives inside hyp/nVHE, > into the kvm_ubsan_buffer. > This buffer is designed to store only UBSan data because it should not be > preoccupied

Re: [PATCH 03/14] KVM: arm64: Add support for creating and checking a logging buffer inside hyp/nVHE

2020-10-01 Thread Andrew Scull
On Mon, Sep 14, 2020 at 05:27:39PM +, George-Aurelian Popescu wrote: > From: George Popescu > > Share a buffer between the kernel and the hyp/nVHE code by using the > macros from kvm_debug_buffer.h. > > The buffer is composed of a writing index and a statically allocated > array. The writing

Re: [PATCH v2 10/10] kvm: arm64: Remove unnecessary hyp mappings

2020-09-10 Thread Andrew Scull
> Signed-off-by: David Brazdil Acked-by: Andrew Scull > --- > arch/arm64/include/asm/kvm_mmu.h | 25 +++-- > arch/arm64/kvm/arm.c | 17 + > 2 files changed, 8 insertions(+), 34 deletions(-) > > diff --git a/arch/arm64/includ

Re: [PATCH v2 04/10] kvm: arm64: Remove hyp_adr/ldr_this_cpu

2020-09-10 Thread Andrew Scull
PIDR_EL2 and > _EL1 based on VHE/nVHE. > > Simplify this now that the nVHE hyp mode case can be handled using the > __KVM_NVHE_HYPERVISOR__ macro. VHE selects _EL2 with alternatives. > > Signed-off-by: David Brazdil Acked-by: Andrew Scull > diff --git a/arch/arm64/include/asm

Re: [PATCH v2 03/10] kvm: arm64: Remove __hyp_this_cpu_read

2020-09-10 Thread Andrew Scull
On Thu, Sep 03, 2020 at 11:17:05AM +0200, 'David Brazdil' via kernel-team wrote: > this_cpu_ptr is meant for use in kernel proper because it selects between > TPIDR_EL1/2 based on nVHE/VHE. __hyp_this_cpu_ptr was used in hyp to always > select TPIDR_EL2. Unify all users behind this_cpu_ptr and frie

Re: [PATCH v2 02/10] kvm: arm64: Partially link nVHE hyp code, simplify HYPCOPY

2020-09-10 Thread Andrew Scull
On Thu, Sep 03, 2020 at 11:17:04AM +0200, 'David Brazdil' via kernel-team wrote: > Previous series introduced custom build rules for nVHE hyp code, using > objcopy to prefix ELF section and symbol names to separate nVHE code > into its own "namespace". This approach was limited by the expressivenes

Re: [PATCH v2 04/14] arm64: kvm: Add build rules for separate nVHE object files

2020-05-18 Thread Andrew Scull
On Fri, May 15, 2020 at 11:58:31AM +0100, David Brazdil wrote: > diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h > index 7f06ad93fc95..13850134fc28 100644 > --- a/arch/arm64/kernel/image-vars.h > +++ b/arch/arm64/kernel/image-vars.h > @@ -51,4 +51,16 @@ __efistub__ctype

Re: [PATCH v2 07/14] arm64: kvm: Split hyp/switch.c to VHE/nVHE

2020-05-18 Thread Andrew Scull
On Fri, May 15, 2020 at 11:58:34AM +0100, David Brazdil wrote: > +__kvm_nvhe_sve_load_state = sve_load_state; > +__kvm_nvhe_sve_save_state = sve_save_state; Building without CONFIG_ARM64_VHE leads to a linker error due to the SVE functions being referenced in this list. This is caused by CONFIG_AR