From patchwork Thu Feb 15 15:02:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 128470 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1847108ljc; Thu, 15 Feb 2018 07:05:53 -0800 (PST) X-Google-Smtp-Source: AH8x2273XtOHk7DwzulABp8T4UptJH8nUdE7Z4YPbVZ8LSKku2Qv8WysBaxqqeYtNQb91OXsY4lD X-Received: by 10.36.39.129 with SMTP id g123mr3535496ita.91.1518707153704; Thu, 15 Feb 2018 07:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518707153; cv=none; d=google.com; s=arc-20160816; b=iEX6qK3KjUD690Kxo8zi1huYXURGnC6+tnVupLFMjn99DfksygEw1UGxXfTYeNsO44 xJNzegeArx8agGSZLfLlgq9bj2ycO4xb1IIaCCFKftUEAkRJNumSz6oCyLCi99s9ArEy nx6Q6W9ONW2Ea5oGM8YMo+jqAWS4G9KUUNlNFcABl3j9sQGHRK39cgNlLcVPP7zqrLi9 5PcSNWeKIT2ug2w4awGoERi+XXAcq8ketCPXupcMBQy0RdWDvS5Densjewz3VKTb7UQ1 bB3LPqD2XSFUSMcxbo+i+vv3FZes7Nsc4NWXiveqAgVopert4Sxy8eeX6jnnpH/LsLNH LsFg== 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=a2cJjh23PDW30aJ2X5AoGwZApoCCEwTJIATcRLYHi5I=; b=zNqwDh8tvP0/m5zIs9wbqnWY4+OCIic8s1trY2A+FNqfbK/S1q1P60Zg/IR4Sz1f5d wB9Hy5gIrfHIlARO9zcr3Otc0zq8+0txcoPSQu3YfeUvBUcv8femDKtcGCdkxeWdxXGc 3+RMYTXgQ20gsjKBoRb8/EApeUzLAU1tuRsHURCM9cz5vl+azmcTYCjJOtQxkXLF/hyH 9n4b9enyNKHm2jmbgvv1h1op47a7PmYCqmE1J+puVUcAjjN4wZ7E8MiB9I4o+OWxVRhr d8XYuxylrlBlRNYQ6jk4WW2OVr8710ZSH3i5LQ0sIY5aiu25/pPVo1D0sazgAfJ5K1tX SuIQ== 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 l6si4615095iog.344.2018.02.15.07.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 07:05:53 -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 1emL4G-0002AK-GW; Thu, 15 Feb 2018 15:03:24 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emL4E-000280-O8 for xen-devel@lists.xen.org; Thu, 15 Feb 2018 15:03:22 +0000 X-Inumbo-ID: 463695b1-1261-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 463695b1-1261-11e8-ba59-bc764e045a96; Thu, 15 Feb 2018 16:02:43 +0100 (CET) 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 E61E515BF; Thu, 15 Feb 2018 07:03:20 -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 B36183F41F; Thu, 15 Feb 2018 07:03:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 15 Feb 2018 15:02:47 +0000 Message-Id: <20180215150248.28922-17-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180215150248.28922-1-julien.grall@arm.com> References: <20180215150248.28922-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 v3 16/17] 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 Cc: mirela.simonovic@aggios.com Reviewed-by: Stefano Stabellini --- 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;