Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5590995yba; Thu, 11 Apr 2019 01:10:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2vI0mmIK67N1FqNhquB4gSnChMejZI0PCjh0VWeyUoPfnGWvXYKYTv4gUmoIuCO5xSCPX X-Received: by 2002:a62:121c:: with SMTP id a28mr48101706pfj.58.1554970236101; Thu, 11 Apr 2019 01:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554970236; cv=none; d=google.com; s=arc-20160816; b=RUPkxpG7yLH6NCewv1CEI9CyTBDUHEJlj2LxWVImjRBJMseZsi2e1Vj9NBttURw5oP S9R77zrfAzvkyVDLSHyIUqjGtBCygUPfBkjw6li+/pBLbO5FiFSpdPsXkc3x+wquG8hF C6k+FuUtmjJcUDXAFqGSIuyOX/Jgd98+pVCj6As29c0rH5BTwp/XFLuZmWu2ByHaZGq7 O8slYR8/FF3TGKoAYyHhkYEiDCLyp4F4p6+ff+CYkzWEZXneqKDNjyoi89PbgybVp68i /nZXpLlTeKsUOlHkYeKT8AV7ZyDqE9ur6C+IVKMJL6pVF7s54epCFUIVM9fxGSOSQElx ugYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=z8304YD94RCjlMSAF19W30BX/NBhw56qlzcYzCUrbBQ=; b=CU/1E54reOd1hg1LqCzvm0Au+K6Tj6h+N1JfUlGEkzEWBcy2kRJ/p/59QjNML1dyU2 eWxR7XqQnmxfbsu2Bz/atttVxV/QNgcgwK2jSUCv7TApSczb4pqAiwO5DMYV2cZobCtb 6TTeUvGI0Lt5ksY6rXJRAp74XbJdeUyZihK8cm0eYgS25znmHuVSHXkQB9xiWMVAqpg0 Ohf5e4zcq3gkX8AZziMv8GelPWcb8Sybpy2QhjWTDA+1YwWrahCFbNzKmdhXXhFWoA5+ S9gD/qqZC/42Y7raKbhIzkM2gwH2eWEMp/7TuOgUBs3i/DPKd9dq6HpZgIcs0jj3ZTED JI4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BN1j3Fmf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si34529516pfa.252.2019.04.11.01.10.19; Thu, 11 Apr 2019 01:10:36 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=BN1j3Fmf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbfDKIJp (ORCPT + 99 others); Thu, 11 Apr 2019 04:09:45 -0400 Received: from mail.skyhub.de ([5.9.137.197]:55204 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfDKIJo (ORCPT ); Thu, 11 Apr 2019 04:09:44 -0400 Received: from zn.tnic (p200300EC2F0ABD00803D8A3D4BEC4F6D.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:bd00:803d:8a3d:4bec:4f6d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 78AB41EC04B9; Thu, 11 Apr 2019 10:09:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554970183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=z8304YD94RCjlMSAF19W30BX/NBhw56qlzcYzCUrbBQ=; b=BN1j3FmfQ0/khzILjomCxEeke76qPL2Rz35iiAr+2BdYmUkH3xhs9smafXLHuyCqTPNQTf Ab379qO0FrLaPmvhaiWRmaInNOJIfsK92kM6pvquKNTffFrS3RKvyeY7cmhnr6yWR8cugu Cmaezy1q31jvGHtzLx3CH+iCrjJJOpI= Date: Thu, 11 Apr 2019 10:09:37 +0200 From: Borislav Petkov To: Junichi Nomura Cc: Dave Young , Chao Fan , Baoquan He , Kairui Song , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v4] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Message-ID: <20190411080927.GA30080@zn.tnic> References: <20190408231011.GA5402@jeru.linux.bs1.fc.nec.co.jp> <20190410171431.GE26580@zn.tnic> <7cbc096d-0548-18b1-a335-8ba114f234a7@ce.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7cbc096d-0548-18b1-a335-8ba114f234a7@ce.jp.nec.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 11:34:51PM +0000, Junichi Nomura wrote: > But efi_get_rsdp_addr() needs to check whether the kernel was > kexec booted to avoid accessing invalid EFI table address. > efi_get_kexec_setup_data_addr() is the only method I know > to check if it was kexec-booted. Your v3 had the right approach - you first check if you can get the address as a kexec-ed kernel. If you do, you use that one and continue the normal path. If you don't, you fall back to efi_get_rsdp_addr() and get it directly from EFI. And then carve out the functionality you need to call multiple times in helper functions like __efi_get_rsdp_addr(). Why doesn't that work anymore? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.