Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3010810imu; Fri, 18 Jan 2019 03:16:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN5LBgzPgLnXdBAY6mt49F67990sxw4I4G0JEjUWc0NJbihsi7ml0EB//mW+S/tWnh9x+JtJ X-Received: by 2002:a17:902:720c:: with SMTP id ba12mr18866356plb.79.1547810191332; Fri, 18 Jan 2019 03:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547810191; cv=none; d=google.com; s=arc-20160816; b=n/mvwsIpDu9robVgkioLs38UCJXK7ovFWJ67Le6Cpo8jsnAQx4NebHWBxTpvE1enaS KJKjQdKS13lWdBbietyFkdL8B+QLtxrx6JEftwb9CmOiExT+Hw+koDYzITib76ltFePg eON6IWACd99AWCLrfV0FhshReU82pQQuZyxJW5gNfnDA7lzM4FfqNv+uN5vOJb86VRLU FsVury7vThHqhuegNq7ZjqmarOvYX9LNLf1oZKh6PB5BWB442IwZyxMfg/ya6lRFxayW FW78Nm2zC5K6eC9yItkDgCRzsqAqjkhYuHiNbMzlIDJ0ljGqBCYYryCGHvw8BLivOYWQ 2DGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=F/mu3WXVeKbYALV8f4j+RbVm+Y7xVux1ASlljHPfN3c=; b=zyec0W+pHxGBMW/cz1BCxkCVxZcgElLQAx3znWOgEscDv9/bal6TU/Z8PQ5qyMsbcP Zk1w+312gq4qWk5ZSJ4QbrSFUs5OLKOOC9VZn0nTq7uSdEplXv99DBFU+/k/aOZav6OO mAuQNG8QqWCuWsl9jRLlzD9m7AidQuVDfp2OB63cu9HprxQ0qPti9g66FL9zLSkljfJg IWHG3ierNtv1V8BuLQ7wZfVtSTsBgYkGMkPKfLU0MPYNYyev9pxHAsn9COndmGtfumtp YyrePsW0dno0m89ZvSMExOcAdWEzqeIaULuMUF+TAFkXZFafyAwzFyuicKgwcIw0PMY2 m0EQ== 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 x66si4422854pfk.73.2019.01.18.03.16.13; Fri, 18 Jan 2019 03:16:31 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbfARLOP (ORCPT + 99 others); Fri, 18 Jan 2019 06:14:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50134 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfARLOO (ORCPT ); Fri, 18 Jan 2019 06:14:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DF479D1FC; Fri, 18 Jan 2019 11:14:14 +0000 (UTC) Received: from kasong-desktop-nay-redhat-com.nay.redhat.com (unknown [10.66.128.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9102101960A; Fri, 18 Jan 2019 11:14:07 +0000 (UTC) From: Kairui Song To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, dyoung@redhat.com, bhe@redhat.com, kexec@lists.infradead.org, akpm@linux-foundation.org, robert.moore@intel.com, erik.schmauss@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org, fanc.fnst@cn.fujitsu.com, linux-acpi@vger.kernel.org, Kairui Song Subject: [PATCH v3 3/3] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map Date: Fri, 18 Jan 2019 19:13:10 +0800 Message-Id: <20190118111310.29589-4-kasong@redhat.com> In-Reply-To: <20190118111310.29589-1-kasong@redhat.com> References: <20190118111310.29589-1-kasong@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Jan 2019 11:14:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When efi=noruntime or efi=oldmap is used, EFI services won't be available in the second kernel, therefore the second kernel will not be able to get the ACPI RSDP address from firmware by calling EFI services and won't boot. Previously we are expecting the user to set the acpi_rsdp= on kernel command line for second kernel as there was no way to pass RSDP address to second kernel. After commit e6e094e053af ('x86/acpi, x86/boot: Take RSDP address from boot params if available'), now it's possible to set an acpi_rsdp_addr parameter in the boot_params passed to second kernel, this commit makes use of it, detect and set the RSDP address when it's required for second kernel to boot. Tested with an EFI enabled KVM VM with efi=noruntime. Suggested-by: Dave Young Signed-off-by: Kairui Song --- arch/x86/kernel/kexec-bzimage64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 097f52fb02e3..63101b2194fb 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -255,8 +256,17 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params, /* Setup EFI state */ setup_efi_state(params, params_load_addr, efi_map_offset, efi_map_sz, efi_setup_data_offset); + +#ifdef CONFIG_ACPI + /* Setup ACPI RSDP pointer in case EFI is not available in second kernel */ + if (!acpi_disabled && (!efi_enabled(EFI_RUNTIME_SERVICES) || efi_enabled(EFI_OLD_MEMMAP))) { + params->acpi_rsdp_addr = acpi_os_get_root_pointer_late(); + if (!params->acpi_rsdp_addr) + pr_warn("RSDP is not available for second kernel\n"); + } #endif +#endif /* Setup EDD info */ memcpy(params->eddbuf, boot_params.eddbuf, EDDMAXNR * sizeof(struct edd_info)); -- 2.20.1