From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from tyo161.gate.nec.co.jp ([114.179.232.161]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEW5B-0006dk-SM for kexec@lists.infradead.org; Thu, 11 Apr 2019 09:33:23 +0000 From: Junichi Nomura Subject: Re: [PATCH v4] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Date: Thu, 11 Apr 2019 09:32:59 +0000 Message-ID: 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> In-Reply-To: Content-Language: ja-JP Content-ID: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Boris Petkov Cc: Chao Fan , Kairui Song , Baoquan He , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Dave Young On 4/11/19 6:21 PM, Boris Petkov wrote: > 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.g. if the >>>> setup_data was invalid. In such a case, falling back to >> efi_get_rsdp_addr() >>>> will hit the problem of accessing invalid table pointer again. >>> >>> Then you need to do this: >>> >>> if (kexeced kernel) { >>> addr = kexec_get_rsdp_addr(); >>> if (!addr) { >>> /* cannot get address */ >>> return -1; >>> } >>> >>> return addr; >>> } >>> >>> and the calling function get_rsdp_addr() must check the return value >> and >>> if it is not 0, return immediately. >> >> Do you mean making get_rsdp_addr() like this? > > Does that look like what I've typed above? No. But that's why I asked the question. Do you mean putting the above code in efi_get_rsdp_addr()? -- Jun'ichi Nomura, NEC Corporation / NEC Solution Innovators, Ltd. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec