From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5707AC10F11 for ; Mon, 22 Apr 2019 14:33:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F29320685 for ; Mon, 22 Apr 2019 14:33:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbfDVOdw (ORCPT ); Mon, 22 Apr 2019 10:33:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50566 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfDVOdw (ORCPT ); Mon, 22 Apr 2019 10:33:52 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65E18308425C; Mon, 22 Apr 2019 14:33:52 +0000 (UTC) Received: from localhost (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DBBF26FC7; Mon, 22 Apr 2019 14:33:49 +0000 (UTC) Date: Mon, 22 Apr 2019 22:33:46 +0800 From: Baoquan He To: Junichi Nomura , Borislav Petkov , dyoung@redhat.com Cc: Kairui Song , Thomas Gleixner , linux-kernel@vger.kernel.org, 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: <20190422143346.GD3584@localhost.localdomain> References: <20190419101733.GA10324@zn.tnic> <20190419105014.GE11060@MiWiFi-R3L-srv> <20190419112801.GB10324@zn.tnic> <20190419113621.GD10324@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190419113621.GD10324@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 22 Apr 2019 14:33:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19/19 at 01:36pm, Borislav Petkov wrote: > On Fri, Apr 19, 2019 at 01:28:01PM +0200, Borislav Petkov wrote: > > Read again what I said: "should all be passed through boot_params". > > Which means, boot_params should be extended with a field of a flag to > > say: "this is a kexec'ed kernel". > > And by that I mean similar to the XLF_EFI_KEXEC mechanism. The first > kernel or kexec(1) should prepare the info needed by the kexec'ed > kernel. We have set the loader type to '0x0D << 4' for kexec specifically, in both kexec_load and kexec_file_load. We can check this to identify if it's kexec-ed kernel or not. Update patch with it? static void *bzImage64_load(struct kimage *image, char *kernel, unsigned long kernel_len, char *initrd, unsigned long initrd_len, char *cmdline, unsigned long cmdline_len) { ... /* bootloader info. Do we need a separate ID for kexec kernel loader? */ params->hdr.type_of_loader = 0x0D << 4; ... }