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.web08.22017.1661420624112182560 for ; Thu, 25 Aug 2022 02:43:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cSC0f32z; 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=1661420623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1zF/esfLwsseHEnSLJaXu4r9nL2xfCOjJMSFu4+gOuI=; b=cSC0f32zlN3Jjui79Ts8DpFt6KdnwZ/r3HJ/2ZOknrXTIBEDOIQc5oMrScpNmnv0P7KJLc FgBopmHD9rl2hcxzmBNqEXzrzgKqGFm9bJqtNqPRbm1/IBbKoSYi2Rw6hQ12sWid+opoWU xi+7OOWPG9ib7YAG41peb+8pxx+2QRs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-eLCocwdAO42lMhuyuh_erQ-1; Thu, 25 Aug 2022 05:43:40 -0400 X-MC-Unique: eLCocwdAO42lMhuyuh_erQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2D1C2919EAA; Thu, 25 Aug 2022 09:43:39 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68478492C3B; Thu, 25 Aug 2022 09:43:39 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1205F1800082; Thu, 25 Aug 2022 11:43:38 +0200 (CEST) Date: Thu, 25 Aug 2022 11:43:38 +0200 From: "Gerd Hoffmann" To: =?utf-8?Q?Pawe=C5=82_Po=C5=82awski?= Cc: devel@edk2.groups.io, Ard Biesheuvel , Leif Lindholm , Sami Mujawar Subject: Re: [[edk2-devel] PATH v1 3/3] ArmVirtPkg: take PcdResizeXterm from the QEMU command line Message-ID: <20220825094338.po2tzpk37rtsitf5@sirius.home.kraxel.org> References: <39c43cf39467bdf5139eb350cd89cc4ed953626f.1661215864.git.ppolawsk@redhat.com> MIME-Version: 1.0 In-Reply-To: <39c43cf39467bdf5139eb350cd89cc4ed953626f.1661215864.git.ppolawsk@redhat.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > --- /dev/null > +++ b/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c > @@ -0,0 +1,34 @@ > +/** @file > +* Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg > +* > +* Copyright (C) 2015-2020, Red Hat, Inc. > +* Copyright (c) 2014, Linaro Ltd. All rights reserved.
> +* > +* SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#include > +#include > +#include > + > +#define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName) \ > + do { \ > + BOOLEAN Setting; \ > + RETURN_STATUS PcdStatus; \ > + \ > + if (!RETURN_ERROR (QemuFwCfgParseBool ( \ > + "opt/org.tianocore.edk2.aavmf/" #TokenName, &Setting))) { \ > + PcdStatus = PcdSetBoolS (TokenName, Setting); \ > + ASSERT_RETURN_ERROR (PcdStatus); \ > + } \ > + } while (0) > + > +RETURN_STATUS > +EFIAPI > +TerminalPcdProducerLibConstructor ( > + VOID > + ) > +{ > + UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdResizeXterm); > + return RETURN_SUCCESS; > +} Oh, we have two variants of that code, with different fw_cfg file names even. I think we should: (1) Move this library to OvmfPkg. (2) Change the fw_cfg name to be consistent with other cases we have in the edk2 source tree (see OvmfPkg/Library/PxeBcPcdProducerLib), i.e. read from 'opt/org.tianocore/ResizeXterm'. (3) Use the library for both OvmfPkg and ArmVirtPkg instead of having OVMF set the PCD in platform init code. take care, Gerd