Re: A minor question about endianness setting in hyp-sub.S

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30 June 2014 01:45, Marc Zyngier <marc.zyngier@xxxxxxx> wrote:
> [Added Victor on CC, as he's our BE guy these days... ;-)]
>
> Hi Li,
>
> On 30/06/14 04:10, john.liuli wrote:
>> Hi All,
>>
>> I'm really confused by the endianness setting in hyp-sub.S as below:
>>
>> #ifdef CONFIG_CPU_BIG_ENDIAN
>>          orr     r7, #(1 << 9)           @ HSCTLR.EE
>> #endif
>>
>> Is this line try to set HSCTLR.EE if kernel enabled
>> CONFIG_CPU_BIG_ENDIAN? If so, HSCTLR.EE is defined as bit[25]
>> referring to DDI0606C(P1590). Can you explain the details?
>
> This looks like a bug, really. It only works because when building a BE
> kernel, we force the endianness of the kernel with a "setend be" as the
> first instruction (see arch/arm/kernel/head.S).
>
> KVM then copies the SCTLR.EE bit into HSCTLR.EE, and it may happen to
> work, but we're just lucky...

It worked with my series because I was switching
hypervisor to BE mode in place close to this. Please
look at [1] switch happened in __do_hyp_init.

I was not aware about this place.
It seems to me that this place is more logical place
to do switch. I've tested it quickly and it seems fine.
With proper fix here I can drop [1]. I can fold resulting John's
patch into my series instead of [1].

Thanks,
Victor

[1] https://lists.cs.columbia.edu/pipermail/kvmarm/2014-June/009950.html

>> BTW: another relevant definition can be found in include/asm/kvm_arm.h
>> as blow which makes sense:
>>
>> #define HSCTLR_EE     (1 << 25)
>
> Yes, that's the correct value.
>
> Can you please submit a patch for this?
>
> Thanks,
>
>         M.
> --
> Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux