From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
ian.campbell@citrix.com, stefano.stabellini@citrix.com
Subject: Re: [PATCH v3 13/13] xen/iommu: smmu: Advertise when the SMMU support coherent table walk
Date: Tue, 10 Feb 2015 09:37:36 +0800 [thread overview]
Message-ID: <54D960E0.9080407@linaro.org> (raw)
In-Reply-To: <54D960AC.4050602@linaro.org>
On 10/02/2015 09:36, Julien Grall wrote:
> Hi Stefano,
>
> On 06/02/2015 22:06, Stefano Stabellini wrote:
>> On Fri, 30 Jan 2015, Julien Grall wrote:
>>> When SMMU doesn't support coherent table walk, Xen may need to clean
>>> updated PT (see commit 4c5f4cb "xen/arm: p2m: Clean cache PT when the
>>> IOMMU doesn't support coherent walk").
>>>
>>> If one SMMU of the platform doesn't support coherent table walk, the
>>> feature is disabled for the whole platform. This is because device is
>>> assigned to a domain after the page table are populated.
>>>
>>> This could impact performance on domain which doesn't use device
>>> passthrough. But, as the spec strongly recommends the support of this
>>> feature for maintstream platform, I expect server will always have SMMUs
>>> supporting coherent table walk. If not, we may need to enable this
>>> feature
>>> per-domain.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>>
>>> ---
>>> I've just noticed that the support on the previous driver (i.e in
>>> Xen 4.5) may incorrectly expose this feature when all the SMMUs is
>>> not supporting coherent table walk.
>>>
>>> I'm not sure, if I should send a patch for it.
>>>
>>> Also I didn't squash this patch into "xen/iommu: smmu: Add Xen
>>> specific
>>> code to be able to use the driver" to help for review and to catch
>>> possible error in this patch.
>>>
>>> Changes in v3:
>>> - Patch added
>>> ---
>>> xen/drivers/passthrough/arm/smmu.c | 25 +++++++++++++++++++++++++
>>> 1 file changed, 25 insertions(+)
>>>
>>> diff --git a/xen/drivers/passthrough/arm/smmu.c
>>> b/xen/drivers/passthrough/arm/smmu.c
>>> index 373eee8..f4c7e49 100644
>>> --- a/xen/drivers/passthrough/arm/smmu.c
>>> +++ b/xen/drivers/passthrough/arm/smmu.c
>>> @@ -577,6 +577,13 @@ struct arm_smmu_domain {
>>> spinlock_t lock;
>>> };
>>>
>>> +/*
>>> + * Xen: Platform features. It indicates the list of features support
>>> by all the
>>> + * SMMUs.
>>> + * Actually we only care about coherent table walk.
>>> + */
>>> +static u32 platform_features = ARM_SMMU_FEAT_COHERENT_WALK;
>>> +
>>> /* Xen: Dummy iommu_domain */
>>> struct iommu_domain
>>> {
>>> @@ -2810,6 +2817,13 @@ static int arm_smmu_iommu_domain_init(struct
>>> domain *d)
>>>
>>> domain_hvm_iommu(d)->arch.priv = xen_domain;
>>>
>>> + /*
>>> + * The feature coherent walk can be enabled only when all SMMUs
>>> + * support it.
>>> + */
>>> + if (platform_features & ARM_SMMU_FEAT_COHERENT_WALK)
>>> + iommu_set_feature(d, IOMMU_FEAT_COHERENT_WALK);
>>> +
>>> return 0;
>>> }
>>
>> As long as you are sure that arm_smmu_iommu_domain_init is called after
>> all the iommus have been initialized by arm_smmu_dt_init, then this
>> patch is correct.
>
> We don't support SMMU hotplug on Xen :). All the SMMUs are initialize
> via iommu_setup before DOM0 is created.
Though, I could update the commit message to explain it.
--
Julien Grall
next prev parent reply other threads:[~2015-02-10 1:37 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 18:49 [PATCH v3 00/13] xen/arm: Resync the SMMU driver with the Linux one Julien Grall
2015-01-30 18:49 ` [PATCH v3 01/13] xen/arm: gic-v2: Change the device name in DT_DEVICE_START Julien Grall
2015-02-20 12:16 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 02/13] xen/arm: vgic: Drop unecessary include asm/device.h Julien Grall
2015-02-20 12:16 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 03/13] xen/dt: Extend dt_device_match to possibly store data Julien Grall
2015-02-06 12:37 ` Stefano Stabellini
2015-02-20 12:16 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 04/13] xen/arm: device: Rename device_type into device_class Julien Grall
2015-02-06 12:38 ` Stefano Stabellini
2015-02-20 12:17 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 05/13] xen/iommu: arm: Remove temporary the SMMU driver Julien Grall
2015-02-20 12:18 ` Ian Campbell
2015-02-20 12:53 ` Julien Grall
2015-02-20 13:47 ` Ian Campbell
2015-02-20 13:53 ` Julien Grall
2015-02-20 14:06 ` Ian Campbell
2015-02-20 14:07 ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 06/13] xen/arm: Introduce a generic way to describe device Julien Grall
2015-02-02 8:04 ` Jan Beulich
2015-02-06 12:39 ` Stefano Stabellini
2015-02-20 12:22 ` Ian Campbell
2015-02-24 14:26 ` Julien Grall
2015-02-24 14:45 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 07/13] xen/iommu: Consolidate device assignment ops into a single set Julien Grall
2015-02-20 12:25 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 08/13] xen/arm: Describe device supported by a driver with dt_match_node Julien Grall
2015-02-20 12:30 ` Ian Campbell
2015-02-24 14:42 ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 09/13] xen/iommu: arm: Import the SMMU driver from Linux Julien Grall
2015-02-20 12:31 ` Ian Campbell
2015-02-20 13:33 ` Julien Grall
2015-02-20 13:48 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 10/13] xen/iommu: smmu: Check for duplicate stream IDs when registering master devices Julien Grall
2015-02-20 12:35 ` Ian Campbell
2015-02-20 13:34 ` Julien Grall
2015-02-20 13:48 ` Ian Campbell
2015-02-20 14:47 ` Andreas Herrmann
2015-01-30 18:49 ` [PATCH v3 11/13] xen/iommu: smmu: Introduce automatic stream-id-masking Julien Grall
2015-02-20 13:15 ` Ian Campbell
2015-02-20 13:42 ` Julien Grall
2015-02-20 13:55 ` Ian Campbell
2015-02-20 15:07 ` Julien Grall
2015-02-23 10:42 ` Ian Campbell
2015-02-23 10:52 ` Julien Grall
2015-02-23 12:48 ` Ian Campbell
2015-01-30 18:49 ` [PATCH v3 12/13] xen/iommu: smmu: Add Xen specific code to be able to use the driver Julien Grall
2015-02-02 18:55 ` Manish
2015-02-02 23:01 ` Julien Grall
2015-02-06 13:20 ` Stefano Stabellini
2015-02-09 15:40 ` Julien Grall
2015-02-19 17:17 ` Julien Grall
2015-02-20 13:29 ` Ian Campbell
2015-02-20 14:01 ` Julien Grall
2015-02-20 13:23 ` Ian Campbell
2015-02-20 13:50 ` Julien Grall
2015-01-30 18:49 ` [PATCH v3 13/13] xen/iommu: smmu: Advertise when the SMMU support coherent table walk Julien Grall
2015-02-06 14:06 ` Stefano Stabellini
2015-02-10 1:36 ` Julien Grall
2015-02-10 1:37 ` Julien Grall [this message]
2015-02-20 13:34 ` Ian Campbell
2015-02-20 14:07 ` Julien Grall
2015-02-20 14:13 ` Ian Campbell
2015-02-20 14:15 ` Julien Grall
2015-02-20 14:28 ` Ian Campbell
2015-02-20 14:15 ` [PATCH v3 00/13] xen/arm: Resync the SMMU driver with the Linux one Ian Campbell
2015-02-20 14:19 ` Julien Grall
2015-02-20 14:27 ` Ian Campbell
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=54D960E0.9080407@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.