From nobody Fri May 10 12:18:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1676656164; cv=none; d=zohomail.com; s=zohoarc; b=C/idCSuo59B5QZ4z/Iq1c+vuIBfo4rmAnHTzlO3rpIWdnrnCQp3ExQGWGTjBGhhpq1ZZAGPSKPz85gAJO88A1hcyImU1HvfclXn69RebFn4SJLmWe3jgq27Oq8Wl3LuTsG1UD0bvH7RDVM5FOJ+FduiwiNDLzpmC2LAAvasznG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676656164; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PzYDa6jYBcI4nKtLXjSFwF8vvEKcQxNjqGdJqNvENW8=; b=K/5RKO71V1Vj+9WcR4qh1VZ/F5pgCwx1VhMxOln1dVBgSlmZUBVa8s4oM3McNflgzNvVB46nO+8SLl9ir+tvdjzNEUYcVefiaj3X6gw9Y4IC3tJpfcG2rRKcmLoAeLOtc1a20XHBPetlbPSqzF8zV/BI33efRs8fuAoUUXC9NQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1676656164300888.9920380844845; Fri, 17 Feb 2023 09:49:24 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.497215.768124 (Exim 4.92) (envelope-from ) id 1pT4qf-0003Lz-0X; Fri, 17 Feb 2023 17:48:41 +0000 Received: by outflank-mailman (output) from mailman id 497215.768124; Fri, 17 Feb 2023 17:48:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qe-0003Ls-Sc; Fri, 17 Feb 2023 17:48:40 +0000 Received: by outflank-mailman (input) for mailman id 497215; Fri, 17 Feb 2023 17:48:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qd-0002rh-0E for xen-devel@lists.xenproject.org; Fri, 17 Feb 2023 17:48:39 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4e7c8e8c-aeeb-11ed-933d-83870f6b2ba8; Fri, 17 Feb 2023 18:48:37 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4e7c8e8c-aeeb-11ed-933d-83870f6b2ba8 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1676656117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p5sxvZxuV8RUOamp6LgQhbUMlW7vsrfgFydE9dC8HYM=; b=btB9RcRxg60efDRlyKVErHhgzTCGlP5BFc44jbBG8mHrOjYVvvHdHR52 oiAnBt6QGpNd7FA3tD/2l0KL2K6DwfXmAa1QA/tthZUlQr6IzMWqNOYhK Q+GKCuOnpSATlsHRShyd1JWs4AyvJgIFRsO0O5J9MFIqfPqZTfD9Ha8rN I=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 96897981 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:yAfCsqKg0l3I1J+gFE+Rx5UlxSXFcZb7ZxGr2PjKsXjdYENS02FWn 2EeCmuDPq7bN2L9KYglbd+1phlS7cCAz9Q3HQJlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpJrfPcwP9TlK6q4mhA5AVhPaojUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c54Dl1q7 fBIdwsdcw6h2e2xg+ybWNFj05FLwMnDZOvzu1llxDDdS/0nXYrCU+PB4towMDUY354UW6yEP oxANGQpNU6bC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TbG5UEwRfI/ woq+Uz0P0snG/m61QbYyWLymPHMhirkAYkdQejQGvlC3wTImz175ActfUS/iem0jAi5Qd03A 1wZ/G8ioLY/8GSvT8LhRFuorXicpBkeVtFMVeog52ml6IDZ/gKYDWgsVSNaZZots8peeNAx/ gbXxZWzX2Up6eDLDyvHrd94sA9eJwAaIlMmfSNUEjAV/sfB/o40zUzvXO5sRfvdYsLOJRn8x DWDrS4bjroVjNIW26jTwW0rkw5AtbCSEFdru1y/snaNq1ogOdX7P9DABU3zt64oEWqPcrWWU JHoceC65ftGM5yCnTflrA4lTODwvKbt3NExbDdS83gdG9aFoSLLkWN4umsWyKJV3iEsIGaBX aMrkVkNjKK/xVPzBUONX6q/Ct4x0Y/rHsn/W/bfY7JmO8YuKlLYpn02NRXLjwgBdXTAdollZ P+mnTuEVy5GWcyLMhLoLwvi7VPb7n9nnj6CLXwK5x+mzaCfdBaopUQtaTOzghQCxPrc+m39q o8PX/ZmPj0DCIUSlAGLq99MRb3LRFBnba3LRzt/LbLSfFM2QDt6VJc8A9oJIuRYokicrc+Ql lnVZ6OS4AGXaaHvQelSVk1eVQ== IronPort-HdrOrdr: A9a23:mm60zqFOjei4Jq6+pLqE18eALOsnbusQ8zAXPo5KOGVom62j5r iTdZEgvyMc5wxhPU3I9erwWpVoBEmslqKdgrNxAV7BZniDhILAFugLhrcKgQeBJ8SUzJ876U 4PSdkZNDQyNzRHZATBjTVQ3+xO/DBPys6Vuds= X-IronPort-AV: E=Sophos;i="5.97,306,1669093200"; d="scan'208";a="96897981" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 1/3] x86/kexec: Drop compatibility_mode_far Date: Fri, 17 Feb 2023 17:48:12 +0000 Message-ID: <20230217174814.1006961-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230217174814.1006961-1-andrew.cooper3@citrix.com> References: <20230217174814.1006961-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1676656166303100001 ljmp is (famously?) incompatible between Intel and AMD CPUs, and while we're using one of the compatible forms, we've got a good stack and lret is the f= ar more common way of doing this. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/x86_64/kexec_reloc.S | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_= reloc.S index f4842025eb56..035164e96f38 100644 --- a/xen/arch/x86/x86_64/kexec_reloc.S +++ b/xen/arch/x86/x86_64/kexec_reloc.S @@ -86,12 +86,11 @@ ENTRY(kexec_reloc) movq %rax, (compat_mode_gdt_desc + 2)(%rip) lgdt compat_mode_gdt_desc(%rip) =20 - /* Relocate compatibility mode entry point address. */ - leal compatibility_mode(%rip), %eax - movl %eax, compatibility_mode_far(%rip) - /* Enter compatibility mode. */ - ljmp *compatibility_mode_far(%rip) + lea compatibility_mode(%rip), %rax + push $0x10 + push %rax + lretq =20 relocate_pages: /* %rdi - indirection page maddr */ @@ -171,13 +170,6 @@ compatibility_mode: ud2 =20 .align 4 -compatibility_mode_far: - .long 0x00000000 /* set in call_32_bit above */ - .word 0x0010 - - .type compatibility_mode_far, @object - .size compatibility_mode_far, . - compatibility_mode_far - compat_mode_gdt_desc: .word .Lcompat_mode_gdt_end - compat_mode_gdt -1 .quad 0x0000000000000000 /* set in call_32_bit above */ --=20 2.30.2 From nobody Fri May 10 12:18:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1676656171; cv=none; d=zohomail.com; s=zohoarc; b=C3ITjyVAsAJM3Wwmj8Rhm43UOoVx12+SDpqTlgCMosnkdKeUUA6ezSW9EWbFSA2x6q0dhD6Nn22mSTW236MPxHGYJC6zeFhIcuh7cg+82dWMkh9tW3Hnub17ev7AlaP1Z5pNsz2SZ9DY5UIukxgqOrxbuCXG0Zh3zwLDxsk7INk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676656171; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qecademhceIBEJoBtI2nXsZVLYEKN6iKu/YANeUVmZQ=; b=F7iut2WhCqO4FZEsNliI3P3PODtp8JD8hdiyoz77BijZ/XgKANvNQQoj4rRL1chLSMpNAmkzQlRb4sie3qTq8YRD4smCFZecQQlrMJLyjjGCALdlY8zbPgfhE831/uX4eMq5Migkf/4CdOR6l/5aTgGMPVSp5aTE1Be+AdlxPd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1676656171171750.6635995285933; Fri, 17 Feb 2023 09:49:31 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.497216.768135 (Exim 4.92) (envelope-from ) id 1pT4qh-0003cF-73; Fri, 17 Feb 2023 17:48:43 +0000 Received: by outflank-mailman (output) from mailman id 497216.768135; Fri, 17 Feb 2023 17:48:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qh-0003c6-3Z; Fri, 17 Feb 2023 17:48:43 +0000 Received: by outflank-mailman (input) for mailman id 497216; Fri, 17 Feb 2023 17:48:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qf-0003GN-6L for xen-devel@lists.xenproject.org; Fri, 17 Feb 2023 17:48:41 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c263dcb-aeeb-11ed-93b5-47a8fe42b414; Fri, 17 Feb 2023 18:48:36 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4c263dcb-aeeb-11ed-93b5-47a8fe42b414 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1676656116; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ti3YGuh5AB+DkoIjcnY6SodZUoUvn3qg2dzkSWt0iaU=; b=FVizbSmtPmHUn/RrywOSt0iHNUvIE6H5Xho4rvNw79p4tqr24AkAMuvQ XnBXukdiOjh0TGyQKsxxx3U7f4g773w3+O+2aawqt6AyAC1jhJPTGXq+j c7NqMZjBP+Uv0DO9snd0oP2ZRbYjRbWdJG1MKwH1wK/npCTatVAB/dY9C s=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 97511809 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:tUaVdqh8VgjMdx6kNb1JOkzLX161cRAKZh0ujC45NGQN5FlHY01je htvW2uFP/bZYmf9LYskaYS+800AvJODnIU1Ggc//ihhHngb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWt0N8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ZDN5DpB/L7HCWCDer5KqrjmzEnrv5ak854Ed3AyV0gK1XYcNu/vKDwReOAwP+tfKH Pz3LskmxOQPVAsKuirDHgMWObO4/XNiZLdeBYDQzI39QWUijusybjiVzyVxA0XXT9jyaortT GtqX232oyT99WAjjPM3W7a6Jpb3PPn19t4HcSJzuQFNzn2jQ6sRYJ5H5mPpio8ru2D4Esj1P PMvxAjFcJu7G65RBD4nTLdny3blBo+4X7rzlGVxVH5p9bieT48A81dwapEbxrw8SMbzZ9B+Z MO+1jcm4tcDBvGkii4zcPPTQtWmk29pmdnufIPjkZYTZAVZNZq3M0iFQJuYdc99RDBmcIa+d pVfYThDTFtABenhkXizypSKRqXLzMO91m9Mw4/U4euokdrdThCvjUlLYok7y89HdsGOuh5zv WBPaJymL5USMgKKap7GecaWMOyTnfAWBTWLQupUB3a/Yw8SgXwQqTMkcMIzfDvfIZNwIo5mZ zHXl8dvWkue1j2AcnL2JFQ6BjCTGi0QDyok6hlltNEk6y5QKCuPTyISVgoncflq/IDAtfDU/ L2PJ5NGffsIWbnBI4M1QzjXJtZL2UYTaQuy54GckPLptiOJpzht+TdfvqWLL3xESw8Ume6GX cHVCibHrQ10qlqYA6MvPH8YQKeRqWkx+MBLEHzxZlh9LQw X-IronPort-AV: E=Sophos;i="5.97,306,1669093200"; d="scan'208";a="97511809" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/3] x86/kexec: Simplify the relocation of compat_mode_gdt_desc Date: Fri, 17 Feb 2023 17:48:13 +0000 Message-ID: <20230217174814.1006961-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230217174814.1006961-1-andrew.cooper3@citrix.com> References: <20230217174814.1006961-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1676656172370100003 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. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/x86_64/kexec_reloc.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_= reloc.S index 035164e96f38..a81f64146190 100644 --- a/xen/arch/x86/x86_64/kexec_reloc.S +++ b/xen/arch/x86/x86_64/kexec_reloc.S @@ -72,7 +72,6 @@ ENTRY(kexec_reloc) testq $KEXEC_RELOC_FLAG_COMPAT, %r8 jnz .L_call_32_bit =20 -.L_call_64_bit: /* Call the image entry point. This should never return. */ callq *%rbp ud2 @@ -81,9 +80,8 @@ ENTRY(kexec_reloc) /* Setup IDT. */ lidt compat_mode_idt(%rip) =20 - /* 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) =20 /* Enter compatibility mode. */ @@ -172,7 +170,7 @@ compatibility_mode: .align 4 compat_mode_gdt_desc: .word .Lcompat_mode_gdt_end - compat_mode_gdt -1 - .quad 0x0000000000000000 /* set in call_32_bit above */ + .quad . - kexec_reloc /* Relocated before use */ =20 .type compat_mode_gdt_desc, @object .size compat_mode_gdt_desc, . - compat_mode_gdt_desc --=20 2.30.2 From nobody Fri May 10 12:18:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1676656172; cv=none; d=zohomail.com; s=zohoarc; b=niYjIBbIxJPbCFQiEAiFOWcjJ5wtBZnsM91IlIsxRJXj7oCXAM7BULD94lBTCzuCDQ0jPx8DsLtHayhl3IiuPphdxHlKRKzNwdhEpsI6owIiKIFvpyLMoypMDjNBpyf/vxsASpNYJCQu7FNOk6B2MtxUczYf1iZbIDIXCskRuNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676656172; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0NIWWVlKmfFGWoxNfAz5kxo9idQbtcMAD6qZ0TXarhk=; b=TWtuFT6pKblih2VALtDQ7PjpTZfhynof3M0+5DsesYxxE8bAtWitxebROY5Ebs49sWbFYO5y4bvYLyLjMFeudRi0DIweDW24O0tHV3QxcKcHoNCWBh4B8Z+EBaZevAUrEdMOLx6VTB68ZIDOi/ymz1WjEt9WGPsztz5si6euXDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1676656172416502.65645593454974; Fri, 17 Feb 2023 09:49:32 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.497213.768102 (Exim 4.92) (envelope-from ) id 1pT4qd-0002s6-E1; Fri, 17 Feb 2023 17:48:39 +0000 Received: by outflank-mailman (output) from mailman id 497213.768102; Fri, 17 Feb 2023 17:48:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qd-0002rz-AR; Fri, 17 Feb 2023 17:48:39 +0000 Received: by outflank-mailman (input) for mailman id 497213; Fri, 17 Feb 2023 17:48:38 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pT4qc-0002rh-E7 for xen-devel@lists.xenproject.org; Fri, 17 Feb 2023 17:48:38 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4c015a78-aeeb-11ed-933d-83870f6b2ba8; Fri, 17 Feb 2023 18:48:35 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4c015a78-aeeb-11ed-933d-83870f6b2ba8 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1676656115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pQkR+t2gNbGqRxj7fNmsb+K2rgz5dHlSLHWFbF6Ydbw=; b=B9EhBZtg13lP1HYjlI50/jpjSxhHBocxQpB5dq62keTMAI01I89nJ23y tPd6OHMGd5jx0+ZPOYT/fBQYKkS0XDOjcWvTWn1DUZCEfg/p4BQe6zDsb n2WBckDPE3PTBLyit56nYuQWKvJFDi+Tks7gS8CD9kvprcaNeFEeBM3ud 8=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 96897979 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data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yNq b53bpLaoyizpcWiOkE7B6ZPdwFVRZX6bLiqw/FqmhmreVY3RjhxU6WKntvMueVNxsxoqwsBx VnlMmcw9bY1rSevxdmiApy7VI7SYA== IronPort-HdrOrdr: A9a23:1N5Kzao2CEnA+oDbgt0Dg3oaV5oUeYIsimQD101hICG9vPbo7v xG/c5rrSMc7Qx6ZJhOo6HkBEDtewK/yXcx2/hzAV7AZmjbUQmTXeVfBOLZqlWKJ8S9zI5gPM xbAs9D4bPLfD5HZAXBjDVQ0exM/DBKys+VbC7loUtQcQ== X-IronPort-AV: E=Sophos;i="5.97,306,1669093200"; d="scan'208";a="96897979" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 3/3] x86/kexec: Annotate functions with ELF metadata Date: Fri, 17 Feb 2023 17:48:14 +0000 Message-ID: <20230217174814.1006961-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230217174814.1006961-1-andrew.cooper3@citrix.com> References: <20230217174814.1006961-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1676656174150100005 All of kexec_reloc(), relocate_pages() and compatibility_mode() are function-like. Annotate them appropriately. Furthermore, move the data into a different cacheline from the code, so the relocation of compat_mode_gdt_desc doesn't trigger self-modifying safety lo= gic in the pipeline. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/x86_64/kexec_reloc.S | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/x86_64/kexec_reloc.S b/xen/arch/x86/x86_64/kexec_= reloc.S index a81f64146190..c7fc11fa5868 100644 --- a/xen/arch/x86/x86_64/kexec_reloc.S +++ b/xen/arch/x86/x86_64/kexec_reloc.S @@ -13,6 +13,7 @@ =20 .file __FILE__ =20 +#include #include =20 #include @@ -90,7 +91,10 @@ ENTRY(kexec_reloc) push %rax lretq =20 -relocate_pages: + .type kexec_reloc, @function + .size kexec_reloc, . - kexec_reloc + +ENTRY(relocate_pages) /* %rdi - indirection page maddr */ pushq %rbx =20 @@ -137,9 +141,12 @@ relocate_pages: popq %rbx ret =20 + .type relocate_pages, @function + .size relocate_pages, . - relocate_pages + .code32 =20 -compatibility_mode: +ENTRY(compatibility_mode) /* Setup some sane segments. */ movl $0x0008, %eax movl %eax, %ds @@ -167,7 +174,14 @@ compatibility_mode: call *%ebp ud2 =20 - .align 4 + .type compatibility_mode, @function + .size compatibility_mode, . - compatibility_mode + + /* + * Ensure data is in a different cache line to code. + */ + .align SMP_CACHE_BYTES, 0 + compat_mode_gdt_desc: .word .Lcompat_mode_gdt_end - compat_mode_gdt -1 .quad . - kexec_reloc /* Relocated before use */ --=20 2.30.2