Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp426519imu; Thu, 8 Nov 2018 23:20:57 -0800 (PST) X-Google-Smtp-Source: AJdET5dfj1C8KYQdpfFo6wkIi1l6FdvKfE7GfZWZ0ot0B8npqXJuyNWlH2Wuu6Re9nXkkUcJL9ng X-Received: by 2002:a63:c746:: with SMTP id v6-v6mr6686625pgg.108.1541748057604; Thu, 08 Nov 2018 23:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541748057; cv=none; d=google.com; s=arc-20160816; b=xvH0eQ3JHGM2aaKjMqCBB1rYJEQuIZLsdP+eUpwzJbRvhaBZ+mxu7HfQU4PLltaHTe Zx2wowEnHyBfItFmLy1/0/JliwhJnom5sI2mWq5OD4m0WiqIUGlBIAToH+2n9haH01Or FWpJ2bYk7v0qtEGv+3972N5sAmkYjnSDbZupaRl668XHMYHz4gv/3CQzKdfx6/y/Q19v vRAiwRAoB/cmRf0hg9BRg0EcRwc49pPX2ZWibrfORvWtB4EiXASvk9MqnKSblRj9bDGA pmbzMXNzBVmMuepwvAoAoWyErGNGE/hYT3k4pNNPcXApbYVU/nsEh8q7n491QgOsLOXI w1nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=t4/Z93NpSjWRXYVjkJMcRprWEQbJMh3hbotZAHtoic8=; b=rtL52p0PfPEnEtFJ8mAvMJdRX92itMZl3KEFRLkPKxVaVKJAqNDeVh32nQRAejTGTG HXVEUapAVMBT/IyIcHiUqCvXDJxxnx55ktF5bn4VnMTsyFw0EPrNe4n1M5NPVEoxyHkD +KYhyIghC1/xLkqBGPkKV9meYHJR4ayTxETj7U1PJKSmfmT6fOnKi5vUomz9adMU7ePF D/lfVbydfGXLW0rTC12FWgeKfJ56fM4Jt3z+L5yDTTc6DuVDCgslFwvGorOb6qxXwULm WFLuLvylTsNYbfb6inHl2gseum5+73G0wbW9sSx/xej9eo8tjy1SVJQsM++6Ct0kTejD nFMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="sRbbfGg/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13-v6si6101498pgk.127.2018.11.08.23.20.41; Thu, 08 Nov 2018 23:20:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="sRbbfGg/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbeKIQ7i (ORCPT + 99 others); Fri, 9 Nov 2018 11:59:38 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36718 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727869AbeKIQ7h (ORCPT ); Fri, 9 Nov 2018 11:59:37 -0500 Received: by mail-wm1-f68.google.com with SMTP id v70-v6so536059wmd.1 for ; Thu, 08 Nov 2018 23:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t4/Z93NpSjWRXYVjkJMcRprWEQbJMh3hbotZAHtoic8=; b=sRbbfGg/BBreaLfD5mxRjQ34xhes+LY2xD5w+ViNGrm9wIAI1C+E6RWar6/Z9UAPc+ yXzKP/xwFt/ZtCVx9H+t/4yVD0jJSwqp/mkZMsDAlA0ho4htei/Aed3WxfskpjLA6TkD moTGfw6stzf0GNAekxPNfAEe6O9IXy90FnWjTPUbvvDb9JJnqENmGsnH8B4FcnPa/sd4 bmf30dzHzE66O0MnixBwUkHffN/9e6NiSxImnW3NhSLzPtykyxL960YcJgNdeCl7H865 ysyexVEjMT8DVFC0MyzE60NHD55p6j7ez/alqYQ8IDOUahhGmVdQmr5n0n+oB8BgnF29 shiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=t4/Z93NpSjWRXYVjkJMcRprWEQbJMh3hbotZAHtoic8=; b=T8MF5N7OlaFm5IgmGiP0Z3YAICTF4eseoloQNYjOxEuEwvEbzrs7XUSHmixwgD3dz/ NjbJJw8ZmH2AQQ2P6auXZj3YGdrx6jBcYPUi8UjXS/HQvT5S7jT1CqHwJDQFN8CmiBZH zii8YPefUbeOnigleG2yCAM07/0UmuO1KzNKi/iTXeRWutOQbIBJi72jqu6vqf1S8Dxx IfiAWhwaKEAv2ZfO2BvA1rGlOnBwgP7/Er1MObfIOckUu6j0pt0+Cj6NaARilEMntbId hoXmGz262Fg0cZHklJKBSK3W3G05c7czzkc8BwKM+uSR61OjG2Fpreunq61RRB6DawIN j56A== X-Gm-Message-State: AGRZ1gITilEPmV5o4U5fw9/6upD/TilnRbJoyggFKIS6wMb0YnWAaxo9 VArXv3vAveak9OJVHvxheZc= X-Received: by 2002:a1c:1189:: with SMTP id 131-v6mr3667075wmr.87.1541748018907; Thu, 08 Nov 2018 23:20:18 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id h189-v6sm2434376wma.10.2018.11.08.23.20.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 23:20:18 -0800 (PST) Date: Fri, 9 Nov 2018 08:20:15 +0100 From: Ingo Molnar To: Li Zhijian , Juergen Gross Cc: Peter Maydell , x86@kernel.org, hpa@zytor.com, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, QEMU Developers , Philip Li , zhijianx.li@intel.com, linux-kernel@vger.kernel.org, Linus Torvalds , Peter Zijlstra , Kees Cook Subject: Re: [Qemu-devel] [RFC/PoC PATCH 1/3] i386: set initrd_max to 4G - 1 to allow up to 4G initrd Message-ID: <20181109072015.GA86700@gmail.com> References: <1541674784-25936-1-git-send-email-lizhijian@cn.fujitsu.com> <1541674784-25936-2-git-send-email-lizhijian@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Li Zhijian wrote: > > If the kernel initrd creation process creates an initrd which > > is larger than 2GB and also claims that it can't be placed > > with any part of it above 2GB, then that sounds like a bug > > in the initrd creation process... > > Exactly, it's a real problem. > > Add x86 maintainers and LKML: > > The background is that QEMU want to support up to 4G initrd. but linux header ( > initrd_addr_max field) only allow 2G-1. > Is one of the below approaches reasonable: > 1) change initrd_addr_max to 4G-1 directly simply(arch/x86/boot/header.S)? > 2) lie QEMU bootloader the initrd_addr_max is 4G-1 even though header said 2G-1 > 3) any else A 10 years old comment from hpa says: initrd_addr_max: .long 0x7fffffff # (Header version 0x0203 or later) # The highest safe address for # the contents of an initrd # The current kernel allows up to 4 GB, # but leave it at 2 GB to avoid # possible bootloader bugs. To avoid the potential of bugs lurking in dozens of major and hundreds of minor iterations of various Linux bootloaders I'd prefer a real solution and extend it - because if there's a 2GB initrd for some weird reason today there might be a 4GB one in two years. The real solution would be to: - Extend the boot protocol with a 64-bit field, named initrd_addr64_max or such. - We don't change the old field - but if the new field is set by new kernels then new bootloaders can use that as a new initrd_addr64_max value. (or reject to load the kernel if the address is too high.) - The kernel build should also emit a warning when building larger than 2GB initrds, with a list of bootloaders that support the new protocol. Or something along those lines. Thanks, Ingo