From patchwork Sat Dec 3 03:03:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13063406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E21D4C4321E for ; Sat, 3 Dec 2022 03:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oCAqiGvCQ7qUg1QhaKVn4+U1Fww8tvOy7nvlKwQcakY=; b=Bz5XzuEVefx0Xl 3N1N1zs/Owa/+a+lQBSuo+UHHE+NPiYuN9UrJ6BVjvg42lHKL67RGsHAXu/prjLFFq30R0YwzDbFJ rUUXEsxfh8LfckIcUM/YDV4MtsOvdD8KQZfEXgNv3VcNX0n2P4rqTNFeRnDt3z54TqKMPrZjzBXZw 3s1l8EqGb4blvLr1F/Ic6B/3slF7KKEglHfPx+8NU18R0l3sWBAU2vCDZlEucwpc9kT1fSMtExbVx O9TM9lbtCG0d4t6SdSIl0ldWvDWov9VfwYxwVdY6TQ0gNjLzXdcaPN5woGUCnCQgSgtmguv43AhF8 RK9fselpwZiBsGpskrdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Ir5-002Ary-IA; Sat, 03 Dec 2022 03:06:19 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1IqZ-002AdW-4E for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 03:05:48 +0000 Received: by mail-pl1-x633.google.com with SMTP id s7so6285512plk.5 for ; Fri, 02 Dec 2022 19:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:from:to:cc:subject:date :message-id:reply-to; bh=0od2UA8BjfVP9H3ox8w77ADIivJIw8By1NOK2zw+FrE=; b=KE60HFRJtajGozkhN1G07j7c4EziYG6716Pa6R9qKsnbLrhO3hCPHcTangQUHJQ3GY X2rbnjn7S4+RLLyhk83PlpuLOfyJhKoBVtlxnkZuvLLT1Dy0XXbzHJO+Zb1syJAyiJwK 1HzKJ8H9/hEF3GYwFmyWk0Q0HJt299gtgQDCfvuWmd4WQ04k7q85X+2UiGbQp6C3N8eC JB+LwQRi4zg/FQlDJbAjSfuyM8ImcVmPJAoCvFAWZxvGbIfyu5saspnbFUHqAR9GovKz bu7+YMpT1y/VmhmBNOg6RXvDyiXtw3R2OK3M9Gt60B1+AIpI/MivGoMygnXM/C8pBqnw RD8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0od2UA8BjfVP9H3ox8w77ADIivJIw8By1NOK2zw+FrE=; b=oP6MfHZz5Hmyvh4zJiOqIUCeGoGnhbvmrzFJSxT379ltJeY2DeC9nTFSGoEeHuJCpJ xwU6Qe1atgpQb0acRUi4uzSWLUob2c8Hy1AsBSoohImzlKVGaccvYf4w/9094cTrsngc FGYShNdD6yzbnssjWJ/1E8hBsZbq3DimqXSldUUBTNaDne7functu0i1bWDidp7A/yLk NNjfHLJIA0hHJSsXRb55SKINIfZ5pnnsXwND81SafCw8z9JCZG5r+oMfAdcSPWRji8mY neSRJIMFBF38/c5j3LaiW2HTVujkiWFjBd++sgMM79HhZOmSu4YGo5QSxmjZhX6uV8j+ Uxqw== X-Gm-Message-State: ANoB5pl9Qba2xCk8vhXWNCWozSSPzN3OLeajgMppVU2H2Rva7BtWu2mM Vl7SX30vYMoLLk2elcvxdeq/tA== X-Google-Smtp-Source: AA0mqf7I3UiJ8c0sc3B4EdMW1XbN/zXhNbb6fQTziUJ0tB9x01rO25QtP9NFuONupmrWTY1OWyBuOA== X-Received: by 2002:a17:90a:be02:b0:219:8199:ef57 with SMTP id a2-20020a17090abe0200b002198199ef57mr9335059pjs.129.1670036742753; Fri, 02 Dec 2022 19:05:42 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id y2-20020a17090264c200b001873aa85e1fsm6182904pli.305.2022.12.02.19.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 19:05:42 -0800 (PST) Subject: [PATCH 1/5] mm: Add a leading 0 to the VM_FAULT_* types Date: Fri, 2 Dec 2022 19:03:52 -0800 Message-Id: <20221203030356.3917-2-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221203030356.3917-1-palmer@rivosinc.com> References: <20221203030356.3917-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_190547_293215_AA4E8355 X-CRM114-Status: GOOD ( 10.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The next patch will add enough codes to need another character, this adds the 0 to all the existing codes to keep alignment. Signed-off-by: Palmer Dabbelt --- include/linux/mm_types.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 500e536796ca..758eb70829cb 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -862,24 +862,24 @@ typedef __bitwise unsigned int vm_fault_t; * in DAX) * @VM_FAULT_COMPLETED: ->fault completed, meanwhile mmap lock released * @VM_FAULT_HINDEX_MASK: mask HINDEX value - * + * @VM_FAULT_ARCH_*: Architecture-specific VM fault codes. */ enum vm_fault_reason { - VM_FAULT_OOM = (__force vm_fault_t)0x000001, - VM_FAULT_SIGBUS = (__force vm_fault_t)0x000002, - VM_FAULT_MAJOR = (__force vm_fault_t)0x000004, - VM_FAULT_WRITE = (__force vm_fault_t)0x000008, - VM_FAULT_HWPOISON = (__force vm_fault_t)0x000010, - VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x000020, - VM_FAULT_SIGSEGV = (__force vm_fault_t)0x000040, - VM_FAULT_NOPAGE = (__force vm_fault_t)0x000100, - VM_FAULT_LOCKED = (__force vm_fault_t)0x000200, - VM_FAULT_RETRY = (__force vm_fault_t)0x000400, - VM_FAULT_FALLBACK = (__force vm_fault_t)0x000800, - VM_FAULT_DONE_COW = (__force vm_fault_t)0x001000, - VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x002000, - VM_FAULT_COMPLETED = (__force vm_fault_t)0x004000, - VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x0f0000, + VM_FAULT_OOM = (__force vm_fault_t)0x0000001, + VM_FAULT_SIGBUS = (__force vm_fault_t)0x0000002, + VM_FAULT_MAJOR = (__force vm_fault_t)0x0000004, + VM_FAULT_WRITE = (__force vm_fault_t)0x0000008, + VM_FAULT_HWPOISON = (__force vm_fault_t)0x0000010, + VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x0000020, + VM_FAULT_SIGSEGV = (__force vm_fault_t)0x0000040, + VM_FAULT_NOPAGE = (__force vm_fault_t)0x0000100, + VM_FAULT_LOCKED = (__force vm_fault_t)0x0000200, + VM_FAULT_RETRY = (__force vm_fault_t)0x0000400, + VM_FAULT_FALLBACK = (__force vm_fault_t)0x0000800, + VM_FAULT_DONE_COW = (__force vm_fault_t)0x0001000, + VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x0002000, + VM_FAULT_COMPLETED = (__force vm_fault_t)0x0004000, + VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x00f0000, }; /* Encode hstate index for a hwpoisoned large page */ From patchwork Sat Dec 3 03:03:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13063404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24E4DC4321E for ; Sat, 3 Dec 2022 03:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DcBZw4s01kDCpTLe9uKRaHl97yITzPjpcInGXYAZHlE=; b=gT4sPHnnXBDWi9 XEyah5Mx5B70/rMirHUiHu1GH3jHCtj1Zq6j9VHnQSe1BApFFCUDy5rKd5+46SM8dov7jwLt8KJZj H7HuWE7my5v+F05ERjema/vJttCWePchFHJRXLifyhAXg/pPotzL65COw6C+OKjh/jkkAcmloXqtE NBUsAOnXiKd8MXI0D/HHzTWMzIGZTAO9Z9tDOwgRnMxPLe8frlJkL1zlWXDdUKY9sTqZAoz4JqGOF q0XvskqVYALvBcqKwG/1ecKtfN7hzsMACLqL+F/Tmyw6lxVp0+ek7749saY8FeL8gQHYpJvpPE08M LoJRHVJh67sCWRnkBVHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Iql-002AkF-PS; Sat, 03 Dec 2022 03:05:59 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1IqW-002Adj-Mz for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 03:05:46 +0000 Received: by mail-pj1-x1033.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9974164pjs.4 for ; Fri, 02 Dec 2022 19:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:from:to:cc:subject:date :message-id:reply-to; bh=oUHGCrN2/GzmAYwHPUyKBA8Ge6xsvUhA3e+Vb+bqY68=; b=GTPXNM4I8XSeRWKFJbfehEVG870eOYMF/pKY9yMWeVjzuXAmyGPMV5Nuhgkd2Rpezc s+BSs8uV7IDAeaosxWjvuIEHbnwRyildLgIAk88UrLwNCF86OOw+gvsvp87gvdO7j5yY khg7Alr0W4R4/KHofpJ9D+lLwLem7Qb0wpi6ArvXA+llBKDEm0aE2tH//UDUW/zvNNNy gfVSZqmFmW+aoOXgq4s35qIFSAZ9WmYlvLQAEJEUCLULeQimBikv4W8YGE42LNgyHFBS veDXzJC3LeHh7Nnv4F5UhC6Q9SyzW2T+bBN93Ioth3DJNcJNlGBAnbsRy+dlZx3PTjOZ 6m8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oUHGCrN2/GzmAYwHPUyKBA8Ge6xsvUhA3e+Vb+bqY68=; b=el/ShQUvc/w0lRAnwatREly1KICGNNkEdJKeiVu3LGxo9SYMCjkTKtxbWy40NLh3IZ akl2Kn4dpf/vfGksGl8FP9Ti4pcUFfDtmGaGRHhy2mshLE+4JoUbSQCoI+vTKnArGcBZ OSf8PTf1hl4e5wQBNf83WCZNt8Ru/uTd77X7hhIHbHuE8ws26OIlRQ2ucRWqmcsVj0+N /+XBfHtBCS5nq4H8vYV95RtIWAu9yxT+jPRbR3Bq9rTfdNPDkslFXAA7vecHic5Z7pL2 sZouMhxCtlsLhFD7ThflQYP9sMjhl/avBlV2cfYAlhF19Yy1RDXCUDxP+dOUvZMMDKMF YKmw== X-Gm-Message-State: ANoB5pmI2bh/7m4crT1eO9p9IFZxJ2dbu1grwKvxhZRy8OjP/raOcX/i 4esoWx6NjKNkF6DLsgQ8tl2aiw== X-Google-Smtp-Source: AA0mqf6uIzMwjns2LD/gQeHWIsS+ZDiU1QORTWoif/bzBJr4V+crCrb3KCajLaMXkOYnYMNn1jPFyA== X-Received: by 2002:a17:90b:609:b0:219:3ad9:64f5 with SMTP id gb9-20020a17090b060900b002193ad964f5mr29166277pjb.138.1670036743958; Fri, 02 Dec 2022 19:05:43 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id b2-20020a62a102000000b005745635c5b5sm5713256pff.183.2022.12.02.19.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 19:05:43 -0800 (PST) Subject: [PATCH 2/5] mm: Add VM_FAULT_ARCH_* codes Date: Fri, 2 Dec 2022 19:03:53 -0800 Message-Id: <20221203030356.3917-3-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221203030356.3917-1-palmer@rivosinc.com> References: <20221203030356.3917-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_190544_768894_554A4A2C X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A handful of architectures (arm, s390, and soon RISC-V) define their own internal fault codes, so instead dedicate a few standard codes as being architecture-specific to avoid conflicts. Signed-off-by: Palmer Dabbelt --- include/linux/mm_types.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 758eb70829cb..df1aa8d58444 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -880,6 +880,11 @@ enum vm_fault_reason { VM_FAULT_NEEDDSYNC = (__force vm_fault_t)0x0002000, VM_FAULT_COMPLETED = (__force vm_fault_t)0x0004000, VM_FAULT_HINDEX_MASK = (__force vm_fault_t)0x00f0000, + VM_FAULT_ARCH_0 = (__force vm_fault_t)0x0100000, + VM_FAULT_ARCH_1 = (__force vm_fault_t)0x0200000, + VM_FAULT_ARCH_2 = (__force vm_fault_t)0x0400000, + VM_FAULT_ARCH_3 = (__force vm_fault_t)0x0800000, + VM_FAULT_ARCH_4 = (__force vm_fault_t)0x1000000, }; /* Encode hstate index for a hwpoisoned large page */ @@ -903,7 +908,12 @@ enum vm_fault_reason { { VM_FAULT_RETRY, "RETRY" }, \ { VM_FAULT_FALLBACK, "FALLBACK" }, \ { VM_FAULT_DONE_COW, "DONE_COW" }, \ - { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" } + { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }, \ + { VM_FAULT_ARCH_0, "ARCH_0" }, \ + { VM_FAULT_ARCH_1, "ARCH_1" }, \ + { VM_FAULT_ARCH_2, "ARCH_2" }, \ + { VM_FAULT_ARCH_3, "ARCH_3" }, \ + { VM_FAULT_ARCH_4, "ARCH_4" }, \ struct vm_special_mapping { const char *name; /* The name, e.g. "[vdso]". */ From patchwork Sat Dec 3 03:03:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13063405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1AC08C4321E for ; Sat, 3 Dec 2022 03:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n4gezz6iKH5hIkffNq83LNGgFli8bzSvlxP422vLrLI=; b=vQ51rLCESZWexa X19138JFB/U8mb5lYCnC8P/SM4hT9VtWRkwHLzWZGVjXTQNyCpatIPvecdHR3oZ1uJgfqgi6wUiWL KhnghtXe9Sb6tZLVmOlv5GWLLPWAJV7AHYy62KitLWFgoAUQ+AQ6fYtmcDN7oS06wsWG3iDptP3rN h3tRY/35nGJvO6ghPjepdT2noOxoWOCMo4NrnPmdJE6pf8YtLTiXIdoesMYBH43xhvAmtL8v8OwTb FgSANO+kBvA9M3hEiwge1JmQG1jqVjXcOlZX06h1vQ0YSmePFedCsWEKzIngz0QoQH5GhKM2r6l7D p+y/75W6f0hgMi7pw7mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Iqu-002AnC-2X; Sat, 03 Dec 2022 03:06:08 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1IqX-002AeQ-OJ for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 03:05:47 +0000 Received: by mail-pj1-x1035.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9974185pjs.4 for ; Fri, 02 Dec 2022 19:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:from:to:cc:subject:date :message-id:reply-to; bh=OhR/DvZbp+3vR9eB4A5wFYKGQTjA+LqOJxd/xHKwNw4=; b=KpJKmzUqKuY7RNz1zoEByIJW90y1Livh3n8yRVCtF7Wr2SNUWd5EFqo0EjjNi6loJv TlFuL2eEbd8DZ8FBCGv2ReWj958YzPC2Tt8AZagpgWofFTbPz3N9Aoss5wquaRZv35pt zf534yNV0g0gfKF8Bxz3qsNDzOBS2wJGcO2gP6yGN2p/yU3fATEm0f/qdKSMHwBwAsqk jnSfc+OaPsVevmGerR1dP9afYP2sPSSOlwlnAwWpFHuq0XqOLftSexffps5iSRlfBRFT fJHeyOjJR8qw7F5Bxhqn6UBDRAZfg680T48PHv4bOtksy7UlERFx7XNKzkB4IIToom71 zAjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OhR/DvZbp+3vR9eB4A5wFYKGQTjA+LqOJxd/xHKwNw4=; b=Wnb0lGe2EG/WDYZYQm7NCb0wxP8ibDWVoG+tK+11e0cNcbpZdXAr7DxG4EfWe6J+vh 0MGUNBJC8mkpCgHdKIqf4nZPWZoxJV6G3R/bxG+JpFLotPKHHQU4FhsUyyYcUsGg0vhV 3L/jae3QBd7JD8fduhIcqPfAz18KlLFMWYf5K2GMJiTDupJPpQ7mpAZhhzsd1rfrUMuG hpc17gcIGEa0gngFVZWMty/mSZ8P28KCnM698P6C+fQeQ9uh3IC6Hn3rtYmya/GwoqmG dEByu16Kesn/0mK1KQI20qGdJDoY5XV7XRBk7s8j16K6sVsx0AXO3Lzp0d6RjaP6UxHE /y3Q== X-Gm-Message-State: ANoB5pkUbOjd9cHgE0gHkRgzrMB3OdvqWd8rRbEytcwPkI8mj7+U2nVk GFzpTtAZa6+xCQ+KWxUZp42BiQ== X-Google-Smtp-Source: AA0mqf7bOAyepA04ituLKXHZJH3uQ4cqneDkfqNEF7GDlldsPNuzsJMKn7BDVi7Zx/YGZ+BpcYq8AA== X-Received: by 2002:a17:902:bf06:b0:188:d3b1:dbfc with SMTP id bi6-20020a170902bf0600b00188d3b1dbfcmr57933988plb.127.1670036744950; Fri, 02 Dec 2022 19:05:44 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id c11-20020a170903234b00b00186c3afb49esm6182561plh.209.2022.12.02.19.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 19:05:44 -0800 (PST) Subject: [PATCH 3/5] arm: fault: Convert to VM_FAULT_ARCH_* codes Date: Fri, 2 Dec 2022 19:03:54 -0800 Message-Id: <20221203030356.3917-4-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221203030356.3917-1-palmer@rivosinc.com> References: <20221203030356.3917-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_190545_919181_EDDC0366 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These conflict with VM_FAULT_HINDEX_MASK, so move to some designated arch-specific values. Signed-off-by: Palmer Dabbelt --- arch/arm/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 46cccd6bf705..7063b875b05f 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -201,8 +201,8 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs) } #ifdef CONFIG_MMU -#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000) -#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000) +#define VM_FAULT_BADMAP VM_FAULT_ARCH_0 +#define VM_FAULT_BADACCESS VM_FAULT_ARCH_1 static inline bool is_permission_fault(unsigned int fsr) { From patchwork Sat Dec 3 03:03:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13063408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56209C4321E for ; Sat, 3 Dec 2022 03:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fNBiGKB+ddDvWFGw8jfWD2PnjuGDfZ5UN3F5jBnAtME=; b=jZtzXo0/xAFtmP JfjIUWg0LS0f0o3acxqumB8yxwa1e1xvI/1N1BrWQNe1TxIxs1jLC4XEfLK7THt376/XyQJXogwvp Nu8CFXSeJRV8SjRgMrzBmN4wKzB2A3UlH3GksKrrk0mGqT3J1QO+Euv5mn7Pfp4BONMUwTZ9gh6M1 un+JAO5VEWi2eChrQ3zUXyRISep4gM00cyTn38VaRcgWje0K7KpcyeII4WilYX/bxfjSxx0jus1Kg YGQH0ReDn6bh8493F4hJD+u0f5H5CZhk6YGW47JeOoSz8knjMbug8qeyNDPlknoYk+JoprLEk8LPc Y8fA0zTgpMEMuIyFxUFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Irj-002BDq-4q; Sat, 03 Dec 2022 03:06:59 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Iqb-002Aei-QT for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 03:05:51 +0000 Received: by mail-pl1-x62a.google.com with SMTP id c7so2062777pls.4 for ; Fri, 02 Dec 2022 19:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:from:to:cc:subject:date :message-id:reply-to; bh=nXyyhDtl8c7AV1KDvPOaTLsEEraDYLnRgQTRKevMxLE=; b=J9nA5zFzEgIt8zsxxMPn+sGlIH86WVlgcK5M4y+MnARF9MADgB6h9QisIFpQgAX5Xc gT+JZZbSYIwNPr5lPusi+V73ZxiVkLhM81QZ6t8o4/bUs0p7dwivbSNGIto+U0W3vJje odd1RyOpgxE8uPgVe+OvIiemZQ8s/XdQJhhr+yDr90iN2d2hOZAsbJWqu8yYBosqrxer 9lITxlUrsZAUjRZJKcN0IbJ2m0ZjxM8c9gapj57wHECA6g4hNRl0vKRmp3L5kzuNEkTN fw8pU5isxRHsgpJlmPJcoUscGfiLE65hETmvjd9z7oAjQb+boL6+grwCz+iNw1swFZvZ utXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nXyyhDtl8c7AV1KDvPOaTLsEEraDYLnRgQTRKevMxLE=; b=vSUQCw+IAygaxswjad5MLjprGKG6obXEmn/ZdP03Imc9x1e6PvlBjH8HaKOZZA1uc6 EU/wuuLCCmfWekAOpoOmXkliTIRIge69J5dNnkHC4QLflvKw/3g9rHwzB5u+SRQNIalJ Kar2yAeNBvAq1fUWYngWAzzUMc36FyQA8qi9BU09q2uZEKJqMcSTIgdc+lq41Zm3B9kU 6sjgITpn5UV+uzVVF9DeaVSekEBoak5sBmEJr7YqbEr2epw2I+LBXkNZ6s9+IyCYHr+Y Z8APUefnqupxwIepe7TFJZN3i7pFpeECMObYiNUMc90Ldj5tEDKscGpLKK5vGy0qIJ5R KDjg== X-Gm-Message-State: ANoB5pkMd5m6AbYzYwMRzlnIoXACGfMEGzGP0C2rLA0cce6+FO+F0cJf NpG2Q7LFTGk5mIPxnolstp9/NQ== X-Google-Smtp-Source: AA0mqf7g0g8qmEYMQvaaJVG+LEYazPjzCbvT60LuJ6AU8Q984Tt5DyiX5U2wTDFpAbMwx/ydl7UUTA== X-Received: by 2002:a17:902:ce8e:b0:174:b537:266d with SMTP id f14-20020a170902ce8e00b00174b537266dmr54845874plg.144.1670036746128; Fri, 02 Dec 2022 19:05:46 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id b12-20020a1709027e0c00b001886ff822ffsm6147005plm.186.2022.12.02.19.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 19:05:45 -0800 (PST) Subject: [PATCH 4/5] s390: fault: Convert to VM_FAULT_ARCH_* codes Date: Fri, 2 Dec 2022 19:03:55 -0800 Message-Id: <20221203030356.3917-5-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221203030356.3917-1-palmer@rivosinc.com> References: <20221203030356.3917-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_190549_875777_5B11078F X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These conflict with VM_FAULT_HINDEX_MASK, so move to some designated arch-specific values. Signed-off-by: Palmer Dabbelt --- arch/s390/mm/fault.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 9649d9382e0a..464a74e52465 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -46,11 +46,11 @@ #define __SUBCODE_MASK 0x0600 #define __PF_RES_FIELD 0x8000000000000000ULL -#define VM_FAULT_BADCONTEXT ((__force vm_fault_t) 0x010000) -#define VM_FAULT_BADMAP ((__force vm_fault_t) 0x020000) -#define VM_FAULT_BADACCESS ((__force vm_fault_t) 0x040000) -#define VM_FAULT_SIGNAL ((__force vm_fault_t) 0x080000) -#define VM_FAULT_PFAULT ((__force vm_fault_t) 0x100000) +#define VM_FAULT_BADCONTEXT VM_FAULT_ARCH_0 +#define VM_FAULT_BADMAP VM_FAULT_ARCH_1 +#define VM_FAULT_BADACCESS VM_FAULT_ARCH_2 +#define VM_FAULT_SIGNAL VM_FAULT_ARCH_3 +#define VM_FAULT_PFAULT VM_FAULT_ARCH_4 enum fault_type { KERNEL_FAULT, From patchwork Sat Dec 3 03:03:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13063407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E143C4321E for ; Sat, 3 Dec 2022 03:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hWyxJt9rrrlvTRqUNbYwpcx6mjRC07wzYKTeV1RhPyI=; b=h1HWJLTjB56y+F ztaTL3nRWxFu9i9dLqcpt7+/t9/GDnuchAGXJtwCa1RpybD/EgRQuugkeI+AEEWRRm3aF3I49ZYna iMnSIm+rVVUnTcVitVIhgtrq2iQaj0QSbYXa0nHDLBvknmmtYDv0Q95nfImFnZoZe5kx/MJ4MK3TC Af9wXobkd8G0Xhec6hnWqEdasdt9SsUDhUytxG5w3j4reKyWenXy85nEwJwXxmlqCt111WvVN4pq4 Cq5OAy01PkSZ2pzlifRPp8jWXTpRakbyFBq/aFvy57WD58eWt6rnSUOhWIzkOd2wnDUbdHa+9pDi8 rAw11YKmPsP8Rt38VrVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1IrH-002Axi-6h; Sat, 03 Dec 2022 03:06:31 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1IqZ-002Adj-GD for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 03:05:49 +0000 Received: by mail-pj1-x1033.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9974224pjs.4 for ; Fri, 02 Dec 2022 19:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:from:to:cc:subject:date :message-id:reply-to; bh=tSVgH09qEnpbMDCTLASqX2OMVKXLGyPI/rjfeHRIKu4=; b=wrC9Di4g/FkQry/CsUbIzu4ShoQtDm632rHMb1y98183Vkm7GE+1KgGiQeiqPRu746 EpOqc9dOuSYQ+KgbsAL0f0eaO3YxXVARb1Qy/aZlLGx5xT8FJkymkARbubJV3UJhsZIH X0s2m87BWl0Nk7Bcfhw39dO5P0B7WZR3xG8jCR7ylvOfUZJOlQHN0djD0b5b36wlrQxo jgkGiA62CEcQWD//xV7j8pXqM1WcnxGbE2honL5gHULuNRyMkT1dxPj0xOx1vMDLAewW AXdhismtJx65svzL/lahWs98kLQcqmbFwviKntKjqxOCAmGqWokX22ZxG9BANL1F6/V3 RqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tSVgH09qEnpbMDCTLASqX2OMVKXLGyPI/rjfeHRIKu4=; b=anKb9S7jhkWtC4iG2CEuvgIJibQsmJzL3AXGx4Fm9Nmv21ImExikr/sdfShn35DpQo kU0sD1ZNGt4pAUL1wq96EhE1Ucx6CiWGNUXBmSjpZJlApUAAZMA9TkLrfWySePL7gby5 9+XK7bFp3BSgVLpyMhvOhELc/v6P38iY3j06rwRf3rD5l+jTeV7HRjD7Ztpzs3iCSzfc GueSsNxBRcJkFGrQ1XaYf9ujWTf64aihZPRYLWchNOcUrSSovOiGqQOu0wrzNUrblYyT mZGU0Hl3KoUtUAoLeBGsnzKiL3d+8JsTcBOpCwcZaSxTdl0cBjN4BEC5tC3HhAsu5DlC odNw== X-Gm-Message-State: ANoB5pkFbsq72nGzSjKMv0xyVuCq0xvSq3nYmNDH8y2eArdhKd93krwF IITHkNZiOECRtF448oBCz4CqWg== X-Google-Smtp-Source: AA0mqf4XSUxHT34o8cfUz81MqLg2uR3iZhKmjmdLNRSRwmN3btpX4jv5Kh1mNew10ARt+0Rl1idwLg== X-Received: by 2002:a17:90a:2b88:b0:219:a1e4:20e2 with SMTP id u8-20020a17090a2b8800b00219a1e420e2mr2146067pjd.182.1670036747139; Fri, 02 Dec 2022 19:05:47 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id z27-20020aa7949b000000b00575fbe1cf31sm4894634pfk.67.2022.12.02.19.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 19:05:46 -0800 (PST) Subject: [PATCH 5/5] RISC-V: fault: Convert to VM_FAULT_ARCH_* codes Date: Fri, 2 Dec 2022 19:03:56 -0800 Message-Id: <20221203030356.3917-6-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221203030356.3917-1-palmer@rivosinc.com> References: <20221203030356.3917-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Palmer Dabbelt From: Palmer Dabbelt To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_190547_601202_46D37AB0 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These conflict with VM_FAULT_HINDEX_MASK, so move to some designated arch-specific values. Signed-off-by: Palmer Dabbelt --- arch/riscv/mm/fault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index 3fdc2eebdd36..bd990735aa90 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -202,8 +202,8 @@ static inline bool access_error(unsigned long cause, struct vm_area_struct *vma) return false; } -#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000) -#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000) +#define VM_FAULT_BADMAP VM_FAULT_ARCH_0 +#define VM_FAULT_BADACCESS VM_FAULT_ARCH_1 static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int mm_flags, struct pt_regs *regs)