From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.web09.10879.1654598329744028738 for ; Tue, 07 Jun 2022 03:38:50 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: gmail.com, ip: 209.85.218.42, mailfrom: jirislaby@gmail.com) Received: by mail-ej1-f42.google.com with SMTP id h23so23229660ejj.12 for ; Tue, 07 Jun 2022 03:38:49 -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:references:from:in-reply-to :content-transfer-encoding; bh=/u4NDoiq35BMiiLsNu4R4Wgcdb6+ouuq5qSN1Onc1eU=; b=fuKW8cc4jpyFT4SuMlPNe2+12UOBP1aI/U8wEE75kRUkMwQeQt9kp+y0oefrzn2Z7v okOlXcTdv3Ae9yqZ+XA8RoCd0wyBDblzG3V76GdTVws6lWfvydNGg1MP1G7Ow8cPg1Pe XCt3+Uo1Vv/cQRCa9UiD0p7yucwa9RI2mdaU0YxB/0sWE33ptgUBrTmjW07+GZgvsh9K bAi+stONozIHW9YQcel37JO5H73cpcM5MOrdwnPbsflLkWyahMDSPALbOVM7wEb9qnvc /bJlUbdtJmjsWLzLjo2RDbyAUe90WuvdR9WqDAoGyzj2Rq+gzduxdRRcoHR9p2XUiWsK r5aw== X-Gm-Message-State: AOAM530VzaVh3Lsn8zWxuP/SdRHAHbyic/+XeV7YEq8zp9uBbN1M5DMf S1mR47JhD0xBvnFV86bK0/s= X-Google-Smtp-Source: ABdhPJzC+WnLVVXuWHEZxhM2I3qUjf2h6VtfQ7bCtErkiP7Ex8m+JmzU+14SeZ/3CLXlUCrxyu5fxw== X-Received: by 2002:a17:907:1c25:b0:6fe:e07a:9d4d with SMTP id nc37-20020a1709071c2500b006fee07a9d4dmr24988484ejc.310.1654598328146; Tue, 07 Jun 2022 03:38:48 -0700 (PDT) Return-Path: Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id n8-20020a170906724800b006fee526ed66sm7462379ejk.35.2022.06.07.03.38.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 03:38:47 -0700 (PDT) Message-ID: Date: Tue, 7 Jun 2022 12:38:46 +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 , devel@edk2.groups.io References: <887c3f4f-c279-bd59-d92d-25922faae6dc@kernel.org> <20220607103120.zvgofggypzhdms5m@sirius.home.kraxel.org> From: Jiri Slaby In-Reply-To: <20220607103120.zvgofggypzhdms5m@sirius.home.kraxel.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. 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. So I didn't comment there: https://bugzilla.tianocore.org/show_bug.cgi?id=3934 thanks, -- js