public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Cc: Guo Heyi <heyi.guo@linaro.org>, Eric Dong <eric.dong@intel.com>,
	 "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	 Laszlo Ersek <lersek@redhat.com>,
	Star Zeng <star.zeng@intel.com>
Subject: Re: [RFC v4 1/3] MdeModulePkg/PciHostBridgeDxe: Add support for address translation
Date: Tue, 27 Feb 2018 10:14:53 +0000	[thread overview]
Message-ID: <CAKv+Gu8g_Fj-AAXS9rntyu_DPDKziMS2h476a1e46ARsZCoUsQ@mail.gmail.com> (raw)
In-Reply-To: <19deadb3-4d26-914c-c9f8-c6c6716746fa@Intel.com>

On 27 February 2018 at 09:59, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> On 2/27/2018 5:33 PM, Guo Heyi wrote:
>>
>> Hi Ray,
>>
>> Thanks for your comments. It seems comments 10 and 12 are the major issue;
>> let's
>> discuss that first.
>>
>> 1. In current implementation, namely PciBusDxe and PciHostBridgeDxe both
>> in
>> MdeModulePkg, Address parameter passed to RootBridgeIoMemRead comes from
>> PciIoMemRead().
>> 2. In PciIoMemRead(), Offset is only an offset within selected BAR; then
>> PciIoDevice->PciBar[BarIndex].BaseAddress is added to Offset in
>> PciIoVerifyBarAccess().
>
> Agree. I thought PciIoMemRead() gets the BAR base address from
> GetBarAttributes().
>
>> 3. So whether the "Address" passed to RootBridgeIoMemRead() is host
>> address or
>> device address depends on the property of
>> PciIoDevice->PciBar[BarIndex].BaseAddress.
>
> RootBridgeIoMemRead() can choose to accept HOST address or Device address.
> Either can be implemented.
> I am fine to your proposal to use Device Address.
>
>> 4. In PciBusDxe, we can see PciIoDevice->PciBar[BarIndex].BaseAddress
>> simply
>> comes from the value read from BAR register, which is absolutely a device
>> address.
>> 5. What we do in patch 3/3 is also to convert the device address in
>> PciBar[BarIndex].BaseAddress to host address before returning to the
>> caller of
>> PciIoGetBarAttributes().
>>
>> Please let me know your comments.
>>
>> For other comments, I have no strong opinion and I can follow the
>> conclusion of
>> the community.
>
>
> So the issue (13) (not 12) is closed.
> But what's your opinion to my comment (1): Explicitly add assertion and
> if-check to make sure the alignment meets requirement.
>
> Ard,
> I provided the detailed comments because I felt the code is almost
> finalized.
> So the detailed comments can avoid creating more versions of patches.
>
> For the EMPTY comments and STATIC modifier, I created the first version of
> this driver, so I'd like to make the coding style in this driver is
> consistent.
> But if you insist to use a different style, I am fine as long as the coding
> style rule allows.
>

Heyi is spending a lot of time to fix an important limitation in the
generic PCI host bridge driver, and so I would like to remain on
topic, that's all.

And for the comment style: I personally prefer the empty lines before
and after as well, but it is not reasonable to reject code that
follows the coding style.


  reply	other threads:[~2018-02-27 10:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  2:09 [RFC v4 0/3] Add translation support to generic PciHostBridge Heyi Guo
2018-02-27  2:09 ` [RFC v4 1/3] MdeModulePkg/PciHostBridgeDxe: Add support for address translation Heyi Guo
2018-02-27  8:48   ` Ni, Ruiyu
2018-02-27  8:55     ` Ard Biesheuvel
2018-02-27  9:33     ` Guo Heyi
2018-02-27  9:59       ` Ni, Ruiyu
2018-02-27 10:14         ` Ard Biesheuvel [this message]
2018-02-27 10:45         ` Guo Heyi
2018-02-27 11:44           ` Guo Heyi
2018-02-28  2:29             ` Ni, Ruiyu
2018-02-28  7:25               ` Ni, Ruiyu
2018-02-28  7:53                 ` Guo Heyi
2018-02-28  9:39                   ` Laszlo Ersek
2018-02-28 23:31                     ` Guo Heyi
2018-03-01  3:56     ` Guo Heyi
2018-03-01  4:44       ` Ni, Ruiyu
2018-02-27  2:09 ` [RFC v4 2/3] MdeModulePkg/PciBus: convert host address to device address Heyi Guo
2018-02-27  2:09 ` [RFC v4 3/3] MdeModulePkg/PciBus: return CPU address for GetBarAttributes Heyi Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu8g_Fj-AAXS9rntyu_DPDKziMS2h476a1e46ARsZCoUsQ@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox