Re: [BUG] x86/efi: MMRs no longer properly mapped after switch to isolated page table

From: Mike Travis
Date: Mon May 02 2016 - 18:17:12 EST

On 5/2/2016 2:39 PM, Alex Thorlton wrote:
>> > Who owns the MMR space and what is it used for? Do both the kernel and
>> > the firmware need access to it? My SGI UV knowledge is zero, so I'm
>> > happy to be educated! I can't think of any analogous memory regions on
>> > x86 where the EFI services require the kernel to map them, other than
>> > the EFI regions themselves.
> We have MMRs that get used for a ton of different purposes. I'm only
> familiar with the details of a few of them, but they provide a bunch of
> information about various bits of SGI-specific hardware (i.e. the hub
> and the BAU) and I think there are also some that allow you to control
> that hardware.
> This is more Mike Travis's department - he might be able to paint a
> better picture.

I don't have the complete picture either. But from what I do understand,
the answer is "yes", BIOS and the kernel both access the MMRs during the
lifetime of the system operation. The vast majority of the MMRs are setup
by UV BIOS during system startup. At some point they switch from each
blade/board/chassis running separately, to one doing overall system setup.
Then BIOS hands over the system to the kernel as expected.

After the hand off, the kernel and drivers, use the MMRs for machine control
and feedback. In addition, various services are provided by BIOS in the
"System Management Mode" layer. I'm not completely sure how the regs are
shared while in this mode, I think they both need the same address mappings.
Russ or Dimitri would know more about this, as this is the "kernel/BIOS
interface" the efi bios callbacks are using (most commonly in UV kernel