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

Re: [PATCH v2] xen/arm: fix arm_iommu_map_page after f9f6b22ab


  • To: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 14 Jul 2025 09:38:13 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=EiOa0RXYk6hL1L0l/E/YibeHnKTP/uVHCkscMF7expc=; b=QG6LdL6o/W6rKqMJmjC+NjXTrmjej8qX/qbbVP57GOfEMON8I8fgQ7NG1b3/z31l1aj6pgYCiDsVJaoPcgS9UIEckMkf6gyWuQd66zTd07uCTze2ttFqSCljqmKhYwyJYp6G5E0LbZQec2EX/asYk/UYKS2wUKRUESwUc9sD9TEBGPSGoEQ4c2zDRhV1rzzGenHfd4GuRfGfTHjH7jyR781pD//b3qn4dGghPxMfRlx2J9C6z9habGRr1oelxe11tkWSTy9Yc71As8cyvYe2kolm8DnVCehBzuKo8eedRMqq99425NRkSy0fT3154/Gj1LWPc5kDuCS9ZvHceRJcOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sBKGDvyOaimIXUg1FD65nd4ib/CLPvjgwCS9JFpfoZ7cggcz947VOpt1z0Smb1joQQ4kEfszJJNdONC3f0HbK+568PFBU6MrXX4bPbkZmSTEIY1bZdrREpi7EkeNeM+c2unfeCPd0Q7wmOdoqypXurMV7jTuyff78OnhAU+EKlLBMX8okY3VtnKbpJRWuj2TTurbM1qUQZRtLrnpaZGhLuN28QOmSxNyMXQIwBZunFFFTMNDt9jpFNPGDbIrsluyonj7wHk4PmlArgPqYQ5DvGvSqIeMWuL4NP1HTi1NcrzLkXmr2/+JmAFWHLOz8vNNJfMEM6OFnUY9UdBe08c9cg==
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Rahul Singh" <rahul.singh@xxxxxxx>, <stewart.hildebrand@xxxxxxx>
  • Delivery-date: Mon, 14 Jul 2025 13:38:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-07-12 06:08, Julien Grall wrote:
Hi Stefano,

On 11/07/2025 01:25, Stefano Stabellini wrote:
Up until f9f6b22ab "xen/arm: Map ITS doorbell register to IOMMU page

Everywhere in this commit message, we are using 12 characters commit ID.

tables" the only caller of iommu_map on ARM was grant_table.c which has
a specific usage model and restrictions as described by the in-code
comment in arm_iommu_map_page.

f9f6b22ab introduced a second caller to iommu_map on ARM:
vgic_v3_its_init_virtual. This specific statement in the
f9f6b22ab commit message is wrong:

"Note that the 1:1 check in arm_iommu_map_page remains for now, as
virtual ITSes are currently only created for hwdom where the doorbell
mapping is always 1:1."

Leading to crashes any time the hardware domain is not direct-mapped
(e.g. cache coloring and non-Dom0 hardware domain):

(XEN) Xen BUG at drivers/passthrough/arm/iommu_helpers.c:49

Are you using the last staging? Asking because line 49 is a blank line:

https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/drivers/ passthrough/arm/ iommu_helpers.c;h=5cb19874819357b5cd58638864b56c505d07b37a;hb=HEAD#l49

This is my fault. I added some debugging code and shifted the line numbers in my original reporting. 47 is the correct line:
BUG_ON(!is_domain_direct_mapped(d));

Regards,
Jason



 


Rackspace

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