From patchwork Thu Jan 9 19:32:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11326349 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 072D217EE for ; Thu, 9 Jan 2020 19:34:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6CFB2072A for ; Thu, 9 Jan 2020 19:34:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="CaPDE3Xd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6CFB2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdY6-0001tC-6x; Thu, 09 Jan 2020 19:32:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipdY4-0001t6-SV for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 19:32:52 +0000 X-Inumbo-ID: d33f5581-3316-11ea-ba61-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d33f5581-3316-11ea-ba61-12813bfff9fa; Thu, 09 Jan 2020 19:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578598372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4T2bHZMNtQ/+mkzwSgBiDf/wC0cM6a9T4871J62jmJM=; b=CaPDE3Xd7ZBmFrU5g8ZLa3SqZriVJ7a8yDNQgGIFR1sBX1NovRgFnoPf 6Mko3tA6vpy1Ah4h4PiNPOdaahm7XllHsGlq8RFx3iqGpNeef5nur8S2I S3c5dqSdMc5tlT3sOZWeC4mK2eiBO0Iho2658+7X5IJbvH7XpoucCi4JV I=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ea7VDE+wFYXXqEa5FDWMLxDjTSGYJp7E+faaqdfH+Mi/2H8g7vvlPXB71YT90GgkuEFK/sL+YU w1A9WNafERv03ERYGuO2EEnHRSPd1dw8jk04Hhe3Ecoi7IPsnXWRL/nTrH0SPiPvG462YpTxM3 AiZa1+BdSD/Ngs3e7UIZNXdaX006GIwPoTHh/pdcymJpTDg1yJL/zLDdgqWvujHTd7eztGtRzR 799vfT/dRdk7VCHoDAyhUmqL9omRU3CmBbjxVQhQR0T2ibLesOwPG+ULPtjkuSvMuQKRwq3zB+ 1+g= X-SBRS: 2.7 X-MesageID: 11295601 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,414,1571716800"; d="scan'208";a="11295601" From: Andrew Cooper To: Xen-devel Date: Thu, 9 Jan 2020 19:32:41 +0000 Message-ID: <20200109193241.14542-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109193241.14542-1-andrew.cooper3@citrix.com> References: <20200109193241.14542-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 4/4] x86/boot: Drop INVALID_VCPU 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 , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now that NULL will fault at boot, there is no need for a special constant to signify "current not set up yet". Since c/s fae249d23413 "x86/boot: Rationalise stack handling during early boot", the BSP cpu_info block is now consistently zero, so drop the adjacent re-zeroing. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné v2: * Drop re-zeroign of the cpu_info block --- xen/arch/x86/cpu/mcheck/mce.c | 2 +- xen/arch/x86/domain_page.c | 2 +- xen/arch/x86/setup.c | 3 --- xen/arch/x86/tboot.c | 2 +- xen/include/asm-x86/setup.h | 3 --- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 29f3f9c5e3..198595ff97 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -260,7 +260,7 @@ static int mca_init_global(uint32_t flags, struct mcinfo_global *mig) &mig->mc_coreid, &mig->mc_core_threadid, &mig->mc_apicid, NULL, NULL, NULL); - if ( curr != INVALID_VCPU ) + if ( curr ) { mig->mc_domid = curr->domain->domain_id; mig->mc_vcpuid = curr->vcpu_id; diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 4a07cfb18e..dd32712d2f 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -29,7 +29,7 @@ static inline struct vcpu *mapcache_current_vcpu(void) * When current isn't properly set up yet, this is equivalent to * running in an idle vCPU (callers must check for NULL). */ - if ( v == INVALID_VCPU ) + if ( !v ) return NULL; /* diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 62adc9e2a8..1b6ca4a47d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -707,9 +707,6 @@ void __init noreturn __start_xen(unsigned long mbi_p) /* Critical region without IDT or TSS. Any fault is deadly! */ - set_processor_id(0); - set_current(INVALID_VCPU); /* debug sanity. */ - idle_vcpu[0] = current; init_shadow_spec_ctrl_state(); percpu_init_areas(); diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index 3e828fe204..5020c4ad49 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -392,7 +392,7 @@ void tboot_shutdown(uint32_t shutdown_type) * During early boot, we can be called by panic before idle_vcpu[0] is * setup, but in that case we don't need to change page tables. */ - if ( idle_vcpu[0] != INVALID_VCPU ) + if ( idle_vcpu[0] ) write_ptbase(idle_vcpu[0]); ((void(*)(void))(unsigned long)g_tboot_shared->shutdown_entry)(); diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 861d46d6ac..28257bc5c8 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -4,9 +4,6 @@ #include #include -/* vCPU pointer used prior to there being a valid one around */ -#define INVALID_VCPU ((struct vcpu *)0xccccccccccccc000UL) - extern const char __2M_text_start[], __2M_text_end[]; extern const char __2M_rodata_start[], __2M_rodata_end[]; extern char __2M_init_start[], __2M_init_end[];