[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: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Oct 2023 15:32:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=cS42fa5xeS8kqa0u0Vn8Vlt1a9nm0+suWp9X85KeMY8=; b=Kw/rH26V3nwzpZgXaYAc8wwt0MEkkWfHSYHUJRGd1hrTK0InVA96dqiD/SLlwNZmvLu8belmC9CX00D/27WJjaQj+Ut4lJc9USD7TCBfRSRkkFdTfEvcluT9BGOIhQaH+OMu+zYzzgfuMfCE3+osDaZeYh+VGknY4vsq4FVnR5iP26vyCyQsvj/TgaNXmlQWmZVFZfQBdt2g1+pNcx8mh6t5mrAiVBHxPyx3uaPV8fwc1rp5TRwsSjk1/LLmxixMjmAKKSy0RhsS0RrMCtr5ieI0Lv8cpuECsH1Au0SiIod+m/r0DNJoVVj9QaDaZyfaTa1QSgmylNXJzQsZfQWI1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0lWM0aSr0zyDD15fn+Vwfpu64sOL7f6qcsDlx//JZ2kGZUgdSUu6RI8nmn+60ucTUi2xl9+BHQLRiDpNVS9WnrDB4gw1TkVwbbD85834dtmAgNcsu0KCb7EUtDOBGXE2gUzSZf7Id+dakdgK/nG7RIkQjbq+ERoavHvHYLKHA/vxxtKRIfhi2BRnnkbHuC6t+dYBRvotF2/ds8czSKo9VQXQv1DzLKpFkMr+otkFuViT+0UUnevohr5+aiRKfgVdpTg+QjKGqHgsMLEQLN3vsu+qt2RN+nt08bgGHS+8MeA2O+OiP2PbEOY/Q3YGzaxaDrs8gxxgK7ehV+AuvxjIQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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:33:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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).

Jan



 


Rackspace

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