From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ABB4C433E0 for ; Sat, 30 Jan 2021 18:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C52D64E05 for ; Sat, 30 Jan 2021 18:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbhA3SLA (ORCPT ); Sat, 30 Jan 2021 13:11:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:33190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbhA3SK7 (ORCPT ); Sat, 30 Jan 2021 13:10:59 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8232E64E05; Sat, 30 Jan 2021 18:10:18 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l5uhM-00B0ti-DX; Sat, 30 Jan 2021 18:10:16 +0000 Date: Sat, 30 Jan 2021 18:10:14 +0000 Message-ID: <87pn1ml2ih.wl-maz@kernel.org> From: Marc Zyngier To: Guenter Roeck Cc: David Brazdil , kvmarm@lists.cs.columbia.edu, Mark Rutland , Suzuki K Poulose , Catalin Marinas , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Will Deacon , Ard Biesheuvel , Julien Thierry Subject: Re: [PATCH v2 4/8] KVM: arm64: Generate hyp relocation data In-Reply-To: <20210130161104.GA77773@roeck-us.net> References: <20210105180541.65031-1-dbrazdil@google.com> <20210105180541.65031-5-dbrazdil@google.com> <20210129214325.GA195322@roeck-us.net> <87r1m2lets.wl-maz@kernel.org> <20210130161104.GA77773@roeck-us.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux@roeck-us.net, dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, mark.rutland@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, will@kernel.org, ardb@kernel.org, julien.thierry.kdev@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 30 Jan 2021 16:11:04 +0000, Guenter Roeck wrote: > > On Sat, Jan 30, 2021 at 01:44:15PM +0000, Marc Zyngier wrote: > > From d80ca05b2ed90fc30d328041692fa80f525c8d12 Mon Sep 17 00:00:00 2001 > > From: Marc Zyngier > > Date: Sat, 30 Jan 2021 13:07:51 +0000 > > Subject: [PATCH] KVM: arm64: Make gen-hyprel endianness agnostic > > > > gen-hyprel is, for better or worse, a native-endian program: > > it assumes that the ELF data structures are in the host's > > endianness, and even assumes that the compiled kernel is > > little-endian in one particular case. > > > > None of these assumptions hold true though: people actually build > > (use?) BE arm64 kernels, and seem to avoid doing so on BE hosts. > > Madness! > > > > In order to solve this, wrap each access to the ELF data structures > > with the required byte-swapping magic. This requires to obtain > > the kernel data structure, and provide per-endianess wrappers. > > > > This result in a kernel that links and even boots in a model. > > > > Fixes: 8c49b5d43d4c ("KVM: arm64: Generate hyp relocation data") > > Reported-by: Guenter Roeck > > Signed-off-by: Marc Zyngier > > Tested-by: Guenter Roeck > > Compiles and boots both big- and little-endian systems in qemu. Great, thanks for confirming that it fixed this issue. Now applied to kvm-arm64/hyp-reloc, and pushed out to kvmarm/next. M. -- Without deviation from the norm, progress is not possible.