Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2653332rwn; Fri, 16 Sep 2022 13:56:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77d6cHrP0RZtD5H/b4otBvarLmp1fQX474nHQG7v65FNAIgnK6/BnGWeHDygLsUCNX4xJc X-Received: by 2002:a17:902:d4c3:b0:178:1d5b:fb10 with SMTP id o3-20020a170902d4c300b001781d5bfb10mr1659188plg.108.1663361779365; Fri, 16 Sep 2022 13:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663361779; cv=none; d=google.com; s=arc-20160816; b=c8iQsXQ2LWVD2iNBfKmPje6wUovcLMfxY0KIz/u/WNFnvgRM6SRmDkZwQhJpYA/dgN /LYKhHawuWIX7HtCUVaN6B1oPk8wmPoZmpA73SKYoA/hzXSc4je6R0T3gcia2AOxDch+ Xw6ZhP7Me94MK8uhJMYZTPNeevsWdkQ9Ddv9yIWl8FSA/1makBl/GK100tupCpbRfEfF HyPZxpkJKSa/V6nVYPETJHd4yROH6/5KrMMlbhGKqdpa8UxtpNd4SfPnIXYBlBFg9fW3 x3y3zWKG5NlZbslwRKs+xs22eiK+8vN6O9Oub9lenxGo//XczDJDZ0aHu3y92ea7qfVr JBEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TsMblmh+whw0Y6G/T+5phEJp9Ji8yHMxQQQ7u1lRyXY=; b=rKtxyzcPX8REdOctdGiJ4+6sU0zglgz1gI0OQjx8Mo8cvjM7/N1PQl/nLT5aF1c4Ow /x1Q/IqgBu3iU0Q9hHIJKC+DM1MmiuAcXR3WkVcblF7bSzs+WIdMTyHri0zlICkCW/RP MN/gmRaDn3HSeJDIoM7jIdkjG4khbxtNHDhRqH6jIhPx+kXjWyDOY1u44mJlm6m486g0 qWCsmrXj1PNuhLfTGrck16whYZrV5tb/0B2XGePDb2GlDWHHxKaSz4jkvHo0YX9sxlkJ ncx5MqOhJvK25u5VVrFhdFLPnf+6JlkKb2zVzVfeKknBaKrWfkGugvPVRodOqgFaJ/OS btjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ncmgb346; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a17090a0c8400b00201d6d4cc79si3570906pja.113.2022.09.16.13.56.07; Fri, 16 Sep 2022 13:56:19 -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=@linux-foundation.org header.s=google header.b=Ncmgb346; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230193AbiIPUJq (ORCPT + 99 others); Fri, 16 Sep 2022 16:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbiIPUJo (ORCPT ); Fri, 16 Sep 2022 16:09:44 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 763EB11C1F for ; Fri, 16 Sep 2022 13:09:42 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id k10so37254524lfm.4 for ; Fri, 16 Sep 2022 13:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=TsMblmh+whw0Y6G/T+5phEJp9Ji8yHMxQQQ7u1lRyXY=; b=Ncmgb346gJscq3aycEEXnWjiY0CHuVAHV0RlaoWLU+j1MTRJpDoAsoEjr92c1ImEQE wUR2uXMmhrSr2EcRxP/0WQVj2BSKwChTvWjlVAhXdp87Y7fbMjzsZxXfpGgOfEtIIVq+ iI+UrAMASxvdzeBx3yA0yusS+tMecl61oCiMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=TsMblmh+whw0Y6G/T+5phEJp9Ji8yHMxQQQ7u1lRyXY=; b=Qyg0DLY8TYDk1dnbtiWAf7Ey9zWYkaJYgY3YrZ8emXIS7eKQw490ZMZnj2bW1HcRQA sqiwsE4l2BiSIb0i+ZvBvCsN6rti935btDNlyGUWDmavOHDskMGOzQ3L0mgomqL7FJpI 0m7sOQiDgN11ZS2/zSqpKJEUmZXHk3tSwY5n29yc1j0Hig3oMfmH/NmqIzZ3W2Y9JvDA B1kqcXZceJX/YaTVs/Sqy4n0QGCy5e0A5TUyQ6jQTUB33vR7eAUwqd8hlQoNXbTjXb8M fMnDd2TdQVncDZeBzW//TF+1ShGgKXHP+Lt8ZSw10VGEUHmszcjdHbrfiYsD+lohcQcF ULgQ== X-Gm-Message-State: ACrzQf3S2aGGO+BOAkXj8qqsoddrftJhy/OpRrqukKXsmxHOKBhU/9vF Y9qPi/N0okeRJ2h/8HsoinlA55jYwu7E1qXqaBc= X-Received: by 2002:a05:6512:6d6:b0:499:27c:1aa0 with SMTP id u22-20020a05651206d600b00499027c1aa0mr2302527lff.88.1663358980561; Fri, 16 Sep 2022 13:09:40 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id x12-20020a056512078c00b00498fd423cc3sm1771497lfr.295.2022.09.16.13.09.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Sep 2022 13:09:40 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id k10so37254461lfm.4 for ; Fri, 16 Sep 2022 13:09:39 -0700 (PDT) X-Received: by 2002:a19:4f45:0:b0:49a:63c9:190d with SMTP id a5-20020a194f45000000b0049a63c9190dmr2001777lfk.61.1663358979664; Fri, 16 Sep 2022 13:09:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Fri, 16 Sep 2022 13:09:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] RISC-V Fixes for 6.0-rc6 To: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Fri, Sep 16, 2022 at 8:31 AM Palmer Dabbelt wrote: > > I have one merge conflict as a result of a treewide fix, I'm getting some odd > output from just showing the merge (it's showing some of the fix too), but I > think the merge itself is OK. My fix is to keep the write lock > > - mmap_read_lock(mm); > ++ mmap_write_lock(mm); > + ret = walk_page_range_novma(mm, start, end, &pageattr_ops, NULL, > + &masks); > - mmap_read_unlock(mm); > ++ mmap_write_unlock(mm); Yes, thatr's the proper merge resolution. HOWEVER. Looking at the *callers* of this new __set_memory_mm(), this is all completely bogus and broken. In particular, fix_kernel_mem_early() does that call under rcu_read_lock(). You can't do that. Not with the read-lock, and not with the write-lock. You simply cannot (and must not) block while in a read-side critical section, and trying to take any sleeping lock - whether for reading or for writing - is just completely wrong. So I'm not doing this pull. The merge resolution is trivial, but the code is simply wrong. Linus