From patchwork Sun Feb 5 23:17:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13129154 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 D0066C636CD for ; Sun, 5 Feb 2023 23:18:15 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=shK63yp1jI1ROLz9/nWEalPEKS2gXPo/L9OHtrOT+cg=; b=rdImMhbYK38+01 5k6TtPMH82fjFQxU/TMbmIM99P8FnJRexJAMGeqwHnAbIaNMgnK5keIA1iAKruWneKqCPYf5ZVqxp 1nShhi1lGOMGcP3AB2HAq9eyjsX4Zi7cXMBeFnci7/9RZPs6LHe22odMQs749t8oGNwInkMwZtKWc u+4bEalMCbUmoQVisPIBwTJJ4OoRGpSF47z0w5Gw6GzFoVaf442hnHszqpQ9Jb7vi9g/Fo1UTJ5OP AlA1c8FXfxT7uy7s0S+4N/GGSN4GL5czuzXS86k/Ua+3JxVr7x0XQXQTerknGXuWuvslQurjKI3Pn AU0wxN/97n1ZeX1Fc3Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoG5-006xjs-6x; Sun, 05 Feb 2023 23:17:17 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoG2-006xiD-6K for linux-arm-kernel@lists.infradead.org; Sun, 05 Feb 2023 23:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675639031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qONcW0u0rSlhga0NbKyxqeLooMqDqXOYmnEPrTgV3J4=; b=dJSb0lxJHnclIJ4lB4Mnluj/6zC4tqqktExCwmcqNHkJMKNDFnkNfU688n0jSwiuT3/gwA cP2WNW4rOAA8Of/7KlqDEsHxj0tIn8ksb5pml//fcn7SiJH3D/0Dfa1+rYpHMHFuLnkd20 /PIBFE5Bvfw1SC13yOY961+gTEMo/+I= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-645-jjcpj7uuP0Glr6V0CUYG4w-1; Sun, 05 Feb 2023 18:17:09 -0500 X-MC-Unique: jjcpj7uuP0Glr6V0CUYG4w-1 Received: by mail-qk1-f200.google.com with SMTP id s7-20020ae9f707000000b007294677a6e8so6878120qkg.17 for ; Sun, 05 Feb 2023 15:17:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qONcW0u0rSlhga0NbKyxqeLooMqDqXOYmnEPrTgV3J4=; b=UTAyNccK3peGtDhZk3cTRW6egZoI6WfBBtfc2gN2OSfuBmPre14+/WPvWKeII+1AQM hHoqDsP/j4hNV2b7v1a5grEd/dUdw9R5Cf7So9hiaAx32zOrf01Hp1QWAkj1wzC0YnDR LD3cu7gZbRQ1tq3dKYlmMAs1uo14Ql5VyK5TaP9WM/3sYWRn6VIZXwkmvPOsFoQ5hHRo POaYJeyavA6zWpW3m5zrg6n76wEF3a4GUy2gf3zsLmmTs4ed8qGK+H3zE0Go6gv/BR7s lPyV5hc+CBZ2UaDJQW+auVXCPcLhDQ7NkAJ2oLRhgbdCUJ61tuF2BNUnSgvWUVms/MdZ F0oQ== X-Gm-Message-State: AO0yUKUtMt3AjY38eR1fqbMxaJpizF4bUP4RW/FlAxWqWuGjnN9fjkJ0 /Td17ba/E0NctnpEyIFBt/h8tPn4oweR+dt1hb160jHd492kUTJBTbBG/wr1/Ly39FQZAyujGEj F9CcxX0Xc3TXMdtlEiWv7NmjSP1MlZ2U0usE= X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36967892qta.5.1675639028661; Sun, 05 Feb 2023 15:17:08 -0800 (PST) X-Google-Smtp-Source: AK7set9kqgEL6o3t7eGoOILoA6rSeOClso5mcvRwdEtgXNoCUXmYbAoESbFf+GAMsxjDlz50rZUFyQ== X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36967876qta.5.1675639028460; Sun, 05 Feb 2023 15:17:08 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id h26-20020ac8515a000000b003b82cb8748dsm5986545qtn.96.2023.02.05.15.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 15:17:07 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org Subject: [PATCH 1/3] mm/arm: Define private VM_FAULT_* reasons from top bits Date: Sun, 5 Feb 2023 18:17:02 -0500 Message-Id: <20230205231704.909536-2-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230205231704.909536-1-peterx@redhat.com> References: <20230205231704.909536-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230205_151714_342220_FE4F4DCD X-CRM114-Status: GOOD ( 11.72 ) 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 current definition already collapse with the generic definition of vm_fault_reason. Move the private definitions to allocate bits from the top of uint so they won't collapse anymore. Signed-off-by: Peter Xu --- arch/arm/mm/fault.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 2418f1efabd8..67879d995835 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -216,8 +216,12 @@ 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) +/* + * Allocate private vm_fault_reason from top. Please make sure it won't + * collide with vm_fault_reason. + */ +#define VM_FAULT_BADMAP ((__force vm_fault_t)0x80000000) +#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x40000000) static inline bool is_permission_fault(unsigned int fsr) { From patchwork Sun Feb 5 23:17:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13129156 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 E5CEFC636CC for ; Sun, 5 Feb 2023 23:18:21 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Mh1EljaG9GqZzOI0gnpieCGuFiwQ0nWoW8dD1U1K+cA=; b=k720YtwT1d3rA1 XFXs+wh6UsUAGclY3CwJEC7wVMp2H43UBp9sri7asmV2+Z8wruuKLZj3vvylAEqwaVKxWeqIDcu+F AuzLD47qAWL9kJ1TX6+VR9WS3hHuuDisU1Z5/gQmHaArG4MCkjb2axQ+8ohVthnyADZM+nh8o2ruN r2QLP35t4gNW0Q55FtpHhsEodtlsKMA8TAjGE82En8EnF8VveSlqU5mVUEA8bOBNMLu4lq8viDSe7 uYddBiC+E/joLcZAfIkcDTu+YW/s3+rOMOIDoGUnXW5zb4zlI5PqtBfTAULI9SnCdG42QXbyhu4Th VGhBNKoz+plEAcWmnkBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoGK-006xn3-Ev; Sun, 05 Feb 2023 23:17:32 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoG2-006xiH-JM for linux-arm-kernel@lists.infradead.org; Sun, 05 Feb 2023 23:17:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675639032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P5/Ww/5/bhqPqutkGRybIHLtU9jqdfakTNy4g0j2iQk=; b=WWeIPSREVQm/CT1nP1WJ6QCFhcW4UYbfB+d/BVU+Uozmyt03ZngwdXKyCt11wLjagHWrvU adfPg+yojRgBl9RdZUIcosSG7YWApO9l/J73LuRZql2XqbbML1z0FGZg/8qgmdXXKcsJwK NExNpIPn1/0es0BSsrbQgIZ7XpYk/o0= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-639-0iX2NtIKOMu552wrSsF_fg-1; Sun, 05 Feb 2023 18:17:11 -0500 X-MC-Unique: 0iX2NtIKOMu552wrSsF_fg-1 Received: by mail-qk1-f197.google.com with SMTP id s7-20020ae9f707000000b007294677a6e8so6878152qkg.17 for ; Sun, 05 Feb 2023 15:17:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P5/Ww/5/bhqPqutkGRybIHLtU9jqdfakTNy4g0j2iQk=; b=y7L7ahCZ+czlTePOGC0e2u/gJiI6/Fw1JX3fQQYMqDaeR0Gsrn8nhdDlfR1Bw/ZsCd 1PPxH+ilDX8QEHqg9HFITIXLrPOcYLLGw4ctvPbz0bsl37iJqaMD1SYgsmJLMnKq4kLv 7HcbOEReM9bc+RLkB0UcWcGM1PdgipK3iVxqVDIAv6Syei3w4ce+LFzB+kN3NxBgx5CF IfVhAp5AX7qbOI+1av+9jtPyFpL91ATBjCCAxpNls6FoHvn8DC+LfxaQUQmPSdo6T7gF nXj4zTkgFJ4imCww7ZjslE2a512hrW1h/xuMKsRmS8A+/CaYgckPD8nI5HpUTttPQ6Sg tsFg== X-Gm-Message-State: AO0yUKU4CoR4X/8PEtJ1aHPlVBBWV4gPVYVfkBCXAmywoAVym+R5qIgC NFuaxsEdHuiNiwUP1oqILhoJGy1hlRX6u6Jgyyc1mqtn5jTmb8S0IGim2pZntI9YJExK7OCw/hd THEScLfzaJ3sRUKzqXFTo9TZAS74LjJHiBxw= X-Received: by 2002:ac8:5813:0:b0:3b9:a4d4:7f37 with SMTP id g19-20020ac85813000000b003b9a4d47f37mr37363476qtg.3.1675639030435; Sun, 05 Feb 2023 15:17:10 -0800 (PST) X-Google-Smtp-Source: AK7set8mrnK+ikirixTmDtvR78/fRtminiJLSrpX/G80o7vhvBjyiJhn1+xWU/af4TGpWMpz/q/ScQ== X-Received: by 2002:ac8:5813:0:b0:3b9:a4d4:7f37 with SMTP id g19-20020ac85813000000b003b9a4d47f37mr37363454qtg.3.1675639030152; Sun, 05 Feb 2023 15:17:10 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id h26-20020ac8515a000000b003b82cb8748dsm5986545qtn.96.2023.02.05.15.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 15:17:09 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org Subject: [PATCH 2/3] mm/arm64: Define private VM_FAULT_* reasons from top bits Date: Sun, 5 Feb 2023 18:17:03 -0500 Message-Id: <20230205231704.909536-3-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230205231704.909536-1-peterx@redhat.com> References: <20230205231704.909536-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230205_151714_746675_21183102 X-CRM114-Status: GOOD ( 12.09 ) 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 current definition already collapse with the generic definition of vm_fault_reason. Move the private definitions to allocate bits from the top of uint so they won't collapse anymore. Signed-off-by: Peter Xu --- arch/arm64/mm/fault.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 596f46dabe4e..44fd16f58f94 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -480,8 +480,12 @@ static void do_bad_area(unsigned long far, unsigned long esr, } } -#define VM_FAULT_BADMAP 0x010000 -#define VM_FAULT_BADACCESS 0x020000 +/* + * Allocate private vm_fault_reason from top. Please make sure it won't + * collide with vm_fault_reason. + */ +#define VM_FAULT_BADMAP ((__force vm_fault_t)0x80000000) +#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x40000000) static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int mm_flags, unsigned long vm_flags, From patchwork Sun Feb 5 23:17:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13129157 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 4003AC636CD for ; Sun, 5 Feb 2023 23:18:35 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FEOK67PzOO53KVzmXvkc5b59vE2e1Ofc/iPeM0/5h/Y=; b=SI5YS11Gh85x3i Y79lu0Ge2LRWviqSsdDZpqT7IodzH0FQ40cDZRBWs7ReEW/UPlcql42M9D7kKZ0wdR113WhxW2f52 zee5j8VPhKbimwguk1N49VhS9EfLEmVo3TSXBACXEe7zYst2nrSbP5IFy4UVXtiPq2JdBBWGQzf14 kQMe98fFYyrseI63nrRDJHXx1odOBWmJMNxsGoI41m74cHb4zdqLWZq/uRfu+1W2g2jGLpG1z2NPz 1QuyIOx2Yt1CZKGuAmQ4feNaYi9R/BWUIki+6tg82tDUfQLbF+FYazjo/tYji65R9x0EC4RAZ6/Gd 6IR3SPXGAfHDkqNsjjWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoGS-006xoj-2d; Sun, 05 Feb 2023 23:17:40 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOoG4-006xip-7T for linux-arm-kernel@lists.infradead.org; Sun, 05 Feb 2023 23:17:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675639034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O+iHbljQE4cWri51QLXa4Xz+3mOqMYYEFGlGW+CbZSY=; b=BnZ5x526thPMdD+/OkBDbyNUxwpiiXO+sLKB3yBXbDKjZQMkWOIRDisrfmklfbsldtOSy7 qqVFTyVNtNOlqc95C4cgeKpUo00QAkUK5GtRAVM4d0TmZPJEqDd1xD5WjH7nMWsugFDh18 s0l8Oi5yDXnWz6kB52bwvC3hjdAyGJA= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-486-CFOsgRXpN06dr_156bxIhA-1; Sun, 05 Feb 2023 18:17:12 -0500 X-MC-Unique: CFOsgRXpN06dr_156bxIhA-1 Received: by mail-qt1-f200.google.com with SMTP id s4-20020ac85284000000b003b849aa2cd6so5518924qtn.15 for ; Sun, 05 Feb 2023 15:17:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O+iHbljQE4cWri51QLXa4Xz+3mOqMYYEFGlGW+CbZSY=; b=tiva3OHQb3LE3RoEHvef7fstJ2g3d5mV51L0ZFHX9wtcB8GCAnQWxFwii7B7HbgJ6x 4FY5oHT3KywpRQaZ5oz1rrKxryHjDPWDPJ5/eUbO2ME6aDbizXs4LUiGFI7FHyfwBBOA NNAirirr62mcNC3w9Amp4kev6UB+yrXcHO3JoZzKNyiNtxzW694jM61qDdmWLk2z5y7M rggjZ7eEzigwn4P+mA6n0fy0c5hEHQMQz1BoKL5t/JgWs0CxUxcW29kbwQDjvCXT9B51 dT6zViyq2WU1DSVxn2QNKV0SYNhP11psoEUCJdQrhnFtavtSOT+YsGlyyrUiQ6wdntAn ULAg== X-Gm-Message-State: AO0yUKXxnAhxWAjRpDHMoAPHrp0VQTbkJ0BEEGsivt/2WOHLYUQATc49 AkzRHBTSwIJRu7OzyoNtlRYIcqPioD8zNdnVpB3Eq1zwOtFR8QxFLPhG7wLygq2U6id0WOHJGwo XHqbEr0hRcJJKUNUO4UovrCbXVMITT7YKCCU= X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36968149qta.5.1675639032210; Sun, 05 Feb 2023 15:17:12 -0800 (PST) X-Google-Smtp-Source: AK7set8/HJ9ylfEnCGuGjHiBabf9O5KRa6hhSOUhT6sDqtmC260VVR8y98Nl2i/0VhE4BCc93ILrBA== X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36968130qta.5.1675639031977; Sun, 05 Feb 2023 15:17:11 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id h26-20020ac8515a000000b003b82cb8748dsm5986545qtn.96.2023.02.05.15.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 15:17:10 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org Subject: [PATCH 3/3] mm/s390: Define private VM_FAULT_* reasons from top bits Date: Sun, 5 Feb 2023 18:17:04 -0500 Message-Id: <20230205231704.909536-4-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230205231704.909536-1-peterx@redhat.com> References: <20230205231704.909536-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230205_151716_357141_6A4CD43D X-CRM114-Status: GOOD ( 11.38 ) 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 current definition already collapse with the generic definition of vm_fault_reason. Move the private definitions to allocate bits from the top of uint so they won't collapse anymore. Signed-off-by: Peter Xu --- arch/s390/mm/fault.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 9649d9382e0a..cebfbd6dcbaf 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -46,11 +46,15 @@ #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) +/* + * Allocate private vm_fault_reason from top. Please make sure it won't + * collide with vm_fault_reason. + */ +#define VM_FAULT_BADCONTEXT ((__force vm_fault_t) 0x80000000) +#define VM_FAULT_BADMAP ((__force vm_fault_t) 0x40000000) +#define VM_FAULT_BADACCESS ((__force vm_fault_t) 0x20000000) +#define VM_FAULT_SIGNAL ((__force vm_fault_t) 0x10000000) +#define VM_FAULT_PFAULT ((__force vm_fault_t) 0x8000000) enum fault_type { KERNEL_FAULT,