<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm64/include/asm/el2_setup.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-09T13:47:11Z</updated>
<entry>
<title>arm64: Simplify init_el2_state to be non-VHE only</title>
<updated>2021-02-09T13:47:11Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2021-02-08T09:57:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2df464173f0b585adb958a09536eae2cd1dbefd'/>
<id>urn:sha1:e2df464173f0b585adb958a09536eae2cd1dbefd</id>
<content type='text'>
As init_el2_state is now nVHE only, let's simplify it and drop
the VHE setup.

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-9-maz@kernel.org
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: Drop early setting of MDSCR_EL2.TPMS</title>
<updated>2021-02-09T13:47:11Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2021-02-08T09:57:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6f8c92f3f368d345c38aea5cc0e60515bcb159e'/>
<id>urn:sha1:c6f8c92f3f368d345c38aea5cc0e60515bcb159e</id>
<content type='text'>
When running VHE, we set MDSCR_EL2.TPMS very early on to force
the trapping of EL1 SPE accesses to EL2.

However:
- we are running with HCR_EL2.{E2H,TGE}={1,1}, meaning that there
  is no EL1 to trap from

- before entering a guest, we call kvm_arm_setup_debug(), which
  sets MDCR_EL2_TPMS in the per-vcpu shadow mdscr_el2, which gets
  applied on entry by __activate_traps_common().

The early setting of MDSCR_EL2.TPMS is therefore useless and can
be dropped.

Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210208095732.3267263-7-maz@kernel.org
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: Fix labels in el2_setup macros</title>
<updated>2021-02-08T12:51:26Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2021-02-08T09:57:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=114945d84a30a5feba8ec24d854257c78c89abd1'/>
<id>urn:sha1:114945d84a30a5feba8ec24d854257c78c89abd1</id>
<content type='text'>
If someone happens to write the following code:

	b	1f
	init_el2_state	vhe
1:
	[...]

they will be in for a long debugging session, as the label "1f"
will be resolved *inside* the init_el2_state macro instead of
after it. Not really what one expects.

Instead, rewite the EL2 setup macros to use unambiguous labels,
thanks to the usual macro counter trick.

Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
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/20210208095732.3267263-2-maz@kernel.org
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>arm64: Extract parts of el2_setup into a macro</title>
<updated>2020-12-04T10:07:12Z</updated>
<author>
<name>David Brazdil</name>
</author>
<published>2020-12-02T18:41:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78869f0f0552d032c7e32724c4abb2715e8f974a'/>
<id>urn:sha1:78869f0f0552d032c7e32724c4abb2715e8f974a</id>
<content type='text'>
When a CPU is booted in EL2, the kernel checks for VHE support and
initializes the CPU core accordingly. For nVHE it also installs the stub
vectors and drops down to EL1.

Once KVM gains the ability to boot cores without going through the
kernel entry point, it will need to initialize the CPU the same way.
Extract the relevant bits of el2_setup into an init_el2_state macro
with an argument specifying whether to initialize for VHE or nVHE.

The following ifdefs are removed:
 * CONFIG_ARM_GIC_V3 - always selected on arm64
 * CONFIG_COMPAT - hstr_el2 can be set even without 32-bit support

No functional change intended. Size of el2_setup increased by
148 bytes due to duplication.

Signed-off-by: David Brazdil &lt;dbrazdil@google.com&gt;
[maz: reworked to fit the new PSTATE initial setup code]
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20201202184122.26046-9-dbrazdil@google.com
</content>
</entry>
</feed>
