<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/arch/arm64/kvm/hyp/entry.S, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2021-06-22T13:08:05Z</updated>
<entry>
<title>KVM: arm64: Save/restore MTE registers</title>
<updated>2021-06-22T13:08:05Z</updated>
<author>
<name>Steven Price</name>
<email>steven.price@arm.com</email>
</author>
<published>2021-06-21T11:17:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e1f358b5046479d2897f23b1d5b092687c6e7a67'/>
<id>urn:sha1:e1f358b5046479d2897f23b1d5b092687c6e7a67</id>
<content type='text'>
Define the new system registers that MTE introduces and context switch
them. The MTE feature is still hidden from the ID register as it isn't
supported in a VM yet.

Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Steven Price &lt;steven.price@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210621111716.37157-4-steven.price@arm.com
</content>
</entry>
<entry>
<title>KVM: arm64: Don't use cbz/adr with external symbols</title>
<updated>2021-03-09T08:48:24Z</updated>
<author>
<name>Sami Tolvanen</name>
<email>samitolvanen@google.com</email>
</author>
<published>2021-03-05T20:21:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dbaee836d60a8e1b03e7d53a37893235662ba124'/>
<id>urn:sha1:dbaee836d60a8e1b03e7d53a37893235662ba124</id>
<content type='text'>
allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following
linker errors:

  ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC):
  relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in
  [-1048576, 1048575]; references hyp_panic
  &gt;&gt;&gt; defined in vmlinux.o

  ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0):
  relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in
  [-1048576, 1048575]; references hyp_panic
  &gt;&gt;&gt; defined in vmlinux.o

This is because with LTO, the compiler ends up placing hyp_panic()
more than 1MB away from __guest_enter(). Use an unconditional branch
and adr_l instead to fix the issue.

Link: https://github.com/ClangBuiltLinux/linux/issues/1317
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Suggested-by: Marc Zyngier &lt;maz@kernel.org&gt;
Suggested-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210305202124.3768527-1-samitolvanen@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Avoid corrupting vCPU context register in guest exit</title>
<updated>2021-03-06T09:18:40Z</updated>
<author>
<name>Will Deacon</name>
<email>will@kernel.org</email>
</author>
<published>2021-03-05T18:52:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=31948332d5fa392ad933f4a6a10026850649ed76'/>
<id>urn:sha1:31948332d5fa392ad933f4a6a10026850649ed76</id>
<content type='text'>
Commit 7db21530479f ("KVM: arm64: Restore hyp when panicking in guest
context") tracks the currently running vCPU, clearing the pointer to
NULL on exit from a guest.

Unfortunately, the use of 'set_loaded_vcpu' clobbers x1 to point at the
kvm_hyp_ctxt instead of the vCPU context, causing the subsequent RAS
code to go off into the weeds when it saves the DISR assuming that the
CPU context is embedded in a struct vCPU.

Leave x1 alone and use x3 as a temporary register instead when clearing
the vCPU on the guest exit path.

Cc: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: Andrew Scull &lt;ascull@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 7db21530479f ("KVM: arm64: Restore hyp when panicking in guest context")
Suggested-by: Quentin Perret &lt;qperret@google.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210226181211.14542-1-will@kernel.org
Message-Id: &lt;20210305185254.3730990-3-maz@kernel.org&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kvm-arm64/hyp-pcpu' into kvmarm-master/next</title>
<updated>2020-09-30T13:05:35Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2020-09-30T13:05:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=14ef9d04928b61d699fd0dd858b14b5d8150113e'/>
<id>urn:sha1:14ef9d04928b61d699fd0dd858b14b5d8150113e</id>
<content type='text'>
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: Share context save and restore macros</title>
<updated>2020-09-15T17:39:03Z</updated>
<author>
<name>Andrew Scull</name>
<email>ascull@google.com</email>
</author>
<published>2020-09-15T10:46:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=603d2bdaa57e48a33d57eeb88971b88fbe5875d6'/>
<id>urn:sha1:603d2bdaa57e48a33d57eeb88971b88fbe5875d6</id>
<content type='text'>
To avoid duplicating the context save and restore macros, move them into
a shareable header.

Signed-off-by: Andrew Scull &lt;ascull@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200915104643.2543892-12-ascull@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Restore hyp when panicking in guest context</title>
<updated>2020-09-15T17:39:02Z</updated>
<author>
<name>Andrew Scull</name>
<email>ascull@google.com</email>
</author>
<published>2020-09-15T10:46:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba'/>
<id>urn:sha1:7db21530479f071ee0e0a4d5fcf5e6bc6c0352ba</id>
<content type='text'>
If the guest context is loaded when a panic is triggered, restore the
hyp context so e.g. the shadow call stack works when hyp_panic() is
called and SP_EL0 is valid when the host's panic() is called.

Use the hyp context's __hyp_running_vcpu field to track when hyp
transitions to and from the guest vcpu so the exception handlers know
whether the context needs to be restored.

Signed-off-by: Andrew Scull &lt;ascull@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200915104643.2543892-11-ascull@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Update context references from host to hyp</title>
<updated>2020-09-15T17:39:02Z</updated>
<author>
<name>Andrew Scull</name>
<email>ascull@google.com</email>
</author>
<published>2020-09-15T10:46:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7c2e76d87f9ce7af47a07ca803343fd5f4aa4ab5'/>
<id>urn:sha1:7c2e76d87f9ce7af47a07ca803343fd5f4aa4ab5</id>
<content type='text'>
Hyp now has its own nominal context for saving and restoring its state
when switching to and from a guest. Update the related comments and
utilities to match the new name.

Signed-off-by: Andrew Scull &lt;ascull@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200915104643.2543892-10-ascull@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Introduce hyp context</title>
<updated>2020-09-15T17:39:02Z</updated>
<author>
<name>Andrew Scull</name>
<email>ascull@google.com</email>
</author>
<published>2020-09-15T10:46:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b619d9aa8b385bdab747df596961d8fdddde4d52'/>
<id>urn:sha1:b619d9aa8b385bdab747df596961d8fdddde4d52</id>
<content type='text'>
During __guest_enter, save and restore from a new hyp context rather
than the host context. This is preparation for separation of the hyp and
host context in nVHE.

Signed-off-by: Andrew Scull &lt;ascull@google.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20200915104643.2543892-9-ascull@google.com
</content>
</entry>
<entry>
<title>KVM: arm64: Add kvm_extable for vaxorcism code</title>
<updated>2020-08-28T14:23:42Z</updated>
<author>
<name>James Morse</name>
<email>james.morse@arm.com</email>
</author>
<published>2020-08-21T14:07:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e9ee186bb735bfc17fa81dbc9aebf268aee5b41e'/>
<id>urn:sha1:e9ee186bb735bfc17fa81dbc9aebf268aee5b41e</id>
<content type='text'>
KVM has a one instruction window where it will allow an SError exception
to be consumed by the hypervisor without treating it as a hypervisor bug.
This is used to consume asynchronous external abort that were caused by
the guest.

As we are about to add another location that survives unexpected exceptions,
generalise this code to make it behave like the host's extable.

KVM's version has to be mapped to EL2 to be accessible on nVHE systems.

The SError vaxorcism code is a one instruction window, so has two entries
in the extable. Because the KVM code is copied for VHE and nVHE, we end up
with four entries, half of which correspond with code that isn't mapped.

Signed-off-by: James Morse &lt;james.morse@arm.com&gt;
Reviewed-by: Marc Zyngier &lt;maz@kernel.org&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>KVM: arm64: Make struct kvm_regs userspace-only</title>
<updated>2020-07-07T08:28:38Z</updated>
<author>
<name>Marc Zyngier</name>
<email>maz@kernel.org</email>
</author>
<published>2019-06-28T21:40:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e47c2055c68e06977d7d8b7dbc2f7468a36d3658'/>
<id>urn:sha1:e47c2055c68e06977d7d8b7dbc2f7468a36d3658</id>
<content type='text'>
struct kvm_regs is used by userspace to indicate which register gets
accessed by the {GET,SET}_ONE_REG API. But as we're about to refactor
the layout of the in-kernel register structures, we need the kernel to
move away from it.

Let's make kvm_regs userspace only, and let the kernel map it to its own
internal representation.

Reviewed-by: James Morse &lt;james.morse@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
</content>
</entry>
</feed>
