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

Re: [PATCH 1/8] x86/boot: Drop incorrect mapping at l2_xenmap[0]


  • To: Andrew Cooper <amc96@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 30 Nov 2021 12:22:55 +0100
  • 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=a+ADUfzGeFfQzAVMf3ka8n9nmIIHqPhFm2mvC7CeZCI=; b=Mj0GHMj9qpzTVx2Q6DKF2SBUsJHgd4HuAVik0nbhqkvzhOXVROnNqCNdfXSiMvV9ih4mrNTIRTBiGCktbG9ASxkNYNnRBqR08A2OiPuHbCU987bam0u1UUFZqREFu/6zBXXuc0ZFvsMW7jcddRsx9H2ZDFj08i/Baa2KRatRb7zwFRa4vK7gwZovIhY+bDu8XXTJOi342uHE1fpqUYd35erPuddomfJSqaaihlADBMC+bLhocKNuS5+Mk8+gFFzQiHKtHFCXKupRvTor4NB7CyGXEtdGQ2bm4FyJyjWJEdRWZIgmcHZH2icRksMZoSJD8W9lHZfx6NYx6Qxg+GS7CQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TidktcUigJ2LC8GIdi9hqw6Eg/lbPNG93/0hi9DVkovZwxHV81n9BiNjsAYdOv5kA3DuBYzHkS1lsDuTgpnZ4sQPR0UFcDr+k/CEFNM3k5CcVlfaj2LijjIF6FjmQVB7HCx3ypjwwv9rlYTYkMtGFjgHb1GeeUd/2HUUIbq6eSgR3yo/No9uJHGxx8hDwQzW0mAJd0HxL+dq6QDaQzxe6JmzDPGXBg0r+5LOC2O2lzRcVxG9PTvTHlSvQRP/JSKPaJV2Q3iTCSWp7IWdlWZ/13ag+0/G2fxvRu6liBi8bSAoqw94uNBaGF0DQ0KSjcDog27PiK6+mEVE+mF851JcpQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 30 Nov 2021 11:23:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.11.2021 12:14, Andrew Cooper wrote:
> On 30/11/2021 10:33, Jan Beulich wrote:
>> On 30.11.2021 11:04, Andrew Cooper wrote:
>>> It has been 4 years since the default load address changed from 1M to 2M, 
>>> and
>>> _stext ceased residing in l2_xenmap[0].  We should not be inserting an 
>>> unused
>>> mapping.
>>>
>>> To ensure we don't create mappings accidentally, loop from 0 and obey
>>> _PAGE_PRESENT on all entries.
>>>
>>> Fixes: 7ed93f3a0dff ("x86: change default load address from 1 MiB to 2 MiB")
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> I guess this may be worth backporting despite not having any immediate
>> adverse effect.
> 
> I'd say so, yes.  I too can't see an adverse effect right now, but I'm
> definitely wary of stray executable mappings lying around.
> 
> 
> In principle, it would be nice to reclaim the 2M of space (which only
> exists for the MB1 path IIRC), but then we're getting into a position
> where xen_phys_start isn't really that any more.

Well, xen_phys_base might be slightly more accurate, but apart from that
I do think that we reclaim that space (as much as we did reclaim the 1Mb
before the change of the default load address):

    if ( efi_boot_mem_unused(&eb_start, &eb_end) )
    {
        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
        reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
    }
    else
        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));

Jan




 


Rackspace

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