Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbcLTBke (ORCPT ); Mon, 19 Dec 2016 20:40:34 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:33867 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbcLTBke (ORCPT ); Mon, 19 Dec 2016 20:40:34 -0500 Subject: Re: [PATCH] x86/microcode: Adjust ramdisk address when accessing by virtual address To: Borislav Petkov References: <1482161533-21097-1-git-send-email-boris.ostrovsky@oracle.com> <20161219153714.rhbpvcauc5xigzua@pd.tnic> <383d2984-fdd0-a198-4477-677b992fc955@oracle.com> <20161219164027.ejbf3h6qsnkjjezy@pd.tnic> <20161219180709.2tsvsebagdiyxxrs@pd.tnic> <20161219184340.4tzv2hg2vf3n63b7@pd.tnic> <20161219233229.p5uw2thbl55o26ds@pd.tnic> <22d4e277-81bb-ef10-3f55-f8f947df60e8@oracle.com> Cc: x86@kernel.org, linux-kernel@vger.kernel.org From: Boris Ostrovsky Message-ID: Date: Mon, 19 Dec 2016 20:40:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <22d4e277-81bb-ef10-3f55-f8f947df60e8@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1563 Lines: 67 On 12/19/2016 08:27 PM, Boris Ostrovsky wrote: > > > On 12/19/2016 06:32 PM, Borislav Petkov wrote: >> On Mon, Dec 19, 2016 at 07:43:40PM +0100, Borislav Petkov wrote: >>> On Mon, Dec 19, 2016 at 01:12:25PM -0500, Boris Ostrovsky wrote: >>>> IIUIC find_microcode_in_initrd() is called with paging on only on Intel >>>> (which is where I observed it). >>> >>> Ah, that was an important fact. Yes, I can repro it now. >> >> Ok, questions: >> >> * does your guest relocate the ramdisk? > > > This is not a guest. I crashed with baremetal kernel. > > >> >> I.e., do you see something like this in dmesg before the splat: >> >> [ 0.000000] RAMDISK: [mem 0x7f84c000-0x7ffcffff] >> [ 0.000000] Allocated new RAMDISK: [mem 0x3647a000-0x36bfd9e6] >> [ 0.000000] Move RAMDISK from [mem 0x7f84c000-0x7ffcf9e6] to [mem >> 0x3647a000-0x36bfd9e6] >> ^^^^^^^^^^^^^^ Sorry, forgot about this: I see the first line but not the other two (so the relocation did not occur). -boris >> >> If not, then I know what happens. >> >> Also, does it work if you change these lines: >> >> if (!use_pa && relocated_ramdisk) >> start = initrd_start; >> >> to: >> >> if (!use_pa) >> start = initrd_start; > > Yes, it does. > > I also thought it might be better but I haven't gone through the code to > make sure this would always work. > > I can run more tests tomorrow if you want. > > -boris > >> >> >> Because if that works, I can actually simplify that function radically. >> >> But more tomorrow. >> >> Thanks. >>