Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4071919ima; Mon, 4 Feb 2019 09:42:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IYfpkE3MacnHzMWkQp/tcwfO/uuN+qDvBazndwNKiXir9lCGbpI2pRUNSUzFolilT1qOYWX X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr554583plb.296.1549302133247; Mon, 04 Feb 2019 09:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549302133; cv=none; d=google.com; s=arc-20160816; b=eIRZOy5kQlrHZOO+9JBrBTpPu4vozunXmrjDAzTtsElvXa2GgAJvULnpqkWTQQ7bzO NSffzlnV/15ECh5Q5BFG55P7hMG6hvdHL2nKinCSCXnoHqQyjnY0X6uyPtGq2K3B/1le 1C5984LMia/Hod+s7E/Qi09cVKn3Han2Wmarxx/d39GksS4qmQslQCfOCb4YXghyNzcL maWy9PdsAdn6FZ50DGyNieX9sbgsh8HeMPK8YrtPjCgbOFi5qpx3qBeNoYjM5Lll9FZw qo2PgUNQB3JJ3BHAYmeyjbnkShujRYt2qy+kBkLxD9oQOIygSUiZAPvPY7SgEHE0AEUq Zq+w== 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 :message-id:date:subject:cc:to:from; bh=NAFROfJmJ9tiOwMS1/kLfhNksN4Pyd5d5FvYPKN17yQ=; b=kjeDT1Z4Hl1zcYubnXbd4aC6+2sJmSo2qdP5q+v+XP4LoeMtyDY7MvonwdIRXzfbEs lhrePPEwr2y1yrUSnVyBsU47w+mo655ySDuF+hoSfTc9WhoXUUnRrdnj6fRAeK4yor0f Gt5m4UfmLWmKy14bdukoxAOU7A9pvXKNJZPs+1utTCMCdpJWjZwqgSoy1j+VrsXAC3Cj wCiYlGhn5yPfG9MZe/QDjwhwf69P7i1rQbJN0rfHrBJ7EXeAxdcCJiSJ2DTMSCqzM1S+ zwMnFxT0hrDd5S4k3DwcfepZJ4dNyqEdYxcAc0TKGCvSyfBF0wr+POYXVWfnB1W47tJZ 4E+g== 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 b24si554506pgg.288.2019.02.04.09.41.56; Mon, 04 Feb 2019 09:42:13 -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 S1728056AbfBDRjO (ORCPT + 99 others); Mon, 4 Feb 2019 12:39:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64113 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbfBDRjO (ORCPT ); Mon, 4 Feb 2019 12:39:14 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 659E181F0E; Mon, 4 Feb 2019 17:39:13 +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 49E805BBCB; Mon, 4 Feb 2019 17:39:06 +0000 (UTC) From: Kairui Song To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Dave Young , Baoquan He , kexec@lists.infradead.org, Andrew Morton , Chao Fan , Kairui Song Subject: [PATCH] x86, kexec_file_load: fill in acpi_rsdp_addr boot param unconditionally Date: Tue, 5 Feb 2019 01:38:52 +0800 Message-Id: <20190204173852.4863-1-kasong@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 04 Feb 2019 17:39:13 +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 so it 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 other 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, and kernel will prefer using this value for the RSDP address when it's set. And with commit 3a63f70bf4c3 ("x86/boot: Early parse RSDP and save it in boot_params"), now the acpi_rsdp_addr will always be filled with valid RSDP address. So we just fill in that value for second kernel's boot_params unconditionally, this ensure second kernel always use the same RSDP value as the first kernel. Tested with an EFI enabled KVM VM with efi=noruntime. Signed-off-by: Kairui Song --- This is update of part of patch series: "[PATCH v3 0/3] make kexec work with efi=noruntime or efi=old_map." But "[PATCH v3 1/3] x86, kexec_file_load: Don't setup EFI info if EFI runtime is not enabled" is already in [tip:x86/urgent], and with Chao's commit 3a63f70bf4c3 in [tip:x86/boot], we can just fill in acpi_rsdp_addr boot param unconditionally to fix the problem, so only I update and resend this patch. arch/x86/kernel/kexec-bzimage64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c index 53917a3ebf94..3611946dc7ea 100644 --- a/arch/x86/kernel/kexec-bzimage64.c +++ b/arch/x86/kernel/kexec-bzimage64.c @@ -218,6 +218,9 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params, params->screen_info.ext_mem_k = 0; params->alt_mem_k = 0; + /* Always fill in RSDP, it's either 0 or a valid value */ + params->acpi_rsdp_addr = boot_params.acpi_rsdp_addr; + /* Default APM info */ memset(¶ms->apm_bios_info, 0, sizeof(params->apm_bios_info)); @@ -256,7 +259,6 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params, setup_efi_state(params, params_load_addr, efi_map_offset, efi_map_sz, efi_setup_data_offset); #endif - /* Setup EDD info */ memcpy(params->eddbuf, boot_params.eddbuf, EDDMAXNR * sizeof(struct edd_info)); -- 2.20.1