[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] x86: don't build unused entry code when !PV32
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 1 Apr 2021 16:01:55 +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-SenderADCheck; bh=zbbjIKru2b5o3Z6Na/+GtpQrrUZlqjlPIiTbirVMMf0=; b=M8fMHbJDpssX0QJ8BAXJDAzAKRmz/3+EpYfiWJ/x0luB1eT+gkw9lM4ZycxbS0iPADzsFfJX8cMTZX2eRr2I2smPLWVYApe3Lb9taWvMqq5QlSXiqvYH1AEGZtRSrxxxViiM+/NoxreT1QsgavNX8RWhaV69UyJfpeRw8sXLl42zJGsJ5J5aRaa73z+ZqzA9n3wFVtEubZkRCDS3X3SZwpp1/l4MV7ltLEgvw6pDqbcxPssyFgC0kWshWm4Hif80WdxMrPcYw0CtZNbBY2VuZQYmGmY4KooVkLOod++bApaox+THT8pgqleURP3a34H3xN51pEnVLE1V7qqhIHFMBA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx2kTgjFNjhdZkQRbGQJJjzImCwDyPZfMXGoWfwl3cQH5lHA1/p+yDMTTHMzDFRXuL5z0bPrLowze32M8BtKccfQmJ6rYG42E2Xo+GLNrBgFlE+SzM5N3Lm7EwWr5DM0m8hhNlBe1oXQCw1F82gPnlUakz6rQ73NpwyoREyHBl7Fk5MbbtZsmq+U7KMV31MIQqbgTYtEThMeSWOWAGNtWMAYNLVvmVyMayMsF0CnKE4paEZMufzdSLrdexyg3TcEmBFfPPULT/Z8oXtbTFsvaHmoeXlzanPpUkk7k0kn5cD338yzv+lEvWlBb5buwSCFkRXFD1aPhkKuLO+EGoX4BA==
- Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 01 Apr 2021 14:02:13 +0000
- Ironport-hdrordr: A9a23:UcL8naivYaaT8xME4+DKJiZHTXBQX0tw3DAbvn1ZSRFFG/Gwv/ uF2NwGyB75jysQUnk8mdaGfJKNW2/Y6IQd2+YsFJ+Ydk3DtHGzJI9vqbHjzTrpBjHk+odmuZ tIW5NVTOf9BV0St6vHySGlDtctx8SG+qi0heHYi0xgVx1udrsI1WZEIyywe3cGIzVuL5w/CZ aa+45rpyC4f24Wc8S8ARA+LpL+jvfMk4/rZgNDOg4/5GC1/EiVwZPZMzzd5BcRVDtT3awvmF KqryXV7riu2svLqCP0+HTU6/1t6b7c4/tFQPeBk80Ebgjr4zzYGbhJf52nkHQLrPq06FAs+e O80isIG8ho8XveciWUjHLWqnDd+Q0j4XPj1lOU6EGLyaeSJENYerl8rLlUfRfD500rsMsU6t My40uju4dKFhSFpSzh5rHzJm9Xv3Cpqnkvm/N7tQ04baIibtZq3Ogi1XIQOpIBECXm0ZsgAe ljAerNjcwmDm+yXjT3uHJiz8erWWl2NhCaQlIassjQ6DROmmtlpnFoifA3rzMlztYQWpNE7+ PLPuBBk6xPdNYfaeZYCP0aScW6J2TRSXv3QS6vCGWiMJtCF2PGqpbx7rlwzvqtYoY0wJw7n4 mEeE9EtEYpEnieSPGm7dluyFTgUW+9VTPixoV1/J5ioIDxQ7LtLGmqVE0uqc29uP8Sa/erFc qbCdZzObvOPGHuEYFG00nVQJ9JM0QTV8UTp5IVQFSLjsXXKpD7l+DSffrJTYCdUgoMayfaO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893T/D3AWC606c3xSJn2AAuhji6u16V3xw7Yv6MKhWskLOSLiUrkc hDyuakApo8HdVqIuEGVDoNOmpo5dxWuPkljJS/3SgKukcX79JTfq2DCazAqsgkboNnbRVbrcnl wTY=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Nov 25, 2020 at 09:51:33AM +0100, Jan Beulich wrote:
> Except for the initial part of cstar_enter compat/entry.S is all dead
> code in this case. Further, along the lines of the PV conditionals we
> already have in entry.S, make code PV32-conditional there too (to a
> fair part because this code actually references compat/entry.S).
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> TBD: I'm on the fence of whether (in a separate patch) to also make
> conditional struct pv_domain's is_32bit field.
>
> --- a/xen/arch/x86/x86_64/asm-offsets.c
> +++ b/xen/arch/x86/x86_64/asm-offsets.c
> @@ -9,7 +9,7 @@
> #include <xen/perfc.h>
> #endif
> #include <xen/sched.h>
> -#ifdef CONFIG_PV
> +#ifdef CONFIG_PV32
> #include <compat/xen.h>
> #endif
> #include <asm/hardirq.h>
> @@ -102,19 +102,21 @@ void __dummy__(void)
> BLANK();
> #endif
>
> -#ifdef CONFIG_PV
> +#ifdef CONFIG_PV32
> OFFSET(DOMAIN_is_32bit_pv, struct domain, arch.pv.is_32bit);
> BLANK();
>
> - OFFSET(VCPUINFO_upcall_pending, struct vcpu_info, evtchn_upcall_pending);
> - OFFSET(VCPUINFO_upcall_mask, struct vcpu_info, evtchn_upcall_mask);
> - BLANK();
> -
> OFFSET(COMPAT_VCPUINFO_upcall_pending, struct compat_vcpu_info,
> evtchn_upcall_pending);
> OFFSET(COMPAT_VCPUINFO_upcall_mask, struct compat_vcpu_info,
> evtchn_upcall_mask);
> BLANK();
> #endif
>
> +#ifdef CONFIG_PV
> + OFFSET(VCPUINFO_upcall_pending, struct vcpu_info, evtchn_upcall_pending);
> + OFFSET(VCPUINFO_upcall_mask, struct vcpu_info, evtchn_upcall_mask);
> + BLANK();
> +#endif
> +
> OFFSET(CPUINFO_guest_cpu_user_regs, struct cpu_info,
> guest_cpu_user_regs);
> OFFSET(CPUINFO_verw_sel, struct cpu_info, verw_sel);
> OFFSET(CPUINFO_current_vcpu, struct cpu_info, current_vcpu);
> --- a/xen/arch/x86/x86_64/compat/entry.S
> +++ b/xen/arch/x86/x86_64/compat/entry.S
> @@ -29,8 +29,6 @@ ENTRY(entry_int82)
> mov %rsp, %rdi
> call do_entry_int82
>
> -#endif /* CONFIG_PV32 */
> -
> /* %rbx: struct vcpu */
> ENTRY(compat_test_all_events)
> ASSERT_NOT_IN_ATOMIC
> @@ -197,6 +195,8 @@ ENTRY(cr4_pv32_restore)
> xor %eax, %eax
> ret
>
> +#endif /* CONFIG_PV32 */
> +
> .section .text.entry, "ax", @progbits
>
> /* See lstar_enter for entry register state. */
> @@ -230,6 +230,13 @@ ENTRY(cstar_enter)
> sti
>
> movq STACK_CPUINFO_FIELD(current_vcpu)(%rbx), %rbx
> +
> +#ifndef CONFIG_PV32
> +
> + jmp switch_to_kernel
> +
> +#else
> +
> movq VCPU_domain(%rbx),%rcx
> cmpb $0,DOMAIN_is_32bit_pv(%rcx)
> je switch_to_kernel
> @@ -393,3 +400,5 @@ compat_crash_page_fault:
> jmp .Lft14
> .previous
> _ASM_EXTABLE(.Lft14, .Lfx14)
> +
> +#endif /* CONFIG_PV32 */
Seeing this chunk, would it make sense to move the cstar_enter part
relevant to !is_32bit_pv into the common entry.S and leave the rest
here as compat_cstar_enter or some such?
AFAICT we only need a tiny part of the compat stuff when !CONFIG_PV32,
so I think we could make the hole compat/entry.S depend on
CONFIG_PV32.
Thanks, Roger.
|