From patchwork Mon Feb 5 13:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126867 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1967470ljc; Mon, 5 Feb 2018 05:22:50 -0800 (PST) X-Google-Smtp-Source: AH8x227AVF2Any2Rev+3L2VxPnXERA1OmFtXJvjhFLo87yQlUe5WiVSGun1K5c9vq3RIpeODY8dW X-Received: by 10.36.41.76 with SMTP id p73mr1487162itp.127.1517836970113; Mon, 05 Feb 2018 05:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517836970; cv=none; d=google.com; s=arc-20160816; b=q0Aal+6Dw9dcULmv0fus/yxOnnPY/CAplHVWOln8fl1SWw/YVF8mYXeT+CtgBNsFNx fIuKDNv9ppaz1BRtX0m0w6+GJhYdidl942Pn7d7R4YMcPhbAj9EfAtsalFxQd2upet4U WvWC+qYLR5PSoHhZApy/R4HG0mq/EjDJrHTostgRnL/x0LIN6adaak0fSXvYna673MLg VmTM2n8KHOCOv45feVUR/wTwBkZL9Lzuvs8Fdalvo4QTbcossaYglRsFuHvhVazyXEcG cp73xqfogBm537RGfGXPx6EhWqWXq/JmweNZvn8/seW/OADXn7LMqW67IZ+VFkajmnQ1 ZwKg== 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:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=cTLy14IltHgsOp0JFQX4iOhA0AH4Rl4va/ghiNcUI2E=; b=X0hYAJIHf9JIdr3c+9d0rLdEEK0gPRsIbgUTLeiUHXmLijs+Ieeqc2Hy0mA7Qz1vdI XUk/qIhNVnDeOriX+dwgjhb1qv2mJE8kBk5c3YMk166eNRtwBwuW4RBz5RqS0dvoiUvX nJqjLEJHb4kRd5IZPz3DXyngY84icBnZbG2jGZODpnK2XsIq/XGVOWZcA0QBwz6dh9lu grtKLr9h+ctWnLtJwpTXeM8/pYqguWwNM/z642Kp1LGPXukSpT1st99MkUlSMTedWD2c JJjQn8/NfRryVDtN0713dYbt0cgfiwChnKMPCZ9Rj8Mq+FWXsMv8poh4Yazxp5gzWmIx zO+Q== 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 i82si4411542ioo.25.2018.02.05.05.22.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Feb 2018 05:22:50 -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 1eighI-0007SM-5L; Mon, 05 Feb 2018 13:20:36 +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 1eighG-0007MF-A1 for xen-devel@lists.xen.org; Mon, 05 Feb 2018 13:20:34 +0000 X-Inumbo-ID: 705381e0-0a77-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 705381e0-0a77-11e8-b9b1-635ca7ef6cff; Mon, 05 Feb 2018 13:21:13 +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 599AE1529; Mon, 5 Feb 2018 05:20:28 -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 6E1A83F24D; Mon, 5 Feb 2018 05:20:27 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 5 Feb 2018 13:20:10 +0000 Message-Id: <20180205132011.27996-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180205132011.27996-1-julien.grall@arm.com> References: <20180205132011.27996-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH 8/9] 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();