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::144; helo=mail-it1-x144.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 B9F9020886D98 for ; Sun, 17 Feb 2019 23:53:15 -0800 (PST) Received: by mail-it1-x144.google.com with SMTP id f10so15545216ita.4 for ; Sun, 17 Feb 2019 23:53:15 -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=axRGKCkg6eNDa7QGUaSYJSa0ccsdHO/8CuO29D8XxZE=; b=MK4VHeYb2pemzqsP4fi16CJuQ/gctF06eMWG1w3jZzu9OZQLUIEH/PBw0ob307GFL2 g5x+0BdttSJFqbyzj64YJ7jKLmQTLaH9PAU2p754UqXU6931tATNzdGf5MXt07YXgzXu XGqnh15+olNO9Er78iH3gUVswRb8Q4VpehqOetfadqD8wa7Gsx7dKqnUCb/EIoLy+KtT IZaiDEgCRegQPPEPptTWercMprKo0pCA890QU02jqYWcwkPh8KNj/nhDooK0pLPFHOFx LrjV0KdGHccUi2byeY5ufeMUUC03jo6ig/9be3qdQF/w4kr7apFoM1dUPko6GHJaf6Xu vkYw== 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=axRGKCkg6eNDa7QGUaSYJSa0ccsdHO/8CuO29D8XxZE=; b=Ek3wvcks/q7oNFcBEXrdN1iwfrMcBP6x8VLJ6pXT9431MZs4lWdC14AQtrA0t6iDzE VGDRsncOTCuxOb3huo0AW7ZXw3X3lxkRaCm35lmaYrauE+rDYZbYPF8m9vZaSGGh/eqL VCzFYz06Ei3+P0LUAqZtKznZ5IshldOmaGBBQOAvVJMPHyqFLVN7XUKVMHheBDIbB6zK wSf3d7mDg8FQExLR4br53IJwE6iayIkc3hV3O7LynYlVMr0t7rlbPGGf4F2AFqeEND4E XWETeqNR7JsKln4FwHpyuZcZYt5YBPRycrg6OG/AvMTwTfLnZOQBuARWrp0R4IWH8bhY t1nw== X-Gm-Message-State: AHQUAubMMVZeeksgm5eVKIJXaD6/TNOnB4lFq1udfNfgevtHeE+8ydCE /u3XvSyHzh8D8bj8saocldP/iP55KWa337ztDpwwZg== X-Google-Smtp-Source: AHgI3IYLaEUIgcAXcx0LSCd4/vGVLaWjx1BeA/jzuDOvHNS1zmGxYqd6u77aBXdM43OIZXJURNKlZDTjnbZmi04GUEM= X-Received: by 2002:a5e:9704:: with SMTP id w4mr14079195ioj.60.1550476394463; Sun, 17 Feb 2019 23:53:14 -0800 (PST) MIME-Version: 1.0 References: <20190218041141.21363-1-jordan.l.justen@intel.com> <20190218041141.21363-7-jordan.l.justen@intel.com> In-Reply-To: <20190218041141.21363-7-jordan.l.justen@intel.com> From: Ard Biesheuvel Date: Mon, 18 Feb 2019 08:53:01 +0100 Message-ID: To: Jordan Justen Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Anthony Perard , Julien Grall Subject: Re: [PATCH 06/10] OvmfPkg/Sec: Disable optimizations for TemporaryRamMigration 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: Mon, 18 Feb 2019 07:53:16 -0000 Content-Type: text/plain; charset="UTF-8" On Mon, 18 Feb 2019 at 05:12, Jordan Justen wrote: > This needs an explanation why optimization needs to be disabled. > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Anthony Perard > Cc: Julien Grall > --- > OvmfPkg/Sec/SecMain.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c > index 46ac739862..86c22a2ac9 100644 > --- a/OvmfPkg/Sec/SecMain.c > +++ b/OvmfPkg/Sec/SecMain.c > @@ -873,6 +873,13 @@ SecStartupPhase2( > CpuDeadLoop (); > } > > +#ifdef __GNUC__ > +#pragma GCC push_options > +#pragma GCC optimize ("O0") > +#else > +#pragma optimize ("", off) > +#endif > + > EFI_STATUS > EFIAPI > TemporaryRamMigration ( > @@ -946,3 +953,8 @@ TemporaryRamMigration ( > return EFI_SUCCESS; > } > > +#ifdef __GNUC__ > +#pragma GCC pop_options > +#else > +#pragma optimize ("", on) > +#endif I can't tell from the context if this is the end of the file, but if it is not, aren't you turning on optimization here for non-GCC even if it was not enabled on the command line to begin with?