From patchwork Fri Feb 23 18:57:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129480 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp984493edc; Fri, 23 Feb 2018 10:59:35 -0800 (PST) X-Google-Smtp-Source: AG47ELsdiHf8xyqhbmGP7W1QmzmESYeRIIRG1YytE18L+bujPljoLB7i8JDlafuZZwFHS2YyBKvQ X-Received: by 10.36.67.1 with SMTP id s1mr3715491itb.145.1519412375315; Fri, 23 Feb 2018 10:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412375; cv=none; d=google.com; s=arc-20160816; b=F61zWb8xJXYykgm795AO3tqRmjlOmwpEox6tOHN8iXfQttd03/zfbAQAye79Q8tVUZ 6Gwt/IEVYubwq4BIaSHwvIEdD3qmVppd2B8vjnTgJ8XuE0xXHpYfkX/7JG5DTL7iqt42 hFTmTSAxbdO6Kr1zmFVII7jiMbFPLT/fM93N0gqlugmLs9rMaPcKdU2OlEE78cpf6zvy RODTOAOFhDLtJdEnNc3l6wOGWw7jaCUm3yqTPyGMjpHL9YVkRgbJVGy6auCqpXxrOQVA bCwHuolYAGmZec/xhZmedm5qwMtm1y4OlYUK4LRNYWjvNvQvP4JRGw8MbwsFOATKka78 mcHw== 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=qhqHsg56NQpAFhCdGQUTXZTa24gl2H32RXQPVMz6wjwmXSgjCOcjPFNYoa2Mb5p8C7 6sujM0xDawkchGGmq3j8jg+1d+t1oH3lwDO9/vVlDBih6Ygmc3NGz7jE2L2saBYQzBhm 7zRAbE3mtv/SACtQaQASBbmMWeulPKBfOuVKpu3KyXj5fE1lq1hG88d4R7iIVYfSZWH/ M/QqWwsDOx5ieIEP+2TQD3STpRx0pr7F+2/k6cS4brhUrmmsQPe8QLgxeRAw9LQwj+Oy u4Od8mlSMRhbaeHV8g7+GTjhG7hzEUjHikyTHm5EAPVXSwwTmmRPqH8AyGzuhgyeBlzM sbVg== 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 f27si2000837ioi.102.2018.02.23.10.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 10:59:35 -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 1epIXo-0003L4-1H; Fri, 23 Feb 2018 18:58:08 +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 1epIXm-0003AJ-Hg for xen-devel@lists.xen.org; Fri, 23 Feb 2018 18:58:06 +0000 X-Inumbo-ID: b5c4229c-18cb-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id b5c4229c-18cb-11e8-b9b1-635ca7ef6cff; Fri, 23 Feb 2018 18:59:44 +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 BA85A15BE; Fri, 23 Feb 2018 10:58:00 -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 87A233F25C; Fri, 23 Feb 2018 10:57:59 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 18:57:28 +0000 Message-Id: <20180223185729.8780-18-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223185729.8780-1-julien.grall@arm.com> References: <20180223185729.8780-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 v5 17/18] 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;