From patchwork Wed Mar 15 03:03:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13175255 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 236C3C6FD1D for ; Wed, 15 Mar 2023 03:13:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A67E26B0072; Tue, 14 Mar 2023 23:13:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9EFB96B0074; Tue, 14 Mar 2023 23:13:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8908A6B0075; Tue, 14 Mar 2023 23:13:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 763D46B0072 for ; Tue, 14 Mar 2023 23:13:34 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 404011A0233 for ; Wed, 15 Mar 2023 03:13:34 +0000 (UTC) X-FDA: 80569662348.21.6EF8D6E Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf20.hostedemail.com (Postfix) with ESMTP id 712631C0003 for ; Wed, 15 Mar 2023 03:13:32 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=qEfXoxWo; spf=pass (imf20.hostedemail.com: domain of palmer@rivosinc.com designates 209.85.219.47 as permitted sender) smtp.mailfrom=palmer@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678850012; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kjXs6Q9el+E3DjFj75yzzOPO7Ucq3PFGsjms6Llyx9A=; b=LyXE3tJFM/PblafFnhf8n/vWeAmt0sFe2FkUf7/Z04dYGad9rVwNuHQeHqhYG5OFiSsCdQ F+TrSrX+SkD97jjUAujtnTcymZCWe+fXJJ9K+clFlR65N6VFzntFKG1JB57tyNXMWTH0zq rxcaDd2AvsSDCM0+Phwuh8iZ7TSfABY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=qEfXoxWo; spf=pass (imf20.hostedemail.com: domain of palmer@rivosinc.com designates 209.85.219.47 as permitted sender) smtp.mailfrom=palmer@rivosinc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678850012; a=rsa-sha256; cv=none; b=dB29vMNn/D2SOQIRKNE2nogkowgIL9j44CsOJ6S859GFc5FADlNijjm0kpSek1nDqU/Vra MsHB04aubt4n1PzEO03jjeRWGgrXUWlbEj6za7qXDKRyfo1Rl2CX2GdbTEEOgdE6lMAXIV 5S4x0q6rL0oo0sPDdpuLT1EnNOcsG2I= Received: by mail-qv1-f47.google.com with SMTP id jl13so10716401qvb.10 for ; Tue, 14 Mar 2023 20:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1678850011; 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=kjXs6Q9el+E3DjFj75yzzOPO7Ucq3PFGsjms6Llyx9A=; b=qEfXoxWoyd5DDYIHeqmYdjDmd91+zHbvBrTblyjeTdMwGXEJ/DVO3axUAO4C+IebS7 91oC15hDpSMEWau3u3S9EDBbYzkc1o8MLbUvPJsuiDXeri2BSa2B8RM915XaykRhHdLr fT4uSIQXISNyxGQHZ3xSNctJtTpOEr+xZojKsBzj+4EY6nHobYl60fkM4gcFehU/90xs ZVzB5rgRU0nU0o1JBxywGpSDjHAKBAD2URuxjiKuDZef6j23Dl+iiFsVg1i61Tnc1D3+ ZbqEFDMgMv7Fj4+OI3j0Ieok3dm3xlVtkRnUOENKzOUNbE/CCDO3qqfLmR7TSBHc0Mar Lf5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678850011; 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=kjXs6Q9el+E3DjFj75yzzOPO7Ucq3PFGsjms6Llyx9A=; b=qGnAV0fBDGqvYPtDTFPWlbooEM6QUvqgmYgtY8Oev9WsE1EijW37bKbb2htfolSere 0AKI/FPoQs/dwKGUReDz+ncXlTv1ncXbzZ82foxc356tZZrmnsVRF8v8GXxjDwmDhkTd QrWo/y9LiauYShr9/mjdG8NjawW65CjFP2EPXUfybdUP7TDUMX3Ajwrxg2mlkXWd5R4N 1XU+vkIs+EPC8AL3yxsBvq3lwMrJ2J4GybdpHWWzoQz7ZswVAcKU8p2E78XdcbUz/BUV Z+MZyYLKqbNnZh14Gd4nvxiwZm/EL2oN9OYV66oUuD5s7cwRDhStXHkm5lI5kCadaDcC Rw9w== X-Gm-Message-State: AO0yUKUu/IQD/3r4B4FFEmdN3OeJOmmluTmsponGp+a5fJsUi2t+6emz Mna3x22W564/ayv88e6cSPcJwG7g5TAEPqqIBRU= X-Google-Smtp-Source: AK7set8aNlVZNOCixnv/wCzZZa//jnHG6FrTV/mi2NGNpxsUbRVCAmKzBlXv1PxwH+TLgm6P1rGJNQ== X-Received: by 2002:a17:903:48d:b0:19e:e39b:6d98 with SMTP id jj13-20020a170903048d00b0019ee39b6d98mr981507plb.35.1678849528720; Tue, 14 Mar 2023 20:05:28 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id jz12-20020a170903430c00b0019f2cee9221sm2447268plb.95.2023.03.14.20.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 20:05:28 -0700 (PDT) Subject: [PATCH v2 3/6] mm: Add VM_FAULT_ARCH_* codes Date: Tue, 14 Mar 2023 20:03:56 -0700 Message-Id: <20230315030359.14162-4-palmer@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315030359.14162-1-palmer@rivosinc.com> References: <20230315030359.14162-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Palmer Dabbelt From: Palmer Dabbelt To: akpm@linux-foundation.org X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 712631C0003 X-Rspam-User: X-Stat-Signature: ifgwf69yu5awr4kqwuj1yrd37g7cii4p X-HE-Tag: 1678850012-344270 X-HE-Meta: U2FsdGVkX19TCkK72sZp4XuI6Y7eEYzW80ovLzgA7tYV+fk/APM/v6zV32A3jru7drmUDBK1fbjuIAReSwU/kTz8iFroMjw0gasFl4XTFRkjAUGVyjDDyThJfAuujgJlSMFzFEIMZO3CXjfCRB4Qbrw7zoYE6ErFaL8jtPCujfQevYcM4jl3gotXx4qpZCt8AuIKgAyfpVyUqQx3dEuO776KKyI2goIJ3chnu+PgswV9eAhEEpm+Di3+iynODQ+0/pu8sloYYjsdg3sDkTjF4HZIddiZ2/RYWrf40sGRytTLN1zbGi5AwGncUBXXsdxj9Xf3x7/s4vdAJ1Fi6MgpUWQoiARMe3ozt0Ke4l6YUVDv2KyPuYpQ6Zb/Wr4FhYAwBXhhTRqbWPQ0UIqPStm0l+nrkQudEBzqKr6XlOOHW+ZjcSUfogmdY6p7lU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ity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index fd9b863869b4..47f36a2fdaac 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -938,6 +938,7 @@ 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 { @@ -955,6 +956,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 */ @@ -977,7 +983,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]". */