From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.groups.io with SMTP id smtpd.web08.11386.1654600463578909716 for ; Tue, 07 Jun 2022 04:14:23 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: gmail.com, ip: 209.85.218.54, mailfrom: jirislaby@gmail.com) Received: by mail-ej1-f54.google.com with SMTP id v1so23797692ejg.13 for ; Tue, 07 Jun 2022 04:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Je/6kmyMGQsJl+YjD9osacomXS3eoyMZhB7/xBWrAGA=; b=v7jqtfFSTzRrwzwbVtg07OpnnV5ul/VjZDqqbLRnmD8R7D/CXTbMIlr3tDU5Qe7jpg hGnPuR3ibRC8JLGlujUSzWAmN0uXUPYXGwAIm2XnxP77mOnXesiZT9fZpQScLWDCTDgR ZjZwkqwLQUJvHgartDG2ZTpDXSJZA9saXVj+/WkHfIb7Rr2IZ19TL7cTZwhPIJNxG8Dg UBFc/MbNtkTW/y559COdtUc918F7ukiOe571cEn8YbnH+go4VMaznFJNX6zFXLf+iKyc fm6IpU9fLd++etvoMlgZM5y3gW8Qxmm6CZf+q/U+xtZ7Spzfn9jpiUzcP/r4nnPQX/r+ HwRg== X-Gm-Message-State: AOAM532PNDKlBlv02Cya5iH54TI65kzqrAFyC1tzwNjuSPsA4+FfsZS+ 3JcffIYC40GbY1gf7aeShVk= X-Google-Smtp-Source: ABdhPJz8Gf+1rGk3Vk2Q1NQ0LM9kTClwcQtb8bOdxjWTe4Ucv24dqIU1ep+upzCXhtLxSUTrVl6A+A== X-Received: by 2002:a17:907:97d1:b0:711:4524:1f3 with SMTP id js17-20020a17090797d100b00711452401f3mr13500718ejc.317.1654600461835; Tue, 07 Jun 2022 04:14:21 -0700 (PDT) Return-Path: Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id g12-20020a056402424c00b00431962fe5d4sm647069edb.77.2022.06.07.04.14.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 04:14:21 -0700 (PDT) Message-ID: <4063953e-3c6a-8095-3023-9edd4469c35f@kernel.org> Date: Tue, 7 Jun 2022 13:14:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [edk2-devel] ovmf miscompiles with gcc-12 To: Gerd Hoffmann Cc: devel@edk2.groups.io References: <887c3f4f-c279-bd59-d92d-25922faae6dc@kernel.org> <20220607103120.zvgofggypzhdms5m@sirius.home.kraxel.org> <20220607110749.wyg7trlelht3cag5@sirius.home.kraxel.org> From: Jiri Slaby In-Reply-To: <20220607110749.wyg7trlelht3cag5@sirius.home.kraxel.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07. 06. 22, 13:07, Gerd Hoffmann wrote: > On Tue, Jun 07, 2022 at 12:38:46PM +0200, Jiri Slaby wrote: >> Hi, >> >> On 07. 06. 22, 12:31, Gerd Hoffmann wrote: >>>> The reason is TemporaryRamMigration() overwrites rbp unconditionally -- it >>>> adds an offset to rbp even if rbp is NOT used as a frame pointer >>> >>>> Now, what is the right way to fix this? Do the SetJump/LongJump in assembly >>>> and wrap it into push rbp/pop rbp? >>> >>> push/pop rbp will break in case frame pointers are used, no? >> >> Yes, see the downstream bug at: >> >> https://bugzilla.suse.com/show_bug.cgi?id=1199597#c45 >> >> and read further. >> >>> I think essentially the code needs to know whenever frame pointers are >>> used or not and then update (or not) rbp depending on that. Update >>> compiler flags to explicitly set -f(no-)omit-frame-pointer, also add >>> -D OMIT_FRAME_POINTER=1, the compile conditionally on OMIT_FRAME_POINTER? >> >> Yes, the comment above mentions this too (cf. CONFIG_FRAME_POINTER in the >> kernel). So see the downstream bugzilla for discussion. > > Ok. So what is the status here? Someone working on patches? I don't know of anybody. I only tracked it down, reported and worked around locally by: --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -928,7 +928,7 @@ SecStartupPhase2 ( CpuDeadLoop (); } -EFI_STATUS +EFI_STATUS __attribute__((optimize("-fno-omit-frame-pointer"))) EFIAPI TemporaryRamMigration ( IN CONST EFI_PEI_SERVICES **PeiServices, >> The upstream bugzilla needs an account which I don't have and cannot create >> automatically. It needs manual intervention and I am too lazy to do so. > > It's just an email though: > https://github.com/tianocore/tianocore.github.io/wiki/Reporting-Issues As I wrote earlier, there is a bug created by the openSUSE ovmf maintainer (Joey): https://bugzilla.tianocore.org/show_bug.cgi?id=3934 If there is any input needed from me, I might reconsider... So far, it's stuck. regards, -- js