[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


  • To: Julien Grall <julien@xxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Date: Mon, 11 May 2020 15:58:09 -0700 (PDT)
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=epam.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5CEMu3z68dH/mrbR1Lvb8MxsL5xs/aDZWZz3J8TNTY=; b=Ubvb4aMUbcNVLQaqIScRxF6o4px3aG4OYfTW86630kNEhd2SKes+an6cf+HJRnUf1x9HWxqgaLluYiA/RqQObPEmKUJlFnAo0i/K7u5QhInFfbmNnyKsLKSXfNpBk5pxEwOFUzoWmS9WfXzzhwUjrUMlVw14qE9gq5hgT0fU34orYjNZJZawO+wmvAB3kN2wNOjv7Acqe60xJ8bn85GXER7o2IOTJ1ZIyiRERDuUP2fJrYV9+PH+oE3ql3RVBMSkGnUXGZgcJS1HYqDNQJCFm+45+BFAOAk3qXXc19/hdGvw0FwQZBecR9VrcSMUNXgylo6Er8N7FGr+/Sbonpx4rw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PiU3pPYgCT8zd5wAa2Mm1Bs7sDX8BPvvqIw8JdlrLGfyBdj70i1SRxLnnium+u1/+pRbjvcD445rHMLVoM/S+yxSmdZTLFK/f5uAO2sP74E6L4KTDYVn8Gr9WYvZSOLoe88OAj0vb2zTM2PgFPCTmiv7q/sg2XduRByNZc4H4KEziMLNTw7f9sHtUcuzUbSnSW/SPMoGMSqwpZRjUdMODZvfOHBeLdbKBmjE/dYFD6S+VbQzvo7GaHI/38HA0jHSZ4thfR4pVtZSoV54VSf0Ce6xpV+SfVnbs0TbcPx8JF2xf6pVHZdpbbjNYXcnlmou7zjWnYNFQ/oM+5Onos4qIQ==
  • Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=bestguesspass action=none header.from=xilinx.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Volodymyr_Babchuk@xxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 11 May 2020 22:58:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Sat, 9 May 2020, Julien Grall wrote:
> 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.

OK thanks for clarifying, I'll do that.



 


Rackspace

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