Thread (42 messages) 42 messages, 4 authors, 2021-08-16

Re: [PATCH v3 06/15] KVM: arm64: Restore mdcr_el2 from vcpu

From: Will Deacon <will@kernel.org>
Date: 2021-08-12 08:47:39
Also in: kvm, kvmarm

On Wed, Jul 21, 2021 at 08:37:21AM +0100, Fuad Tabba wrote:
On Tue, Jul 20, 2021 at 3:53 PM Andrew Jones [off-list ref] wrote:
quoted
On Mon, Jul 19, 2021 at 05:03:37PM +0100, Fuad Tabba wrote:
quoted
On deactivating traps, restore the value of mdcr_el2 from the
newly created and preserved host value vcpu context, rather than
directly reading the hardware register.

Up until and including this patch the two values are the same,
i.e., the hardware register and the vcpu one. A future patch will
be changing the value of mdcr_el2 on activating traps, and this
ensures that its value will be restored.

No functional change intended.
I'm probably missing something, but I can't convince myself that the host
will end up with the same mdcr_el2 value after deactivating traps after
this patch as before. We clearly now restore whatever we had when
activating traps (presumably whatever we configured at init_el2_state
time), but is that equivalent to what we had before with the masking and
ORing that this patch drops?
You're right. I thought that these were actually being initialized to
the same values, but having a closer look at the code the mdcr values
are not the same as pre-patch. I will fix this.
Can you elaborate on the issue here, please? I was just looking at this
but aren't you now relying on __init_el2_debug to configure this, which
should be fine?

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help