public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, grao.v80@gmail.com
Subject: Re: [edk2-devel] Read SPI BAR offset 0x10 throwing processor exception
Date: Fri, 28 Jan 2022 12:59:24 +0000	[thread overview]
Message-ID: <735241e7-8ada-0fb0-e035-0a88d0800403@ipxe.org> (raw)
In-Reply-To: <CAFz4ObH6Lz363izuGhhs5tfSJWZvBwuHvT_OXfyAG8H0MMYbKg@mail.gmail.com>

On 28/01/2022 12:47, Rao G wrote:
> Attempting to Read SPIBAR 0x10 from BUS 0 Dev 1F Func 5
> 
>  >>
> ScSpiBar0 = MmioRead32 (SpiInstance->PchSpiBase + 
> PCI_BASE_ADDRESSREG_OFFSET) & 0xFFFFF000;
>  >>
> 
> The above code is throwing exception
> 
> PchSpiBase at 0xC00FD000
> !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
> ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
> RIP  - 00000000771903D0, CS  - 0000000000000038, RFLAGS - 0000000000010046
> 
>  From the shell the value at offset 0x10 is 0xFE010000
> 
> Any clues on why the processor is throwing exception while accessing the 
> value PchSpiBase+0x10 ?

PCI_BASE_ADDRESSREG_OFFSET is an offset within PCI configuration space. 
  It looks as though you are trying to use an MMIO access to read from 
PCI configuration space, which is not a valid thing to do.

I suspect you may want to use EFI_PCI_IO_PROTOCOL.Pci.Read() instead.

HTH,

Michael

  reply	other threads:[~2022-01-28 12:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 12:47 Read SPI BAR offset 0x10 throwing processor exception Rao G
2022-01-28 12:59 ` Michael Brown [this message]
2022-01-28 13:08   ` [edk2-devel] " Rao G
2022-01-29  5:49     ` Jeff Fan

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=735241e7-8ada-0fb0-e035-0a88d0800403@ipxe.org \
    --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