Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2677560pxb; Sat, 30 Jan 2021 10:15:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWMLAqsOj2FCzbiW6T33NzwZGlzKa9LU4BdRAK3gMlt1sQVLW6la/K01Uv11ZNcqmjurOk X-Received: by 2002:a17:906:5495:: with SMTP id r21mr10036832ejo.59.1612030501568; Sat, 30 Jan 2021 10:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612030501; cv=none; d=google.com; s=arc-20160816; b=DlwUK5yy8Pn34lCCfuiit7+991K47Wgp+Nw6M61ctfgtxjHmup3d5GDsg2Gp8FKZHn 8HQjxXHR+yX/pZTMqQJEJqH0QRahySzHpIdbQMZKOB3Q0PZhFFz4iZhHvLWXWWxtNq04 AUL4vZaTcl80+/ZIux/zh3Vh3aapipiLagLadPyDImitNKyAK7ng+Cnb7szoXV1cGGUA JT74oDlDiAnVYXhiZS7wAUhoYTDCijV2kxpzniutqo6ogmx8VH6WzRaNoh1azaemrOUg X6KJuKqww/QLvglSetUb5Nf4EqPYuI5lBqfEh5Y2Bw8D2yd6My+44kmFlqK6Bq4gUzUB ysYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=Cf9KgWoEc3278JCboeln28KTP/OO/ZSbyAwdLWD3vzE=; b=013cFHaX3Ik28fV7GhMhdOTwJNmSAxioHs93kmItDIkg/Xl4gG+/K0P1s+0t0OmQjI 2qHw2WpZrbLHDd5y+FZH7QsiekDbuf/q8GZN9e3qjCHatqmJt6zH+e5UUZYFUKS8Id6o RXx8nMGSzFc/NHzHmdH2sYbW7UHlfg5uXgaLeq/ZmZSGebLsHsRIlPxxwDUfVChnAXcC kdmr7sU2gtNG5GM1PwvgirPffip0BT2ZVO0tHByOrSE14wo/sQ8Uaas9MWjSbSO1Zpxq figUfj7f/ulbOfGxfY2uHFWFtLmeFRcz9d+lQjj2VA4X6M59WdaKs2zai1rqKJk9/+m/ EcQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si755116edh.147.2021.01.30.10.14.36; Sat, 30 Jan 2021 10:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbhA3SK7 (ORCPT + 99 others); Sat, 30 Jan 2021 13:10:59 -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.