[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU
- To: Ayan Kumar Halder <ayankuma@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 11 Nov 2024 16:33:50 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I06zpplD+QkIuycA5LXZ1gNN6tZ7rIvGTvzyF+xJq0U=; b=u7GEiU4qwfsVZu0cazFEA2kP/1cneWJ71+j8L+T3Xi0O2ulWq5pJvzMqhhcwM/3qf06Wlx3zijT/VzIr7JWEjGIjuLRd8YPT5PSd0WYXs5EPNb8wyA+vwrNbs/ky7pQcSkIWFx0jMxpJyVkaq6SwwyFi4LC/xJEwVxr/Ov61BSSx5aGEocBAMd6bHKFn7YD/frDWGiqTANtXN13Z4xl+usqo1w9w25oXxAHN20YLhIC2UkaNbFBLHbveDrAxPC/ondgzfBT+SdahjEl9LWOEOs3tLt1UHjh13+GkJ56RxMxZoYIrhGXulwzps+IB1xEtOf9oUIWCmNQXA5vHyjTQvg==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I06zpplD+QkIuycA5LXZ1gNN6tZ7rIvGTvzyF+xJq0U=; b=pcN5rx1RK5P1K9+Be5mBkx4xFLOWx+f3ABJWfDq/mMZTM3iTefnXwqz1B+Ch1X9F7WCU7gd8Jyc4hcBSOsoMDlyTzNn1RghR52t4xSG7Ff9epxBgTmKUyANfjDbU6lOIhGMKe4nuJrMIEI/EeMJXunrAQCA0pdrXhI9129B7DC6tm9blajkjUtIxLAaZgi85VZLuUqBMYbJe5bZurhmYfIUGHVmwBG9PAw5SSx5m7pI8pPnVmMEXn//SPUi0dd+3CU+Mma2af4t/A1wD2vkh7Dq03owu00AJsLumHImTLoskb8B1lqaZxzF6EQ5djQOV3e1VMriurCpfttWJgTQilQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=iuOUrPJ2Yjs0Hc29eWdn0bK17t639kkvUOlodX0hO7RKvQpr/6Q8FAu+K/z0V+2d1vPfbAVQvjDQ3Gp/g6+GUcdSmUUOyeYPAS2mrc5Ngf0cjF1oo4coZ1+epzA0t+u/VNNXaj9Uv9XXSlyNhfTxH054qwMISeVWq6S/nt3fXpX5ZKHwvC6G+wDpo3ONEmPhlVQZTZu4E6hffK4boY3PbdVBSexc03OMtQV/9ZN0mg7xYA/2QDfJil2oecgSpFazbxo1pRr3PMy2UqHcnv7DBBnNzfLcsqn4A8nQU8aiJbAK11+ntRd+dbCu4fBpzey6XumZd+49DucZIuUfDPExdg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B1xjHnEedT6HlxwDZM+e+WjundhHt87b7TE2RlnFWRfmuqsfTE+d6X14Qq6VSFC6VwyU84tabZask7LmxeCWmchHx1Cj8mwJxWlBtnMvnhN9+xHKQ3sNoP8m88sg9gJ23GYXfVFF1pzvLnzNmAsIH2gl4MgXANwije6KrQUWCqRoj16N9/i94U+ent1MpnteCcA+03pIO+P+LfLc+8ohknepC4Kchw570itnPjT93H2EPJe9G0488TDhC2Ksx8mEl/YOYMxDVKZws3Krl6kH8KtrJ/KL66Gc+b+K953NJ/MBhKLErDZ8fCDbH0oJQn5zB9D9ZOteuk5iERK+VUpsJA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>
- Delivery-date: Mon, 11 Nov 2024 16:34:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHbMhnBgSbSnEnP3kCeg3Nc76pTWrKx8P2AgAAk5QCAAAXeAIAAJc0AgAAJLIA=
- Thread-topic: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU
Hi Ayan,
> On 11 Nov 2024, at 16:00, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
>
>
> On 11/11/2024 13:45, Julien Grall wrote:
>> Hi Ayan,
> Hi Julien,
>>
>> On 11/11/2024 13:24, Ayan Kumar Halder wrote:
>>> On 11/11/2024 11:12, Julien Grall wrote:
>>>> Hi,
>>> Hi Julien,
>>>>
>>>> On 08/11/2024 19:59, Ayan Kumar Halder wrote:
>>>>> From: Penny Zheng <Penny.Zheng@xxxxxxx>
>>>>>
>>>>> In Xen, SMMU subsystem is supported for MMU system only. The reason being
>>>>> SMMU
>>>>> driver uses the same page tables as MMU.
>>>>> Thus, we make it dependent on CONFIG_MMU.
>>>>>
>>>>> Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
>>>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
>>>>> ---
>>>>> xen/arch/arm/Kconfig | 2 +-
>>>>> xen/drivers/passthrough/Kconfig | 3 ++-
>>>>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>>>> index 15b2e4a227..3699e148e9 100644
>>>>> --- a/xen/arch/arm/Kconfig
>>>>> +++ b/xen/arch/arm/Kconfig
>>>>> @@ -16,7 +16,7 @@ config ARM
>>>>> select HAS_DEVICE_TREE
>>>>> select HAS_PASSTHROUGH
>>>>> select HAS_UBSAN
>>>>> - select IOMMU_FORCE_PT_SHARE
>>>>> + select IOMMU_FORCE_PT_SHARE if MMU
>>>>
>>>> Realistically, everything under drivers/passthrough is MMU specific. So
>>>> does it actually make any sense to select HAS_PASSTHROUGH right now?
>>>
>>> Actually we are able to assign devices to different DomUs (eg UART1 to
>>> domU1) as long as the device isn't behind an IOMMU. So in our case, the
>>> passthrough device tree has this node
>>>
>>> uart@9c0b0000 {
>>> compatible = "arm,pl011\0arm,primecell";
>>> reg = <0x00 0x9c0b0000 0x00 0x10000>;
>>> interrupt-parent = <0x01>;
>>> interrupts = <0x00 0x07 0x04>;
>>> clock-names = "uartclk\0apb_pclk";
>>> clocks = <0x06 0x07>;
>>> xen,path = "/uart@9c0b0000";
>>> xen,reg = <0x00 0x9c0b0000 0x00 0x10000 0x00 0x9c0b0000>;
>>> xen,force-assign-without-iommu;
>>
>> So how devices will be protected on an MPU systems?
>>
>> > };> So, should we still disable HAS_PASSTHROUGH for MPU ?
>>
>> While it may work, a lot of code in drivers/passthrough is IOMMU specific
>> (see all the function named iommu_*). So I find really odd that you disable
>> IOMMU_FORCE_PT_SHARE but all the rest is still present...
>>
>> I think we need some consistency. If you are planning to do device
>> passthrough without any protection, then I don't think you need any code
>> within drivers/passthrough/ (at least for platform devices).
>>
>> Overall, for this patch, I think it would be better to simply select
>> HAS_PASSTHROUGH when MMU is enabled. We can revisit device passthrough once
>> we have the patches on the ML.
> Yes, this makes sense. I will wait for Luca to confirm as well.
It makes sense to don’t compile all that stuff, anyway we are using some
functions from drivers/passthrough/device_tree.c to pass the pl011 to the
guests, we will try to handle them later in the series then.
Cheers,
Luca
|