From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.10691.1654597885539386403 for ; Tue, 07 Jun 2022 03:31:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fq2H9ky2; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654597884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=O0N6RnfFLlyT9TQkyeqdiab0LuMDBPPaQSaljMANxyw=; b=Fq2H9ky2xCH3iD6K3VU0vid2PiJAa2bQOha8u6kmporQ/n4xb7+sqnZfundOc41teiKx78 hc3GHB6Phjx5zzIYJJafN7h/jJJFoDVtw/DjrHdvciY2LxVcBOri3/S9g940AJDUIfxsMh 4RfhX1f3D2ANyck4FG5brvTSF3/Lyzc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-R7udb4s-Nm--aFHbjo2FTw-1; Tue, 07 Jun 2022 06:31:23 -0400 X-MC-Unique: R7udb4s-Nm--aFHbjo2FTw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EF80811E7A; Tue, 7 Jun 2022 10:31:23 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF8BF1415100; Tue, 7 Jun 2022 10:31:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0DD771800081; Tue, 7 Jun 2022 12:31:21 +0200 (CEST) Date: Tue, 7 Jun 2022 12:31:20 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, jirislaby@kernel.org Subject: Re: [edk2-devel] ovmf miscompiles with gcc-12 Message-ID: <20220607103120.zvgofggypzhdms5m@sirius.home.kraxel.org> References: <887c3f4f-c279-bd59-d92d-25922faae6dc@kernel.org> MIME-Version: 1.0 In-Reply-To: <887c3f4f-c279-bd59-d92d-25922faae6dc@kernel.org> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > 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? 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? take care, Gerd