* Re: Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree
[not found] <159230500664142@kroah.com>
@ 2020-08-06 2:26 ` yangerkun
2020-08-06 7:10 ` Greg KH
2020-08-06 8:55 ` Marc Zyngier
0 siblings, 2 replies; 3+ messages in thread
From: yangerkun @ 2020-08-06 2:26 UTC (permalink / raw)
To: linux-kernel, gregkh, james.morse, maz, drjones, marc.zyngier,
christoffer.dall
Cc: stable-commits, kvm
Hi,
Not familiar with kvm. And I have a question about this patch. Maybe
backport this patch 3204be4109ad("KVM: arm64: Make vcpu_cp1x() work on
Big Endian hosts") without 52f6c4f02164 ("KVM: arm64: Change 32-bit
handling of VM system registers") seems not right?
Thanks,
Kun.
在 2020/6/16 18:56, gregkh@linuxfoundation.org 写道:
>
> This is a note to let you know that I've just added the patch titled
>
> KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts
>
> to the 4.4-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> kvm-arm64-make-vcpu_cp1x-work-on-big-endian-hosts.patch
> and it can be found in the queue-4.4 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
>>From 3204be4109ad681523e3461ce64454c79278450a Mon Sep 17 00:00:00 2001
> From: Marc Zyngier <maz@kernel.org>
> Date: Tue, 9 Jun 2020 08:40:35 +0100
> Subject: KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts
>
> From: Marc Zyngier <maz@kernel.org>
>
> commit 3204be4109ad681523e3461ce64454c79278450a upstream.
>
> AArch32 CP1x registers are overlayed on their AArch64 counterparts
> in the vcpu struct. This leads to an interesting problem as they
> are stored in their CPU-local format, and thus a CP1x register
> doesn't "hit" the lower 32bit portion of the AArch64 register on
> a BE host.
>
> To workaround this unfortunate situation, introduce a bias trick
> in the vcpu_cp1x() accessors which picks the correct half of the
> 64bit register.
>
> Cc: stable@vger.kernel.org
> Reported-by: James Morse <james.morse@arm.com>
> Tested-by: James Morse <james.morse@arm.com>
> Acked-by: James Morse <james.morse@arm.com>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> arch/arm64/include/asm/kvm_host.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -178,8 +178,10 @@ struct kvm_vcpu_arch {
> * CP14 and CP15 live in the same array, as they are backed by the
> * same system registers.
> */
> -#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r)])
> -#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r)])
> +#define CPx_BIAS IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
> +
> +#define vcpu_cp14(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
> +#define vcpu_cp15(v,r) ((v)->arch.ctxt.copro[(r) ^ CPx_BIAS])
>
> #ifdef CONFIG_CPU_BIG_ENDIAN
> #define vcpu_cp15_64_high(v,r) vcpu_cp15((v),(r))
>
>
> Patches currently in stable-queue which might be from maz@kernel.org are
>
> queue-4.4/kvm-arm64-make-vcpu_cp1x-work-on-big-endian-hosts.patch
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree
2020-08-06 2:26 ` Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree yangerkun
@ 2020-08-06 7:10 ` Greg KH
2020-08-06 8:55 ` Marc Zyngier
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-08-06 7:10 UTC (permalink / raw)
To: yangerkun
Cc: linux-kernel, james.morse, maz, drjones, marc.zyngier,
christoffer.dall, stable-commits, kvm
On Thu, Aug 06, 2020 at 10:26:24AM +0800, yangerkun wrote:
> Hi,
>
> Not familiar with kvm. And I have a question about this patch. Maybe
> backport this patch 3204be4109ad("KVM: arm64: Make vcpu_cp1x() work on Big
> Endian hosts") without 52f6c4f02164 ("KVM: arm64: Change 32-bit handling of
> VM system registers") seems not right?
I do not know, can you verify that this is needed and let us know?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree
2020-08-06 2:26 ` Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree yangerkun
2020-08-06 7:10 ` Greg KH
@ 2020-08-06 8:55 ` Marc Zyngier
1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2020-08-06 8:55 UTC (permalink / raw)
To: yangerkun
Cc: linux-kernel, gregkh, james.morse, drjones, marc.zyngier,
christoffer.dall, stable-commits, kvm
Hi Kun,
On 2020-08-06 03:26, yangerkun wrote:
> Hi,
>
> Not familiar with kvm. And I have a question about this patch. Maybe
> backport this patch 3204be4109ad("KVM: arm64: Make vcpu_cp1x() work on
> Big Endian hosts") without 52f6c4f02164 ("KVM: arm64: Change 32-bit
> handling of VM system registers") seems not right?
This seems sensible. Please post a backport of this patch, assuming
you are in a position to actually test it (I'm not able to run BE
kernels, let alone userspace).
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-06 17:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <159230500664142@kroah.com>
2020-08-06 2:26 ` Patch "KVM: arm64: Make vcpu_cp1x() work on Big Endian hosts" has been added to the 4.4-stable tree yangerkun
2020-08-06 7:10 ` Greg KH
2020-08-06 8:55 ` Marc Zyngier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.