Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2121013yba; Fri, 19 Apr 2019 12:32:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdrE4xd4sbSG8KZUpHpPtg1974/hVjIu8tjn+5yCdZryU+PH4s6ezhNywHVVNlcAnofVB+ X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr5608602plb.318.1555702363735; Fri, 19 Apr 2019 12:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555702363; cv=none; d=google.com; s=arc-20160816; b=OBENO/2qEGzypHPKDNoA7uUhuZilMORCSSPhrD6I7h+azgaO909j/5rO1Cc3QhwYik uIw0NJulaBYs3Eoh2tsHrUWLSQOUTh+CTBXR3T4VA9p0KbXMQ15er/MJOCm7NtY5gYSp JbtxIUlEvUgbWlO7yU0AlknoBCAcX5A3NVIv3Ojkh0bELZAK0a60gAySJzcxV4mgdyzq 9RTWWF88vm8eSs/Kx4k6GS8dk+9c1TvDEMiDrDDkh25vG0hWGym+6cgV+lgmPb1zmN71 mYM6tSGZSqA/yoZKvhmgB6YhiTuUy9SM7hMaYZbz6hLxICLorvLdTMIumdhCzFs7x6L3 lp5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=/xwv2Jj5H9ECcT4qbxSkUQgVfTdS9O7FoHlMXAykRFg=; b=KHL3+WL6KAeua5yEdeB7FW7INkfGsrBGC8q0Ew1R66lCqXJpjYmHPNCg9cLd0Pow0X DXr6FlRIYV3Ws1qi6GSqmyMmJ0LAL9OARlDdSV1x04ZFaaCWzMbmt94zzfutcGxEDUPB /AC156S8Mo74fq6Kp4OBaBsH8V8sZ4wncPBiIJH1wdxLpR5yFGxrd59gmRl0rSzlP5xT 9FmyKBrXGGW+AAsw6P1FDjNMzFAo8+VdX+lmiXvua8WPW9Sx75gYvciJBoAos31LZsLm brKuMjiHjzwnqyUZl2TVUCBZoz6W8fmys3AD2MNErtCwnFr/y2XRYUeqPA92YIgyufNx PwxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si5234110pgv.442.2019.04.19.12.32.27; Fri, 19 Apr 2019 12:32:43 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbfDSTaF (ORCPT + 99 others); Fri, 19 Apr 2019 15:30:05 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:41150 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbfDSTaF (ORCPT ); Fri, 19 Apr 2019 15:30:05 -0400 Received: by mail-io1-f66.google.com with SMTP id r10so1240142ioc.8 for ; Fri, 19 Apr 2019 12:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/xwv2Jj5H9ECcT4qbxSkUQgVfTdS9O7FoHlMXAykRFg=; b=kdaNN5mgYMQZGMGxtHKxOcKX9Rf9lUlXGOtNUX5cN6BSBOjCgt+wNsBMW5wSWF7U8N vkXBcYYWtZ21yQmQHwXNnQSRk5xzg4ZgY+v1OigqojcIvf2Fkn5FBLF+3pHwddmcXaVz +ZXfrw2gc67hpW98jCiwTSZBM9HmeiDxFhgSXX+TWpK7SQYsb/dFi4igBrzfoE6Jm3lr YjNJ9+RQWgS4uplZJcSLL1E1y7P4SoTKzyJ87I8w9aTZ/xdeZ69b5+6170b4yehI73a7 zdwxiVx4rBdOhX447e+L6hjyjJJOmYfEyuAWrF6JGarLRP7OWSmQRzbACAxyk/wUeaXp Pa5w== X-Gm-Message-State: APjAAAUFkcWQhHN8FlQ8d0DyrfBdOZXRVpfUr6rptEZ9k3qNH4OcXM4i uOqqwyed9+wLIU+cs/DWAn536GA6CPBtk5Vie9VfZQCYy5IZ/A== X-Received: by 2002:a6b:6509:: with SMTP id z9mr2215896iob.43.1555674629051; Fri, 19 Apr 2019 04:50:29 -0700 (PDT) MIME-Version: 1.0 References: <20190419101733.GA10324@zn.tnic> <20190419105014.GE11060@MiWiFi-R3L-srv> <20190419113413.GC10324@zn.tnic> In-Reply-To: <20190419113413.GC10324@zn.tnic> From: Kairui Song Date: Fri, 19 Apr 2019 19:50:17 +0800 Message-ID: Subject: Re: [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it To: Borislav Petkov Cc: Baoquan He , Thomas Gleixner , Linux Kernel Mailing List , Junichi Nomura , Dave Young , Chao Fan , "x86@kernel.org" , "kexec@lists.infradead.org" Content-Type: text/plain; charset="UTF-8" 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 7:34 PM Borislav Petkov wrote: > > 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? > OK. And then fix the mapping issue in 1st kernel is the right way, I'll skip the update for the early code mapping thing. -- Best Regards, Kairui Song