Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5634851yba; Thu, 11 Apr 2019 02:22:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQwT18RKw038vTkmEHdWdY6tMVhQv3wBst1LM5gcHV6XnVzzX6Zgqi4ZwD2MG3/aiD6Apb X-Received: by 2002:a65:4bce:: with SMTP id p14mr47106893pgr.376.1554974548725; Thu, 11 Apr 2019 02:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554974548; cv=none; d=google.com; s=arc-20160816; b=oidWpUvJg9i82zh8q6GZ+NJL7hev8O2BIF8c5jCfVUAGXaMf+QdCSdAwSScZLB9H7f zR1GG7v2Vs6LKOXO3yX/sI2gl7uH8RPrPzVq9NLJ9CK7gB/VixwKO/URBoZIE1hkB9Zz BOwGnoIJ6O9+W1CLLVIfHtvW7wRa+WPX13XzCk0VOmmeUMV8wGTyFLQnmTET+sTz0IVP mTUgUFpIgh0cUhdjAdSnLbshZeMAFCj1rpXVRxlFOSfd5DA4f70R5XLBtegOWQ7jw+j1 brgGktxOkSaN3LJCmnQfrQoUbDxI1frPIL3qKA0Wh0QtpjOOmbQgMfiL6EH4XVJvlXIC HivQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=ArcHdxASerKPWBHzWz02Yr3opgXM61uRU/36Wc0nFAw=; b=Yh8Ue0cl+euIl0QN6fP1pbwB7xxB5qfdrknebUM4OhH2Ef6emPmehNARQhwDhzhGt8 vK3zuXxodNjn1l4XkLJSouTY6eizZqdHy3VSyic8VF73jBlzsj7b7oCdByde5zlqdJnd XqYxxkXGb4KXI0DCRZzu9wYj5k5JUvGOg1gyvpwIBD/9UwttdwwqvCwnsbWlJeRfQ4Vc IayjJuK6KPvmwUKjlskVIaG5iH55oKWY5WzxBZsaWTbP8HfUX+dWBbYwPHTzdyge5ezM RU/29yJsHVCFdH0xAuq6dee5+cLy+0bnJVtT2eQ4n0N2opm1w0zTOIk5QBsO1QlNGQFV hhXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alien8.de header.s=dkim header.b=ixT9WUjK; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si32480663pgl.402.2019.04.11.02.22.13; Thu, 11 Apr 2019 02:22:28 -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=fail header.i=@alien8.de header.s=dkim header.b=ixT9WUjK; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbfDKJVe (ORCPT + 99 others); Thu, 11 Apr 2019 05:21:34 -0400 Received: from mail.skyhub.de ([5.9.137.197]:38326 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfDKJVd (ORCPT ); Thu, 11 Apr 2019 05:21:33 -0400 Received: from [10.119.185.175] (x2f7f9af.dyn.telefonica.de [2.247.249.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EEC991EC01B6; Thu, 11 Apr 2019 11:21:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554974490; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ArcHdxASerKPWBHzWz02Yr3opgXM61uRU/36Wc0nFAw=; b=ixT9WUjKH0lmoUFef7fiK6hzXaoNvNWejhhGm7xfF7LWG0kQo5E8VkdCFKC3HjKBpTcHwK qdQiHNcX3ZMKanLpkkeLc2VDO9V77snHlvZHOGUy6DjoUwoCrM4EyysMRnZGHCyjIAPkGV KALBz1jW2TqOO6OjDQvewlXGVcL3E6k= Date: Thu, 11 Apr 2019 11:21:28 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <2946b5e3-90bf-d617-16a4-d2225b490b5d@ce.jp.nec.com> References: <20190408231011.GA5402@jeru.linux.bs1.fc.nec.co.jp> <20190410171431.GE26580@zn.tnic> <7cbc096d-0548-18b1-a335-8ba114f234a7@ce.jp.nec.com> <20190411080927.GA30080@zn.tnic> <20190411083738.GC30080@zn.tnic> <2946b5e3-90bf-d617-16a4-d2225b490b5d@ce.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v4] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel To: Junichi Nomura CC: Dave Young , Chao Fan , Baoquan He , Kairui Song , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" From: Boris Petkov Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On April 11, 2019 11:13:03 AM GMT+02:00, Junichi Nomura wrote: >On 4/11/19 5:37 PM, Borislav Petkov wrote: >> On Thu, Apr 11, 2019 at 08:16:45AM +0000, Junichi Nomura wrote: >>> kexec_get_rsdp_addr() might fail on kexec-booted kernel, e=2Eg=2E if t= he >>> setup_data was invalid=2E In such a case, falling back to >efi_get_rsdp_addr() >>> will hit the problem of accessing invalid table pointer again=2E >>=20 >> Then you need to do this: >>=20 >> if (kexeced kernel) { >> addr =3D kexec_get_rsdp_addr(); >> if (!addr) { >> /* cannot get address */ >> return -1; >> } >>=20 >> return addr; >> } >>=20 >> and the calling function get_rsdp_addr() must check the return value >and >> if it is not 0, return immediately=2E > >Do you mean making get_rsdp_addr() like this? Does that look like what I've typed above? --=20 Sent from a small device: formatting sux and brevity is inevitable=2E