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

Re: [PATCH 1/3] x86/boot: Drop pte_update_limit from physical relocation logic


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Dec 2021 12:37:18 +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=AZpKi1AAiUKueAsqNoBd+0b0NR6mJhQN10Qky2HmwjY=; b=EvS3+FAKTr5U3E6nha2CRFsBbIxvgAJvZ9wtx8t3e//zbBYt3K7kIPjn3cV8Eq3hNamLdHVpt/OCSuRzknYUjxmCxwR99pnq3/0s7F4wG8zFZCqJc5m8bEZnCszRg42W+i3arvUu6NOztb7ORLjnoQABmwiRZwkjRlOdJZwIE5y0NFzNU6KZIc9QhXc01R7jGmvKAtz3uwQ7bk4gAkSmmyJqChlVI4b8+VIfTlg2OhKVbkC9EGNO3uqLO9jVOq3U05TGDOQ/Dqp/Y5IyITsmbDSClJW+Hx70bgOyG9Tw4OK81Z7AXN3CnTRbYXahWP6+KQ6/noug+G2fhpJAlVLqxw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQz8AkoUrZ4GQcXGxEoah6frmcZ38gNLVFuWe1KGCwf5oh4AWfUbOdg9Pv0DIYwDD+tja/n5NBuiGyMZ+6FN1P0IMJ1rqAJmyvC49fwZByOEK270f6SbnF2wt6b9kWBS7+yfsGKsRZ1YzQ06QytCs7Rp6Xkao4Fx+Jex87uV5/u0Ur1SUpLVCIU55lG/5G1kFHVbKuiTxzsuX7lMN6PHUhtyVHrbLuZoAfZ3PJp3KNgBdL1RD2swXDxs0ZzaLGJ1TeP3BEEgjZkvSufbQLQEp+TpLTa4TeTHeeCttEpirOBFp0kSkO5PWTZRM5DYpZpacVTcWuQnH0IJ9IXgydN9Wg==
  • 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, 07 Dec 2021 11:37:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.12.2021 11:53, Andrew Cooper wrote:
> This check has existed in one form or another since c/s 369bafdb1c1 "xen: Big
> changes to x86 start-of-day" in 2007.  Even then, AFAICT, it wasn't necessary
> because there was a clean split between the statically created entries (L3 and
> higher) and the dynamically created ones (L2 and lower).
> 
> Without dissecting the myriad changes over the past 14 years, I'm pretty
> certain Xen only booted by accident when l2_xenmap[0] was handled specially
> and skipped the pte_update_limit check which would have left it corrupt.
> 
> Nevertheless, as of right now, all non-leaf PTEs (the first loop), and all 2M
> xenmap leaf mappings (the second loop) need relocating.  They are no unused
> mappings in the range, no mappings which will be encountered multiple times,
> and it is unlikely that such mappings would be introduced.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

However, as to the description and ...

> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1230,7 +1230,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>              l3_pgentry_t *pl3e;
>              l2_pgentry_t *pl2e;
>              int i, j, k;
> -            unsigned long pte_update_limit;
>  
>              /* Select relocation address. */
>              xen_phys_start = end - reloc_size;
> @@ -1238,14 +1237,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>              bootsym(trampoline_xen_phys_start) = xen_phys_start;
>  
>              /*
> -             * No PTEs pointing above this address are candidates for 
> relocation.
> -             * Due to possibility of partial overlap of the end of source 
> image
> -             * and the beginning of region for destination image some PTEs 
> may
> -             * point to addresses in range [e, e + XEN_IMG_OFFSET).
> -             */
> -            pte_update_limit = PFN_DOWN(e);

... considering the comment here: Isn't it 0d31d1680868 ("x86/setup: do
not relocate Xen over current Xen image placement") where need for this
disappeared? Afaict the non-overlap of source and destination is the
crucial factor here, yet your description doesn't mention this aspect at
all. I'd therefore like to ask for an adjustment there.

Jan




 


Rackspace

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