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

Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Tue, 20 Aug 2024 12:48:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=xnjWSxH+BV3jaBfhBiZBgKzEHYqQ6mDPDgE62TaengM=; b=NrC67s1OnWDZ6HUcuX6zkktH9lIJ+vP0nRKLOlsKOEpFPtIDf0EH2koCNGefILWj82qsbwpHZFoQwIbpGEmPuJx3sLJV8Fa5UQr+lHZ34avOxtkxpkukSptBY1AP8leSt/WJxle8a5QEfqJAnjg6cC/QtrtJc5D+4jWURoFWA6hHzBK30HYEaIy6rNho+zpNd6LUbyofgpr76ECZZoZia8/F3jcx/ShYy9Hu2liT9ZuMaZBbT/W3icblD1XmroH0Oe1Il7cKwIgE8mzZT3BjddWtC+dltOdq6z1nnqv3BLNTv0Gp00Q3hLLYpxY6w7eMOWIGCJ6/i3yvtBZVFCzoRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Af8gA0DHolEHp/ighUYdHIIYgR/FW7T/sa4GgrI6GCNOBtgicSsvX7DhoV2L4NhkyRR+UOU2Vt/A20ftSw38eIQJoHbrzPLBHDGfHj1k7D05dEbzWJ7TaYrSJVLI1j20f1kkpzzzmLoFGXqilyJInMzJVJEWLlbsQwx1ldMqngeqrgtrXZn85Pl5wxVGEPCoBFusweEj9X2rlMVug6qdNjolG9Lgq6i4o6L3z25CIFV/L+sRQX5msVe5B7ZLKG0jOZaOAK0INQK0TD2+wgVoOR1Ef9JGWRgjPE/cv7MJnzh2uZGoKIVSy+BfTB3/TP/pEd2DoofzeuWjnmKatzbv9w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Penny Zheng <penny.zheng@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, sstabellini@xxxxxxxxxx, bertrand.marquis@xxxxxxx, michal.orzel@xxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Volodymyr_Babchuk@xxxxxxxx
  • Delivery-date: Tue, 20 Aug 2024 11:48:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien/Jan,

On 19/08/2024 10:58, Julien Grall wrote:


On 19/08/2024 10:55, Julien Grall wrote:
Hi Ayan,

On 19/08/2024 10:45, Ayan Kumar Halder wrote:
I am ok with this. This has the benefit that the change can be contained within arch/arm if we do the following :-

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b8..26f7406278 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -329,7 +329,9 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,

      setup_mm();

+#ifdef CONFIG_MMU
      vm_init();
+#endif

      /* Parse the ACPI tables for possible boot-time configuration */
      acpi_boot_table_init();

Are we ok with this ?

The definition of vm_init() is in xen/include/xen/vmap.h. If I enclose it using any CONFIG_XXX (like I have done in the current patch), then I need to introduce it in common/Kconfig and define it for x86 and PPC. I would prefer to contain the change within arch/arm only if possible.

Just to clarify, are you suggesting to just protect the call vm_init(). In other word, common/vmap.c would still be included in the final binary for the MPU?

If yes, then I think it would be a bit odd... Someone could still call vmap() and this would not break until runtime.

So I don't see how we could get away from modifying the common code.

Readying my previous reply again. I think the confusion comes from:

> But maybe ARCH_VMAP was an incorrect suggestion. It might be better to gate with the !MMU (IIRC this would imply MPU).

This was specifically referring to the branch predictor Kconfig. This was not a suggestion to avoid introducing ARCH_VMAP.

Thanks for clarifying this. Yes, I misunderstood your previous comment. So I will do :-

1. HARDEN_BRANCH_PREDICTOR will depend on MMU.

2. ARCH_VMAP will be selected by PPC and RISCV. The reason is below.

3. xen/common/vmap.c will be conditionally compiled on ARCH_VMAP and the "#ifdef VMAP_VIRT_START .. endif" will be from removed within the file. As VMAP_VIRT_START is defined by RISCV and PPC, thus #2 is needed.

Julien, Jan :- Please let me know if you are ok with #3. This was in response to Michal's comment. While his suggestion makes sense, I am not sure if extending the changes to other architectures is the correct approach. Or do you prefer keeping xen/common/vmap.c unchanged.

Kind regards,

Ayan



Cheers,




 


Rackspace

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