[{"id":1767948,"web_url":"http://patchwork.ozlabs.org/comment/1767948/","msgid":"<87o9qeac2s.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-13T14:48:59","subject":"Re: [PATCH v2 06/28] arm64/sve: System register and exception\n\tsyndrome definitions","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Dave Martin <Dave.Martin@arm.com> writes:\n\n> The SVE architecture adds some system registers, ID register fields\n> and a dedicated ESR exception class.\n>\n> This patch adds the appropriate definitions that will be needed by\n> the kernel.\n>\n> Signed-off-by: Dave Martin <Dave.Martin@arm.com>\n> Cc: Alex Bennée <alex.bennee@linaro.org>\n\nReviewed-by: Alex Bennée <alex.bennee@linaro.org>\n\n>\n> ---\n>\n> Changes since v1\n> ----------------\n>\n> Requested by Alex Bennée:\n>\n> * Add comments to clarify CPACR_EL1_ZEN_ELxEN bit meanings.\n> * Add comment clarifying the status of the LEN field expansion bits.\n> ---\n>  arch/arm64/include/asm/esr.h     |  3 ++-\n>  arch/arm64/include/asm/kvm_arm.h |  1 +\n>  arch/arm64/include/asm/sysreg.h  | 21 +++++++++++++++++++++\n>  arch/arm64/kernel/traps.c        |  1 +\n>  4 files changed, 25 insertions(+), 1 deletion(-)\n>\n> diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h\n> index 66ed8b6..014d7d8 100644\n> --- a/arch/arm64/include/asm/esr.h\n> +++ b/arch/arm64/include/asm/esr.h\n> @@ -43,7 +43,8 @@\n>  #define ESR_ELx_EC_HVC64\t(0x16)\n>  #define ESR_ELx_EC_SMC64\t(0x17)\n>  #define ESR_ELx_EC_SYS64\t(0x18)\n> -/* Unallocated EC: 0x19 - 0x1E */\n> +#define ESR_ELx_EC_SVE\t\t(0x19)\n> +/* Unallocated EC: 0x1A - 0x1E */\n>  #define ESR_ELx_EC_IMP_DEF\t(0x1f)\n>  #define ESR_ELx_EC_IABT_LOW\t(0x20)\n>  #define ESR_ELx_EC_IABT_CUR\t(0x21)\n> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h\n> index 61d694c..dbf0537 100644\n> --- a/arch/arm64/include/asm/kvm_arm.h\n> +++ b/arch/arm64/include/asm/kvm_arm.h\n> @@ -185,6 +185,7 @@\n>  #define CPTR_EL2_TCPAC\t(1 << 31)\n>  #define CPTR_EL2_TTA\t(1 << 20)\n>  #define CPTR_EL2_TFP\t(1 << CPTR_EL2_TFP_SHIFT)\n> +#define CPTR_EL2_TZ\t(1 << 8)\n>  #define CPTR_EL2_DEFAULT\t0x000033ff\n>\n>  /* Hyp Debug Configuration Register bits */\n> diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h\n> index 480ecd6..36fe2ae 100644\n> --- a/arch/arm64/include/asm/sysreg.h\n> +++ b/arch/arm64/include/asm/sysreg.h\n> @@ -145,6 +145,7 @@\n>\n>  #define SYS_ID_AA64PFR0_EL1\t\tsys_reg(3, 0, 0, 4, 0)\n>  #define SYS_ID_AA64PFR1_EL1\t\tsys_reg(3, 0, 0, 4, 1)\n> +#define SYS_ID_AA64ZFR0_EL1\t\tsys_reg(3, 0, 0, 4, 4)\n>\n>  #define SYS_ID_AA64DFR0_EL1\t\tsys_reg(3, 0, 0, 5, 0)\n>  #define SYS_ID_AA64DFR1_EL1\t\tsys_reg(3, 0, 0, 5, 1)\n> @@ -163,6 +164,8 @@\n>  #define SYS_ACTLR_EL1\t\t\tsys_reg(3, 0, 1, 0, 1)\n>  #define SYS_CPACR_EL1\t\t\tsys_reg(3, 0, 1, 0, 2)\n>\n> +#define SYS_ZCR_EL1\t\t\tsys_reg(3, 0, 1, 2, 0)\n> +\n>  #define SYS_TTBR0_EL1\t\t\tsys_reg(3, 0, 2, 0, 0)\n>  #define SYS_TTBR1_EL1\t\t\tsys_reg(3, 0, 2, 0, 1)\n>  #define SYS_TCR_EL1\t\t\tsys_reg(3, 0, 2, 0, 2)\n> @@ -253,6 +256,8 @@\n>\n>  #define SYS_PMCCFILTR_EL0\t\tsys_reg (3, 3, 14, 15, 7)\n>\n> +#define SYS_ZCR_EL2\t\t\tsys_reg(3, 4, 1, 2, 0)\n> +\n>  #define SYS_DACR32_EL2\t\t\tsys_reg(3, 4, 3, 0, 0)\n>  #define SYS_IFSR32_EL2\t\t\tsys_reg(3, 4, 5, 0, 1)\n>  #define SYS_FPEXC32_EL2\t\t\tsys_reg(3, 4, 5, 3, 0)\n> @@ -335,6 +340,7 @@\n>  #define ID_AA64ISAR1_DPB_SHIFT\t\t0\n>\n>  /* id_aa64pfr0 */\n> +#define ID_AA64PFR0_SVE_SHIFT\t\t32\n>  #define ID_AA64PFR0_GIC_SHIFT\t\t24\n>  #define ID_AA64PFR0_ASIMD_SHIFT\t\t20\n>  #define ID_AA64PFR0_FP_SHIFT\t\t16\n> @@ -343,6 +349,7 @@\n>  #define ID_AA64PFR0_EL1_SHIFT\t\t4\n>  #define ID_AA64PFR0_EL0_SHIFT\t\t0\n>\n> +#define ID_AA64PFR0_SVE\t\t\t0x1\n>  #define ID_AA64PFR0_FP_NI\t\t0xf\n>  #define ID_AA64PFR0_FP_SUPPORTED\t0x0\n>  #define ID_AA64PFR0_ASIMD_NI\t\t0xf\n> @@ -444,6 +451,20 @@\n>  #endif\n>\n>\n> +/*\n> + * The ZCR_ELx_LEN_* definitions intentionally include bits [8:4] which\n> + * are reserved by the SVE architecture for future expansion of the LEN\n> + * field, with compatible semantics.\n> + */\n> +#define ZCR_ELx_LEN_SHIFT\t0\n> +#define ZCR_ELx_LEN_SIZE\t9\n> +#define ZCR_ELx_LEN_MASK\t0x1ff\n> +\n> +#define CPACR_EL1_ZEN_EL1EN\t(1 << 16) /* enable EL1 access */\n> +#define CPACR_EL1_ZEN_EL0EN\t(1 << 17) /* enable EL0 access, if EL1EN set */\n> +#define CPACR_EL1_ZEN\t\t(CPACR_EL1_ZEN_EL1EN | CPACR_EL1_ZEN_EL0EN)\n> +\n> +\n>  /* Safe value for MPIDR_EL1: Bit31:RES1, Bit30:U:0, Bit24:MT:0 */\n>  #define SYS_MPIDR_SAFE_VAL\t\t(1UL << 31)\n>\n> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c\n> index 5ea4b85..f202932 100644\n> --- a/arch/arm64/kernel/traps.c\n> +++ b/arch/arm64/kernel/traps.c\n> @@ -603,6 +603,7 @@ static const char *esr_class_str[] = {\n>  \t[ESR_ELx_EC_HVC64]\t\t= \"HVC (AArch64)\",\n>  \t[ESR_ELx_EC_SMC64]\t\t= \"SMC (AArch64)\",\n>  \t[ESR_ELx_EC_SYS64]\t\t= \"MSR/MRS (AArch64)\",\n> +\t[ESR_ELx_EC_SVE]\t\t= \"SVE\",\n>  \t[ESR_ELx_EC_IMP_DEF]\t\t= \"EL3 IMP DEF\",\n>  \t[ESR_ELx_EC_IABT_LOW]\t\t= \"IABT (lower EL)\",\n>  \t[ESR_ELx_EC_IABT_CUR]\t\t= \"IABT (current EL)\",\n\n\n--\nAlex Bennée","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"OSPML5Ss\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"bEuog128\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsl1X1gnqz9s76\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 00:49:36 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds8yr-0005W5-7T; Wed, 13 Sep 2017 14:49:33 +0000","from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds8ym-0005TC-L0 for linux-arm-kernel@lists.infradead.org;\n\tWed, 13 Sep 2017 14:49:30 +0000","by mail-wr0-x22a.google.com with SMTP id v109so1081164wrc.1\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tWed, 13 Sep 2017 07:49:02 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\tw82sm1942063wme.5.2017.09.13.07.48.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Sep 2017 07:48:59 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id 64E8B3E01BD;\n\tWed, 13 Sep 2017 15:48:59 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:\n\tIn-reply-to:Subject:To:From:References:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=AXPd1l7j7N0UVSEu/O453EpFbJSSc7feTetCo0hrt8I=;\n\tb=OSPML5SsQbKJ2jxFNsdz2svK3n\n\tVprw3zBX1Qg5tuj2Wl/ucE3+kRZJsTspxgohva5Akctt1lx6mQYlNlVjIqsjPd5YbZhy4Xw97hX6J\n\t6wkP3Ppko6kaYltvrw/WRHXalowXvvo5Rn4Lsbhnmse+3Qm3fyr4LELOg0afLVZR6k71kNoJXpX9u\n\t/pq3hN37pt106Hw7mDeC/L3OXovXTqNDOJoHTVVeTUksaJBt4yNeDsOLBKLIwxZ2UWvc0OPN3+YMj\n\t1e+hHoLgk4RBShDQheL5zh+iQZbMYPR0/qHmqeFAxwXup5UoW0wbG89TiTlS6Ij0het//i9cyYZbX\n\tpgYMQLvg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=FE3xfVnzi54ajW48VxxwuXsT/sbXh2YchgGpDVBWqOU=;\n\tb=bEuog128ihm7Z06dsaI3T3ii7JF2ATgS06WGMGNwdeZNTnf68oWwKM72eOqWrthS7r\n\tGE9gHHvXASnnTPAN9+6lWDBz3LmhPS967xpb52c1so/2ecxM4HStxyXTzmDT6jnFLH87\n\t6qY2kj8j3m0J/rff8JsFFz7AROOTPAohso3ug="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=FE3xfVnzi54ajW48VxxwuXsT/sbXh2YchgGpDVBWqOU=;\n\tb=G5y4Ga/PrASRw3BBchGaohy++/9WkkFFRLttb/s1ojZeMt34fD1pzCyuwMpMWBwxa0\n\tkbgTpE5csObJ4h+TpS17lPBGue9Ai0nKi09kl3qY7/2GmCleou2m1/gVjMLCZI8hbeiW\n\tMv+6+OEhTWSEe1l8C5rPONrQe0XyXrdyey1yAwzAN6/AfV5HgALWwsvrgLAzvxj5cuiK\n\td3Wik0ntGgnRUxIxY5ddcnpW6ijxIFuBHHQYWQ9UDh2cvBMUvLo3H5xDCrTZKk+F5ZdM\n\tiCF/ufOklDLrn5lXPLEcdauqULKrViJuSBSLZxxRjWvUjG70ZPxfUcEcD37UW31z3hhZ\n\tTu7w==","X-Gm-Message-State":"AHPjjUiS+147EXbmFHvbxu8vrWkYGELwdnS4r+e7BSQ3sKdZbtYa3ytM\n\tqIijLfhh6Z8G3qw0yF3DsA==","X-Google-Smtp-Source":"ADKCNb46jA+FnGkd0vnrAXb+y+0eeEG9kyRMy38/eL7pHvOLCEPPZXDsTxi+3U3KDpEZllLcrKWIMg==","X-Received":"by 10.223.164.206 with SMTP id\n\th14mr14953790wrb.221.1505314140703; \n\tWed, 13 Sep 2017 07:49:00 -0700 (PDT)","References":"<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>\n\t<1504198860-12951-7-git-send-email-Dave.Martin@arm.com>","User-agent":"mu4e 0.9.19; emacs 25.2.50.3","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Dave Martin <Dave.Martin@arm.com>","Subject":"Re: [PATCH v2 06/28] arm64/sve: System register and exception\n\tsyndrome definitions","In-reply-to":"<1504198860-12951-7-git-send-email-Dave.Martin@arm.com>","Date":"Wed, 13 Sep 2017 15:48:59 +0100","Message-ID":"<87o9qeac2s.fsf@linaro.org>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170913_074929_018763_45036FC1 ","X-CRM114-Status":"GOOD (  15.06  )","X-Spam-Score":"-2.0 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c0c:0:0:0:22a listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-arch@vger.kernel.org, libc-alpha@sourceware.org,\n\tArd Biesheuvel <ard.biesheuvel@linaro.org>,\n\tSzabolcs Nagy <szabolcs.nagy@arm.com>,\n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will.deacon@arm.com>, \n\tRichard Sandiford <richard.sandiford@arm.com>,\n\tkvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}}]