From patchwork Fri Jan 31 17:49:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11360321 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 6AE2092A for ; Fri, 31 Jan 2020 17:50:47 +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 458F9206F0 for ; Fri, 31 Jan 2020 17:50:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qY7rrW0y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 458F9206F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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 1ixaQM-0005s4-Su; Fri, 31 Jan 2020 17:49:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ixaQL-0005rn-IG for xen-devel@lists.xenproject.org; Fri, 31 Jan 2020 17:49:45 +0000 X-Inumbo-ID: 0d301422-4452-11ea-ad98-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0d301422-4452-11ea-ad98-bc764e2007e4; Fri, 31 Jan 2020 17:49:39 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id a5so8892727wmb.0 for ; Fri, 31 Jan 2020 09:49:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ukFC00hv0LSjsqkLHJaQ2pzoEWeQaG6eI/AMe7Aox9U=; b=qY7rrW0y+KtfcnTPkFKPLQUp356gelkjDS2iQfTBVrNBzxXmXJOAsgaZa9ZiBpUfib mqiDb/OLZzLUoblYXbPe8SL8RsiwvSpQdOTiUKeB0Oh+ZlwV7hjuFb/Igmg60cJRvyxr pZv2mYe5VvUs4mytYNVHTSj+X7nwdKw5s1hjR1dWf5s8dpQQ67PJLgkngK/9Cv92Gzro 7wrkWkK+Gdi7FnzyzWYxk0t8/5xLLIceW5uAMQQ9G0CgZfQMI+mFGmRQmkzocHOIOw+p /Qa24Mu88IS1B3ixgdO3saRR1+9tOonPrz7XTJcxl3zaPD1xvlgXW27rI/MfX1Hfenzk P4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ukFC00hv0LSjsqkLHJaQ2pzoEWeQaG6eI/AMe7Aox9U=; b=kBiKH8X2qNJlOs8M2yGfUlPAyyRfdir+ezyQV8+NRf8B1B7J4yYOp8a1GYe9o9mQmG 8VcaTymFdRU46Pn/qAzbzCv/c+OTX4YqtDPOX4WlKfoiBT1M0wsfQg59i8eotnlM3ND2 ijbfBeZNvrHzKHMmrSC5PBh8o4u/gggMPwCri5KeXEQSP38m2cw82Q+4yk5RppvVT+mA QZBxM/uLa/KKLf7sdcKrjP7RuyA1mw3RKG3b2oeEyvxcr6ew0sYYvPhY6NBNsUiQDAD9 P2g02cmATTFhr4W9dkfpgE+8jImwEfAp6ss+KZB5Jfs1tjYsxlpVex3DVrlKd7tcmMEw f3ug== X-Gm-Message-State: APjAAAVB4ADlN3GqAWvckORTFvoP66baqb56pFdFte5QGtTaGiTCkJye ymtJBf+hWijyp82tQ91MJRzGNQ0zhJY= X-Google-Smtp-Source: APXvYqwuyZmsavJInbCXnvE8ycz7lQmctHDLiPtR/S/g4V0xekdfLUqCPu3n8w8cvXI8duzu5MjVOw== X-Received: by 2002:a05:600c:20c6:: with SMTP id y6mr13273447wmm.95.1580492978224; Fri, 31 Jan 2020 09:49:38 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id 133sm4364352wmd.5.2020.01.31.09.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2020 09:49:37 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 31 Jan 2020 17:49:21 +0000 Message-Id: <20200131174930.31045-3-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200131174930.31045-1-liuwe@microsoft.com> References: <20200131174930.31045-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v6 02/11] x86/smp: don't online cpu if hypervisor_ap_setup fails 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: Wei Liu , Wei Liu , Andrew Cooper , Paul Durrant , Michael Kelley , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Push hypervisor_ap_setup down to smp_callin. Take the chance to replace xen_guest with cpu_has_hypervisor. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné Reviewed-by: Jan Beulich --- xen/arch/x86/smpboot.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index c9d1ab4423..93b86a09e9 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -199,6 +199,13 @@ static void smp_callin(void) goto halt; } + if ( cpu_has_hypervisor && (rc = hypervisor_ap_setup()) != 0 ) + { + printk("CPU%d: Failed to initialise hypervisor functions. Not coming online.\n", cpu); + cpu_error = rc; + goto halt; + } + if ( (rc = hvm_cpu_up()) != 0 ) { printk("CPU%d: Failed to initialise HVM. Not coming online.\n", cpu); @@ -371,9 +378,6 @@ void start_secondary(void *unused) tsx_init(); /* Needs microcode. May change HLE/RTM feature bits. */ - if ( xen_guest ) - hypervisor_ap_setup(); - smp_callin(); set_cpu_sibling_map(cpu);