Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1813493imu; Thu, 17 Jan 2019 03:46:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN7xII19e2wKVheuooV+Crej7eL+SnykF9zOvRkwPA1xFSySNiYa192DKgWswhLVLmzpDJZ7 X-Received: by 2002:a63:eb0e:: with SMTP id t14mr13321969pgh.445.1547725561711; Thu, 17 Jan 2019 03:46:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547725561; cv=none; d=google.com; s=arc-20160816; b=ytAIFj7tUg8ZxLf/XUymX4wzpvh98e9BxNSMOwlaLtIs6Qij/fz1pv9w+0Rmo8/+Zy cU5xQ89nloOfUnDHuk2ct1UekWq0KKjpIIF59LRuTEpuekOAE5ev3nLjAxaUDWBEv+3F oB6VkMDKYx7EJGWs0ne6Y1DPdK/fztXrF7xd0MRNg5/X17yTk9yUxkEWLXuMATx1W9IP dM2DTb1lF/MR3SbWHcUkgfx8XWajp1GmPhoWCa+9mamEdc7m2sB5UZVsM+Mshsu1Uf/J 2/iLDzYpn0b/Nz/dCkX4sOQeT+FnolQjkfsxzFM9ozddJpE8pc2UxREK2uLj80Wvc+pa +KLw== 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=CFKSzFsfMt9ff9QVI8w6EY+shCSKMvCQypFeZi0ZZew=; b=RAOhtDEszNBF+t5lys97rtufvPPmoESgGUzrCk3tg0p3vEZLFPLVvuJ7h5L9ywkBwJ F0b1SoW01qoklybc6FwCuYEPe2NR0c011ozGa29y4Qp1ifN/VPX87RpzAwzOAHMUIZ25 0gpx1EoIKQPJk3pX/EthXu6ME9STv2UkfhVnOucQqzyWnR7Ba5q/EImDt0XUjgG9WLHb 3jasX6buvAn4NyeeBjDDZQqZRfZbzzgt8hd9G3bSyc9azsPNT6K7ooAipsAPwaTc9/eE vkTM2H/AU2RblbfMEOJlyql2DrIXR4Vk7C5vzV28dPecI1fXyCofQAnJrWnFYMiUTvfr WYkw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si1352818pgk.323.2019.01.17.03.45.46; Thu, 17 Jan 2019 03:46:01 -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; 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 S1727983AbfAQJkK (ORCPT + 99 others); Thu, 17 Jan 2019 04:40:10 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:42088 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfAQJkJ (ORCPT ); Thu, 17 Jan 2019 04:40:09 -0500 Received: by mail-ot1-f67.google.com with SMTP id v23so10519674otk.9; Thu, 17 Jan 2019 01:40:09 -0800 (PST) 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=CFKSzFsfMt9ff9QVI8w6EY+shCSKMvCQypFeZi0ZZew=; b=nSen9A0JuTTV+vzcunTjw5WCRV1JqP7h9eU01jDGTRkbizlCUTTBk77ZTh58TUgkot d+5yCSw4AlOJChL5d0dqCoQrHkJFL8116P2YiPX7NIB+b6ZqPrfuYO+36zOfop98evVb Kb1eP0AW9xoTxHErF1CpAtwx0fU4CrbuqOzhrVxWd9gzugZ4x1r7X1EJz32KFWS25l2Q RAS12wFLft2ry1LVkhs/Dg6vAANF3R86h4UiO52xYeaIvbYhHRMTnSUsCxKQFivU0BPp IIsps5Ui8YAy6GFqA/ZQ1OIH13zW0m/1hddckZIfwK0sPZGzrewNUgAUoE0ejU/Sc+RF UCkQ== X-Gm-Message-State: AJcUukcJ7UQwqxHptY/w4glzcgZilhaqKMiWLXeKLGOgkEUkJFZCvxki LDsOGQHuP7QNgTahc7pLv+inBc6n5Cok22st8hA= X-Received: by 2002:a9d:7f0d:: with SMTP id j13mr7838799otq.119.1547718008394; Thu, 17 Jan 2019 01:40:08 -0800 (PST) MIME-Version: 1.0 References: <20190115095834.22617-1-kasong@redhat.com> <20190115095834.22617-3-kasong@redhat.com> <20190115231005.GF6596@zn.tnic> <20190116094619.GB15409@zn.tnic> <20190117085316.GA17940@dhcp-128-65.nay.redhat.com> In-Reply-To: <20190117085316.GA17940@dhcp-128-65.nay.redhat.com> From: "Rafael J. Wysocki" Date: Thu, 17 Jan 2019 10:39:57 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map To: Dave Young Cc: Kairui Song , Borislav Petkov , Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Baoquan He , kexec@lists.infradead.org, Andrew Morton , Robert Moore , "Schmauss, Erik" , Rafael Wysocki , Len Brown , Chao Fan , ACPI Devel Maling List 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 Thu, Jan 17, 2019 at 9:53 AM Dave Young wrote: > > Add linux-acpi list Well, thanks, but please resend the patches with a CC to linux-acpi. > On 01/17/19 at 03:41pm, Kairui Song wrote: > > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > > > > > > On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > > > > I didn't see a way to reuse things in that patch series, situation is > > > > different, in that patch it needs to get RSDP in very early boot stage > > > > so it did everything from scratch, in this patch kexec_file_load need > > > > to get RSDP too, but everything is well setup so things are a lot > > > > easier, just read from current boot_prams, efi and fallback to > > > > acpi_find_root_pointer should be good. > > > > > > No no. Early code should find out that venerable RSDP thing once and > > > will save it somewhere for further use. No gazillion parsings of it. > > > Just once and share it with the rest of the code that needs it. > > > > > > > How about we refill the boot_params.acpi_rsdp_addr if it is not valid > > in early code, so it could be used as a reliable RSDP address source? > > That should make things easier. > > > > But if early code should parse it and store it should be done in > > Chao's patch, or I can post another patch to do it if Chao's patch is > > merged. > > > > For now I think good to have something like this in this patch series > > to always keep storing acpi_rsdp in late code, > > acpi_os_get_root_pointer_late (maybe comeup with a better name later) > > could be used anytime to get RSDP and no extra parsing: > > > > --- a/drivers/acpi/osl.c > > +++ b/drivers/acpi/osl.c > > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args) > > #endif > > } > > > > -#ifdef CONFIG_KEXEC > > static unsigned long acpi_rsdp; > > +#ifdef CONFIG_KEXEC > > static int __init setup_acpi_rsdp(char *arg) > > { > > return kstrtoul(arg, 16, &acpi_rsdp); > > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg) > > early_param("acpi_rsdp", setup_acpi_rsdp); > > #endif > > > > +acpi_physical_address acpi_os_get_root_pointer_late(void) { > > + return acpi_rsdp; > > +} > > + > > acpi_physical_address __init acpi_os_get_root_pointer(void) > > { > > acpi_physical_address pa; > > > > -#ifdef CONFIG_KEXEC > > if (acpi_rsdp) > > return acpi_rsdp; > > -#endif > > + > > pa = acpi_arch_get_root_pointer(); > > - if (pa) > > + if (pa) { > > + acpi_rsdp = pa; > > return pa; > > + } > > > > if (efi_enabled(EFI_CONFIG_TABLES)) { > > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) > > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) { > > + acpi_rsdp = efi.acpi20; > > return efi.acpi20; > > - if (efi.acpi != EFI_INVALID_TABLE_ADDR) > > + } > > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) { > > + acpi_rsdp = efi.acpi; > > return efi.acpi; > > + } > > pr_err(PREFIX "System description tables not found\n"); > > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { > > acpi_find_root_pointer(&pa); > > } > > > > + acpi_rsdp = pa; > > return pa; > > } > > > > > -- > > > Regards/Gruss, > > > Boris. > > > > > > Good mailing practices for 400: avoid top-posting and trim the reply. > > -- > > Best Regards, > > Kairui Song