Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2488721pxb; Sat, 30 Jan 2021 04:21:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMFwMw8zOTBjAMbrFYzmTFSQKKP5JM8jokGYtVRuQQ8/SdSM16kE/zT1NfMHk1/PNm4o/W X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr485951ejb.377.1612009306156; Sat, 30 Jan 2021 04:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612009306; cv=none; d=google.com; s=arc-20160816; b=dByjYV0TBTzQm/YhEI6CM+hX9taQi79KerCBkJEx5+lNmqnEw6dK8gA4uDGiuH34XA ZeWUgdlSL2VK7ggilStUBswuTMg3K0A1lHMpGLW4L8P8qgltKuJqSnF85Kt5iqclN+Yr X5pPMs9zTClPtW9Bv+d+wGLuPxEKQ2wg3boyrJJxQ3ZinGptTfWl1Q+JooLHJRoFxLa/ LTgD54T8jvUAMuCTs8nSvXB+3w6vjMI3MMow3amsX9LrYuRL6IdSTnnKVYVkIWZkJCuN C5gIJ0y03OHHWAdTMKIu9UFXtrYgv42slqRGlvNFFi8pIwY0qBarthGOKeBqWwftmLyW vHpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=WU4zugZ4UMaZPfp4SlJUy3de5kHsAVpxF6qvU+Obm7w=; b=q6FmyJvxEJKHzoVATuS7SIp0sRUwg0LalqEjaLAhgT4fpmvbdvqLDEYaQ2cTH77nrM 7Ju32Wd1r8e1BsSDIsc6+AKfPz7OI/eeIkW348DJWqJgLOh+B4VJkRWxBKCwdSf0vDXk Dp1jxe/F0Tyi7c96sDzt7nyTsMAx6CU6ogF2HFKPPG0EmlA/IgTzKeNNiXB9Ycb3pDZ/ Gmk5sjKlumFO0ssIL3EGc3kWuQ5jSz0MblR46hgFG33EvziczI+ATBg3Rk2XUlTxeg7E ImM72UHj4b7ap5spq764jPPPkRFt4kJi9X/O19Z/mzi0w1giEdIlCqXEVYSF42gkspZu Q4Ew== 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 t1si6109431ejc.524.2021.01.30.04.21.19; Sat, 30 Jan 2021 04:21:46 -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 S229854AbhA3MRY (ORCPT + 99 others); Sat, 30 Jan 2021 07:17:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:60476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbhA3MRX (ORCPT ); Sat, 30 Jan 2021 07:17:23 -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 CE8A564E06; Sat, 30 Jan 2021 12:16:42 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l5pBA-00Ayge-MI; Sat, 30 Jan 2021 12:16:40 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 30 Jan 2021 12:16:40 +0000 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: <20210129214325.GA195322@roeck-us.net> References: <20210105180541.65031-1-dbrazdil@google.com> <20210105180541.65031-5-dbrazdil@google.com> <20210129214325.GA195322@roeck-us.net> User-Agent: Roundcube Webmail/1.4.10 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 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 Hi Guenter, Thanks a lot for the heads up. On 2021-01-29 21:43, Guenter Roeck wrote: > Hi, > > On Tue, Jan 05, 2021 at 06:05:37PM +0000, David Brazdil wrote: >> Add a post-processing step to compilation of KVM nVHE hyp code which >> calls a custom host tool (gen-hyprel) on the partially linked object >> file (hyp sections' names prefixed). >> >> The tool lists all R_AARCH64_ABS64 data relocations targeting hyp >> sections and generates an assembly file that will form a new section >> .hyp.reloc in the kernel binary. The new section contains an array of >> 32-bit offsets to the positions targeted by these relocations. >> >> Since these addresses of those positions will not be determined until >> linking of `vmlinux`, each 32-bit entry carries a R_AARCH64_PREL32 >> relocation with addend + . The linker of >> `vmlinux` will therefore fill the slot accordingly. >> >> This relocation data will be used at runtime to convert the kernel VAs >> at those positions to hyp VAs. >> >> Signed-off-by: David Brazdil > > This patch results in the following error for me. > > error: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.tmp.o: assertion > elf.ehdr->e_ident[5] == 1 failed (lhs=2, rhs=1, line=250) > > The problem is seen when trying to build aarch64 images in big endian > mode. Ah, big-endian. of course, the ELF header is in native endianness, and the sanity checks explode (still much better than generating crap). I'll have a look shortly. It shouldn't too hard to fix, just a bit invasive... Thanks again, M. -- Jazz is not dead. It just smells funny...