Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1462337pxb; Thu, 14 Apr 2022 06:49:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmhtbLZ+ZGWqvLK4hHRnq3UMw74kb57wq0H5mWohteE621ftYtPZCtuZwVRDPNRF+NJT4j X-Received: by 2002:a17:902:7795:b0:157:c50:53a6 with SMTP id o21-20020a170902779500b001570c5053a6mr35024462pll.40.1649944174933; Thu, 14 Apr 2022 06:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649944174; cv=none; d=google.com; s=arc-20160816; b=ksOZldOwv4DSD7sUwPa7tk7sH3M7036uGfZoUbv6gV6gaq+IET9XYOM3XUOa3wESg6 LzTwcZnptmH4unWQJoGcxGz4UcnmMKO9v+ta1EXOC+abA5shzNGVo+3ISxMDN6KWCN2C NhzL7LLYSwNsopqSQsZTLl+eo6oXkQ37mTA4OFsbLpmKi6p08mhaUoniV910T3EJgnh0 2DG7CNhEcUypSpVk7+dsN7eIP8n0rHj8RLmgaxJwp1cNfQQ2sRq7mokoUc0p9B+j1MyB 34EBmQjrtF8EQlDJpAKm8VGRMf+K4BI3eaTVKEQ2UFgXBx/RU2GTeh1cEa94b2Rdx+f6 ZBVg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2D/qBXdrk7ZXIoBr7a89aPIY20fw/HMXa9aQEJud9fA=; b=ulxjSOctqr70Xof9zZTjRmAZYKSSI8dZbgoA8KeSPxpUVevKL2RkxB5gQBa98Y1AMo 6vVjbOmU6rNfwLK/3R/X/AQ8K72uY3rkzKZ7wM3AkQYzsdBOJtQXOUyWCk2DobZJIF2A Ls6UfJAAcIHswoijk7cyLGhgm9wRLOtJqNcXYmvNHEH0WktN0etDpnFSiFlTFX07TsoK vPy9yKqZFr7Lx/7XBWWxN53D5jkoYPY47gVFXJwHbnYCgHmeOU4fdS1NPZPohvg7yaeD HtEDn4e3A1ePD2Bno/Sg3Vej25Q7h8nNb9vh53vibEIMHFJYHtc5YPAedqpXYnjeCS3o ZCyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=B7ESQlFR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b0039db9ceaea8si3655936pgd.771.2022.04.14.06.49.16; Thu, 14 Apr 2022 06:49:34 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=B7ESQlFR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238388AbiDMXwP (ORCPT + 99 others); Wed, 13 Apr 2022 19:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiDMXwK (ORCPT ); Wed, 13 Apr 2022 19:52:10 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7104C3CFCB for ; Wed, 13 Apr 2022 16:49:46 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id bg24so3551667pjb.1 for ; Wed, 13 Apr 2022 16:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2D/qBXdrk7ZXIoBr7a89aPIY20fw/HMXa9aQEJud9fA=; b=B7ESQlFRcLSjm8ncxhQggA9eJW5n7dvus1LsemSYq3h/tA9JxUM1Cx1h0ey5iqPVCI ZsZCrosRxaOY+V59K161xjtvovm6aGW3EiGFEWhxkY5Y6XLqOaZtJPSsK4HobbJxhGdt iyleaYOVVFHkevCL1Yju5RVzS6AYe3T1v9g5hY8kltHmgq8zKWsLE5vuEJbAXdWb44pa maDHPgfb68vMVKEBHNnAerhnt2lpqF6d2tN0j7XYCujfIirsjqCSVjRxtLr8KBk5d1OO EaEZ20LCJN9aTS55PmhJnsHnq+jG2VppDayu9XrUPDxrvfTx7IUwcRMukUTOajp41QS5 UyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2D/qBXdrk7ZXIoBr7a89aPIY20fw/HMXa9aQEJud9fA=; b=Oqe66Oqt8LQjMoZNgZfskOdohik50s/40zd6HCOKhS4PxDWz20gQ4+sDomR/wy14ut 9+eft9Zb6TlIJQyLE6iNK3s1duLcfzxX2qhHKCPzlhVQcmITVNpOAduf+U/M+J7MPdwT jN926cVfbhVdW8FPBHeysZmPK6Rv6dyChKGDsgXNqMHcTsl95kf6B88LFx0K/Mf8sgI9 iWw5DWLtMGK1GTdY9H0vgWcrf2eeBUi117QM/vvbtph7lgL6qhHtKwPJBIe8VHfbRddb ByaYTJOeyZ2JqTgf5kaYWjotf+xtyR6x+Y85kkkI+ZnPSBSTo/Z496kB77DhobhIwpMD 6+8g== X-Gm-Message-State: AOAM530Bkti7mDuGNBbNkDOWj63xRn9ip0JuKkX8l2fWbcqlr/3NS3pe ZjWZloaeCuhZc+HLG8l9D4Q= X-Received: by 2002:a17:90b:4c43:b0:1cb:bc2c:ad4a with SMTP id np3-20020a17090b4c4300b001cbbc2cad4amr675144pjb.230.1649893785961; Wed, 13 Apr 2022 16:49:45 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:400:e00:389b:6ba3:7cbd:d8d]) by smtp.gmail.com with ESMTPSA id d20-20020a056a00199400b005060849909esm197075pfl.176.2022.04.13.16.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 16:49:45 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: [PATCH 0/3] xtensa: allow handling protection faults in noMMU Date: Wed, 13 Apr 2022 16:49:27 -0700 Message-Id: <20220413234930.1212335-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, most xtensa cores have some sort of memory protection mechanism, even those without full MMU. This series separates protection fault handling from the CONFIG_MMU setting and allows noMMU configurations to also do it. This improves userspace behavior in case of errors such as passing NULL pointer to a syscall that expects a valid memory pointer: instead of killing the process the kernel is now able to return -EINVAL from a syscall. Max Filippov (3): xtensa: move asid_cache from fault.c to mmu.c xtensa: extract vmalloc_fault code into a function xtensa: noMMU: allow handling protection faults arch/xtensa/Kconfig | 11 ++++ arch/xtensa/kernel/traps.c | 20 +++---- arch/xtensa/mm/Makefile | 3 +- arch/xtensa/mm/fault.c | 112 +++++++++++++++++++------------------ arch/xtensa/mm/mmu.c | 2 + 5 files changed, 83 insertions(+), 65 deletions(-) -- 2.30.2