From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 47B7820945BA7 for ; Wed, 11 Oct 2017 14:26:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CEB0DC04B333; Wed, 11 Oct 2017 21:30:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CEB0DC04B333 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-78.rdu2.redhat.com [10.10.120.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 480D36266D; Wed, 11 Oct 2017 21:29:59 +0000 (UTC) To: Jian J Wang , edk2-devel@lists.01.org Cc: Michael Kinney , Ayellet Wolman , Jiewen Yao , Eric Dong , Star Zeng References: <20171009141722.992-1-jian.j.wang@intel.com> <20171009141722.992-6-jian.j.wang@intel.com> From: Laszlo Ersek Message-ID: Date: Wed, 11 Oct 2017 23:29:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171009141722.992-6-jian.j.wang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 11 Oct 2017 21:30:01 +0000 (UTC) Subject: Re: [PATCH v4 5/6] IntelFrameworkModulePkg/Csm: Add code to bypass NULL pointer detection X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 21:26:32 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit This patch breaks the GCC5 build: On 10/09/17 16:17, Jian J Wang wrote: > diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c > index 3d9a8b9649..f42c13cd89 100644 > --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c > +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c > @@ -57,7 +57,11 @@ LegacyBiosInt86 ( > IN EFI_IA32_REGISTER_SET *Regs > ) > { > - UINT32 *VectorBase; > + UINT16 Segment; > + UINT16 Offset; > + LEGACY_BIOS_INSTANCE *Private; > + > + Private = LEGACY_BIOS_INSTANCE_FROM_THIS (This); > > Regs->X.Flags.Reserved1 = 1; > Regs->X.Flags.Reserved2 = 0; > @@ -72,12 +76,15 @@ LegacyBiosInt86 ( > // The base address of legacy interrupt vector table is 0. > // We use this base address to get the legacy interrupt handler. > // > - VectorBase = 0; > + DisableNullDetection (); > + Segment = (UINT16)(((UINT32 *)0)[BiosInt] >> 16); > + Offset = (UINT16)((UINT32 *)0)[BiosInt]; > + EnableNullDetection (); > > return InternalLegacyBiosFarCall ( > This, > - (UINT16) ((VectorBase)[BiosInt] >> 16), > - (UINT16) (VectorBase)[BiosInt], > + Segment, > + Offset, > Regs, > &Regs->X.Flags, > sizeof (Regs->X.Flags) IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c: In function 'LegacyBiosInt86': IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c:62:26: error: variable 'Private' set but not used [-Werror=unused-but-set-variable] LEGACY_BIOS_INSTANCE *Private; ^~~~~~~ cc1: all warnings being treated as errors Can you please send a patch? Thanks! Laszlo