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

Re: [PATCH][4.17] EFI: don't convert memory marked for runtime use to ordinary RAM


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 4 Oct 2022 12:38:17 +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=pTIzh/cGfSG7Jmx5cM7EaLBMIQDJ9e6y/xf0WHT4DwM=; b=ftOVBiqOd0ZmWTYwVgC79V+jtSF7IgVEjYJ07fcjkIwy4/mdJSI/nsEaBwhuevv6bFoDHU2dKFkX3Ptvkd7/gfpmhF/cOqT1Bt6M/R/OGFpdVYYviNR60RdaF8HEY7IJc6gkh9wzBJ4sLRAw/16gL84aUT5EdDHk1TZgsEB16/KOUZhhXu1Hgv4bU0VQiDhUfcf9u/D8MrfMKzUL/OKGg+vtIshbEyg15CmnIARUTtG7M3a1rzYe2hnMgF1cfXK+bIbDcXenNB68vX7o9G2i480l7ILU7VkSJ80nXd1UjwmZy/xnIrCvW70AST7LwPrIgNPf0yJMgMqQtvEmaGXRnA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KmMJI82xP7svNC12G/xbAgpPv+yvsG5ZBHPcY25Qlj7WsNmI+9vfsUujkYkAd3XSy6hWv9hcbufuAngqS+MhlhhEn9Vq1DY5fPkSpAFO6AayQjIr7DJMgjx2coazWsWtqR8SGaRUtHWIX29l2LaGRoQjCFx0J5J+ET3uL54ePyjYMCXYIDRymQW4BF7GEZvll7VQWUjdPmnW/w1nJKGRVvLsVPpJAVbw88siIXHe1vIk5VaXxb3NwFMuGxglGCb9gUxo1lPIaztA0BWF0W7P7gaXgKautMsojzlHGqM0Keubc4ftuILi+S23ha8uJfJB7pprVZ1hTQgncckgWhHLjQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Tue, 04 Oct 2022 10:38:37 +0000
  • Ironport-data: A9a23:LqBL2KPXOWFJ4J3vrXNrnJZSyEGnJRDYMC5AexGJyHHeKWpRNYcDrMm2QDDCkKbTWXua21jbuHuAQz0ke00KzI+dpJEvOOBVEmRPbh97t9r6cUfyeUPzHnKaejJW8QDgsTH/oe4x4zukpFQelCOLjCbDSROX0i7yRpo+PX5d4x/iMG0RDxQ3LJXfMiKuHW1N0epPiCCrevLahTuUeA+F7+BYlr8Xq0miRg5pxpj+T6U7xi7RaPaTIeXnurLgSb80cL08RZWnozRrw9nfjjClSp7m9YeyWMrRcwpfjEAZ82IQfwfnEzRK0ThLAwWN4mjfh5ADaweceLhSewybT7Z9axOdsYViNCJnHVPP2ZjEi6qaVeMAJp57WpzPZoiZpTO3iI40rk4iL1CRNsmuScf5gToqWhAJuUtZF0qSOtZAuf+0h0/cCnU4OVomadjklRI2CUy05Rl01gjXc9P3xoWdZTebAIhg7xEv5eAQpMim1gugiNBSReSOn+BRVEiY7L3GZIr3RDgQTfL5xRJT8Bs/X/j3A9oepMPNFP7OEtsVeXIH+NP4LM3Yv4sIw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ject.org>

On Tue, Oct 04, 2022 at 12:23:23PM +0200, Jan Beulich wrote:
> On 04.10.2022 11:33, Roger Pau Monné wrote:
> > On Tue, Oct 04, 2022 at 10:06:36AM +0200, Jan Beulich wrote:
> >> On 30.09.2022 16:28, Roger Pau Monné wrote:
> >>> On Fri, Sep 30, 2022 at 09:50:40AM +0200, Jan Beulich wrote:
> >>>> efi_init_memory() in both relevant places is treating EFI_MEMORY_RUNTIME
> >>>> higher priority than the type of the range. To avoid accessing memory at
> >>>> runtime which was re-used for other purposes, make
> >>>> efi_arch_process_memory_map() follow suit. While on x86 in theory the
> >>>> same would apply to EfiACPIReclaimMemory, we don't actually "reclaim"
> >>>> E820_ACPI memory there and hence that type's handling can be left alone.
> >>>
> >>> What about dom0?  Should it be translated to E820_RESERVED so that
> >>> dom0 doesn't try to use it either?
> >>
> >> I'm afraid I don't understand the questions. Not the least because I
> >> think "it" can't really mean "dom0" from the earlier sentence.
> > 
> > Sorry, let me try again:
> > 
> > The memory map provided to dom0 will contain E820_ACPI entries for
> > memory ranges with the EFI_MEMORY_RUNTIME attributes in the EFI memory
> > map.  Is there a risk from dom0 reclaiming such E820_ACPI ranges,
> > overwriting the data needed for runtime services?
> 
> How would Dom0 go about doing so? It has no control over what we hand
> to the page allocator - it can only free pages which were actually
> allocated to it. E820_ACPI and E820_RESERVED pages are assigned to
> DomIO - Dom0 can map and access them, but it cannot free them.

Maybe I'm very confused, but what about dom0 overwriting the data
there, won't it cause issues to runtime services?

If the memory is reported in the memory map provided to dom0 as
E820_ACPI dom0 is free to reclaim the region for it's own usage.

Thanks, Roger.



 


Rackspace

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