From nobody Fri Mar 29 09:27:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560337606; cv=none; d=zoho.com; s=zohoarc; b=FKet9zbyq1w7q0aIQwd0JYONO26hoxu+B6WxKFHSQ3mjQlWblIQk72zAx6SgQL4PmZHSC3cg6bMJ54VTF5NhldUw7q9KnwWczPDGOJ+LvuIvwDqzxeAj6NzAOEygFTTxVYdwx2F7E2R2ODl4jy1yq0nNuYrCoj9EMg+McAuBmyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560337606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=ii6iQTd/WQ64s2LYic2eMQKDmaRhefXvlCnIn2KbvTI=; b=k0fGJur97dnj7g/c32l+gS94rI7iminSMaAYxIehmU7ri4L9yyV6V3Qk1IEBszKF1MXu/dlaeA2sFDd97KO8fnb5MonyqMofJByITurxBBPSIF/jFVIgvuz3mTDtzEgW3sKhVFQe0gku+f7HbmePHH/mzujEaj273dig+y+s5dA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560337606498594.6944033875963; Wed, 12 Jun 2019 04:06:46 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hb14B-0005EJ-5K; Wed, 12 Jun 2019 11:05:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hb14A-0005EE-Bp for xen-devel@lists.xenproject.org; Wed, 12 Jun 2019 11:05:18 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f54b229a-8d01-11e9-8980-bc764e045a96; Wed, 12 Jun 2019 11:05:16 +0000 (UTC) X-Inumbo-ID: f54b229a-8d01-11e9-8980-bc764e045a96 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 8pY/9z/w/t5F9VEZ4EWJ3QS/Qy7+Slthcfe+AH7LUadMI1YbFEQNFjdn6/549aYpfa5zj4dTYW GkQkitqJE4lcOrt+NZqPoTx4u0trQM0hJJe5jE2BDu+pCqj0Yy9mMV+Os0C2W2NEAK9MnbfpLA xs8iGgxpMkUUI3ND/to+C8B4yVGIjPW+npB+qRHqzAETx1k9VDigV5zGXmNYnSLI5pePVAJPTZ 4v2BjqQ85UAG1dHAugBpN6Zkx78qxbkW2y9NV+NkkLCxjTQDRjzkkkqOXXJCAPmwgamEcKhE3Y d3k= X-SBRS: 2.7 X-MesageID: 1641817 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,365,1557201600"; d="scan'208";a="1641817" From: Andrew Cooper To: Xen-devel Date: Wed, 12 Jun 2019 12:05:13 +0100 Message-ID: <1560337513-6958-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/boot: Drop vestigial support for pre-SIPI APICs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , David Woodhouse , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The current code in do_boot_cpu() makes a CMOS write (even in the case of an FADT reduced hardware configuration) and two writes into the BDA for the start_eip segment and offset. BDA 0x67 and 0x69 hail from the days of the DOS and the 286, when IBM put together the fast way to return from Protected mode back to Real mode (via a deliberate triple fault). This vector, when set, redirects the early boot logic back into OS control. It is also used by early MP systems, before the Startup IPI message became standard, which in practice was before Local APICs became integrated into C= PU cores. Support for non-integrated APICs was dropped in c/s 7b0007af "xen/x86: Remo= ve APIC_INTEGRATED() checks" because there are no 64-bit capable systems witho= ut them. Therefore, drop smpboot_{setup,restore}_warm_reset_vector(). Dropping smpboot_setup_warm_reset_vector() also lets us drop TRAMPOLINE_{HIGH,LOW}, which lets us drop mach_wakecpu.h entirely. The fin= al function in smpboot_hooks.h is smpboot_setup_io_apic() and has a single caller, so expand it inline and delete smpboot_hooks.h as well. This removes all reliance on CMOS and the BDA from the AP boot path, which = is especially of interest on reduced_hardware boots and EFI systems. Reported-by: David Woodhouse Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: David Woodhouse This has involved several months of on-and-off code archeology. It turns o= ut that details of how the 486-era MP systems booted are feindishly difficult = to locate. --- xen/arch/x86/smpboot.c | 11 +----- xen/include/asm-x86/mach-default/mach_wakecpu.h | 12 ------ xen/include/asm-x86/mach-default/smpboot_hooks.h | 47 --------------------= ---- 3 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 xen/include/asm-x86/mach-default/mach_wakecpu.h delete mode 100644 xen/include/asm-x86/mach-default/smpboot_hooks.h diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 274865a..730fe14 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -46,8 +46,6 @@ #include #include #include -#include -#include =20 #define setup_trampoline() (bootsym_phys(trampoline_realmode_entry)) =20 @@ -565,10 +563,6 @@ static int do_boot_cpu(int apicid, int cpu) =20 set_cpu_state(CPU_STATE_INIT); =20 - Dprintk("Setting warm reset code and vector.\n"); - - smpboot_setup_warm_reset_vector(start_eip); - /* Starting actual IPI sequence... */ if ( !tboot_in_measured_env() || tboot_wake_ap(apicid, start_eip) ) boot_error =3D wakeup_secondary_cpu(apicid, start_eip); @@ -623,8 +617,6 @@ static int do_boot_cpu(int apicid, int cpu) bootsym(trampoline_cpu_started) =3D 0; smp_mb(); =20 - smpboot_restore_warm_reset_vector(); - return rc; } =20 @@ -1162,7 +1154,8 @@ void __init smp_prepare_cpus(void) connect_bsp_APIC(); setup_local_APIC(); =20 - smpboot_setup_io_apic(); + if ( !skip_ioapic_setup && nr_ioapics ) + setup_IO_APIC(); =20 setup_boot_APIC_clock(); } diff --git a/xen/include/asm-x86/mach-default/mach_wakecpu.h b/xen/include/= asm-x86/mach-default/mach_wakecpu.h deleted file mode 100644 index 32555e1..0000000 --- a/xen/include/asm-x86/mach-default/mach_wakecpu.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __ASM_MACH_WAKECPU_H -#define __ASM_MACH_WAKECPU_H - -/*=20 - * This file copes with machines that wakeup secondary CPUs by the - * INIT, INIT, STARTUP sequence. - */ - -#define TRAMPOLINE_LOW maddr_to_virt(0x467) -#define TRAMPOLINE_HIGH maddr_to_virt(0x469) - -#endif /* __ASM_MACH_WAKECPU_H */ diff --git a/xen/include/asm-x86/mach-default/smpboot_hooks.h b/xen/include= /asm-x86/mach-default/smpboot_hooks.h deleted file mode 100644 index 14e1ee5..0000000 --- a/xen/include/asm-x86/mach-default/smpboot_hooks.h +++ /dev/null @@ -1,47 +0,0 @@ -/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws - * which needs to alter them. */ - -static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) -{ - unsigned long flags; - - spin_lock_irqsave(&rtc_lock, flags); - CMOS_WRITE(0xa, 0xf); - spin_unlock_irqrestore(&rtc_lock, flags); - flush_tlb_local(); - Dprintk("1.\n"); - *((volatile unsigned short *) TRAMPOLINE_HIGH) =3D start_eip >> 4; - Dprintk("2.\n"); - *((volatile unsigned short *) TRAMPOLINE_LOW) =3D start_eip & 0xf; - Dprintk("3.\n"); -} - -static inline void smpboot_restore_warm_reset_vector(void) -{ - unsigned long flags; - - /* - * Install writable page 0 entry to set BIOS data area. - */ - flush_tlb_local(); - - /* - * Paranoid: Set warm reset code and vector here back - * to default values. - */ - spin_lock_irqsave(&rtc_lock, flags); - CMOS_WRITE(0, 0xf); - spin_unlock_irqrestore(&rtc_lock, flags); - - *((volatile int *) maddr_to_virt(0x467)) =3D 0; -} - -static inline void smpboot_setup_io_apic(void) -{ - /* - * Here we can be sure that there is an IO-APIC in the system. Let's - * go and set it up: - */ - if (!skip_ioapic_setup && nr_ioapics) - setup_IO_APIC(); -} --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel