From patchwork Fri Feb 23 16:47:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129469 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp814233lja; Fri, 23 Feb 2018 08:50:25 -0800 (PST) X-Google-Smtp-Source: AG47ELsy/hPtMTyH1oJN2mPiOQyK8Qj6YcAPwtfjXQhGN/bE9Re6Thzm2QZuXTeppUHSyQFmXQiy X-Received: by 10.36.87.197 with SMTP id u188mr2988763ita.87.1519404624921; Fri, 23 Feb 2018 08:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519404624; cv=none; d=google.com; s=arc-20160816; b=aR0BF6OxLZNLVO4h7aHtIKqQKletKUORuCXS26F/mCxQz2yeoZS5QSYPqKtSXlEMh1 uogt3gPCMciObdyTsG/PYPK8zbZcafXffinACAy0YfVjHQAxCRYSpoelu/SgEAvskFll t3NjIfIyrneUwYY6zQZOBo1UtvoqAPS11/3qWuEExdXfUCxBFx5/p4ABwTolh9v4XtID S6N0Z1R4UTWn/PARXYjIidglyKGg+wkddgt8q49mSBLOKr98rnBjZ4Xk7Ebtj0Qdp2er a7PqgOqa+L8hibdDZSILXYgpKsfuI0crF+yzx2snpsk9L+VCLZYi77ebjsCrkhr2s0vY ckkg== 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=/0rIio5QeCp+glGttn2kDs0K0F87RArvWiZ4b3I3FXU=; b=uuVTXAkVJKEqcrBF4roJoX53wfpIfjZ3fi1xeTEMh1yd9/EZo+bZoaHuWGvJ0I8Sva 0lyeidEB8tGPeBRQaeYHW8llpf8d5HDDN2MmQCZR8ZwL+PJYXI1sNlMAFRaew0nwOIhl UNh8we4q8pyEQ7i2a6Nn9Zy64vvl+34Dwee6Lws+4v3LVaPt3hMdK+Nbnxq2rEQJ1tPg KfglOLoRbe0rDDzZQmlFpRoNaYRfaOFOnRUA5d+Gxj6lKXtj1yVZr0wupSUN1SIZikFm UeTOx4Pbr7Ekf32rcy+KkDNOrgacnDBwynfBT/0Zckyfo3XmQd4QT3soFc2wDrMrchWP nPKA== 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 i4si1412534ite.158.2018.02.23.08.50.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 08:50:24 -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 1epGWU-0003t3-Jb; Fri, 23 Feb 2018 16:48:38 +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 1epGWT-0003ju-0F for xen-devel@lists.xen.org; Fri, 23 Feb 2018 16:48:37 +0000 X-Inumbo-ID: 9e2a5c61-18b9-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 9e2a5c61-18b9-11e8-b9b1-635ca7ef6cff; Fri, 23 Feb 2018 16:50: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 7DB6C15AD; Fri, 23 Feb 2018 08:48:30 -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 48F493F25C; Fri, 23 Feb 2018 08:48:29 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 16:47:52 +0000 Message-Id: <20180223164753.27311-19-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223164753.27311-1-julien.grall@arm.com> References: <20180223164753.27311-1-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, mirela.simonovic@aggios.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v4 18/19] xen/arm: vpsci: Introduce and use PSCI_INVALID_ADDRESS 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" PSCI 1.0 added the error return PSCI_INVALID_ADDRESS. It is used to indicate the entry point address is known to be invalid. In Xen case, this error could be returned when a 64-bit vCPU is using a Thumb entry address. For PSCI 0.1 implementation, return PSCI_INVALID_PARAMETERS instead. Suggested-by: mirela.simonovic@aggios.com Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini Cc: mirela.simonovic@aggios.com --- Changes in v4: - Add Stefano's reviewed-by Changes in v3: - Patch added --- xen/arch/arm/vpsci.c | 10 +++++++--- xen/include/asm-arm/psci.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c index 9a082aa6ee..1729f7071e 100644 --- a/xen/arch/arm/vpsci.c +++ b/xen/arch/arm/vpsci.c @@ -38,7 +38,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point, /* THUMB set is not allowed with 64-bit domain */ if ( is_64bit_domain(d) && is_thumb ) - return PSCI_INVALID_PARAMETERS; + return PSCI_INVALID_ADDRESS; if ( !test_bit(_VPF_down, &v->pause_flags) ) return PSCI_ALREADY_ON; @@ -99,10 +99,14 @@ static int32_t do_psci_cpu_on(uint32_t vcpuid, register_t entry_point) ret = do_common_cpu_on(vcpuid, entry_point, 0); /* - * PSCI 0.1 does not define the return code PSCI_ALREADY_ON. + * PSCI 0.1 does not define the return codes PSCI_ALREADY_ON and + * PSCI_INVALID_ADDRESS. * Instead, return PSCI_INVALID_PARAMETERS. */ - return (ret == PSCI_ALREADY_ON) ? PSCI_INVALID_PARAMETERS : ret; + if ( ret == PSCI_ALREADY_ON || ret == PSCI_INVALID_ADDRESS ) + ret = PSCI_INVALID_PARAMETERS; + + return ret; } static int32_t do_psci_cpu_off(uint32_t power_state) diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h index e2629eed01..9ac820e94a 100644 --- a/xen/include/asm-arm/psci.h +++ b/xen/include/asm-arm/psci.h @@ -13,6 +13,7 @@ #define PSCI_INTERNAL_FAILURE -6 #define PSCI_NOT_PRESENT -7 #define PSCI_DISABLED -8 +#define PSCI_INVALID_ADDRESS -9 /* availability of PSCI on the host for SMP bringup */ extern uint32_t psci_ver;