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: 13175246 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 0E0F4C6FD1F for ; Wed, 15 Mar 2023 03:06:38 +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=xpjMQEFGcHtFDzlYX24Ki1PpIRg4hNdB5GDJtmvhQaw=; b=U1RikVL/6wjr/I r3rcoMV4B0dDQP+6yOdV1UAOWT/mBVtVD/GqNkBn2gi9VjhFYOOI5ZFf0+tsUyTB1iV7id41p2++V lAKcsZddO77MYwwbnvjoudW1NEZU+LiXY3fMd5J3k2KpZoNHHojmG9Lg2MpBqrmFF8eJ41Pdmq7rh n1chQdIUc9n3U7JD+mcYhcjHEzBpcOf266Fo3NLsQyk7Y4gvywBx997y32AxgP4ukLupt7hLqU638 Mw+CwjUulcXrCvpFU6wkSNm1lXu21cbD4NJc3fLLnjmqOFQPStkXiLWNx1O/Yx36FB1ipDAf49cHL yhke9Jl8quFpjWflJGOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcHSU-00C6oM-25; Wed, 15 Mar 2023 03:05:46 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcHSF-00C6hB-25 for linux-arm-kernel@lists.infradead.org; Wed, 15 Mar 2023 03:05:34 +0000 Received: by mail-pl1-x62f.google.com with SMTP id p20so18607632plw.13 for ; Tue, 14 Mar 2023 20:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1678849529; 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=mRz3PKHV4IBxR+2dOFKG5hwZul2ABonaRfC7Ehdx0OfdaJc8X1QKmjbUc3A/sMtQmb gbdDUmN6C0xqiSSvVk7V6RYl7rj70SnASOVED2xToUNivvfAXHpYOvdfNg9PNLDBWyDp IncEoQPsAhVH27iWxXjZiY9+MPHJp6iXyumIDVQgIFvnpqQ2awg+ak4Y4xvxSFjC0zod 3dJQKPZ3iUEBFf1zv/1bEdn3ErqHsi/M0WCTCcYx6qxBUNzn+biRBb8C3pLH8Kmj08p4 BzamwZHJuVc6k1iXhWSR7eCcnQcS6MM7x9tkiaPkVq0c4rPipsvwrOOR87W+SmOuO7ef mW4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678849529; 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=lOczSPRbplVLKCADuJlOwriRMXVUhhTZgRyoXBF9DoQEqDMXI73Y3b7Ecosqxmvosd dJbLsUFY+P0T0/DxejoWNUE5jbaDaA4VxK39NCxDAxm4/NmIBq2lK3bKoKJRMdBrWvkX XuXecpsJLmAppcufeio+ITJAoig2cAld68a5YeVglH1KeuPFqSs6+AN5ncjivuOsgFcL ZaKy0y3gYMNqenATMyK6GVhNDI7Yu+8iVceIxc8kBBBnRVjU8cfygkDSYcUCwHsIi2RM NAVsNPbLu9DCVAyAwKWIHx4qslqIEh8llhrh1Klrky1gk3HmUbPIzrjvNfFqJwMBniDf gXQw== X-Gm-Message-State: AO0yUKUR+E4bGllJtqbm9QfDMhOoL2Z2QsO8Fvg+iI5JgpF7Ydqe/jn4 jgkUoYJ1li1785Z1xuXo+bWpWg== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230314_200531_763800_71A97CEF X-CRM114-Status: GOOD ( 12.62 ) 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 | 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]". */