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]". */