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.48701.1638778368058218591 for ; Mon, 06 Dec 2021 00:12:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dICu15WN; 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=1638778367; 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=v3U6J+IeSzBnt/dA8AXxAZ5SH3sT6pdcBkaB9d+f71U=; b=dICu15WNJH+41MMEnnuF7u4SnIx5c4CRbbvRpu35STWbGuofrFrEtVQjFb4SxhrciOIc7j jLgvZhVZEQYDOZeFFLB+ppvge8OBqul0xjdQcDkmVDeaiQV1j6NyEhNPzoSlo+4GE/IIQ/ vyOLaI/8E2cmo9CZb7yaC3KXlqPeB1Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-8Hh302MEMrWf96ZBq-ct3g-1; Mon, 06 Dec 2021 03:12:44 -0500 X-MC-Unique: 8Hh302MEMrWf96ZBq-ct3g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C11822F26; Mon, 6 Dec 2021 08:12:42 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 844A022DEF; Mon, 6 Dec 2021 08:12:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5C1CE18003A7; Mon, 6 Dec 2021 09:12:40 +0100 (CET) Date: Mon, 6 Dec 2021 09:12:40 +0100 From: "Gerd Hoffmann" To: sebastien.boeuf@intel.com Cc: devel@edk2.groups.io, jiewen.yao@intel.com, jordan.l.justen@intel.com Subject: Re: [PATCH v2 1/5] OvmfPkg: Handle Cloud Hypervisor host bridge Message-ID: <20211206081240.olfmvrfvck3fnkkh@sirius.home.kraxel.org> References: <2368c18ff5330c5ebab8ff0857823749299d8211.1638658097.git.sebastien.boeuf@intel.com> MIME-Version: 1.0 In-Reply-To: <2368c18ff5330c5ebab8ff0857823749299d8211.1638658097.git.sebastien.boeuf@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > STATIC UINT16 mAcpiPmBaseAddress; > +STATIC UINT16 mAcpiHwReducedSleepCtl; > > EFI_STATUS > EFIAPI > @@ -26,6 +27,7 @@ DxeResetInit ( > { > UINT16 HostBridgeDevId; > > + mAcpiPmBaseAddress = 0; Hmm? mAcpiPmBaseAddress + mAcpiHwReducedSleepCtl should be treated equal here (zero both or zero none). I think explicitly zeroing is not needed, the variables should be in a zero-initialized memory block. > - IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0); > - IoOr16 (mAcpiPmBaseAddress + 4, BIT13); > + if (mAcpiPmBaseAddress == 0) { if (mAcpiHwReducedSleepCtl) > + IoWrite8 (mAcpiHwReducedSleepCtl, 5 << 2 | 1 << 5); take care, Gerd