From nobody Mon Dec 23 09:41:12 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 1519887491222112.86736479708418; Wed, 28 Feb 2018 22:58:11 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 97C6322423853; Wed, 28 Feb 2018 22:52:02 -0800 (PST) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 669282242384D for ; Wed, 28 Feb 2018 22:52:01 -0800 (PST) Received: by mail-pf0-x244.google.com with SMTP id u5so2088003pfh.6 for ; Wed, 28 Feb 2018 22:58:09 -0800 (PST) Received: from localhost.localdomain ([45.56.152.115]) by smtp.gmail.com with ESMTPSA id p63sm6489867pfk.74.2018.02.28.22.58.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 22:58:08 -0800 (PST) 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:c00::244; helo=mail-pf0-x244.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=+l5P3SpoNzVI01jT5vur2BeNu3YylFW+/juKckuFnnk=; b=dO/KtnJBVCu7ze11YE11rbbETwxMSEgKRna1aCPfOCX82qtthEfdbHYy6W+r8+j4TV jXkAzhd8iE7BZdHR/Unjp9d6o6sv7BnpIoETIdTopYU7BDU1RI66mEwOhyCX5gx/2L/a U8Vxlmo7pwXVsv2l4Fk4wLQZ3YqmBmVwIR1pM= 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=+l5P3SpoNzVI01jT5vur2BeNu3YylFW+/juKckuFnnk=; b=GIvDsctF3uarKOiMZqurZbHm6H41iuSalOLKKeQ3ZEO+5pBFcmxCWCXPjzkojSphix 31s5HveL40EE92jRo5mfA5y8ITWFap+9Mg1bFFHx4ecod33MCMkSanMo2zU/6Ndhlo91 rJNm6QcgMsbdej1NXHvHywydjXAJb0JbGREOUOeQh0TMerfF6nPdOybJvSw1mT/9HAsG B0ZnjDk/tp2rixeHGjJWRVLbD8fJYmR2CYe4hYhj6/2aS4pRS5VWSYJa+WyGft1a40nK 77yaIMEw4EwyokRBci/duvRNHF+YZvMLNN/eyRy5xArZj/00UJVcBvYvRH0CfjweEEWk W1hQ== X-Gm-Message-State: APf1xPBzF+S7xkLdSad8CRFIubbNpvhfie3hYXCNYXEtenK3pS27IzrD GN4H4yJTKBkNZ9EA34C77MVCLGdPKsA= X-Google-Smtp-Source: AG47ELuyKWGcVFxnPUwsywIrHX48MHcbC2jAsay0YHyPow71o/51wV5wjSzRIZ65LYlwiYWm9xRM/w== X-Received: by 10.98.70.89 with SMTP id t86mr896406pfa.215.1519887489011; Wed, 28 Feb 2018 22:58:09 -0800 (PST) From: Heyi Guo To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 14:57:20 +0800 Message-Id: <1519887444-75510-3-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519887444-75510-1-git-send-email-heyi.guo@linaro.org> References: <1519887444-75510-1-git-send-email-heyi.guo@linaro.org> Subject: [edk2] [PATCH v5 2/6] OvmfPkg/PciHostBridgeLib: Init PCI aperture to 0 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 , 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 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 Cc: Jordan Justen Cc: Anthony Perard Cc: Julien Grall Cc: Ruiyu Ni Cc: Laszlo Ersek Cc: Ard Biesheuvel --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++++ OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/= Library/PciHostBridgeLib/PciHostBridgeLib.c index ff837035caff..4a650a4c6df9 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -217,6 +217,10 @@ PciHostBridgeGetRootBridges ( PCI_ROOT_BRIDGE_APERTURE Mem; PCI_ROOT_BRIDGE_APERTURE MemAbove4G; =20 + ZeroMem (&Io, sizeof (Io)); + ZeroMem (&Mem, sizeof (Mem)); + ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); + if (PcdGetBool (PcdPciDisableBusEnumeration)) { return ScanForRootBridges (Count); } diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Librar= y/PciHostBridgeLib/XenSupport.c index 31c63ae19e0a..aaf101dfcb0e 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c +++ b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c @@ -193,6 +193,11 @@ ScanForRootBridges ( =20 *NumberOfRootBridges =3D 0; RootBridges =3D NULL; + ZeroMem (&Io, sizeof (Io)); + ZeroMem (&Mem, sizeof (Mem)); + ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); + ZeroMem (&PMem, sizeof (PMem)); + ZeroMem (&PMemAbove4G, sizeof (PMemAbove4G)); =20 // // After scanning all the PCI devices on the PCI root bridge's primary b= us, --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel