xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Shanker Donthineni <shankerd@codeaurora.org>
To: Julien Grall <julien.grall@arm.com>, xen-devel@lists.xen.org
Cc: sstabellini@kernel.org, shankerd@qti.qualcomm.com
Subject: Re: [PATCH for-4.9] xen/arm: acpi: Map MMIO on fault in stage-2 page table for the hardware domain
Date: Thu, 30 Mar 2017 07:52:30 -0500	[thread overview]
Message-ID: <85da40c1-2c25-f08f-5630-5763bfc44d78@codeaurora.org> (raw)
In-Reply-To: <20170330124306.17357-1-julien.grall@arm.com>

Hi Julien,


On 03/30/2017 07:43 AM, Julien Grall wrote:
> When booting using ACPI, not all MMIOs can be discovered by parsing the
> static tables or the UEFI memory map. A lot of them will be described in
> the DSDT. However, Xen does not have an AML parser which requires us to
> find a different approach.
>
> During the first discussions on supporting ACPI (see design doc [1]), it
> was decided to rely on the hardware domain to make a request to the
> hypervisor to map the MMIO region in stage-2 page table before accessing
> it. This approach works fine if the OS has limited hooks to modify the
> page tables.
>
> In the case of Linux kernel, notifiers have been added to map
> the MMIO regions when adding a new AMBA/platform device. Whilst this is
> covering most of the MMIOs, some of them (e.g OpRegion, ECAM...) are not
> related to a specific device or the driver is not using the
> AMBA/platform API. So more hooks would need to be added in the code.
>
> Various approaches have been discussed (see [2]), one of them was to
> create stage-2 mappings seamlessly in Xen upon hardware memory faults.
> This approach was first ruled out because it relies on the hardware
> domain to probe the region before any use. So this would not work when
> DMA'ing to another device's MMIO region when the device is protected by
> an SMMU. It has been pointed out that this is a limited use case compare
> to DMA'ing between MMIO and RAM.
>
> This patch implements this approach. All MMIOs region will be mapped in
> stage-2 using p2m_mmio_direct_c (i.e normal memory outer and inner
> write-back cacheable). The stage-1 page table will be in control of the
> memory attribute. This is fine because the hardware domain is a trusted
> domain.
>
> Note that MMIO will only be mapped on a data abort fault. It is assumed
> that it will not be possible to execute code from MMIO
> (p2m_mmio_direct_c will forbid that).
>
> As mentioned above, this solution will cover most of the cases. If a
> platform requires to do DMA'ing to another device's MMIO region without
> any access performed by the OS. Then it will be expected to have
> specific platform code in the hypervisor to map the MMIO at boot time or
> the OS to use the existing hypercalls (i.e XENMEM_add_to_add_physmap{,_batch})
> before any access.
>
> [1] https://lists.xen.org/archives/html/xen-devel/2015-11/msg00488.html
> [2] https://marc.info/?l=linux-arm-kernel&m=148469169210500&w=2
>
> Signed-off-by: Julien Grall <julien.grall@arm.com>
>
> ---
>     This patch is a candidate for Xen 4.9. Whilst the last posting date
>     was few days ago, I think it would be good to have this patch in the
>     next release. Although ACPI support for ARM64 is still a technical
>     preview, it would help servers to test Xen upstream on their platform
>     with ACPI and provide feedback on missing features.
>
>     All the code is gated by !acpi_disabled and therefore will not be
>     executed on when using Device Tree.
>
>     RM hat on: I will leave the decision to Stefano.
>
>     Shanker: You mentioned offline that you tested the patch. May I add
>     your tested-by?

Sure add my tested-by. If you want I can test one more time this mailing list patch.

-- 
Shanker Donthineni
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-30 12:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 12:43 [PATCH for-4.9] xen/arm: acpi: Map MMIO on fault in stage-2 page table for the hardware domain Julien Grall
2017-03-30 12:52 ` Shanker Donthineni [this message]
2017-03-30 12:58   ` Julien Grall
2017-03-30 13:15     ` Shanker Donthineni
2017-03-30 18:37 ` Stefano Stabellini
2017-03-30 18:45   ` Julien Grall
2017-03-30 18:55     ` Stefano Stabellini
2017-03-30 19:54       ` Julien Grall
2017-03-31 14:50         ` Julien Grall
2017-03-31 18:01           ` Stefano Stabellini
2017-03-31 18:47             ` Julien Grall
2017-03-31 18:50               ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85da40c1-2c25-f08f-5630-5763bfc44d78@codeaurora.org \
    --to=shankerd@codeaurora.org \
    --cc=julien.grall@arm.com \
    --cc=shankerd@qti.qualcomm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).