On 06/13/18 20:20, Laszlo Ersek wrote:

> * testing on aarch64/KVM:
>
> The graphics output looks great as long as I'm in the UEFI shell / the
> setup TUI / the grub menu. However, once I boot a Fedora 28 Server
> ISO, and the graphical Anacona Welcome screen appears, I get the exact
> same display corruption as before, with QemuVideoDxe + the VGA device
> model. I don't have the slightest idea why that is the case, but it's
> very visible, if I quickly move the thick blue line cursor around the
> language and keyboard layout selection lists. It's visible to the
> naked eye how dirty memory is gradually flushed to the display.

Wait, I see "efifb" has a parameter called "nowc", and it disables
write-combining, according to "Documentation/fb/efifb.txt".

Looking at the source code ("drivers/video/fbdev/efifb.c"), "nowc"
decides between:

>       if (nowc)
>               info->screen_base = ioremap(efifb_fix.smem_start, 
> efifb_fix.smem_len);
>       else
>               info->screen_base = ioremap_wc(efifb_fix.smem_start, 
> efifb_fix.smem_len);

Am I right to think that *both* of these ioremap() variants map the
phsyical address range as uncache-able? ("nowc" defaults to "false", and
I didn't specify "nowc" at all on the kernel command line.)

Quoting "arch/arm/include/asm/io.h":

>  * Function             Memory type     Cacheability    Cache hint
>  * ioremap()            Device          n/a             n/a
>  * ioremap_nocache()    Device          n/a             n/a
>  * ioremap_cache()      Normal          Writeback       Read allocate
>  * ioremap_wc()         Normal          Non-cacheable   n/a
>  * ioremap_wt()         Normal          Non-cacheable   n/a

ioremap() implies "device memory" (by definition uncacheable only),
while ioremap_wc() is normal memory, but UC. Sigh.

The include file "arch/arm64/include/asm/io.h" doesn't have such helpful
comments, but it does declare ioremap_cache() at least:

> extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);

Now, I *guess* if I rebuilt the efifb driver to use ioremap_cache() --
dependent on a new module parameter or some such --, the Linux guest
would start working as expected. Unfortunately, the Linux guest is
already pretty happy with virtio-gpu-pci; the question is how the
Windows guest would map the EFI framebuffer!

Unfortunately, I cannot test ARM64 Windows guests ATM.

So... If the consensus is that the edk2 code simply cannot get better
than this, and everything else is up to the guest OS(es), then I'm 100%
willing to push this version (with my minimal updates squashed).

Thanks!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to