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

Re: [PATCH for-4.22 v2 2/2] x86/mcfg: relax memory map checks on newer firmware


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 5 Jun 2026 09:13:13 +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=arcselector10001; 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=pWUxhTPz3dkRlP+8PB5PHjU80RAgWr4k7/yeKPtup3s=; b=oOCANq40JswT3b4xXz0oDrVhK+nCjfz5YemAsDyY8doZdI3HYi9DsOCmc5ag1VX4N42asUfZpbhPNmkRQoXaUhPLAVrFObCLG3atG+evbrFtIBquBlBC1OKByHWfvKgCa/GIN3VDGAIbcU04VsSS+/3nRJCKXduz5TpxmAawYNt/eYNA9xNpMtR32X2yNRYm1zi1u84TXTWnuBw/0GOQK1OyXo4y3ZZBCp0lfvBkqBBdz55HWMEtF/8khRXcxB3XofOO0XzjbpvPiIkASO9Ezd3/mx8VG3VkpGMBEclWZyhvEd9mko29YX1N1A+3DyyLoVILypkg9J175HpNq2PdTA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p6K9JXkftu1+Yp9ZjIedFvwoDe7yShhcVl+EMkQ1ptRV3RVXfakmhltFiGP9EPgvNaATb6y6Hs8b+Licgpc0zI3eyrVCtDjHW9ouSYmwP+B+kkODCFWd7uKGIzhL6BPlC6z9FHQK3FzICQzlfN7F1uunjaajjpDxpSIB47Gg6ByI4hiH/eRKVit15jXU5/d8s+IMfq8my1RrVsYplgRY37eHP2ot/4h7UnAMYmXPBUKJ74NBNCcTKMb5dlYfos5M1QobpqTAGu8Xyvu3Qn2u4M1LyCXYSmW+VgnBR7RcpSEsyx9F3hjAmIjJJzuSTiyOEhr7TYfxU2LSov13SNbKBA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Fri, 05 Jun 2026 07:13:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jun 04, 2026 at 03:50:28PM +0200, Oleksii Kurochko wrote:
> 
> 
> On 6/4/26 3:25 PM, Roger Pau Monne wrote:
> > Per PCI Firmware 3.3 specification, section 4.1.2, ECAM space must be
> > reserved by declaring a motherboard resource, but there's no requirement to
> > mention it in E820.  The specification additionally states that: the
> > resources can optionally be returned in Int15 E820h or EFIGetMemoryMap as
> > reserved memory.
> > 
> > This fixes an issue with detection of extended capabilities when running
> > Xen on a Lenovo system that doesn't list the MCFG area as an
> > EfiMemoryMappedIO region (or as any other type) in the EFI memory map.
> > 
> > The more strict logic was introduced in Linux in 2006 as 946f2ee5c731
> > ("[PATCH] i386/x86-64: Check that MCFG points to an e820 reserved area").
> > This was picked up by Xen when MCFG support was added in 3b35911d709e
> > ("Enable pci mmcfg and ATS for x86_64").  Apply an approach similar to
> > what Linux has done in 199f968f1484 ("x86/pci: Skip early E820 check for
> > ECAM region") and relax the strict reserved region checking so it's only
> > done for firmware manufactured prior to 2016.  For firmware from 2016 and
> > newer allow MCFG region to reside in holes on the memory map.  Note Xen is
> > still more strict than Linux however, as it will refuse to use MCFG regions
> > that overlap with memory map regions different than reserved.
> > 
> > When dom0 boots it can prevent access to misconfigured MCFG regions by
> > using the PHYSDEVOP_pci_mmcfg_reserved hypercall.  This brings Xen's early
> > usage of MCFG (prior to ACPI AML parsing) more in line with the
> > implementation in Linux.
> 
> Don't we want to add Fixes: or Ammends: here?

Hm, when the code was added to Xen the checks were fine, that's why we
keep the existing behavior for firmware < 2016.  The change here is to
cope with new firmware behavior, so I'm not sure we can reference a
commit from 2009 with a fixes tag when the new behavior only applies
to firmware > 2015.

> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Generally it looks low-risk patch so:
>  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>

Thanks, Roger.



 


Rackspace

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