From patchwork Wed Jan 29 20:20:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11356783 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 0AB2E159A for ; Wed, 29 Jan 2020 20:22:00 +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 DAA0220716 for ; Wed, 29 Jan 2020 20:21:59 +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="BLGE7OHa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAA0220716 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 1iwtpX-0006Wt-6O; Wed, 29 Jan 2020 20:20:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iwtpV-0006Wd-Ue for xen-devel@lists.xenproject.org; Wed, 29 Jan 2020 20:20:53 +0000 X-Inumbo-ID: d1eddfe4-42d4-11ea-b211-bc764e2007e4 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d1eddfe4-42d4-11ea-b211-bc764e2007e4; Wed, 29 Jan 2020 20:20:41 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id t2so1090251wrr.1 for ; Wed, 29 Jan 2020 12:20:41 -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=/FbJPxpmB5OoBHeLoD4a2Tb0dzwLPZohxRxFGDvz/aM=; b=BLGE7OHaGGUF5ilIbVyBjY9XiiaCmjK4Mfe60MEmj8qbr5cB9EpoYL61G16cSaTvJ5 oIepJoEa3iXy+ti7A3ap+Pnyss7gXd8Z0FOk/F1FQEUX1KIRe2Sf+MnZg6oepsNEneUP +mh3rEUvel9pPv+qgEPl8hvFVmGDfHDKzkdaVays1soHKiL2VwzHHNAh1sjYezYLMzQn CHV+GTZhqbrvFqSAei2qQ60ApcZaIIYALZM3Oyx1UT0CSmM4fpaPyYgM/IE7tZ2dyXsX 50MC+euCeN7fZYXg6BsfXwLJH+aszcBDPeIvtCoV47VTbBDZIRyVz+XSl/pfzVBtSamZ 58Lg== 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=/FbJPxpmB5OoBHeLoD4a2Tb0dzwLPZohxRxFGDvz/aM=; b=P0UWrWOTNEB5VTXTgQfvHLCqtE56AazotW9o9EgbaIwqGu85TQWhGpGVskCtiPjzfc E9KZ1/SdqLnWaMm7TLiUxPtFmwnTni8d4v84OHGzYu8BbRqocrHPo3+iaOGd1YPPFNiw vO0kM9j4x5prC2oUmOdTB4I7CqzIBzY93DZL8so/FC30NZz3OouTpSLwuXa3pRp+jpuY eT7XkHEwn1eCK7EDkBrS9tZ4rqdNzaqwRX5ql61KCWT2jcPGlrnnSO99ag8c+MM4MZTv GrLUlkGLtQAvr4HEbcC6DTvXVuNyAQMigHuxO/hm73PPj6warqbXiy+b7IQh690UBcf/ yctw== X-Gm-Message-State: APjAAAWxscpBrQyKAQ3LQiDptPj2C0Y4ukRZudJBDSKekieL/zSgVBn8 Xl1Ro6j9m86Rhu9CbBE9cDB9rSibbuw= X-Google-Smtp-Source: APXvYqw7egBWkgvJxpUfm4AAiudYV7Ho+QXD1BugIAlILurcy88HxFWc1wrKRwjq7XeXsnzXIDy0Gw== X-Received: by 2002:adf:f58a:: with SMTP id f10mr633206wro.105.1580329240578; Wed, 29 Jan 2020 12:20:40 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id a22sm3564115wmd.20.2020.01.29.12.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 12:20:40 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Wed, 29 Jan 2020 20:20:25 +0000 Message-Id: <20200129202034.15052-4-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200129202034.15052-1-liuwe@microsoft.com> References: <20200129202034.15052-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 03/12] 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);