Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651900

Re: [Q] What about PCI mmio access alignment?

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [Q] What about PCI mmio access alignment?
Date 2017-05-27 17:40 +0200
Message-ID <tLLYR-5OD-1@gated-at.bofh.it> (permalink)
References <tKY26-6Uq-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 25, 2017 at 1:12 PM, Du, Changbin <changbin.du@intel.com> wrote:
> I have a basic quesion about the alignment when access PCI bar mmio space. Is
> the address accessed must be DW aligned and count must be DW aligned?

I guess the best answer is PCI architecture specification.
Book I have nearby tells me IIDnMS that yes, you have to follow alignment.

> As far as I know, The address field of TLB ignore lower 2 bits and the unit of
> length field also is DW. So does it mean above question is Yes? Else will CPU
> handle unaligned access for mmio space?

Here you perhaps meant the bus, not the CPU. PCI allows it as long as
actual device allows it.

(I recall patch series that tries to micro optimize PCI config space
access by grouping some bytes into words or even dwords, and it was
rejected).

> I want to know wether below access illegal or not:
>   - readb(bar0)
>   - readb(bar0 + 1)
>   - readl(bar0)

It depends.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Q] What about PCI mmio access alignment? "Du, Changbin" <changbin.du@intel.com> - 2017-05-25 12:20 +0200
  Re: [Q] What about PCI mmio access alignment? Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 17:40 +0200
    Re: [Q] What about PCI mmio access alignment? "Du, Changbin" <changbin.du@intel.com> - 2017-05-28 13:00 +0200

csiph-web