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

Re: [PATCH for-4.18] iommu/vt-d: use max supported AGAW


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Wed, 18 Oct 2023 01:05:27 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=41r4oovqyX9lXtJQ5PNApsKYxYNoamCpYxDPNO4cbSo=; b=P+TxmbTGPwmJWYeVaSveKpGQdPgLFPySA2CBiNSvqOARyoFGP3WtNPVqZQpWHNBc9eW7y8zVHt0DdJAvq7oRuUI0KMWRRKx2/YnEgutDK3RtEOLKNKB0aGIXFJ1LPm1GelxNJ6t4GGx2cHbnAstzVdP2rxIwkqHUbGz0z6snFKcf/x4/NLuosdEDRWhyg+B4Y76TrRjtnczQ6xrDPOWpz+o2hQcv9voRSMCQnQ8Xs4O0RuYEpXivypTLqz+A9npkaCwcxn0cUij3q99xh3wfJOYv4Yd18nr32xpsAjH1D2S0wPW7Vc6DbV0pVzzxi1c4JWjVqEE9zXFRl8UC8QiaYA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edVrPnacu64BZV0icXSe3uxXHFFdTNYqa7a0C5efFVpg82heuTd/Z9y/89+/39LwaFjKNQh1BKAS+XViPyKdrsV+KvThTELbu1sZ4KpeBMXqNqr+avGynqmuS8sgZycpEOfmV6qA3PfXk+T2wQkDislsO4+sg42Wr6DVKn7tH8+lec3JdvOAjyo9m6APYAwV267ncnMX4dPO9stOhdn5+2riQbhg00+un+6NA3nBJP8CBS6fJ2ppqgX7UmPxpJPX4LCz4CGVffrtHzMToKUOZS7Uegzv2vki9bO1qzyhyeZFiDy19IXMCn6w4FCN/p8TKa9p0iuNM7OHo9Q0KPRmgw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Wed, 18 Oct 2023 01:05:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHaAPtNjoXmJF7Mn0CZnd7sKi5tRbBOvFgA
  • Thread-topic: [PATCH for-4.18] iommu/vt-d: use max supported AGAW

Hi Roger,

> On Oct 17, 2023, at 21:09, Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:
> 
> SAGAW is a bitmap field, with bits 1 and 2 signaling support for AGAW 1 and
> AGAW 2 respectively.  According to the Intel VT-d specification, an IOMMU 
> might
> support multiple AGAW values.
> 
> The AGAW value for each device is set in the device context entry, however
> there's a caveat related to the value the field supports depending on the
> translation type:
> 
> "When the Translation-type (T) field indicates pass-through (010b) or
> guest-mode (100b or 101b), this field must be programmed to indicate the
> largest AGAW value supported by hardware."
> 
> Of the translation types listed above Xen only uses pass-through (010b), and
> hence we need to make sure the context entry AGAW field is set appropriately,
> or else the IOMMU will report invalid context entry errors.
> 
> To do so calculate the IOMMU supported page table levels based on the last bit
> set in the SAGAW field, instead of the first one.  This also allows making use
> of the widest address width supported by the IOMMU, in case multiple AGAWs are
> supported.
> 
> Note that 859d11b27912 claims to replace the open-coded find_first_set_bit(),
> but it's actually replacing an open coded implementation to find the last set
> bit.
> 
> Fixes: 859d11b27912 ('VT-d: prune SAGAW recognition')
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry


 


Rackspace

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