From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.2112.1597095168363066607 for ; Mon, 10 Aug 2020 14:32:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nn9hwSBN; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597095167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iZQEWHRO7kS50JZvXPuHDLatHuT+S8fMrW40vyFr/Rk=; b=Nn9hwSBNE8pwqkkPpp/RfSZc7YSIy932/QpAZ1SrXjLwEpFImP9xhZbkImk64HU/CVfCu1 7zW/iCvWrri22D+ykt/Mvx6sWfm65Iwv1e5QfCT5Of1XJxzVX+j9gZ44/D2J5HID8CrVVZ ut55/QVjd/yx5Yd9+ISLlnoV2zYivE4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-444-GyoBuDtIM8qbQFkp0cqwQA-1; Mon, 10 Aug 2020 17:32:40 -0400 X-MC-Unique: GyoBuDtIM8qbQFkp0cqwQA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4DD6CE919; Mon, 10 Aug 2020 21:32:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75B3E5D9E8; Mon, 10 Aug 2020 21:32:38 +0000 (UTC) Subject: =?UTF-8?B?UmU6IOetlOWkjTogW2VkazItZGV2ZWxdIHF1ZXN0aW9uIGFib3V0IFBDSSBicmlkZ2UncyBidXMgcmFuZ2Ugd2luZG93IGNvbmZpZ3VyZSdzIHNhdmUgYW5kIHJlc3RvcmU=?= To: devel@edk2.groups.io, wangxiao.bj@inspur.com, "tigerliu@zhaoxin.com" References: <0f1b74aaf0774f25bfd76d476a05b598@inspur.com> From: "Laszlo Ersek" Message-ID: <62758fad-1ca3-e46d-7302-86742700981b@redhat.com> Date: Mon, 10 Aug 2020 23:32:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <0f1b74aaf0774f25bfd76d476a05b598@inspur.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 08/10/20 13:54, Ric Wang (王晓) wrote: > It’s done by BIOS pei s3 resume code. Restored register value saved while BIOS normal POST BY BootScriptExecutor. You can refer gEfiPeiS3Resume2Ppi usage That doesn't seem right. The S3 boot script is composed by platform drivers in the firmware, for restoring platform hardware state. But the registers in question, in PCI config space, are specified in the PCI(e) spec(s), and the OS is virtually guaranteed to have drivers for PCI bridges / PCIe ports. The OS may even re-enumerate the PCI hierarchy (overriding what the firmware put in place), after which restoring the same configuration in the firmware, during S3 resume, would be wrong. Considering edk2, because PciBusDxe sets the bus numbers initially (possibly influenced by the platform's EFI_PCI_HOT_PLUG_INIT_PROTOCOL provider), if S3 boot script opcodes were saved for this, we should see PciBusDxe consume "gEfiS3SaveStateProtocolGuid". But it doesn't. If at S3, the port goes into D3hot state or shallower, then its config space is not lost. If the port goes into D3, then the OS knows it has to reprogram it after resume. That's my (very superficial) understanding anyway, from the ACPI spec. The Linux kernel seems to have a lot of logic around "bridge_d3" under "drivers/pci/". Thanks Laszlo > Thanks > > 发件人: devel@edk2.groups.io [mailto:devel@edk2.groups.io] 代表 Tiger Liu(BJ-RD) > 发送时间: 2020年8月10日 17:32 > 收件人: devel@edk2.groups.io > 主题: [edk2-devel] question about PCI bridge's bus range window configure's save and restore > > > > Hi, Experts: > > I have a question about PCI Bridge’s config space’s save and restore. > > > > Pci bus driver configured PCI Bridges’ secondary bus number register and subordinate bus number register. > > > > So, if system resumes from S3(Suspend to ram) state, who is responsible for restoring PCI Bridges’ secondary bus number / subordinate bus number registers’ content? > > > > Will the OS be responsible for it? > > > > Thanks > > > > > > 保密声明: > > 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。 > > CONFIDENTIAL NOTE: > > This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited. > > > > > >