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

RE: [PATCH v6 07/11] xen/arm: implement FIXMAP_ADDR for MPU systems


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 11 Nov 2022 07:56:38 +0000
  • Accept-language: 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=armh.onmicrosoft.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=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=p4K/JReIs0wGnmT/fHNkpujlAvHDTOvPix5oIV+KhSU=; b=kOFqfnzB1IQn9z8Ns0g0D7zLT5XkmFnRsmnPC4xQbEJ4+4iyuqmNIMiCYAQ5t3uXwE3H5YEEllglJstYcdoUaVbaLZDSLDwAD05oLlfA6OaVNWPFURF2sMDqv7wI0F7onNOimCa25jK5XCJqaN03cekuI4Sla954Z9rJqF4jb7u7cU8PKEINWN7XN7R/yKHbA+bNBmMDP9XKdHN5tmVx3woDgNHvQQWYcc1KKQWhGvOevUICzK1GJ8zn/qiALgIAXVzWykYLMyfJghFlKCfd5uN++ySGsZBgDAg9g6y1zcWcpRIwen1QXQ9gTAxQL6ZpNgQk78ue2l9AQf4SL4QGgg==
  • 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=p4K/JReIs0wGnmT/fHNkpujlAvHDTOvPix5oIV+KhSU=; b=FBjy8bnacf97SXNuJkRPeLb1/eWhtZ7G8q042pPlOmo8s5oredjKRRG9c973jgyecvO2E2RvUEqkg9rU+63SbrdWIoN+Bj1Raef6Vjslx0EzEjhvnSrm/++cRLGB1nZzj7JJX3FJnP8igcZa8oTq69KTG3mRmp7JkXeb7K+rjM4ndGlJCZPyD9gdCjdTEiZs5tAGrfNRFmcs8QkwRkVxVzbVkdwy4sCbXlj5Q7J8sijNJ+v4w6nVEWjCUQw+/ozi2V4vnWZPBSz513liuP1DcErpcHmA7gB6GVrjNS/RyPdRrOGbCfL1BKPltlEAdokG27DK+oDabA+A9X1KhBNs+g==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Xx0E53wLiwXKbWSxiCJu+fxPZ0MT3oeLpM35PLMIwTG1io8Cv6OecRcLJ4ocy5ytTsuOyH89qmVOvWFErdpufw9AVoxLPYtu1BKYC2iQ0EHt1FuHU0ipvVKCNU3tMVc4IbUElIMQrjSF2jo93IQTYRJjUpI/Wlsw0O+F/q6r9zSG1z5TfvQ0LKYe9XuVTRJfrpeniFCDbBz7/GkHpkqQT3uKsiBfCbhnIiKcHIFNSzDp7St84ZRuYCuFGY1NrO+ptnUIX/+WVV2JUu1rOy+RouAFI+/Vmyjnk0MUdw5Nm42yxnMNLrGfrcAvzPxlbaW3f+FDl3KGF4mPkxI9HaDaqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z81Q+O2j9KN0FhnAsRhMlyLRpsIU2QPpogeN6X5C9OgvNPaPwGQAjKIs9J/jgypD/Z5V+h5p7m1lgMAX3FWIRDMJUI5waXEaNz+5Ob2+Y8zpRbtbez4CndNUtVdW6Bv9aIzzTaQ/hV/L8/ZiKazwWB2nz0TGAGLjkxX78luUQhBmBQ91CnpkaZk5oQtzEXBixZApOoSy6UUp86tV2SIPfaxSvBJcufqavr3DpAgWJIJa6VCeCGD54YEnVcZQ/y0pNaVCuEFx5x7pfB/g41GMIuf8fm6W1gJOHmw3kZaYmEBzZlJsZMzEPrMjBgPWHa4DJZ+fAtwO+izHefMOuQicog==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: nd <nd@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 11 Nov 2022 07:57:07 +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: AQHY8DVneLUTj6n4XEmKaYaqtg988K4yT/yAgAPcKRCAAMX/AIACaq9w
  • Thread-topic: [PATCH v6 07/11] xen/arm: implement FIXMAP_ADDR for MPU systems

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2022年11月10日 2:30
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: nd <nd@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; Bertrand
> Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH v6 07/11] xen/arm: implement FIXMAP_ADDR for MPU
> systems
> 
> 
> 
> On 09/11/2022 06:46, Wei Chen wrote:
> > Hi Julien,
> 
> Hi Wei,
> 
> >
> >> -----Original Message-----
> >> From: Julien Grall <julien@xxxxxxx>
> >> Sent: 2022年11月7日 3:45
> >> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> >> Cc: nd <nd@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
> Bertrand
> >> Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> >> <Volodymyr_Babchuk@xxxxxxxx>
> >> Subject: Re: [PATCH v6 07/11] xen/arm: implement FIXMAP_ADDR for MPU
> >> systems
> >>
> >> Hi Wei,
> >>
> >> On 04/11/2022 10:07, Wei Chen wrote:
> >>> FIXMAP is a special virtual address section for Xen to map some
> >>> physical ram or device memory temporarily in initialization for
> >>> MMU systems. FIXMAP_ADDR will return a virtual address by index
> >>> for special purpose phys-to-virt mapping usage. For example,
> >>> FIXMAP_ADDR(FIXMAP_CONSOLE) for early console mapping and
> >>> FIXMAP_ADDR(FIXMAP_MISC) for copy_from_paddr.
> >>
> >> To me, we are bending quite a bit the definition of the fixmap. There
> >> are not many use of the FIXMAP within the code and I think it would
> >> simply be better to abstract the use (or removing it when possible) and
> >> avoid defining FIXMAP_ADDR() & co for MPU.
> >>
> >
> > I agree, if we don't mind to add some CONFIG_HAS_MPU in some generic
> code.
> 
> FAOD, this is not what I had in mind. Instead, it was to provide helper
> which for !HAS_MPU would call fixmap and for HAS_MPU would do the work
> to map the region in the MPU.
> 

Sorry, I am still confused about this comment, did you mean we can provider
Some generic helpers like: early_map_console / eary_map_guest_memory.
For non-MPU system, we still can call fixmap in these callers, but for
MPU system, we have to map the region to MPU region?

> [...]
> 
> >>>    xen/arch/arm/Kconfig                  |  2 +-
> >>>    xen/arch/arm/include/asm/config_mpu.h |  2 ++
> >>>    xen/arch/arm/include/asm/fixmap.h     | 25
> +++++++++++++++++++++++++
> >>>    3 files changed, 28 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> >>> index ac276307d6..1458ffa777 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_PDX
> >>> - select HAS_PMAP
> >>> + select HAS_PMAP if !HAS_MPU
> >>
> >> I can't find any change of mm.c in this series. So surely this will
> >> break the build?
> >
> > Yes, in our internal testing, open PMAP for MPU will cause building
> > failed, except we add some new stubs for MPU system.
> 
> Do you mean you added some stubs for PMAP? If so, I would not expect any
> caller for the pmap() to be used for the MPU. Therefore, why would they
> be necessary?
> 

No, I mean if we want to make pmap can be built successfully for MPU,
we have to implement some stubs like: fix_to_virt, xen_fixmap and
write_pte, to make compiling success. But just as you said, we would
not expect MPU to use any PMAP function, so we have not implemented
them for MPU. Instead we disable PMAP for MPU. 

Cheer,
Wei Chen

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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