[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] {xen, dom0}_vga_console_info.u.vesa_lfb.lfb_base field too small



>>> On 06.05.19 at 10:04, <jgross@xxxxxxxx> wrote:
> On 05/05/2019 15:27, Marek Marczykowski-Górecki wrote:
>> Hi,
>> 
>> I have a machine that allocate vesa LFB above 4GB, as reported by UEFI
>> GOP. At 0x4000000000 to be specific.
>> vga_console_info.u.vesa_lfb.lfb_base is a 32bit field, so it gets
>> truncated, leading to all kind of memory corruptions when something
>> writes there.
>> If that would be only about Xen, that wouldn't be that bad, but
>> unfortunately exactly the same structure is used as an interface for
>> dom0 start info (at least PV one).
>> My only idea is to introduce yet another entry in *_vga_console_info.u
>> union (efi_lfb64?) with a 64bit lfb_base field. And mark it in
>> video_type (XEN_VGATYPE_EFI_LFB64?). But I'm not sure how non-patched
>> Linux (or other supported OSes) would respond to this. xen_init_vga() in
>> Linux doesn't seem to bail on unknown video_type, so it may be fragile.
>> 
>> Any better ideas?
> 
> In Linux kernel the screen_info structure has ext_lfb_base for that
> purpose (it contains the upper 32 bits of lfb_base).
> 
> We could add a similar member to Xen's dom0_vga_console_info.u.vesa_lfb
> and let the kernel detect its presence by using the value of
> start_info.console.dom0.info_size - this wouldn't require a new video
> type and old kernels would run as today. The same scheme is used for
> gbl_caps and mode_attrs already.

+1

> Releated to that: I assume the comment in xen.h regarding lfb_base and
> lfb_size being in units of 64kB is wrong and should be removed?

The remark applies to lfb_size only, and there it's correct: The
BIOS interface used hands back such a value and
efi_arch_video_init() adjusts the incoming byte-granular value
accordingly (albeit it's debatable whether rounding up is
appropriate).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.