{"id":818310,"url":"http://patchwork.ozlabs.org/api/patches/818310/?format=json","web_url":"http://patchwork.ozlabs.org/project/sparclinux/patch/e6fe27e5382d346bcffba3e01356eae939acae20.1506089472.git.khalid.aziz@oracle.com/","project":{"id":10,"url":"http://patchwork.ozlabs.org/api/projects/10/?format=json","name":"Linux SPARC Development ","link_name":"sparclinux","list_id":"sparclinux.vger.kernel.org","list_email":"sparclinux@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<e6fe27e5382d346bcffba3e01356eae939acae20.1506089472.git.khalid.aziz@oracle.com>","list_archive_url":null,"date":"2017-09-25T16:48:55","name":"[v8,4/9] sparc64: Add HV fault type handlers for ADI related faults","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"4b7a042c2b137949cde5614e5eecf9208c12e9cd","submitter":{"id":42386,"url":"http://patchwork.ozlabs.org/api/people/42386/?format=json","name":"Khalid Aziz","email":"khalid.aziz@oracle.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/sparclinux/patch/e6fe27e5382d346bcffba3e01356eae939acae20.1506089472.git.khalid.aziz@oracle.com/mbox/","series":[{"id":4990,"url":"http://patchwork.ozlabs.org/api/series/4990/?format=json","web_url":"http://patchwork.ozlabs.org/project/sparclinux/list/?series=4990","date":"2017-09-25T16:48:55","name":"Application Data Integrity feature introduced by SPARC M7","version":8,"mbox":"http://patchwork.ozlabs.org/series/4990/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818310/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818310/checks/","tags":{},"related":[],"headers":{"Return-Path":"<sparclinux-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=sparclinux-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y198P23Hhz9t3k\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 Sep 2017 02:51:17 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S934229AbdIYQvQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 25 Sep 2017 12:51:16 -0400","from userp1040.oracle.com ([156.151.31.81]:18656 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752558AbdIYQvP (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Mon, 25 Sep 2017 12:51:15 -0400","from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v8PGp7ED018295\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:08 GMT","from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv8PGp7WD015222\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:07 GMT","from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])\n\tby aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id\n\tv8PGp7Q6028504; Mon, 25 Sep 2017 16:51:07 GMT","from concerto.us.oracle.com (/24.9.64.241)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Mon, 25 Sep 2017 09:51:07 -0700"],"From":"Khalid Aziz <khalid.aziz@oracle.com>","To":"davem@davemloft.net, dave.hansen@linux.intel.com","Cc":"Khalid Aziz <khalid.aziz@oracle.com>, rob.gardner@oracle.com,\n\tdan.carpenter@oracle.com, Liam.Howlett@oracle.com,\n\tsteven.sistare@oracle.com, jane.chu@oracle.com,\n\tpaul.gortmaker@windriver.com, sparclinux@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, Khalid Aziz <khalid@gonehiking.org>","Subject":"[PATCH v8 4/9] sparc64: Add HV fault type handlers for ADI related\n\tfaults","Date":"Mon, 25 Sep 2017 10:48:55 -0600","Message-Id":"<e6fe27e5382d346bcffba3e01356eae939acae20.1506089472.git.khalid.aziz@oracle.com>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":["<cover.1506089472.git.khalid.aziz@oracle.com>","<cover.1506089472.git.khalid.aziz@oracle.com>"],"References":["<cover.1506089472.git.khalid.aziz@oracle.com>","<cover.1506089472.git.khalid.aziz@oracle.com>"],"X-Source-IP":"userv0022.oracle.com [156.151.31.74]","Sender":"sparclinux-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<sparclinux.vger.kernel.org>","X-Mailing-List":"sparclinux@vger.kernel.org"},"content":"ADI (Application Data Integrity) feature on M7 and newer processors\nadds new fault types for hypervisor - Invalid ASI and MCD disabled.\nThis patch expands data access exception handler to handle these\nfaults.\n\nSigned-off-by: Khalid Aziz <khalid.aziz@oracle.com>\nCc: Khalid Aziz <khalid@gonehiking.org>\n---\nv7:\n\t- new patch split off from patch 4/4 in v6\n\n arch/sparc/kernel/traps_64.c | 29 ++++++++++++++++++++++++++---\n 1 file changed, 26 insertions(+), 3 deletions(-)","diff":"diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c\nindex 0fe0eed3cecb..7775d011691c 100644\n--- a/arch/sparc/kernel/traps_64.c\n+++ b/arch/sparc/kernel/traps_64.c\n@@ -352,12 +352,35 @@ void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsig\n \t\tregs->tpc &= 0xffffffff;\n \t\tregs->tnpc &= 0xffffffff;\n \t}\n-\tinfo.si_signo = SIGSEGV;\n+\t/* MCD (Memory Corruption Detection) disabled trap (TT=0x19) in HV\n+\t * is vectored thorugh data access exception trap with fault type\n+\t * set to HV_FAULT_TYPE_MCD_DIS. Check for MCD disabled trap.\n+\t * Accessing an address with invalid ASI for the address, for\n+\t * example setting an ADI tag on an address with ASI_MCD_PRIMARY\n+\t * when TTE.mcd is not set for the VA, is also vectored into\n+\t * kerbel by HV as data access exception with fault type set to\n+\t * HV_FAULT_TYPE_INV_ASI.\n+\t */\n \tinfo.si_errno = 0;\n-\tinfo.si_code = SEGV_MAPERR;\n \tinfo.si_addr = (void __user *) addr;\n \tinfo.si_trapno = 0;\n-\tforce_sig_info(SIGSEGV, &info, current);\n+\tswitch (type) {\n+\tcase HV_FAULT_TYPE_INV_ASI:\n+\t\tinfo.si_signo = SIGILL;\n+\t\tinfo.si_code = ILL_ILLADR;\n+\t\tforce_sig_info(SIGILL, &info, current);\n+\t\tbreak;\n+\tcase HV_FAULT_TYPE_MCD_DIS:\n+\t\tinfo.si_signo = SIGSEGV;\n+\t\tinfo.si_code = SEGV_ACCADI;\n+\t\tforce_sig_info(SIGSEGV, &info, current);\n+\t\tbreak;\n+\tdefault:\n+\t\tinfo.si_signo = SIGSEGV;\n+\t\tinfo.si_code = SEGV_MAPERR;\n+\t\tforce_sig_info(SIGSEGV, &info, current);\n+\t\tbreak;\n+\t}\n }\n \n void sun4v_data_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)\n","prefixes":["v8","4/9"]}