On 5 February 2015 at 09:59, Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx> wrote: > This patch implements a fucntion pointer "virtio_is_big_endian" > from "CPUClass" structure for arm/arm64. > Function arm_cpu_is_big_endian() is added to determine and > return the guest cpu endianness to virtio. > This is required for running cross endian guests with virtio on ARM/ARM64. > > Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx> > --- > target-arm/cpu.c | 24 ++++++++++++++++++++++++ > target-arm/cpu.h | 2 ++ > 2 files changed, 26 insertions(+) > > diff --git a/target-arm/cpu.c b/target-arm/cpu.c > index 285947f..4d9cded 100644 > --- a/target-arm/cpu.c > +++ b/target-arm/cpu.c > @@ -320,6 +320,29 @@ static void arm_cpu_kvm_set_irq(void *opaque, int irq, int level) > kvm_set_irq(kvm_state, kvm_irq, level ? 1 : 0); > #endif > } > + > +static bool arm_cpu_is_big_endian(CPUState *cs) > +{ > + ARMCPU *cpu = ARM_CPU(cs); > + CPUARMState *env = &cpu->env; > + int cur_el; > + > + cpu_synchronize_state(cs); > + > + /* In 32bit guest endianess is determined by looking at CPSR's E bit */ > + if (!is_a64(env)) { > + return (env->pstate & CPSR_E) ? 1 : 0; This is wrong, because if we're not 32-bit then the CPSR isn't in env->pstate but in env->cpsr_uncached. (I'm guessing you didn't test 32-bit guests.) Since this is the only error in this patch, I'll just fix it as I put the series into target-arm.next rather than forcing you to respin it. thanks -- PMM _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm