From patchwork Tue Jan 30 18:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126296 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3597987ljd; Tue, 30 Jan 2018 10:22:56 -0800 (PST) X-Google-Smtp-Source: AH8x225hqBgRNH8eICWDDiCab9BmimSsdqQl4EAdbb0vNQCJx6M7022aWlT/l0d0FI2pz0BXGmRB X-Received: by 10.36.129.130 with SMTP id q124mr31633346itd.24.1517336576237; Tue, 30 Jan 2018 10:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517336576; cv=none; d=google.com; s=arc-20160816; b=e1cUf6Ak++CWdYZ5tCKv+RjDSs0BMjmigeoLAwAov5RO1n8jEALVPBlhT/oyNkbgFL aK4qdJBesIlXIfA7gvzM2S2BJh5qGqOlOzq8cdaeKRwgLtR/McHHVLa/YO80OzjeRbyi i7jj6G89o04oW/5yru+Yk1AWrx8gGGtOtSFn2r16ZhIOlqaGPWtPyDpmR3TzrE965fqK Xt4TgSiw5ClcQJtTzlr6n4xeue8/DnZGNOCQwqUiNXWD3hxvzRVyNaqKCtWWdPuRM/tt 90CCHguXO/BsrLxn3/k+aZIATWQ2udSasDLER8Tdvh3j1u2f/AqsvAEOx5wXM7osMXYF U0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=cTLy14IltHgsOp0JFQX4iOhA0AH4Rl4va/ghiNcUI2E=; b=q0KrZjXWLfea4v5h/Srpju7uuao5kTkXoO99H1xmWJqwrkVAUoMLv0Ydj9JnPH/wnq kHGmcxVLXqWv8r7w+TYr8ddld+4RCbw6R7GfTVyIo+yPHoArGmsH5Lto9iwstJs+DLv4 MBUgPWJs/37dwAuUmBwtdvCRqmYhfy9o3e/Ui//fosMtobhvAami4uUBqBFSO1zwWB9p tEEzXLwPmW+l8ymZiTmrtSWEjT3o7+b2HYAoqiEeHpZzhhu+VPa5Tv86e26FXMpsK/OZ ChcNEdnGhpNKJScZKOIiqWsiCfx9yCowy3IzShxIdhwHjx2vw2kMUaXFSJmfE55YMdSU 4B7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 198si285221itj.108.2018.01.30.10.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 10:22:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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.84_2) (envelope-from ) id 1egaUm-0002qX-7H; Tue, 30 Jan 2018 18:19:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egaUk-0002qK-Ns for xen-devel@lists.xen.org; Tue, 30 Jan 2018 18:18:58 +0000 X-Inumbo-ID: 156c07a3-05ea-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 156c07a3-05ea-11e8-b9b1-635ca7ef6cff; Tue, 30 Jan 2018 18:19:17 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6433D1529; Tue, 30 Jan 2018 10:18:50 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 774163F25C; Tue, 30 Jan 2018 10:18:49 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 30 Jan 2018 18:18:39 +0000 Message-Id: <20180130181840.5068-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Cc: Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH] xen/arm: Park CPUs with a MIDR different from the boot CPU. X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure. This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs. For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE. [1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html Signed-off-by: Julien Grall --- We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs. --- xen/arch/arm/smpboot.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 1255185a9c..2c2815f9ee 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset, init_traps(); + /* + * Currently Xen assumes the platform has only one kind of CPUs. + * This assumption does not hold on big.LITTLE platform and may + * result to unstability. Better to park them for now. + * + * TODO: Add big.LITTLE support. + */ + if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits ) + { + printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n", + smp_processor_id(), current_cpu_data.midr.bits, + boot_cpu_data.midr.bits); + stop_cpu(); + } + mmu_init_secondary_cpu(); gic_init_secondary_cpu();