From nobody Mon Dec 23 05:34:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521086459878665.737554066043; Wed, 14 Mar 2018 21:00:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 146B9226462FA; Wed, 14 Mar 2018 20:54:35 -0700 (PDT) Received: from mail-pl0-x22c.google.com (mail-pl0-x22c.google.com [IPv6:2607:f8b0:400e:c01::22c]) (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 6966F225892C7 for ; Wed, 14 Mar 2018 20:54:33 -0700 (PDT) Received: by mail-pl0-x22c.google.com with SMTP id f23-v6so3004424plr.10 for ; Wed, 14 Mar 2018 21:00:56 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.100]) by smtp.gmail.com with ESMTPSA id e4sm8107785pfa.166.2018.03.14.21.00.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Mar 2018 21:00:55 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::22c; helo=mail-pl0-x22c.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z8JVlvRoQ3Jwafg74pPV1vabHXB0mrC1DPXnIdywwvE=; b=EFztKKJPaAjvWli2uGqkaXCBJ7K+wqf1CVm6zMVD9JOCfA7lzbBiBQnbAXZMCmAhQh cdBz0yY0HUqsdqZSWIhZg0O2iZUrHH5g802kzEaUxm8Vo8ekCAVjS8dp8+v+HbLSfWbk JKiU6SpoMjrBY1S6NUXfey1OZfXj+jlahxQhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z8JVlvRoQ3Jwafg74pPV1vabHXB0mrC1DPXnIdywwvE=; b=FXJ7DufNglhtut2RDyiJgan/hVZ7k89XlB8SR/4x16+kNuvVKmf3EhzbWv3lPn2hJF Of2gmAwefcczysoWaEtL+DqeSvrX9a7SXmhCxNPZMaqFuZxVU2c7+Z9oXet/PN5dP9D3 mti2HZbe6O5dh3bxZo6b+V4/Xwpw/fbNt09RYHJfYJJKzF1jq+gHfZzBqLm4OE0lLo3I tUwswh4so5bCQP5mARp+mcf8rIx5UF++liD6tatU+ZrEEr3qvJrHomILwnOakcMYq0a3 lFvDfSXvTqBLaYOSi1LUfWbdAALiH3FKW4fkio3weBEHv6pOu53sqCiuxaDs5L5Fl4VL sr1A== X-Gm-Message-State: AElRT7FKIqgBD5rKwS/mDFWu0FE0aWX9jCiPuiszqutrWS2Ur99881+o 9o4uauYcOi/5fg5Fw3bV8ZnggM5uDMo= X-Google-Smtp-Source: AG47ELsObGxsPpRWNIvkUbIcPaucTa1HSajvwiCy8/rIQJboPq9xCaDWwJSU2d3kx0FjYVmGxk9ekw== X-Received: by 2002:a17:902:8c97:: with SMTP id t23-v6mr6635508plo.372.1521086456403; Wed, 14 Mar 2018 21:00:56 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.01.org Date: Thu, 15 Mar 2018 12:00:20 +0800 Message-Id: <1521086424-113954-3-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521086424-113954-1-git-send-email-heyi.guo@linaro.org> References: <1521086424-113954-1-git-send-email-heyi.guo@linaro.org> Subject: [edk2] [PATCH v6 2/6] OvmfPkg/PciHostBridgeLib: clear PCI aperture vars for (re)init X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Yi Li , Ard Biesheuvel , Jordan Justen , Heyi Guo , Anthony Perard , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use ZeroMem() to initialize (or re-initialize) all fields in temporary PCI_ROOT_BRIDGE_APERTURE variables to zero. This is not mandatory but is helpful for future extension: when we add new fields to PCI_ROOT_BRIDGE_APERTURE and the default value of these fields can safely be zero, this code will not suffer from an additional change. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Signed-off-by: Yi Li Cc: Jordan Justen Cc: Anthony Perard Cc: Julien Grall Cc: Ruiyu Ni Cc: Laszlo Ersek Cc: Ard Biesheuvel --- Notes: v6: - Move ZeroMem() into the loop [Laszlo] - Move ZeroMem() after checking PcdPciDisableBusEnumeration [Laszlo] - Commit title change (However 74 characters will cause PatchCheck warning, so I tried to reduce the length to eliminate the warning) [l= aszlo] - Minor changes in commit message OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++++ OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/= Library/PciHostBridgeLib/PciHostBridgeLib.c index ff837035caff..65d0ef9252c5 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -221,6 +221,10 @@ PciHostBridgeGetRootBridges ( return ScanForRootBridges (Count); } =20 + ZeroMem (&Io, sizeof (Io)); + ZeroMem (&Mem, sizeof (Mem)); + ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); + Attributes =3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO | EFI_PCI_ATTRIBUTE_ISA_IO_16 | diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Librar= y/PciHostBridgeLib/XenSupport.c index 31c63ae19e0a..920417950ad9 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c @@ -202,8 +202,13 @@ ScanForRootBridges ( for (PrimaryBus =3D 0; PrimaryBus <=3D PCI_MAX_BUS; PrimaryBus =3D SubBu= s + 1) { SubBus =3D PrimaryBus; Attributes =3D 0; + + ZeroMem (&Io, sizeof (Io)); + ZeroMem (&Mem, sizeof (Mem)); + ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); + ZeroMem (&PMem, sizeof (PMem)); + ZeroMem (&PMemAbove4G, sizeof (PMemAbove4G)); Io.Base =3D Mem.Base =3D MemAbove4G.Base =3D PMem.Base =3D PMemAbove4G= .Base =3D MAX_UINT64; - Io.Limit =3D Mem.Limit =3D MemAbove4G.Limit =3D PMem.Limit =3D PMemAbo= ve4G.Limit =3D 0; // // Scan all the PCI devices on the primary bus of the PCI root bridge // --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel