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,