From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d41; helo=mail-io1-xd41.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EE6C621B02822 for ; Fri, 18 Jan 2019 10:41:55 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id v10so11506691ios.13 for ; Fri, 18 Jan 2019 10:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IpdQwUe4aiO2dzx/zekr776LTW1JxM4QcNtI804Emrk=; b=dE6MMVu4+sSlZlMaL2LOGUhpH72pd/Q5OMfzHYki6kHpOvOFlNNgj5TkQGTyyC0TIL FS6rAuXmp9Al5KhmsWNIsfGDt+YjValOXK56wieYRM1RTxYQRWJkzdlfa7CHe47uu3Js kl02aAZ6Adm0dSO/w3Vbn48N0NwwDMsgMwIyo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IpdQwUe4aiO2dzx/zekr776LTW1JxM4QcNtI804Emrk=; b=W8OG9Eti/m6Csvnei/In7EUpPTd9PvwkRYbh6BaMfqzXmOJ6NkN4rkpR1HexoFamig CGTqhWrPim4Fb9G/KWQJmrJyhLysYe9d2pZ/WwtsV65DL/6AmOrDqp/hIUYh9bBQNaKM mUvLkpa5cFoxHCyWij4VoO/2JioLRWAojy6ALbtnSskj1sufdf8MwAovAALQOhmSn1Yy QFA4H9cvry76qm2LEdWYqkweesdD28rzDCg8rs81/42mvpxjXWykcyXQqrdF/E1S5rXP FXm5tyt6pfeB8sp5TK/K0Yza9mC4fSaJzTQgfQir+gYbQ0Pcw2CVQw+fRi61Xc3d/LvO bvmA== X-Gm-Message-State: AJcUukcQ7WEGJW2uyVW2a4dGsV2Gov0VQqYEvPSKuAp7F+L9S28HhpwH FXaqWKq83gBgZ9ZDz2aDCd/gBbXVN4fqmaSHXClThA== X-Google-Smtp-Source: ALg8bN4jeAY2meo5nbAWcg/+jJrQxo7TYf85Zxo78CYY7rswWiCZpiL+gv0x66U03hiIFihlFmOunGBbTfAwYK2g5/I= X-Received: by 2002:a5d:8410:: with SMTP id i16mr11109973ion.173.1547836915212; Fri, 18 Jan 2019 10:41:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Fri, 18 Jan 2019 19:41:44 +0100 Message-ID: To: Julien Grall Cc: edk2-devel-01 , Dandan Bi , "Gao, Liming" , Leif Lindholm , Laszlo Ersek , "Kinney, Michael D" , xen-devel Subject: Re: Unable to boot Linux with master EDK2 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2019 18:41:56 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 18 Jan 2019 at 19:39, Ard Biesheuvel wrote: > > On Fri, 18 Jan 2019 at 19:30, Julien Grall wrote: > > > > Hi all, > > > > I am trying to boot a Xen guest using the latest EDK2 master (cce9d76358 > > "BaseTools: Allow empty value for HiiPcd in Dsc"), GRUB and Linux 5.0-rc2. > > > > The last code executed by Linux is when installing the virtual address > > map in the EFI stub and then it seems to get stuck. I don't have much > > information from the console: > > > > InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 7E041040 > > Loading driver at 0x00068C70000 EntryPoint=0x00069D65664 > > Loading driver at 0x00068C70000 EntryPoint=0x00069D65664 > > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 7DF6AB18 > > ProtectUefiImageCommon - 0x7E041040 > > - 0x0000000068C70000 - 0x0000000002006000 > > SetUefiImageMemoryAttributes - 0x0000000068C70000 - 0x0000000000001000 (0x0000000000004008) > > SetUefiImageMemoryAttributes - 0x0000000068C71000 - 0x00000000011CD000 (0x0000000000020008) > > SetUefiImageMemoryAttributes - 0x0000000069E3E000 - 0x0000000000E38000 (0x0000000000004008) > > EFI stub: Booting Linux Kernel... > > EFI stub: Using DTB from configuration table > > EFI stub: Exiting boot services and installing virtual address map... > > XenBus: Set state to 5 > > XenBus: Set state to 5, done > > XenPvBlk: waiting backend state 5, current: 4 > > XenStore: Watch event 7E957398 > > XenBus: Set state to 6 > > XenBus: Set state to 6, done > > XenPvBlk: waiting backend state 6, current: 5 > > XenStore: Watch event 7E957398 > > XenBus: Set state to 1 > > XenBus: Set state to 1, done > > Xen GrantTable, removing 38003 > > Xen GrantTable, removing 38002 > > Xen GrantTable, removing 38001 > > Xen GrantTable, removing 38000 > > SetUefiImageMemoryAttributes - 0x000000007F360000 - 0x0000000000040000 (0x0000000000000008) > > SetUefiImageMemoryAttributes - 0x000000007BFF0000 - 0x0000000000040000 (0x0000000000000008) > > SetUefiImageMemoryAttributes - 0x000000007BFA0000 - 0x0000000000040000 (0x0000000000000008) > > SetUefiImageMemoryAttributes - 0x000000007BF00000 - 0x0000000000040000 (0x0000000000000008) > > SetUefiImageMemoryAttributes - 0x000000007BE60000 - 0x0000000000040000 (0x0000000000000008) > > SetUefiImageMemoryAttributes - 0x000000007BDC0000 - 0x0000000000040000 (0x0000000000000008) > > > > The bisector pointed to the following commit: > > > > commit 2f4a5a9f4c17ed88aaa3114d1e161e42cb80a9bf > > Author: Dandan Bi > > Date: Thu Jan 3 15:31:23 2019 +0800 > > > > MdePkg/BasePeCoffLib: Add more check for relocation data > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1426 > > > > V2: > > (1) Add NULL pointer check for the input parameters > > (2) Add check for the "Adjust" value before applying fix ups. > > > > In function PeCoffLoaderRelocateImageForRuntime, it doesn't > > do much check when do relocation. For API level consideration, > > it's not safe enough. > > So this patch is to replace the same code logic with function > > PeCoffLoaderImageAddress which will cover more validation. > > > > Cc: Michael D Kinney > > Cc: Liming Gao > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Dandan Bi > > Reviewed-by: Liming Gao > > > > Any ideas what could have gone wrong? > > Yes, that patch broke lots of platforms: OVMF, ArmVirtQemu and ARM Juno as well. You need the following patch to fix it https://lists.01.org/pipermail/edk2-devel/2019-January/035372.html