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

Re: [PATCH v2] ARM: GICv3 ITS: flush caches for newly allocated ITT


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Sat, 23 Sep 2023 00:03:45 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com 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
  • 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=uhJ9mv2GtQZkZ2XmzWL3ze2qspnu63HLT8yoCR4bA78=; b=P4PM4KGXlCqFtsEXywd6iCwchJQ2OzLStsr9jDL7uXYhdj1d20Cju6QG0TWjn+yW+j+zaC/owZa/2iIOq6uA176Z5H9ZZ/TICr45E2/eEd7gfvYHXmEOGcpu4C1nTSxQFUmevVAfAYoj9erWd5wkWzL84dOJgCaFA7muSfMtlZEuGoWt02IWobK4hinNXZT0DWtO43fWGnWLBNsZTrb95b1sz6pJuMmuM+obStL8G6opPG+t8vonfRQyf8IUGQUu46Sj8zPZUt9h6vrcNeKjsuiDueGyJL0l6y/VUO+zdX3vxj9mJ7RFZtNlDQFP5DiR6m4UWLPLmzZEcUZK4QFOkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpKIv0CDU4gZY1ug/auUWfsskCGdo1+wKsOFnBGg5Z2Z7HqtiQcOVl9/WtUqH51SA0IwfF10nllIvRFRFQCy5qlXdqn1cog7N/FX4V6qhmws746rQWyB/GlByqFIYB9ghAZIwA8Qw1P7jcNwo3PAQy9UdejAIPUEKqWBxLiftDjJ4FfJ5F5cxKUCpEKRUCk323ge6xwNkAQ+NddXr9Lif45FYJocBKZrZ5pZAhgg5dh8wfYwvA7ewnjKKBC1198GUf0T6rOPJC7N9dYgVLCoSMiv2OmWgxu7gHLIjy39mw/MkR5RCKxo6HeYrFiyJMXXcCBxNrIxjxNQ1Xc3peJSpQ==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Sat, 23 Sep 2023 04:04:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/22/23 18:27, Volodymyr Babchuk wrote:
> ITS manages Device Tables and Interrupt Translation Tables on its own,
> so generally we are not interested in maintaining any coherence with
> CPU's view of those memory regions, except one case: ITS requires that
> Interrupt Translation Tables should be initialized with
> zeroes. Existing code already does this, but it does not cleans
> caches afterwards. This means that ITS may see un-initialized ITT and
> CPU can overwrite portions of ITT later, when it finally decides to
> flush caches. Visible effect of this issue that there are not
> interrupts delivered from a device.
> 
> Fix this by calling clean_and_invalidate_dcache_va_range() for newly
> allocated ITT.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

Tested-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

> 
> ---
> 
> Changes since v1:
>  - Use clean_and_invalidate_dcache_va_range() instead of
>    clean_dcache_va_range()
>  - Do this unconditionally
>  - Do not rename  HOST_ITS_FLUSH_CMD_QUEUE into HOST_ITS_FLUSH_BUFFERS
> ---
>  xen/arch/arm/gic-v3-its.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index 3aa4edda10..8afcd9783b 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -685,6 +685,9 @@ int gicv3_its_map_guest_device(struct domain *d,
>      if ( !itt_addr )
>          goto out_unlock;
> 
> +    clean_and_invalidate_dcache_va_range(itt_addr,
> +                                         nr_events * hw_its->itte_size);
> +
>      dev = xzalloc(struct its_device);
>      if ( !dev )
>          goto out_unlock;
> --
> 2.42.0



 


Rackspace

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