Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2082366yba; Fri, 19 Apr 2019 11:46:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDFhqFTKkzObnIkJ/ewst1OhbGH5lGt3McSv8oF6/2fe5TGRIE/wuaSp0pnfIcUpgpV7lF X-Received: by 2002:aa7:920b:: with SMTP id 11mr5379680pfo.3.1555699596748; Fri, 19 Apr 2019 11:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555699596; cv=none; d=google.com; s=arc-20160816; b=ubaZU/Cot19ZhLg+TZUG7l/UXMpqKpF6/cgU063BFAlwkH/TAOn3ZunqSrx01RgMBY UEAu9BSM+VCuq8ISCF03X9thKYmHCt/mothzez722Ew257lmjExoNVLHnguSb0R+yKfp L8C6N08IJ5m8AaEFfca5RrndNAk70JFMkbIbZN0lSol9USImWm9FMcb7KSJ+4KEL0mo/ EJW/8S2oQQqU/QLxzmn5LT1OAJZX/vddVlFWThSSjutfYm+NlzdNBou8M/tuKmXGtUec XPpfSR1wjJwjtv9nWGbAu4nPOORsbCtYpsMeAa2HTHr09mTZ44yaXIHhRKS86Tt3IQyX SMew== 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=KvkrT7n0lvO37OOK/U/WO0WFm7q8pLZ2+gcOlL+GzuQ=; b=OoWj+AIo1eCM1C9Fw7hfHBdd+CTlteOA7W3uBkb9ix5i9p8+NhAHN46Jo2JWDIro97 DRexJCOMvjLuFU+iqre/VK2eAamoX4zMut/R83HdrCWTvSQzloRwzwlEI+i523tnrvUF QBSJ+ekZBwOkL5cNyNxKWQAFQJseLOLeypQ9Pp88P4V5zFrwM+PB9coKm12VeTlCzWZZ R4bCueJtBLZ6upEt4qCilAnJLKz93pWkBDI60lfvJip/flF0ubHH4qWv+hNUqOYLFj6u TFs4mJ9DPBfzBtz/rR31sQFQOwadDpjMb2F4mhkYN5O9d/0fqyq4p5+3pF+ZgMMjpHmq 6puA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=pL0J72wH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si5308141pgq.129.2019.04.19.11.46.21; Fri, 19 Apr 2019 11:46:36 -0700 (PDT) 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=pass header.i=@alien8.de header.s=dkim header.b=pL0J72wH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbfDSSoE (ORCPT + 99 others); Fri, 19 Apr 2019 14:44:04 -0400 Received: from mail.skyhub.de ([5.9.137.197]:38360 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbfDSSoC (ORCPT ); Fri, 19 Apr 2019 14:44:02 -0400 Received: from zn.tnic (p200300EC2F112E006C6C37C052F44BC9.dip0.t-ipconnect.de [IPv6:2003:ec:2f11:2e00:6c6c:37c0:52f4:4bc9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0E0391EC0AB0; Fri, 19 Apr 2019 13:34:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1555673655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=KvkrT7n0lvO37OOK/U/WO0WFm7q8pLZ2+gcOlL+GzuQ=; b=pL0J72wHwswtHqQ93OAXCN4pVjPkt6/Gea3yp9Yhp3szy8HeS5KTYYCqLX4/xI8bl+tnBW Zm6wAMZW2D2rzkhsFJCM7p+FlKzMaSTPrXBqcJ/Zmta0OV9zM9qflA17Q3B+AUFJi3v+qO 05BRCkWJrvXluPMPMoRyevg/ZJtytHc= Date: Fri, 19 Apr 2019 13:34:13 +0200 From: Borislav Petkov To: Kairui Song Cc: Baoquan He , Thomas Gleixner , Linux Kernel Mailing List , Junichi Nomura , Dave Young , Chao Fan , "x86@kernel.org" , "kexec@lists.infradead.org" Subject: Re: [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it Message-ID: <20190419113413.GC10324@zn.tnic> References: <20190419101733.GA10324@zn.tnic> <20190419105014.GE11060@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 07:20:06PM +0800, Kairui Song wrote: > Thanks for the declaration Bao, I can verify on the machine I have, > the issue still exist without kaslr. Currently, we read rsdp in early > code and fill in boot_params unconditional, so it will read from the > systab anyway. Yes, and in the future, info required by the kexec'ed kernel - like the EFI systab address or even whether the kernel has been kexec'ed or comes from cold boot - should be passed in boot_params. So that we don't have to do all that ugly dancing in early code. > Yes, kexec only cover RAM in the ident map it prepared for second > kernel, but the systab could be in reserved region, so if it didn't > fall into the 1G padding by accident it will fail when reading from > it. Fix in early code could make sure 2nd kernel always work. Or > should we treat it specially in kexec mapping prepare code? Yes, we should. As I said, this is not early boot code's problem but the kexec setup code's problem. If the new kernel cannot get RSDP that early, then it should fail the same way it failed before. That early RDSP parsing was added for the movable regions thing working with KASLR. If it can't get a RDSP for whatever reason, then if KASLR selects a region overlapping with the movable regions, then it is the old behavior. Ok? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.