Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758146AbcK3Qwb (ORCPT ); Wed, 30 Nov 2016 11:52:31 -0500 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36063 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756174AbcK3QwY (ORCPT ); Wed, 30 Nov 2016 11:52:24 -0500 MIME-Version: 1.0 In-Reply-To: References: <1461888548-32439-1-git-send-email-keescook@chromium.org> <1461888548-32439-3-git-send-email-keescook@chromium.org> <20160816040147.GA4492@hydra.tuxags.com> <20160817022553.GA9962@hydra.tuxags.com> From: Andy Shevchenko Date: Wed, 30 Nov 2016 18:52:22 +0200 Message-ID: Subject: Re: [PATCH 2/6] x86/boot: Move compressed kernel to end of decompression buffer To: Simon Glass Cc: Yinghai Lu , Kees Cook , Ingo Molnar , Ingo Molnar , Baoquan He , "H. Peter Anvin" , Borislav Petkov , Vivek Goyal , Andy Lutomirski , Lasse Collin , Andrew Morton , Dave Young , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2676 Lines: 56 On Tue, Oct 4, 2016 at 12:50 AM, Simon Glass wrote: > HI Matt, > > On 16 August 2016 at 20:25, Matt Mullins wrote: >> On Tue, Aug 16, 2016 at 12:19:42PM -0700, Yinghai Lu wrote: >>> On Mon, Aug 15, 2016 at 9:01 PM, Matt Mullins wrote: >>> > >>> > This appears to have a negative effect on booting the Intel Edison platform, as >>> > it uses u-boot as its bootloader. u-boot does not copy the init_size parameter >>> > when booting a bzImage: it copies a fixed-size setup_header [1], and its >>> > definition of setup_header doesn't include the parameters beyond setup_data [2]. >>> > >>> > With a zero value for init_size, this calculates a %rsp value of 0x101ff9600. >>> > This causes the boot process to hard-stop at the immediately-following pushq, as >>> > this platform has no usable physical addresses above 4G. >>> > >>> > What are the options for getting this type of platform to function again? For >>> > now, kexec from a working Linux system does seem to be a work-around, but there >>> > appears to be other x86 hardware using u-boot: the chromium.org folks seem to be >>> > maintaining the u-boot x86 tree. >>> > >>> > [1] http://git.denx.de/?p=u-boot.git;a=blob;f=arch/x86/lib/zimage.c;h=1b33c771391f49ffe82864ff1582bdfd07e5e97d;hb=HEAD#l156 >>> > [2] http://git.denx.de/?p=u-boot.git;a=blob;f=arch/x86/include/asm/bootparam.h;h=140095117e5a2daef0a097c55f0ed10e08acc781;hb=HEAD#l24 >>> >>> Then should fix the u-boot about header_size assumption. >> >> I was hoping to avoid that, since the Edison's u-boot is 10,000-line patch atop >> the upstream -- I don't trust myself to build and flash one quite yet. > > It would be good to upstream that! > >> >> If this turned out to affect Chromebooks, I'd spend more effort pushing for >> a kernel fix, but it seems that ChromeOS has a different kernel load procedure >> and doesn't use "zboot". For now, I'll probably just keep a local patch that >> hard-codes a value large enough to decompress and launch the kernel. >> >> I may turn that local patch into something gated by a Kconfig eventually, in >> hopes that users of the other x86 u-boot platforms will see it in a "make >> oldconfig" run. > > Well, I think this patch is useful. But also, let's fix U-Boot. Found this late. Anyway, I have got same issue [1] and basically what I did, I just deuglified a bit that monster hack pile for U-Boot to build my own fork of most recent one [2]. For now on I have working x86_64 kernel directly and newest U-Boot. [1] https://github.com/andy-shev/linux/issues/3 [2] https://github.com/andy-shev/u-boot/tree/edison -- With Best Regards, Andy Shevchenko