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 398B8211E011B for ; Mon, 1 Apr 2019 09:14:37 -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 C0304356C4; Mon, 1 Apr 2019 16:14:36 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4391C5D71A; Mon, 1 Apr 2019 16:14:35 +0000 (UTC) To: Heyi Guo , edk2-devel@lists.01.org Cc: wanghaibin.wang@huawei.com, Ard Biesheuvel , Julien Grall , Heyi Guo References: <1554109590-16131-1-git-send-email-guoheyi@huawei.com> <1554109590-16131-3-git-send-email-guoheyi@huawei.com> From: Laszlo Ersek Message-ID: Date: Mon, 1 Apr 2019 18:14:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1554109590-16131-3-git-send-email-guoheyi@huawei.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.30]); Mon, 01 Apr 2019 16:14:36 +0000 (UTC) Subject: Re: [PATCH 2/2] ArmVirtQemu: enable runtime debug by build flag 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, 01 Apr 2019 16:14:37 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 04/01/19 11:06, Heyi Guo wrote: > Introduce a build flag "RT_DEBUG" to enable runtime debug, so that we > can have a handy method for UEFI runtime services debug. > > This build flag only applies to DEBUG build; the reason for not > enabling it for DEBUG build by default is that we are still using > the same UART of OS and it may cause potential conflict. > > User needs to specify "-D RT_DEBUG=TRUE"; "-D RT_DEBUG" is not enough > for we use !if $(RT_DEBUG)==TRUE in the code. (1) This looks like a bug / regression in basetools, or somewhere else. We use a bunch of other similar flags, and "-D FLAG" works just fine. See "HTTP_BOOT_ENABLE" for example -- set to FALSE by default in the individual DSC files, and depended upon in the dsc.inc file as well. > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Julien Grall > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Heyi Guo > Signed-off-by: Heyi Guo > --- > ArmVirtPkg/ArmVirt.dsc.inc | 4 ++++ > ArmVirtPkg/ArmVirtQemu.dsc | 1 + > 2 files changed, 5 insertions(+) (2) I think whenever you modify ArmVirtQemu.dsc, you almost always have to reflect it to ArmVirtQemuKernel.dsc as well. > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index d172a08..5ace31b 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -240,8 +240,12 @@ > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > !if $(TARGET) != RELEASE > +!if $(RT_DEBUG) == TRUE > + SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLibRuntime.inf > +!else > DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf > !endif > +!endif (3) Unless you intend to bring this feature to Xen at some point, adding the lib resolution to "ArmVirt.dsc.inc" seems wrong. IIRC, in such cases we usually move (triplicate) the default lib resolution to the individual DSC files, and then update only the QEMU ones separately (and leave the Xen one alone). > !if $(SECURE_BOOT_ENABLE) == TRUE > BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index d703317..b279d7d 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -37,6 +37,7 @@ > DEFINE SECURE_BOOT_ENABLE = FALSE > DEFINE NETWORK_IP6_ENABLE = FALSE > DEFINE HTTP_BOOT_ENABLE = FALSE > + DEFINE RT_DEBUG = FALSE > > !include ArmVirtPkg/ArmVirt.dsc.inc > > Thanks Laszlo