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

Re: [PATCH v7 8/8] AMD/IOMMU: respect AtsDisabled device flag


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 26 Aug 2021 15:27:42 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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-SenderADCheck; bh=DCvo9tp6pPpG7PWOudbDEPx2JfF8W3LrD2EtNHQFKyk=; b=OxsOQ7j72O7tu4TUc1QcxjVTGbtNpK9QaKJ2eYYDkPcX/Ix3g3rmCIhQjz+EHOM1e351vqbSuNXlbAp4uyBp+RYjcTmh2CUmbLPy5sGYTQWMGm3lsJRLY2w5y6aMYU9pUHB1H69eFnZQ4XGnIPNpzMtTG75ZWSoN8FDoAnRdLKRNFz+byFZY0t+6sXWmgbU+B9wD2aNSSYjqyfdVLEmyunrS+HMyTm0JmWXvj72IxpA5Qma7e6TSgjUiMyviXUnwQhDfMgkvxOHPCb48Kp0NB360KVGwKN5M1UmIDoNAnMm0xaLFQd39/3peJucsxc0ifOlq6m1v1XbSCG2CyktZ2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UvCv9/d2mGBg/9rWtUKcvIjQJzTtQFp1wlB6u0mkFAoN33I9OtALlLCAYXRMXcUwp5XsiyjTujKTQsYOpwHiLPQCVfCNBFWD/MI2ItXbnuYlUEoElnRkJVfvqTBCJYRLLZhCRbkpnctm1edbV55IJtsNZOvNUTuuFguV1U8KwZB59PVqYivuLCYAK2D+So5WacT6OY/D8vXNo+EZa8qt+YXtF7jUVZW6TtNwyNM8Av5bYXdBiDPd2Re2/9MBewBm+TbbKMMFLwoh9xNKnGGo8yi9gQT3oT8TecZm3DPKz83n8llhLy7OZop7ferD1UlLLhp30s/zq4fcebgvk2rOLA==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 26 Aug 2021 14:28:08 +0000
  • Ironport-hdrordr: A9a23:xuW/Q6A3RZrLPWDlHeg7sceALOsnbusQ8zAXPh9KJiC9I/b1qy nxppkmPH/P6Qr4WBkb6LW90dq7MAzhHPlOkPUs1NaZLXTbUQ6TQr2KgrGSuwEIdxeOkdK1kJ 0QCZSWa+eAfWSS7/yKmTVQeuxIqLLskNHK9JXjJjVWPGVXgslbnnZE422gYytLrWd9dPgE/d anl7F6T23KQwVoUi33PAhIY8Hz4/nw0L72ax8PABAqrCGIkDOT8bb/VzyVxA0XXT9jyaortT GtqX222oyT99WAjjPM3W7a6Jpb3PPn19t4HcSJzuwYMC/lhAqEbJloH5eCoDc2iuey70tCqq iCnz4Qe+BIr1/BdGC8phXgnyHmzTYV8nfnjWSVhHPyyPaJDw4SOo5kv8Z0YxHZ400vsJVXy6 RQxV+UsJJREFfpgDn9z8KgbWAoqmOE5V4Z1cIDhX1WVoUTLJVLq5YEwU9TGJAcWArn9YEcFv V0Bs203ocXTbqjVQGdgoBT+q3pYpxqdS32BXTq+/blkgS+pUoJjXfxn6ck7zE9HPtXceg22w zGWp4Y3I2mAPVmNJ6VP91xNfdfPFa9CC4kAFjiVGgPK5t3TE4li6SHqondt9vaNaDh8vMJ6e L8uRVjxDYPR34=
  • Ironport-sdr: tYxvixytcE8qAnWZa413qV56ZyXhE64Uh9YRxiTnZbWSNqKH2HaaYflU7wu/2/M51gkXFkU53G PPrLdvGNvMYUKcNTaAmqTQTuNhVXApQtl7Tve+si4bRxF15RXy1HCzfu09klKxIpCEU/PJjZTw yGzN0GWP6jm+HV0MgABj4vA5F4xGnAx3N//8dQpDhJc1nKlNRhHSr+VpynaJeOhxNlRpowPo7J ag6seLwpEYzPQtQlWjpS7r8WYNG0cNKGoOSqgJRp66MD0ZNOBilMIVslNdWFvK/LoQpdb8QKPZ qkS0tELeLQI0e36iFBhGTGhx
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26/08/2021 08:26, Jan Beulich wrote:
> IVHD entries may specify that ATS is to be blocked for a device or range
> of devices. Honor firmware telling us so.

It would be helpful if there was any explanation as to the purpose of
this bit.

It is presumably to do with SecureATS, but that works by accepting the
ATS translation and doing the pagewalk anyway.

>
> While adding respective checks I noticed that the 2nd conditional in
> amd_iommu_setup_domain_device() failed to check the IOMMU's capability.
> Add the missing part of the condition there, as no good can come from
> enabling ATS on a device when the IOMMU is not capable of dealing with
> ATS requests.
>
> For actually using ACPI_IVHD_ATS_DISABLED, make its expansion no longer
> exhibit UB.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> TBD: I find the ordering in amd_iommu_disable_domain_device()
>      suspicious: amd_iommu_enable_domain_device() sets up the DTE first
>      and then enables ATS on the device. It would seem to me that
>      disabling would better be done the other way around (disable ATS on
>      device, then adjust DTE).

I'd hope that the worst which goes wrong, given the problematic order,
is a master abort.

But yes - ATS wants disabling on the device first, before the DTE is
updated.

~Andrew




 


Rackspace

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