<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm64/include/asm/virt.h, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-02-08T12:51:26Z</updated>
<entry>
<title>arm64: Provide an 'upgrade to VHE' stub hypercall</title>
<updated>2021-02-08T12:51:26Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2021-02-08T09:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f359182291c757cdf77bcd014c025d1ed6b87662'/>
<id>urn:sha1:f359182291c757cdf77bcd014c025d1ed6b87662</id>
<content type='text'>
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.

On exception return, the kernel carries on at EL2. Fancy!

Nothing calls this new hypercall yet, so no functional change.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Acked-by: David Brazdil &lt;dbrazdil@google.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Link: https://lore.kernel.org/r/20210208095732.3267263-5-maz@kernel.org
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: Fix EL2 mode availability checks</title>
<updated>2020-12-04T10:08:36Z</updated>
<author>
<name>David Brazdil</name>
</author>
<published>2020-12-02T18:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f19f6644a5433cfae8a068445b149bc2247c1445'/>
<id>urn:sha1:f19f6644a5433cfae8a068445b149bc2247c1445</id>
<content type='text'>
With protected nVHE hyp code interception host's PSCI SMCs, the host
starts seeing new CPUs boot in EL1 instead of EL2. The kernel logic
that keeps track of the boot mode needs to be adjusted.

Add a static key enabled if KVM protected mode initialization is
successful.

When the key is enabled, is_hyp_mode_available continues to report
`true` because its users either treat it as a check whether KVM will be
/ was initialized, or whether stub HVCs can be made (eg. hibernate).

is_hyp_mode_mismatched is changed to report `false` when the key is
enabled. That's because 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 &lt;dbrazdil@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20201202184122.26046-27-dbrazdil@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Add ARM64_KVM_PROTECTED_MODE CPU capability</title>
<updated>2020-12-04T08:44:19Z</updated>
<author>
<name>David Brazdil</name>
</author>
<published>2020-12-02T18:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3eb681fba2bf8b67b65ce92d0ebfd7cbfc263da9'/>
<id>urn:sha1:3eb681fba2bf8b67b65ce92d0ebfd7cbfc263da9</id>
<content type='text'>
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 &lt;dbrazdil@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20201202184122.26046-3-dbrazdil@google.com
</content>
</entry>
<entry>
<title>arm64: cpufeature: upgrade hyp caps to final</title>
<updated>2020-10-30T08:53:10Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2020-10-26T13:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d86de40decaa14e6613af1b2783bf4d589d0f38b'/>
<id>urn:sha1:d86de40decaa14e6613af1b2783bf4d589d0f38b</id>
<content type='text'>
We finalize caps before initializing kvm hyp code, and any use of
cpus_have_const_cap() in kvm hyp code generates redundant and
potentially unsound code to read the cpu_hwcaps array.

A number of helper functions used in both hyp context and regular kernel
context use cpus_have_const_cap(), as some regular kernel code runs
before the capabilities are finalized. It's tedious and error-prone to
write separate copies of these for hyp and non-hyp code.

So that we can avoid the redundant code, let's automatically upgrade
cpus_have_const_cap() to cpus_have_final_cap() when used in hyp context.
With this change, there's never a reason to access to cpu_hwcaps array
from hyp code, and we don't need to create an NVHE alias for this.

This should have no effect on non-hyp code.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Cc: David Brazdil &lt;dbrazdil@google.com&gt;
Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20201026134931.28246-4-mark.rutland@arm.com
</content>
</entry>
<entry>
<title>KVM: arm64: Factor out is_{vhe,nvhe}_hyp_code()</title>
<updated>2020-10-30T08:52:51Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2020-10-26T13:49:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9a33caec90e05673e2f7fb7c80f172031964d25'/>
<id>urn:sha1:e9a33caec90e05673e2f7fb7c80f172031964d25</id>
<content type='text'>
Currently has_vhe() detects whether it is being compiled for VHE/NVHE
hyp code based on preprocessor definitions, and uses this knowledge to
avoid redundant runtime checks.

There are other cases where we'd like to use this knowledge, so let's
factor the preprocessor checks out into separate helpers.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Cc: David Brazdil &lt;dbrazdil@google.com&gt;
Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: https://lore.kernel.org/r/20201026134931.28246-2-mark.rutland@arm.com
</content>
</entry>
<entry>
<title>KVM: arm64: Use build-time defines in has_vhe()</title>
<updated>2020-07-05T17:38:01Z</updated>
<author>
<name>David Brazdil</name>
</author>
<published>2020-06-25T13:14:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53b671128bd7f9ea41ae1a06106d88eb4cf66623'/>
<id>urn:sha1:53b671128bd7f9ea41ae1a06106d88eb4cf66623</id>
<content type='text'>
Build system compiles hyp code with macros specifying if the code belongs
to VHE or nVHE. Use these macros to evaluate has_vhe() at compile time.

Signed-off-by: David Brazdil &lt;dbrazdil@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200625131420.71444-5-dbrazdil@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Use cpus_have_final_cap for has_vhe()</title>
<updated>2020-05-16T14:04:51Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2020-05-13T10:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce6f8f02f9f6786355fa6c79d88b839639dd75d8'/>
<id>urn:sha1:ce6f8f02f9f6786355fa6c79d88b839639dd75d8</id>
<content type='text'>
By the time we start using the has_vhe() helper, we have long
discovered whether we are running VHE or not. It thus makes
sense to use cpus_have_final_cap() instead of cpus_have_const_cap(),
which leads to a small text size reduction.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Acked-by: David Brazdil &lt;dbrazdil@google.com&gt;
Link: https://lore.kernel.org/r/20200513103828.74580-1-maz@kernel.org
</content>
</entry>
<entry>
<title>KVM: arm64: Ask the compiler to __always_inline functions used at HYP</title>
<updated>2020-02-22T11:01:47Z</updated>
<author>
<name>James Morse</name>
</author>
<published>2020-02-20T16:58:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c37f1ae1c335800d16b207cb578009c695dcd39'/>
<id>urn:sha1:5c37f1ae1c335800d16b207cb578009c695dcd39</id>
<content type='text'>
On non VHE CPUs, KVM's __hyp_text contains code run at EL2 while the rest
of the kernel runs at EL1. This code lives in its own section with start
and end markers so we can map it to EL2.

The compiler may decide not to inline static-inline functions from the
header file. It may also decide not to put these out-of-line functions
in the same section, meaning they aren't mapped when called at EL2.

Clang-9 does exactly this with __kern_hyp_va() and a few others when
x18 is reserved for the shadow call stack. Add the additional __always_
hint to all the static-inlines that are called from a hyp file.

Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200220165839.256881-2-james.morse@arm.com

----
kvm_get_hyp_vector() pulls in all the regular per-cpu accessors
and this_cpu_has_cap(), fortunately its only called for VHE.
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234</title>
<updated>2019-06-19T15:09:07Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-06-03T05:44:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=caab277b1de0a22b675c4c95fc7b285ec2eb5bf5'/>
<id>urn:sha1:caab277b1de0a22b675c4c95fc7b285ec2eb5bf5</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not see http www gnu org
  licenses

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 503 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>arm64: capabilities: Change scope of VHE to Boot CPU feature</title>
<updated>2018-03-26T17:01:41Z</updated>
<author>
<name>Suzuki K Poulose</name>
</author>
<published>2018-03-26T14:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=830dcc9f9a7cd26a812522a26efaacf7df6fc365'/>
<id>urn:sha1:830dcc9f9a7cd26a812522a26efaacf7df6fc365</id>
<content type='text'>
We expect all CPUs to be running at the same EL inside the kernel
with or without VHE enabled and we have strict checks to ensure
that any mismatch triggers a kernel panic. If VHE is enabled,
we use the feature based on the boot CPU and all other CPUs
should follow. This makes it a perfect candidate for a capability
based on the boot CPU,  which should be matched by all the CPUs
(both when is ON and OFF). This saves us some not-so-pretty
hooks and special code, just for verifying the conflict.

The patch also makes the VHE capability entry depend on
CONFIG_ARM64_VHE.

Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Reviewed-by: Dave Martin &lt;dave.martin@arm.com&gt;
Signed-off-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
</feed>
