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

Re: [PATCH v5 13/13] xen/arm: mmu: enable SMMU subsystem only in MMU


  • To: Julien Grall <julien@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 22 Aug 2023 08:48:20 +0000
  • Accept-language: zh-CN, en-US
  • 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=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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SvNcUCCjHhQiKEMqkLpckhqgQAIi/m3zc2iIKsFud7k=; b=i1Vc7aJcpCYIHbWS3W05tezT0u2ri4WRk/LgSX41Xk1022NpE0zY3RXj1wAgFrZzf5FUIZ5JGxnoQ7xk5tPvFj4/X8rB6/36MTkZUYZ75rYN6+F7p1zQ7u+TQ+/th1O72HHp8AGAjtoNDSVWYYn9LinzApr+1dDrUqKaZdCzhxeHlf+7DH67I1mrmX8TrSdRHy4TfrH46X+aGa49jvjw2h/aRiQD6IvONlGt1yPU1KoKlrm7NYjJX1XigQ6J5/ctvxDtKdtKUjMAphhLbFsVd+EvJbpFF7wzXqFlSnjDPHgXhM2eLRmEp2H/wOpjQk+rZje8h/fFCHrMxVXSPQtKzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDPI7Ma9eKZk+TwUd/rzqYn+/d4kxkTku93Tq4dKlH8nQaFszO71iuMSU6W+se0tDO72jpYW/E8uEKp1RZp2twz1mZJQASk8naz5lfDfFxsJi0+tVFgn+xd8yak8g7ve7DkpUjufQdnGVsir5n+J1bGQ3xUje7gmBfSHzX+XkAkSY5gBiSPximX4zHgl0cEP5i0DD+PrSwMa0HEGH4WAkIRX9Y5cnaA0y3z1tC97ChR4noq0WXOQbNRwsGGEQ9M4+QtspHHFEl8FfUOeexRjcpKsBMRJj5uPjNUjy0G+sFk5flbD52ear+GoQi8dr/NI85yM1l33mxkjsW7zcDbr4A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
  • Delivery-date: Tue, 22 Aug 2023 08:49:12 +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: AQHZzmeUay8NQ4kvrE+CkZdRGQuMz6/1UcMAgABNUICAAGaFgIAACFcA
  • Thread-topic: [PATCH v5 13/13] xen/arm: mmu: enable SMMU subsystem only in MMU

Hi Julien,

> On Aug 22, 2023, at 16:18, Julien Grall <julien@xxxxxxx> wrote:
> 
> On 22/08/2023 03:11, Henry Wang wrote:
>> Hi Julien,
> 
> Hi,
> 
>>> On Aug 22, 2023, at 05:34, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi,
>>> 
>>> On 14/08/2023 05:25, Henry Wang wrote:
>>>> From: Penny Zheng <Penny.Zheng@xxxxxxx>
>>>> SMMU subsystem is only supported in MMU system, so we make it dependent
>>>> on CONFIG_HAS_MMU.
>>> 
>>> "only supported" as in it doesn't work with Xen or the HW is not supporting 
>>> it?
>> I think currently there are no hardware combination of MPU + SMMU, but
>> theoretically I think this is a valid combination since SMMU supports the 
>> linear
>> mapping. So would below reword looks good to you:
>> “Currently the hardware use case of connecting SMMU to MPU system is rarely
>> seen, so we make CONFIG_ARM_SMMU and CONFIG_ARM_SMMU_V3
>> dependent on CONFIG_MMU."
> 
> I read this as there might be MPU system with SMMU in development. What you 
> want to explain is why we can't let the developper to select the SMMU driver 
> on an MPU system.
> 
> From my understanding this is because the drivers are expecting to use the 
> page-tables and the concept doesn't exist in the MPU system. So the drivers 
> are not ready for the MPU.

I agree.

> 
>>> 
>>> Also, I am not entirely convinced that anything in passthrough would 
>>> properly work with MPU. At least none of the IOMMU drivers are. So I would 
>>> consider to completely disable HAS_PASSTHROUGH.
>> I agree, do you think adding below addition diff to this patch makes sense 
>> to you?
> 
> I think it should be a replacement because none of the IOMMU drivers works 
> for the MPU. So I would rather prefer if we avoid adding "depends on" on all 
> of them (even if there are only 3) for now.

I am a bit confused, I read your above explanation to the commit message as you
agree with the idea that making SMMU driver not selectable by MPU system. If we
replace this with “select HAS_PASSTHROUGH if MMU”, the SMMU driver will be
selectable by MPU system.

But...


> 
>> If so I guess would also need to mention this in commit message.
> 
> Did you confirm that Xen MPU still build without HAS_PASSTHROUGH?

…this is a good catch, no MPU is not buildable without HAS_PASSTHROUGH, we
will have:

```
In file included from ./include/xen/sched.h:12,
from ./include/xen/iocap.h:10,
from arch/arm/p2m.c:3:
arch/arm/p2m.c: In function 'p2m_set_way_flush':
./include/xen/iommu.h:366:40: error: 'struct domain' has no member named 'iommu'
366 | #define dom_iommu(d) (&(d)->iommu)
| ^~
./include/xen/iommu.h:371:36: note: in expansion of macro 'dom_iommu'
371 | #define iommu_use_hap_pt(d) (dom_iommu(d)->hap_pt_share)
| ^~~~~~~~~
arch/arm/p2m.c:617:10: note: in expansion of macro 'iommu_use_hap_pt'
617 | if ( iommu_use_hap_pt(current->domain) )
| ^~~~~~~~~~~~~~~~
In file included from ./include/xen/sched.h:12,
from ./arch/arm/include/asm/grant_table.h:7,
from ./include/xen/grant_table.h:29,
from arch/arm/domain.c:4:
arch/arm/domain.c: In function 'arch_domain_creation_finished':
./include/xen/iommu.h:366:40: error: 'struct domain' has no member named 'iommu'
366 | #define dom_iommu(d) (&(d)->iommu)
| ^~
./include/xen/iommu.h:371:36: note: in expansion of macro 'dom_iommu'
371 | #define iommu_use_hap_pt(d) (dom_iommu(d)->hap_pt_share)
| ^~~~~~~~~
arch/arm/domain.c:880:11: note: in expansion of macro 'iommu_use_hap_pt'
880 | if ( !iommu_use_hap_pt(d) )
| ^~~~~~~~~~~~~~~~
CC arch/arm/shutdown.o
CC lib/strlen.o
CC arch/arm/smp.o
CC arch/arm/smpboot.o
CC common/xmalloc_tlsf.o
CC lib/strncasecmp.o
make[2]: *** [Rules.mk:247: arch/arm/p2m.o] Error 1
make[2]: *** Waiting for unfinished jobs....
```

Kind regards,
Henry

> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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