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

Re: [PATCH 10/12] xen/arm: if is_domain_direct_mapped use native UART address for vPL011



Hi Stefano,

On 09/05/2020 01:07, Stefano Stabellini wrote:
On Fri, 1 May 2020, Julien Grall wrote:
On 01/05/2020 02:26, Stefano Stabellini wrote:
On Wed, 15 Apr 2020, Julien Grall wrote:
Hi Stefano,

On 15/04/2020 02:02, Stefano Stabellini wrote:
We always use a fix address to map the vPL011 to domains. The address
could be a problem for domains that are directly mapped.

Instead, for domains that are directly mapped, reuse the address of the
physical UART on the platform to avoid potential clashes.

How do you know the physical UART MMIO region is big enough to fit the
PL011?

That cannot be because the vPL011 MMIO size is 1 page, which is the
minimum right?

No, there are platforms out with multiple UARTs in the same page (see sunxi
for instance).

But if there are multiple UARTs sharing the same page, and the first one
is used by Xen, there is no way to assign one of the secondary UARTs to
a domU. So there would be no problem choosing the physical UART address
for the virtual PL011.

AFAICT, nothing prevents a user to assign such UART to a dom0less guest today. It would not be safe, but it should work.

If you want to make it safe, then you would need to trap the MMIO access so they can be sanitized. For a UART device, I don't think the overhead would be too bad.

Anyway, the only thing I request is to add sanity check in the code to help the user diagnostics any potential clash.

Cheers,

--
Julien Grall



 


Rackspace

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