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

Re: [PATCH for-4.18 v2] x86/pvh: fix identity mapping of low 1MB


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 16 Oct 2023 15:51:08 +0200
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VTJmAOcwzM/LiJYGBaCrr/9mqOAO7m86g6k4IF62U9A=; b=mPAENfVWXDRtcIoyAi/z15C4f0/U/ueF5ZBCz1nZWbmjNDEb9P71AcBUxaaFTZ19xlk5nNUieVMbRUADApfzLuqNwZBAUMpK6GDO02ONShAadGioAxGtaZYinpX7E1HSWiqNLr4cQ4bhMEaZjqhp95IB5/SzgDtPQ8CCHJLYhjP/bnQHk4uHgJDN3s/fFZ0UVDHXRmQY3YGtL8AMB02MVysheT56FSkx0QPYpWN4wYO7G5lIGERlgqLO8imT6b1u6ntG3drZCCRkoBF9F95vg7nqQ43fpbxshUZVLrflcHMUsrejar/1fN+dUrnilnYdnUDPG0Gwn4d8j793IyRJ5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0+e7t6YZDFS1WL0BdNrEvFH5TZYBRSkWFPq69ocnBCFDDkb4G+F5DuVsvmgewu8gZzj+hKVw2Vh7ErghpvGILqi05fPRImnJgIBsehaw9Y/9/d7mLQX8NDUD0KmZKq5kzBwFjiKLSK8mbOXWlO56NCVNUc+03ZEEfBALYFxnS6DCoWAmTcrNnvdg1IudR75aB5NRbC1YTXC1QqbGhw2Tku0ijl9zxZxgIWSODpswyAAYEgRX5rKKM1D9nnSK356RVEss3UPBy8B8sJtUlUYriD2UY/mFqknkziM9Frg/Sh6rG7eeJVmuzcU/Mih7ZRpBznvSuzigGxAEYspM2pkDg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Henry Wang <Henry.Wang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 16 Oct 2023 13:51:34 +0000
  • Ironport-data: A9a23:FQhYkK3wV/UC0H3qTPbD5RNwkn2cJEfYwER7XKvMYLTBsI5bp2QGy TFOCz+GPfuOazCjfYxxPI2x90xUupSAnNNkTFFupC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb83uDgNyo4GlD5wRnO6gS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfImZA9 tUeARE0KRWAvca52piVa7crr5F2RCXrFNt3VnBI6xj8VK5ja7acBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouy6KlFQZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13LOUxH+mBNt6+LuQp8JagnSh/XEvFxwwWniQuuOYtHyGYocKQ 6AT0m90xUQoz2SpRNTgWxyzoFafowURHdFXFoUSyAyL0LuS3A+fCUANVDsHY9sj3OcpQRQ62 1nPmMnmbRR3uaCRYWKQ8PGTtzzaETgYKyoOaDEJSSMB4sL/u8cjgxTXVNFhHaWpyNrvFlnNL yuiqSE/g/AZi5EN3qDipVTf2Wv0/t7OUxI/4RjRUiS99ARlaYW5Zouur1/G8fJHK4XfRV6E1 JQZp/WjACk1JcnlvESwrC8lRtlFO97t3OXgvGNS
  • Ironport-hdrordr: A9a23:EEQ8J66F+KOD90uelgPXwMXXdLJyesId70hD6qkRc203TiX2ra qTdZgguCMc6wxwZJhDo7690cC7KBu2yXcS2+Us1NyZPTUO1lHGEKhSqaXLhwD6Eyrl/uRB1a Fme60WMqyTMWRH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Oct 16, 2023 at 03:32:54PM +0200, Jan Beulich wrote:
> On 13.10.2023 10:56, Roger Pau Monne wrote:
> > The mapping of memory regions below the 1MB mark was all done by the PVH 
> > dom0
> > builder code, causing the region to be avoided by the arch specific IOMMU
> > hardware domain initialization code.  That lead to the IOMMU being enabled
> > without reserved regions in the low 1MB identity mapped in the p2m for PVH
> > hardware domains.  Firmware which happens to be missing RMRR/IVMD ranges
> > describing E820 reserved regions in the low 1MB would transiently trigger 
> > IOMMU
> > faults until the p2m is populated by the PVH dom0 builder:
> > 
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb380 flags 0x20 RW
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb340 flags 0
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:13.2 d0 addr 00000000000ea1c0 flags 0
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb480 flags 0x20 RW
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb080 flags 0x20 RW
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb400 flags 0
> > AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb040 flags 0
> > 
> > Those errors have been observed on the osstest pinot{0,1} boxes (AMD Fam15h
> > Opteron(tm) Processor 3350 HE).
> > 
> > Mostly remove the special handling of the low 1MB done by the PVH dom0 
> > builder,
> > leaving just the data copy between RAM regions.  Otherwise rely on the IOMMU
> > arch init code to create any identity mappings for reserved regions in that
> > range (like it already does for reserved regions elsewhere).
> > 
> > Note there's a small difference in behavior, as holes in the low 1MB will no
> > longer be identity mapped to the p2m.
> 
> I certainly like the simplification, but I'm concerned by this: The BDA
> is not normally reserved, yet may want accessing by Dom0 (to see the real
> machine contents). We do access that first page of memory ourselves, so
> I expect OSes may do so as well (even if the specific aspect I'm thinking
> of - the warm/cold reboot field - is under Xen's control).

The BDA on the systems I've checked falls into a RAM area on the
memory map, but if you think it can be problematic I could arrange for
arch_iommu_hwdom_init() to also identity map holes in the low 1MB.

Keep in mind this is only for PVH, it won't affect PV.

Thanks, Roger.



 


Rackspace

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