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

Re: [XEN v9 4/4] xen/arm64: io: Handle data abort due to cache maintenance instructions


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx>
  • Date: Fri, 4 Mar 2022 12:13:23 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=xen.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); 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=wVHYqt6+KjCrCZlM/hq1qXnt9nEaEPbJGD011O0LeKM=; b=YjXvHXCpoOeAtKrdU0nwgk5jCRYUoEMiyy3JW0t78zU+qvxhpHcPMwPPLO87gUT5dgNRcSJE3T56UifEDbHeoPhANT5tFHUKi4xuenRXLOAi92Gf0GSauSgMx0LK9A3kzxerJ1j03Jn4Nc5uhvyjsD1V5Nn7HcQCxpHGwO9u9I8N6G+LDwl/o+U46Jt1p/SrnmNm6Qa88MP8AI3moyA+ndBbIHTrhAFi9K32flSLKXkH49ClUmdRKfB5Inwqy9CqVAh8TEi86jQ2ZDX0nYXm1O22ERMQb2JctiUBcWFRlh8/j4JiSTB4KebZksqEM2cS9XlvVk8EohsfRuB33Sjn0w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AD2Y0OAJPUSYc/s+nmp0erQ5p4L3xjGiqByMQ7iqQPWvhXlv8hsVAdCoPrYnUpz4YTipVPiks95U7No7OlKsvX27iY/pRvuqYG+dybyThvTz3VbduNnvA4foADKlK0o2gHLMaBxZ/j8+umOTf9QM4kJb0OjnkNLuzv0eldD9xLoQs4hcUvbBoyADjTpMB9tLA6xQG3r4TASzYb/rShkNjMtCTEhQwTD+ARF4v0iYoJbETbqv8bzUrNmqhzbCMt4kijElB93IgOYk8AqpEbGBVaV4Rh51ceTKoDdYfP+bmFFMJRbjevEb/wuY1Vt7/qQ5of6h1dY+JGJB7YSu/erT5g==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefanos@xxxxxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, <paul@xxxxxxx>, <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 04 Mar 2022 12:13:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 04/03/2022 10:46, Julien Grall wrote:
Hi Ayan,

On 01/03/2022 12:40, Ayan Kumar Halder wrote:
When the data abort is caused due to cache maintenance for an address,
there are two scenarios:-

1. Address belonging to a non emulated region - For this, Xen should
set the corresponding bit in the translation table entry to valid and
return to the guest to retry the instruction. This can happen sometimes
as Xen need to set the translation table entry to invalid. (for eg
'Break-Before-Make' sequence).

2. Address belongs to an emulated region - Xen should ignore the
instruction (ie increment the PC) and return to the guest.

I would be explicit and say something along the lines:

"Xen doesn't cache data for emulated regions. So we can safely ignore them".

There is a third scenarios:

The address belongs to neither an emulated region nor has a valid mapping in the P2M.

To check this, we should test "try_handle_mmio() == IO_UNHANDLED". If so then send an abort to the guest.

Is this correct ?

- Ayan


We try to deal with scenario#1, by invoking check_p2m(). If this is
unsuccessful, then we assume scenario#2.

This means that you will ignore cache maintenance on invalid region. I think we should send an abort to the guest rather than let them believe it worked.

Cheers,




 


Rackspace

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