arm64: Generate hyp relocation data")
Cc:
Reported-by: Will Deacon
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/gen-hyprel.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c
b/arch/arm64/kvm/hyp/nvhe/gen-hyprel.c
index ea
344051a ("VSOCK: Introduce VM Sockets")
Signed-off-by: David Brazdil
Signed-off-by: David S. Miller
---
net/vmw_vsock/af_vsock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 5d323574d04f..c82e7b52ab1f 100644
--- a/net/vmw_v
On Fri, Mar 19, 2021 at 01:05:41PM +, David Brazdil wrote:
> For AF_VSOCK, accept() currently returns sockets that are unlabelled.
> Other socket families derive the child's SID from the SID of the parent
> and the SID of the incoming packet. This is typically done as the
> co
sting 'security_sk_clone' hook to copy the SID from the
parent (server) socket to the child. There is no packet SID in this
case.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Signed-off-by: David Brazdil
---
Tested on Android AOSP and Fedora 33 with v5.12-rc3.
Unit test i
Hi Paul,
I'll post a v2 shortly but will address your comments here.
> > include/linux/lsm_hooks.h | 7 +++
> > include/linux/security.h | 5 +
> > net/vmw_vsock/af_vsock.c | 1 +
> > security/security.c | 5 +
> > security/selinux/hooks.c | 10 ++
hook 'vsock_sk_clone' that takes the parent (server)
and child (connection) struct socks, and assigns the parent SID to the
child. There is no packet SID in this case.
Signed-off-by: David Brazdil
---
This is my first patch in this part of the kernel so please comment if I
Thanks for writing the fix, Marc! There are no corner cases in this code so
if it boots, that should be a good indicator that all BE inputs were converted.
Just one little thing I noticed below, otherwise:
Acked-by: David Brazdil
> arch/arm64/kvm/hyp/nvhe/Makefile | 1 +
> arch/arm
On Fri, Jan 15, 2021 at 05:18:23PM +, Elena Petrova 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 hyp/nVHE code requires a write index which counts how many elements
> have been writtens inside th
On Fri, Jan 15, 2021 at 05:18:30PM +, Elena Petrova wrote:
> From: George-Aurelian Popescu
>
> Test the UBsan functionality inside hyp/nVHE.
> Because modules are not supported inside of hyp/nVHE code, the default
> testing module for UBSan can not be used.
> New functions have to be defined
rg/r/20210104135011.2063104-1-...@kernel.org
> [3] https://lore.kernel.org/r/2021032811.2455113-1-...@kernel.org
Pretty cool! Left a few minor comments here and there, other than that:
Acked-by: David Brazdil
On Mon, Jan 18, 2021 at 09:45:30AM +, Marc Zyngier wrote:
> Given that the early cpufeature infrastructure has borrowed quite
> a lot of code from the kaslr implementation, let's reimplement
> the matching of the "nokaslr" option with it.
>
> Signed-off-by:
On Mon, Jan 18, 2021 at 09:45:29AM +, Marc Zyngier wrote:
> For completeness, let's document the HVC_VHE_RESTART stub.
>
> Signed-off-by: Marc Zyngier
Acked-by: David Brazdil
> ---
> Documentation/virt/kvm/arm/hyp-abi.rst | 9 +
> 1 file changed, 9 insertio
rc Zyngier
Acked-by: David Brazdil
> ---
> arch/arm64/kernel/idreg-override.c | 20
> 1 file changed, 20 insertions(+)
>
> diff --git a/arch/arm64/kernel/idreg-override.c
> b/arch/arm64/kernel/idreg-override.c
> index 75d9845f489b..16bc8b3b93ae 100644
&
On Mon, Jan 18, 2021 at 09:45:26AM +, Marc Zyngier wrote:
> Finally we can check whether VHE is disabled on the command line,
> and not enable it if that's the user's wish.
>
> Signed-off-by: Marc Zyngier
Acked-by: David Brazdil
> ---
> arch/
ride val/mask pair.
>
> No features are currently defined, so no expected change in
> functionality.
>
> Signed-off-by: Marc Zyngier
Acked-by: David Brazdil
> ---
> arch/arm64/kernel/Makefile | 2 +-
> arch/arm64/kernel/head.S
On Mon, Jan 18, 2021 at 09:45:16AM +, Marc Zyngier wrote:
> As we are about to change the way a VHE system boots, let's
> provide the core helper, in the form of a stub hypercall that
> enables VHE and replicates the full EL1 context at EL2, thanks
> to EL1 and VHE-EL2 being extremely similar.
Zyngier
> ---
> arch/arm64/include/asm/el2_setup.h | 24
> 1 file changed, 12 insertions(+), 12 deletions(-)
Acked-by: David Brazdil
On Fri, Jan 15, 2021 at 05:18:24PM +, Elena Petrova 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_out_of_b
ones defined in kernel-proper lib/ubsan.c.
>
> In this way, enabling UBSAN_MISC won't cause a link error.
The commit message needs to be updated - UBSAN_MISC does not exist any longer.
Also "nVHe" is a typo.
Other than that:
Acked-by: David Brazdil
>
> Signed-off-by: Elena
On Tue, Jan 05, 2021 at 06:08:35PM +, Catalin Marinas wrote:
> On Tue, Jan 05, 2021 at 06:03:14PM +0000, David Brazdil wrote:
> > Commit 5089bc51f81f ("arm64/smp: Use irq_desc_kstat_cpu() in
> > arch_show_interrupts()") removed the only user of variable `irq`.
>
accordingly.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_mmu.h | 42 --
arch/arm64/kvm/hyp/nvhe/host.S | 29 +++--
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 --
3 files changed, 31 insertions(+), 42 deletions(-)
diff --git a/arch/arm64
Hyp code used the hyp_symbol_addr helper to force PC-relative addressing
because absolute addressing results in kernel VAs due to the way hyp
code is linked. This is not true anymore, so remove the helper and
update all of its users.
Acked-by: Ard Biesheuvel
Signed-off-by: David Brazdil
: David Brazdil
---
arch/arm64/include/asm/kvm_mmu.h | 1 +
arch/arm64/include/asm/sections.h | 1 +
arch/arm64/kernel/smp.c | 4 +++-
arch/arm64/kvm/va_layout.c| 28
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include
Storing a function pointer in hyp now generates relocation information
used at early boot to convert the address to hyp VA. The existing
alternative-based conversion mechanism is therefore obsolete. Remove it
and simplify its users.
Acked-by: Ard Biesheuvel
Signed-off-by: David Brazdil
anchor. The linker of `vmlinux` will place the symbols together
with the sections.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/hyp_image.h | 29 +++--
arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 4 ++--
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/arch
We will need to recognize pointers in .rodata specific to hyp, so
establish a .hyp.rodata ELF section. Merge it with the existing
.hyp.data..ro_after_init as they are treated the same at runtime.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/sections.h | 2 +-
arch/arm64/kernel
if missing
* add generated files to .gitignore
-David
David Brazdil (8):
KVM: arm64: Rename .idmap.text in hyp linker script
KVM: arm64: Set up .hyp.rodata ELF section
KVM: arm64: Add symbol at the beginning of each hyp section
KVM: arm64: Generate hyp relocation data
KVM: arm64: Apply
-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 +-
arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S
b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
index 31b060a44045..68fd64f2313e 100644
--- a/arch/arm64
with addend + . The linker of
`vmlinux` will therefore fill the slot accordingly.
This relocation data will be used at runtime to convert the kernel VAs
at those positions to hyp VAs.
Signed-off-by: David Brazdil
---
arch/arm64/kernel/vmlinux.lds.S | 11 +
arch/arm64/kvm/hyp/nvhe/.giti
Commit 5089bc51f81f ("arm64/smp: Use irq_desc_kstat_cpu() in
arch_show_interrupts()") removed the only user of variable `irq`.
Remove the unused variable.
Signed-off-by: David Brazdil
---
arch/arm64/kernel/smp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm64/kernel/sm
On Tue, Dec 29, 2020 at 05:16:41PM +, Marc Zyngier wrote:
> Hi David,
>
> On 2020-12-29 16:00, David Brazdil wrote:
> > The KVM/arm64 PSCI relay assumes that SYSTEM_OFF and SYSTEM_RESET should
> > not return, as dictated by the PSCI spec. However, there is firmware out
&
The KVM/arm64 PSCI relay assumes that SYSTEM_OFF and SYSTEM_RESET should
not return, as dictated by the PSCI spec. However, there is firmware out
there which breaks this assumption, leading to a hyp panic. Make KVM
more robust to broken firmware by allowing these to return.
Signed-off-by: David
: David Brazdil
---
arch/arm64/configs/defconfig | 1 +
arch/arm64/include/asm/kvm_mmu.h | 1 +
arch/arm64/include/asm/sections.h | 1 +
arch/arm64/kernel/smp.c | 4 +++-
arch/arm64/kvm/va_layout.c| 28
5 files changed, 34 insertions(+), 1
Hyp code used the hyp_symbol_addr helper to force PC-relative addressing
because absolute addressing results in kernel VAs due to the way hyp
code is linked. This is not true anymore, so remove the helper and
update all of its users.
Acked-by: Ard Biesheuvel
Signed-off-by: David Brazdil
accordingly.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_mmu.h | 42 --
arch/arm64/kvm/hyp/nvhe/host.S | 29 +++--
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 --
3 files changed, 31 insertions(+), 42 deletions(-)
diff --git a/arch/arm64
Storing a function pointer in hyp now generates relocation information
used at early boot to convert the address to hyp VA. The existing
alternative-based conversion mechanism is therefore obsolete. Remove it
and simplify its users.
Acked-by: Ard Biesheuvel
Signed-off-by: David Brazdil
-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 +-
arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S
b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
index 31b060a44045..68fd64f2313e 100644
--- a/arch/arm64
g
kvm-unit-tests or starting any VM and subsequent soft lockup on a Cortex
A72 device.
Fixes: 30c953911c43 ("kvm: arm64: Set up hyp percpu data for nVHE")
Signed-off-by: Jamie Iles
Signed-off-by: Marc Zyngier
Acked-by: David Brazdil
Cc: David Brazdil
Cc: Marc Zyngier
Cc: Will Deac
with addend + . The linker of
`vmlinux` will therefore fill the slot accordingly.
This relocation data will be used at runtime to convert the kernel VAs
at those positions to hyp VAs.
Signed-off-by: David Brazdil
---
arch/arm64/kernel/vmlinux.lds.S | 11 +
arch/arm64/kvm/hyp/nvhe/Mak
topic/hyp-reloc_v1
-David
David Brazdil (8):
KVM: arm64: Rename .idmap.text in hyp linker script
KVM: arm64: Set up .hyp.rodata ELF section
KVM: arm64: Add symbol at the beginning of each hyp section
KVM: arm64: Generate hyp relocation data
KVM: arm64: Apply hyp relocations at runtime
We will need to recognize pointers in .rodata specific to hyp, so
establish a .hyp.rodata ELF section. Merge it with the existing
.hyp.data..ro_after_init as they are treated the same at runtime.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/sections.h | 2 +-
arch/arm64/kernel
anchor. The linker of `vmlinux` will place the symbols together
with the sections.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/hyp_image.h | 29 +++--
arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 4 ++--
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/arch
Hey, relized I never replied to this...
On Tue, Nov 24, 2020 at 03:08:20PM +0100, Ard Biesheuvel wrote:
> On Thu, 19 Nov 2020 at 17:26, David Brazdil wrote:
> >
> > Hyp code used to use absolute addressing via a constant pool to obtain
> > the kernel VA of 3 symbols - pani
Hey Marc,
On Thu, Dec 03, 2020 at 07:23:19PM +, Marc Zyngier wrote:
> On Wed, 2 Dec 2020 18:40:56 +0000, David Brazdil wrote:
> > As we progress towards being able to keep guest state private to the
> > host running nVHE hypervisor, this series allows the hypervisor to
> &
Move function for skipping host instruction in the host trap handler to
a header file containing analogical helpers for guests.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/include/hyp/adjust_pc.h | 9 +
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 12 ++--
2 files
Minor cleanup removing unused includes.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c
b/arch/arm64/kvm/hyp/nvhe/psci-relay.c
index 0d6f4aa39621..1f7237e45148 100644
--- a/arch
Computing the hyp VA layout is redundant when the kernel runs in EL2 and
hyp shares its VA mappings. Make calling kvm_compute_layout()
conditional on not just CONFIG_KVM but also !is_kernel_in_hyp_mode().
Signed-off-by: David Brazdil
---
arch/arm64/kernel/smp.c | 2 +-
1 file changed, 1
init_hyp_physvirt_offset() computes PA from a kernel VA. Conversion to
kernel linear-map is required first but the code used kvm_ksym_ref() for
this purpose. Under VHE that is a NOP and resulted in a runtime warning.
Replace kvm_ksym_ref with lm_alias.
Reported-by: Qian Cai
Signed-off-by: David
.
Reported-by: Mark Rutland
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_host.h| 20 +++
arch/arm64/kvm/arm.c | 14 +---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 53 +---
3 files changed, 70 insertions(+), 17 deletions(-)
diff
Small cleanup moving declarations of hyp-exported variables to
kvm_host.h and using macros to avoid having to refer to them with
kvm_nvhe_sym() in host.
No functional change intended.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_host.h | 6 ++
arch/arm64/kvm/arm.c
be dropped if any
concerns arise. The remaining patches are minor cleanups from review.
-David
David Brazdil (6):
kvm: arm64: Prevent use of invalid PSCI v0.1 function IDs
kvm: arm64: Use lm_alias in nVHE-only VA conversion
kvm: arm64: Skip computing hyp VA layout for VHE
kvm: arm64: Min
Hi Qian,
> > +/*
> > + * Store a hyp VA <-> PA offset into a hyp-owned variable.
> > + */
> > +static void init_hyp_physvirt_offset(void)
> > +{
> > + extern s64 kvm_nvhe_sym(hyp_physvirt_offset);
> > + u64 kern_va, hyp_va;
> > +
> > + /* Compute the offset from the hyp VA and PA of a random
On Thu, Dec 03, 2020 at 10:47:12AM +, Mark Rutland wrote:
> On Wed, Dec 02, 2020 at 06:41:02PM +0000, David Brazdil wrote:
> > Make it possible to retrieve a copy of the psci_0_1_function_ids struct.
> > This is useful for KVM if it is configured to intercept host's PSCI S
d-off-by: David Brazdil
---
arch/arm64/include/asm/smp.h | 4 ++--
arch/arm64/kernel/setup.c| 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
index 2e7f529ec5a6..bcb01ca15325 100644
--- a/arch/arm64/include/asm/
functional change intended. Size of el2_setup increased by
148 bytes due to duplication.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/el2_setup.h | 182 +
arch/arm64/kernel/head.S | 144 +++
2 files changed, 198 insertions
HCR
flags to use while the nVHE vector is installed when the kernel was
booted with the protected flag enabled. Switch back to the default HCR
flags when switching back to the stub vector.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_arm.h | 1 +
arch/arm64/kvm/hyp/nvhe/hyp
KVM by default keeps the stub vector installed and installs the nVHE
vector only briefly for init and later on demand. Change this policy
to install the vector at init and then never uninstall it if the kernel
was given the protected KVM command line parameter.
Signed-off-by: David Brazdil
; modes matched at the point of KVM
init and KVM will not allow cores not present at init to boot. That
said, the function is never used after KVM is initialized.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/virt.h | 18 ++
arch/arm64/kvm/arm.c | 9 ++---
struct psci_boot_args
to store the state upon powerup, with each CPU having separate structs
for CPU_ON and CPU_SUSPEND so that CPU_SUSPEND can operate locklessly
and so that a CPU_ON call targeting a CPU cannot interfere with
a concurrent CPU_SUSPEND call on that CPU.
Signed-off-by: David Brazdil
Add a handler of SYSTEM_SUSPEND host PSCI SMCs. The semantics are
equivalent to CPU_SUSPEND, typically called on the last online CPU.
Reuse the same entry point and boot args struct as CPU_SUSPEND.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 2 +-
arch/arm64/kvm/hyp
only this_cpu_ptr() was supported by setting TPIDR_EL2.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/percpu.h | 6 ++
arch/arm64/kernel/image-vars.h| 3 +++
arch/arm64/kvm/hyp/nvhe/Makefile | 3 ++-
arch/arm64/kvm/hyp/nvhe/hyp-smp.c | 24
4 files
arguments and results, other GPRs are
preserved.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/host.S | 38 ++
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 35 ---
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/arch/arm64
and can be used when booting new
cores.
Take the opportunity to move copying the T0SZ value from idmap_t0sz in
KVM init rather than in .hyp.idmap.text. This avoids the need for the
idmap_t0sz symbol alias.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_asm.h | 2 ++
arch/arm64
returning ERET to the provided PC in EL1.
There is a simple atomic lock around the boot args struct. If it is
already locked, CPU_ON will return PENDING_ON error code.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 48 +++
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 115
In preparation for adding a CPU entry point in nVHE hyp code, extract
most of __do_hyp_init hypervisor initialization code into a common
helper function. This will be invoked by the entry point to install KVM
on the newly booted CPU.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp
-restoring code after the trap handler would have returned.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/host.S | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/host.S
index 2b56f0bdf874..a820dfdc9c25 100644
--- a/arch
M_OFF
* SYSTEM_RESET
* SYSTEM_RESET2
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 42 +++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c
b/arch/arm64/kvm/hyp/nvhe/psci-relay.c
index 70b42f4
Add a host-initialized constant to KVM nVHE hyp code for converting
between EL2 linear map virtual addresses and physical addresses.
Also add `__hyp_pa` macro that performs the conversion.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 +++
arch/arm64/kvm/va_layout.c
, the SMC is handled by the PSCI handler. For now, all
SMCs return PSCI_RET_NOT_SUPPORTED.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_hyp.h | 2 +
arch/arm64/kvm/arm.c | 25 -
.../arm64/kvm/hyp/include/nvhe/trap_handler.h | 18
.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_asm.h | 2 --
arch/arm64/include/asm/kvm_mmu.h | 24
arch/arm64/kvm/arm.c | 4 +---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 9 ++---
4 files changed, 31 insertions(+), 8 deletions(-)
diff
.
Refactor __do_hyp_init to accept its parameters in a struct. This
prepares the code for KVM booting cores as well as removes any limits on
the number of __do_hyp_init arguments.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_asm.h | 6 ++
arch/arm64/include/asm/kvm_hyp.h | 2
section and they are never
changed by hyp afterwards.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/sections.h | 1 +
arch/arm64/kernel/vmlinux.lds.S | 10 ++
arch/arm64/kvm/arm.c | 8
arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 1 +
4 files changed, 20 insertions
whose features were not checked
against the finalized capabilities.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/arm.c | 19 +++
arch/arm64/kvm/hyp/nvhe/hyp-smp.c | 16
2 files changed, 35 insertions(+)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm6
Make it possible to retrieve a copy of the psci_0_1_function_ids struct.
This is useful for KVM if it is configured to intercept host's PSCI SMCs.
Signed-off-by: David Brazdil
---
drivers/firmware/psci/psci.c | 12 +---
include/linux/psci.h | 9 +
2 files change
s checking.
Signed-off-by: David Brazdil
---
drivers/firmware/psci/psci.c | 29 ++---
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index 13b9ed71b446..593fdd0e09a2 100644
--- a/drivers/firmware/psci/ps
-off-by: David Brazdil
---
drivers/firmware/psci/psci.c | 94 +++-
1 file changed, 60 insertions(+), 34 deletions(-)
diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index ace5b9ac676c..13b9ed71b446 100644
--- a/drivers/firmware/psci/psci.c
on is currently unused so this has no effect on
existing functionality.
Acked-by: Mark Rutland
Signed-off-by: David Brazdil
---
drivers/firmware/psci/psci.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
Expose the boolean value whether the system is running with KVM in
protected mode (nVHE + kernel param). CPU capability was selected over
a global variable to allow use in alternatives.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/cpucaps.h | 3 ++-
arch/arm64/include/asm
ned-off-by: David Brazdil
---
Documentation/admin-guide/kernel-parameters.txt | 10 ++
arch/arm64/include/asm/kvm_host.h | 9 +
arch/arm64/kvm/arm.c| 16
3 files changed, 35 insertions(+)
diff --git a/Documentation/admin-gu
PEND implementation
* replace spinlocks with CAS atomic
* make cpu_logical_map ro_after_init
David Brazdil (26):
kvm: arm64: Add kvm-arm.mode early kernel parameter
kvm: arm64: Add ARM64_KVM_PROTECTED_MODE CPU capability
psci: Support psci_ops.get_version for v0.1
psci: Split fu
On Fri, Nov 27, 2020 at 10:14:33AM +, Lorenzo Pieralisi wrote:
> On Thu, Nov 26, 2020 at 03:54:14PM +0000, David Brazdil wrote:
> > Forward the following PSCI SMCs issued by host to EL3 as they do not
> > require the hypervisor's intervention. This assumes that EL3 correctl
On Thu, Nov 26, 2020 at 05:28:38PM +, Mark Rutland wrote:
> On Thu, Nov 26, 2020 at 03:54:01PM +0000, David Brazdil wrote:
> > CPU index should never be negative. Change the signature of
> > (set_)cpu_logical_map to take an unsigned int.
> >
> > Signed-off-by: Dav
> > > be just me, but if you agree please update so that it doesn't give remote
> > > idea that it is not valid on VHE enabled hardware.
> > >
> > > I was trying to run this on the hardware and was trying to understand the
> > > details on how to do that.
> >
> > I see what you're saying, but !CO
Hey Mark,
> > diff --git a/arch/arm64/include/asm/memory.h
> > b/arch/arm64/include/asm/memory.h
> > index cd61239bae8c..54a22cb5b17b 100644
> > --- a/arch/arm64/include/asm/memory.h
> > +++ b/arch/arm64/include/asm/memory.h
> > @@ -152,6 +152,19 @@
> > #define MT_S2_FWB_NORMAL 6
> > #define
Hey Mark,
> In the head.S code, this was under an ifdef CONFIG_ARM_GIC_V3, but that
> ifdef wasn't carried into the macro here, or into its use below. I'm not
> sure of the impact, but that does seem to be a functional change.
>
> > +
> > +.macro __init_el2_hstr
> > + msr hstr_el2, xzr
Hey Sudeep,
> > +static unsigned int find_cpu_id(u64 mpidr)
> > +{
> > + unsigned int i;
> > +
> > + /* Reject invalid MPIDRs */
> > + if (mpidr & ~MPIDR_HWID_BITMASK)
> > + return INVALID_CPU_ID;
> > +
> > + for (i = 0; i < NR_CPUS; i++) {
>
> I may not have understood the flow
On Fri, Nov 27, 2020 at 04:51:59PM +, Sudeep Holla wrote:
> On Thu, Nov 26, 2020 at 03:54:14PM +0000, David Brazdil wrote:
> > Forward the following PSCI SMCs issued by host to EL3 as they do not
> > require the hypervisor's intervention. This assumes that EL3 correctly
>
Hey Sudeep,
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt
> > b/Documentation/admin-guide/kernel-parameters.txt
> > index 526d65d8573a..06c89975c29c 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@
Hey Mark,
On Thu, Nov 26, 2020 at 05:24:50PM +, Mark Rutland wrote:
> On Thu, Nov 26, 2020 at 03:54:00PM +0000, David Brazdil wrote:
> > Function IDs used by PSCI are configurable for v0.1 via DT/APCI. If the
> > host is using PSCI v0.1, KVM's host PSCI proxy needs
whose features were not checked
against the finalized capabilities.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/arm.c | 19 +++
arch/arm64/kvm/hyp/nvhe/hyp-smp.c | 16
2 files changed, 35 insertions(+)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm6
all cores' modes matched at the point of KVM
init and KVM will not allow cores not present at init to boot. That
said, the function is never used after KVM is initialized.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/virt.h | 18 ++
arch/arm64/kvm/arm.
KVM by default keeps the stub vector installed and installs the nVHE
vector only briefly for init and later on demand. Change this policy
to install the vector at init and then never uninstall it if the kernel
was given the protected KVM command line parameter.
Signed-off-by: David Brazdil
racing them for the same
boot args struct, CPU_SUSPEND uses a different struct instance and entry
point. Each entry point selects the corresponding struct to restore host
boot args from. This avoids the need for locking in CPU_SUSPEND.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp
booted with the protected flag enabled. Switch back to the default HCR
flags when switching back to the stub vector.
Signed-off-by: David Brazdil
---
arch/arm64/include/asm/kvm_arm.h | 1 +
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 10 ++
arch/arm64/kvm/hyp/nvhe/switch.c | 5 -
3 files
In preparation for adding a CPU entry point in nVHE hyp code, extract
most of __do_hyp_init hypervisor initialization code into a common
helper function. This will be invoked by the entry point to install KVM
on the newly booted CPU.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp
-restoring code after the trap handler would have returned.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/host.S | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/host.S
index 2b56f0bdf874..a820dfdc9c25 100644
--- a/arch
Add a host-initialized constant to KVM nVHE hyp code for converting
between EL2 linear map virtual addresses and physical addresses.
Also add `__hyp_pa` macro that performs the conversion.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 3 +++
arch/arm64/kvm/va_layout.c
returning ERET to the provided PC in EL1.
There is a simple atomic lock around the boot args struct. If it is
already locked, CPU_ON will return PENDING_ON error code.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 30
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 109
M_OFF
* SYSTEM_RESET
* SYSTEM_RESET2
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/psci-relay.c | 43 +++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c
b/arch/arm64/kvm/hyp/nvhe/psci-relay.c
index e7091d8
for arguments and results, other GPRs are
preserved.
Signed-off-by: David Brazdil
---
arch/arm64/kvm/hyp/nvhe/host.S | 38 ++
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 35 ---
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/arch
1 - 100 of 352 matches
Mail list logo