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: 52940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1961690wrn; Sun, 5 Feb 2023 15:22:00 -0800 (PST) X-Google-Smtp-Source: AK7set8p4Ec9bzbjCFG74GgiDQSxeMgSLHcwkErIjajpZtKCsPaKcTwwi0Cvf9Wh2P9bSbZeDBK6 X-Received: by 2002:a17:907:9724:b0:88d:d76d:8527 with SMTP id jg36-20020a170907972400b0088dd76d8527mr23402933ejc.47.1675639320524; Sun, 05 Feb 2023 15:22:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675639320; cv=none; d=google.com; s=arc-20160816; b=AjYgPO45KARd99vJd0yW3OklXLLBml+VwqW1av9tmCoTng3OxYadphV5+gY48VUm2v SJXghdjGiHdKYTzQoAEYIDhdP8NmAPReb23zO0BD8qh81zgLtvid5bWMxOJXoSod5OMi iu6TKPsDKs0TPJN5iHPWklZwSFnpGNAuyjvnKzILsUNkiyVz0RLvp7cViiCNYtarz64+ xjNMVbpj6yHq7B3jgt6xM3KOgDWzIoeJyHN+McVaJJNaMx77GwYy/6wUG+xFcaBmS9D3 LrTmsgl7jh7sVxXIYxTpWk5C8VX6rkpNHC3yZqRqAfH5b9LmCLqH1PJpOpIzj8XOd2t6 HPAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qONcW0u0rSlhga0NbKyxqeLooMqDqXOYmnEPrTgV3J4=; b=Dr2gQFfQ0lRA+E7NTVKAL3ZvkI/cxKNQC0rttog82jmdt7nOvhzDXrdTldhZm7pUOp 9aco0yj+Bmno+oHTsJa7goY8sJtycbkjyIni1mjGTfQpnRSg2uTNNZdzsBJyJoW7kHQG svmv+bAQKyDWVKwl1LfpAqd+0wy7hefggXz9b7WGjmnlklJ5q2fGfOH3o1iHcba3Jjcy SF9C5Do8ObbiTJUTCs48YKclr3b0u6pIaGQz0ge4U/THXeBgSfeoUr78dkBKWbVA0Sv9 erSHGxHEH090O/8UnCzg0Aeg3ZfygBDB9Hy3K0tdKbxWxtBVeyR9vaRMBz7cjlwv//41 EefA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NwDki4L4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id up16-20020a170907cc9000b0088e0dce76afsi11401883ejc.979.2023.02.05.15.21.37; Sun, 05 Feb 2023 15:22:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NwDki4L4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbjBEXR6 (ORCPT + 99 others); Sun, 5 Feb 2023 18:17:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjBEXR5 (ORCPT ); Sun, 5 Feb 2023 18:17:57 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9DAF2698 for ; Sun, 5 Feb 2023 15:17:11 -0800 (PST) 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qONcW0u0rSlhga0NbKyxqeLooMqDqXOYmnEPrTgV3J4=; b=NwDki4L4KmNw56uC3T+KTFhy26MfFO7pFMDgpqZtfkPNZZ/Uf0iIJLklJ9vw5yAu4+yDm+ V1Asiql4ffUcNrn7YQAjI0BRhyBhN0ClDDTVcFzb5koS7Bn8Cz8S3EqxPoxGjmu1Fz7orJ zbDYJVmlr5+zN8xdxEkZ/fEts25UJUE= 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-368-ySfTW5yuMNiEMIZsAjfbDQ-1; Sun, 05 Feb 2023 18:17:09 -0500 X-MC-Unique: ySfTW5yuMNiEMIZsAjfbDQ-1 Received: by mail-qk1-f197.google.com with SMTP id a6-20020a05620a102600b00729952b4c73so6771833qkk.6 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=dqTF+ZBcJZt1PzDcQIljNBz9zlUlKNuYNlq5DJVedYztWbudOkRFb56MVGbuYHOjs0 RvD9+DFqTLt2ZEsLZkbvTdJvojqrQYlmHl4zA7p7IS9J2kHmg/mpCYKHS4VyavenosOQ FnKf5DbAC0lYlrkH1O8gbZ6kWfyThz85FAplt7hzghOiOBweVkIeFcWSew0jI2JEAhqh ojB00SAWQOGO4zU0Y0crhG6KV+KRkFd4wsvgXitYoVleDypWI9TyGa/xpHsRrjUy/1oq 204ub1Xb2kR5HvuBRGpBojwzZpCon87XHtOBu9Kodl3i1dSFqLmrvGwnlmnPPMLgCmOW q0pQ== X-Gm-Message-State: AO0yUKX2BxnLHdIeN1WEImpb2CpztLq3h+v2E+2si8VuqHJkTU0ruCaO BHHb41fuQnPvesOZv+xbFhf4vS55ywo/m2O3Ht3vwoowWJV5XrpiF0xXRaLZYYsV5OoWQdBHqxG HYyTTMueddLDMh1uQc7SdIuYW X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36967893qta.5.1675639028663; Sun, 05 Feb 2023 15:17:08 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757035176201400982?= X-GMAIL-MSGID: =?utf-8?q?1757035176201400982?= 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: 52941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1961849wrn; Sun, 5 Feb 2023 15:22:39 -0800 (PST) X-Google-Smtp-Source: AK7set8CfFZjXCZyRgkAJr8GydivhgQ34JXM1B5U43vfJispsiKJcNWxp2F+EQfcVDlYv0GoFNzv X-Received: by 2002:a17:906:33d7:b0:87e:9441:4c6c with SMTP id w23-20020a17090633d700b0087e94414c6cmr20859971eja.49.1675639359135; Sun, 05 Feb 2023 15:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675639359; cv=none; d=google.com; s=arc-20160816; b=sXj5gP2NWPL8IlUQ51ySM8ZMxbYwwoQwjpFWTp/73RRrrASfbw6+bc+TI9NXMj8p5l KGYphh29HwBmPFXNoyp/CWKq/d4koVZqSlPJxoeHygiRXWprYJfq+AbEe6GH6Y6a/gjo 5m3rOKOWwPhh+PoIXZ28+XYTjS6/WZpCT+mkgOcLuCtsSePcdUjtzigTHwVbiIq6VJ4O qfN3v6LiwfosBYNMRVn9PVwNoL0kdbKUhQraqZrlZKqgVj7JJzm/9m9YLfstSKdNW6pP qdAZyWdgWQduPNhIEygxoEYW6MJ03yzqjmzfjNSO5vnkRkIf98uWrBxBHZThJo/v121B uspg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P5/Ww/5/bhqPqutkGRybIHLtU9jqdfakTNy4g0j2iQk=; b=jaROj4hcKkHVmQHpfg29gVzDmyatRESNprB35UATvVFGgAyuMfQfH1rK16QGABQwQF KpXV4mqR2vtyAk8I2WssVlzDu1WKAMM3OoLYW5IvzcrAHBitQXCA7ft23KxUcmjhC7ae NtcEUfpdzE+VDgC5JO9n1JboPiItshbbLewYCjrzDgsB32TIZi4Mtsw33+Z8jcR8zQpN 4W0oyT0PQD3THtu3U40Qx5thLEthR81C3ItTAz8kjSlTLAE/x4x3nTotlUARUv0c8DY1 czx6nvNusbZiCX1AOEyWMZOZAMYoc0fbG/oleb9iaGBw9AIZOaK7O16fGexlpxjln9rf cnbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q2IrcXKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fp33-20020a1709069e2100b0087bcda69438si9957572ejc.465.2023.02.05.15.22.16; Sun, 05 Feb 2023 15:22:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q2IrcXKi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbjBEXSL (ORCPT + 99 others); Sun, 5 Feb 2023 18:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjBEXSC (ORCPT ); Sun, 5 Feb 2023 18:18:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17DB819691 for ; Sun, 5 Feb 2023 15:17:12 -0800 (PST) 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P5/Ww/5/bhqPqutkGRybIHLtU9jqdfakTNy4g0j2iQk=; b=Q2IrcXKinh5UW/cS5BHwRhE7QHpgFMfdia8drwNkRJuUqGLqoLQQzK49ao6JT8ezXocSWb Hv4VmnzirRr62mNFcdLgodGI1TncMhPQD7PgO3l+Mf9K94soxq6F/ba/SVdIv2aEBVK0Dn r2FQzJ8RiQLk8vF9Gpr+RSqCJ65YGb8= 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-311-A9tmxP4xPr2FrXKLQM24WA-1; Sun, 05 Feb 2023 18:17:10 -0500 X-MC-Unique: A9tmxP4xPr2FrXKLQM24WA-1 Received: by mail-qk1-f200.google.com with SMTP id j10-20020a05620a288a00b0070630ecfd9bso6927732qkp.20 for ; Sun, 05 Feb 2023 15:17:10 -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=bN/QYlW4VzVYFxaT6mtk5oAMxdxZ62g4M9xCdtWJU2+DFlTdy3LOifb4f8MWyZzKer mVV1vVXSyVBrHmMZKnlv8lP2SHMhUsrchaa99W9fM0ZLZ8xUFB1fTAN8v2NOst4NtvhG tBDxcTB0YQyHYFz7nUERwINpoFAIy0OfN1rvChvpISSx8ka4F5ZayV0nk4+z9qHHhEWe kuckKfM2JqSPcwwIgyA/8MqB856SdpKKjUIPoxmCA62LLYDKqRrUFjiO1enLiT8JJjoz nHvCkbRiPvia4KbEeEg6qlKvg1HukXD7+zxd6TeiTAcK/Xa/EoGX67PuOcoM1tsix69D 9Siw== X-Gm-Message-State: AO0yUKWBZ6M9vVSZDnnLX5BI9tU3CiXICNfVbW+8HS1i/ogsp8rz72Js O2o6WxfP6Px1cdN0mSmCHnMhowlTviMlCmHugxjQYofXujo927o8VecXFf7xLQxiM53kefg3Qe2 IZlwB+9rg6Wz2rXW0LUmrj7eO X-Received: by 2002:ac8:5813:0:b0:3b9:a4d4:7f37 with SMTP id g19-20020ac85813000000b003b9a4d47f37mr37363479qtg.3.1675639030437; Sun, 05 Feb 2023 15:17:10 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757035216641237877?= X-GMAIL-MSGID: =?utf-8?q?1757035216641237877?= 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: 52942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1962162wrn; Sun, 5 Feb 2023 15:23:53 -0800 (PST) X-Google-Smtp-Source: AK7set8F7TpTsy2qN1AhiEQ7dZlYGrzsDPDhhH2hrLzKQxIi1hsW7ZchmJNg/d9ns+cXbmaFmYMk X-Received: by 2002:a17:906:5a4c:b0:87d:ed60:cb7e with SMTP id my12-20020a1709065a4c00b0087ded60cb7emr14918642ejc.68.1675639433181; Sun, 05 Feb 2023 15:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675639433; cv=none; d=google.com; s=arc-20160816; b=E+l38Btsp9UDjYzV0H3oOdnK3qPEtDBcnLXg55+0kJf7cC6rdEzaQOqRAuPm3dlgqG hoRwbHCLLMbHA9iw5tkQP+4JBw83UvgEcoOilDZ5Z7wv0BeW4aWv39cwoeL50RfbtqVn UGwILZX0IXjk8EIWqgDqty1dCBZKtlbJxZz6clMe0wEFKkG1zWFGfxDn9FBWglYBU6qY DyahH8kGLgaeXM1DiOEYbav+1kzLzMnvPSx58Nq23deWjwcRavzE+RgMmt//CQS29Yj0 QIWhAmbblISCW/ESKHFDe3Cs0CNXgCyzlu3iQ6jCxq8XT1Jc4hMIk6hU7YdjcpMaDJJ3 VY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O+iHbljQE4cWri51QLXa4Xz+3mOqMYYEFGlGW+CbZSY=; b=C67BHu2ISdZsk+BQKhmbcfKRpsN8lv3wttnOOdnni1tB3/eN09/+eum8jSzFsEt7bC 0jHNBy1mK2EhSV3BZPTxrfJ3iEGHvkkuTlYcx/5CNKbjRalfD1Ut4Fnjg5tVZEpV17K5 SIaUV0dQ14w12l85qolCn+EvggPM1CmylxTK/CXNs9lsn4OM28JzPxHhr/MxYImLDLAJ SLFH1smojbBmWmFbzYzBNdclpGAD5jiraUswajPDlaZJr7t4vKk+tAIGPNS557QGCAV6 q/ZhCpY5T9paTxuECZXGWntMtKqWLX+ANlAlaYKw3F8Cmu0CjrAZTGIcxVRnNZ3bCZzg ANoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d0u/kci3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wc6-20020a170907124600b008327270a7e0si9744281ejb.65.2023.02.05.15.23.30; Sun, 05 Feb 2023 15:23:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d0u/kci3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbjBEXSx (ORCPT + 99 others); Sun, 5 Feb 2023 18:18:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjBEXSk (ORCPT ); Sun, 5 Feb 2023 18:18:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB9F19694 for ; Sun, 5 Feb 2023 15:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675639035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O+iHbljQE4cWri51QLXa4Xz+3mOqMYYEFGlGW+CbZSY=; b=d0u/kci3SmpyKeK+1bUK6fjGm+okJNWkRBZ9wjAgT6+IxX9HtyawhmwzebeMMVRWZbBbAA ro7HQB+/wu6P0WGc1DBtxrmNq4l31jDk2BcuO/V2wmGHo4O0N/rb3NWfooaTaUuGg96lyf XKY/nObhEdjEGMVQu5JE9gYM/lWSHGU= 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-488-yOKTGlCyPCGhDhMcTnprHA-1; Sun, 05 Feb 2023 18:17:13 -0500 X-MC-Unique: yOKTGlCyPCGhDhMcTnprHA-1 Received: by mail-qk1-f200.google.com with SMTP id s7-20020a05620a0bc700b006e08208eb31so6824285qki.3 for ; Sun, 05 Feb 2023 15:17:13 -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=0izwM4dUjiIJW5BaB57NngPuugDw4ZAUf0miLTORP3uHM22CgZPVY2p1bmhcpSaKNt Ms/4+VHYhiWL5rECjooinsF987QOPoB3B/AgowQW7gt/2nk+Y+4RWC6D3874VTj15Vfq 1MYjCX3ZlzoQkO07vyH6xRSk3FDE7LVEWprKf7aJTPBXrDRRc17SmHZ9y+ETSqHmD4E1 wKAXeMGrWwhdGIGjUn6ZLhoNSSfnGMn78K11OtG9WFQWV3bvh2o5nr2QBmh202ffDxLU kCrh62bEzoHhmZkBxIeOK+R7nKIzhftiIHafTg4RPb4sgqCyxPQYrAv5ChfyF1gvgXiP /CYQ== X-Gm-Message-State: AO0yUKWeKHI7a3fir+fipQkZ73SwTn+UYBGpNL2ZaHWZjkHYiIpBt2hT xpScmEp7TcVRuNxMGdS+NofAPRD199fHbSsWUfdhntYedL8YntWSVoIkQeP8xXovQz12v/tcAnf 7+TdCSMvnkko0NZJEQnhq0Seu X-Received: by 2002:ac8:5a0c:0:b0:3b5:87db:f979 with SMTP id n12-20020ac85a0c000000b003b587dbf979mr36968152qta.5.1675639032210; Sun, 05 Feb 2023 15:17:12 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757035293956001203?= X-GMAIL-MSGID: =?utf-8?q?1757035293956001203?= 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,