[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] x86/kexec: Simplify the relocation of compat_mode_gdt_desc
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 21 Feb 2023 11:48:14 +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=jGmv4DRHb8hXct3Q1ksBy2nu+OTuIswsO82OERLJWCM=; b=cmjZtDKkFnTgnEm4hny8OwbcCZz4A3/AZ5GNS2WGlTIi8y6xpIAGWE8Vtk9bSn0JvlgDbqO4C+1bPnZJdixOTX1ZHGypUVG0gn68lwsx/Xra+bffFY20o9yaIdbMl7wNU2DLi2lYin6g87rI3wdXpmmK+VoGZc3m2ERQefeCPv4IzsBMCv46hlXXYNFqgBFtsC7i+6JOanOjf3IVqVDv6/aRI60aIJN9P+sKEzQwhL9C9UKumq628FthP5mO8gzyi5Ns8Dm/6KXnpTF+8VWnCHTI1G2cNt8v6RBlyy7rw87X634RYWy4C9ouAtok+4S39bvyklt//LXYbwk3MrAo+g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hzKvsouKzbGIm7Kd6Q8udDg0vI0qOxeE8JFlrhxhdRrWZ/Ht1/jAF+7kTYiOBlrT9PhmjeP5grOeDX6SlxQBlwRDfTewlVqkdFrWs3HgU0dIMQjX33w2RfsB9uY2hSdsj0Jky6oXjahlW7z6Cbm08+KEUuDkTBvLIxPgy6hPkhIDfVxh2zy++EEsg6kj8//F3iWtzbweJQpkJJYNyFhX7D66DpzWCY2D+4ZWYiHa33HZT/9w0rsXzztqpB+EJlghvGIcNm6ynnTdOY8y2+47gtVMCyd6wQdGHFb8tZ45P6LWYLiTQAjAZKiT8ShCp7Y4FXZ5HDZzBZnh8tM4YXh3+g==
- 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, 21 Feb 2023 10:48:34 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 17.02.2023 18:48, Andrew Cooper wrote:
> Assemble the GDT base relative to kexec_reloc, and simply add the identity map
> base address to relocate.
>
> Adjust a stale comment, and drop the unused matching label.
Only kind of - the comment is referencing call_32_bit, and hence wasn't
really stale. And what was (and would remain to be) dead is call_64_bit.
May want slightly re-wording.
> @@ -81,9 +80,8 @@ ENTRY(kexec_reloc)
> /* Setup IDT. */
> lidt compat_mode_idt(%rip)
>
> - /* Load compat GDT. */
> - leaq compat_mode_gdt(%rip), %rax
> - movq %rax, (compat_mode_gdt_desc + 2)(%rip)
> + /* Relocate and load compat GDT. */
> + add %rdi, 2 + compat_mode_gdt_desc(%rip)
> lgdt compat_mode_gdt_desc(%rip)
Where's %rdi being populated for this? At kexec_reloc %rdi points at
the code page, but prior to calling relocate_pages the register is
overwritten (and the original value is lost). relocate_pages also
has normal C calling convention afaict; kind of as a result %rdi is
actually being clobbered there.
Jan
|