From patchwork Tue Sep 24 15:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 13811018 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AFD3CF9C6F for ; Tue, 24 Sep 2024 15:42:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B65D06B00A0; Tue, 24 Sep 2024 11:42:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B15B96B00A2; Tue, 24 Sep 2024 11:42:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B63E6B00A3; Tue, 24 Sep 2024 11:42:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7B5E46B00A0 for ; Tue, 24 Sep 2024 11:42:16 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E0C82C1B93 for ; Tue, 24 Sep 2024 15:42:15 +0000 (UTC) X-FDA: 82600048230.26.DB030CC Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) by imf12.hostedemail.com (Postfix) with ESMTP id 33AA840029 for ; Tue, 24 Sep 2024 15:42:13 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=a1sIdz9Z; spf=pass (imf12.hostedemail.com: domain of groeck7@gmail.com designates 209.85.160.47 as permitted sender) smtp.mailfrom=groeck7@gmail.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727192375; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=ixG4ZDMzlyFb54v95QvHKMCeLFRVK54R0LPeEeUbegM=; b=rGrX4jT8YyERsLzu30xGWLofvnVSxW5WWQqF2vluFWTDJVL4ukbfKhBNk8oBuGo6wMWqlw q4dOmSQm1SIH1ckD0dA0D1WQizECny5pPkhwyPsVIo8MKa+ETXjck6f5QFo6RNY286XwmH Ds6A10tiPaerfXZ5hCvEuxzyODUmp0Q= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=a1sIdz9Z; spf=pass (imf12.hostedemail.com: domain of groeck7@gmail.com designates 209.85.160.47 as permitted sender) smtp.mailfrom=groeck7@gmail.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727192375; a=rsa-sha256; cv=none; b=BCZ1C8QNWymfcna7UcUbkzFch4Dl8jXff9rX1W0Vn3OP2I5Q7OS/zwuDauy62CHOOfTY1L feVAz5eybU2aDy5ZTol9xv7U6snZBoHflcNYbnN0+jidPYvyftSHxpTrGR1CtD9+ipb7tr ip8gKof4zDAJHPDdE0D9NPUL+fQ7rIk= Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-27b55c4b35eso1906079fac.3 for ; Tue, 24 Sep 2024 08:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727192532; x=1727797332; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=ixG4ZDMzlyFb54v95QvHKMCeLFRVK54R0LPeEeUbegM=; b=a1sIdz9Zh+dcvaPP+zqPdLS3BlExVcTGWu2LjywDF6aZMdCqszW3chHVjgvWQn8Qge IocvoXMZgXg5GsqEajoQ6r4dPYxVlZyc5gxpD8PIdAZFbXExYBtDYgAcnchS6q4uoiHw pvjWtnO42a7D/KWWngrYvH9rFArzi2VYEdjrNJv1tCbcL3ctOqwFe57Nv7Womo7dtvxU D+q3HgAm2suno3WgZ3LfUFbNe0Y47HS0D1TikT/pwgTYVOhjAiVWYBNECg0FhRkTAu6O cyZO/fBIfxtA/yZF3qJF3/jPPpoEHT79QTYOgRIn009JXPtmpvUgLmyS6bZ8Jeaz52B1 AAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727192532; x=1727797332; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ixG4ZDMzlyFb54v95QvHKMCeLFRVK54R0LPeEeUbegM=; b=YX+Wd47Hq9c0EeLvDJJOw2zyJTXgynPkxZW4K7J/J0TehNwBt5K7h6jwlEasDdGm1G 04uWz7LSiKNbberE1oE8RRrXX6CkWG6PXCxRU12XFWlblSg7zKhqa40+cXfUtAfczjsh OW8mxfA7OEXW5zA3aehFHrj/Zb8EHeabyDNll7PUqf7k9dpROg//ri7VhTrF+pfkjQdq SmSOcKRHZxbjH1xBRFfUbXYWYi5k9F03MVrxcwOboXtcot3xqLLQXnj06Nw9cxQQe7kW hjGoMkY2K8ngEezq4Aiep+tPHuA0LtNBnf4ezB2Iy+HfNZM2JJ6OmoTjot7LcUZqgDcT NROQ== X-Gm-Message-State: AOJu0YwSPHyM0ysGpMFgZjNUDWL7q3TmtXSEOdApfHvvRIJ4dU1RsEo/ obeGoKc1OLmIcgg0e0HBC0Ushg/4zsP6HnS4kfWDJ4uZBiq6kC2p X-Google-Smtp-Source: AGHT+IE+4oss++7wD3iX/wU5uMQRYlB9EgVM04UXG3m9krNJWRpmzDKONTiHTanuM1LlFyp5S+aFDg== X-Received: by 2002:a05:6871:112:b0:270:5320:2d6d with SMTP id 586e51a60fabf-2803a8d5e31mr8435467fac.47.1727192532170; Tue, 24 Sep 2024 08:42:12 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6b7c308efsm1343612a12.1.2024.09.24.08.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 08:42:11 -0700 (PDT) From: Guenter Roeck To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Guenter Roeck , David Hildenbrand , Geert Uytterhoeven Subject: [PATCH v3] mm: Make SPLIT_PTE_PTLOCKS depend on SMP Date: Tue, 24 Sep 2024 08:42:05 -0700 Message-ID: <20240924154205.1491376-1-linux@roeck-us.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 33AA840029 X-Stat-Signature: xe6b7xbypzwegy18mqaa5qhoc7m6ys36 X-Rspam-User: X-HE-Tag: 1727192533-747914 X-HE-Meta: U2FsdGVkX1+BFJ5mSxq9tFfvOUkehcIWhqczJZ+ESnaPvz/cNXyJ3oiq3xfMQCIQ4Z1uLPUlZwzJS04Jb1h0uiGN7IfWF5Y+QugjFwjBZuU6OCiUbVMe33yuZrFL1LvyklMIu1C3DxWJO2pAi5l/3ElvDQYxPDd03jkno93cxNl1vLXYyUMgyN4J+/OR+J0c+ma7EI5W0D0piDkZJAi2KRzjYPENACFB4x+3TPqx3xIrCNW0ADbwHFNV5iHePu4KYzabWKhOE+a3736S5vkv9YB7kn2aPJU0fM2crMNPK/IttBzy0ZHMZwtRRriIFpW7mUZ/c5oNyNF/71Gru1n6ayYZxv2Oc3r/btU//U4L7XaCZ278GrFht2P1lWtpV5Vyg4jFZIk8vXuglfoxAabHN8u7lhsUxDL5rRLvLw8Is159VUtMo9w0eWl2ke6RYJQAi1oqgMWLpfd1IViubJFKNs2tQ5sf6EeXgNoFP2HxCj9+jyoJXu9D0OSkI49IKSop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qHuRWwsUwbeuEMrJgU4DyhFXEtR0F9MxrgUAdocvjSAErrGbzjewHgSc/TNB7qShMNgUf8th+kPdu4CDUgCfsVlgYZ8U8crUP4n7FX/Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: SPLIT_PTE_PTLOCKS depends on "NR_CPUS >= 4". Unfortunately, that evaluates to true if there is no NR_CPUS configuration option. This results in CONFIG_SPLIT_PTE_PTLOCKS=y for mac_defconfig. This in turn causes the m68k "q800" and "virt" machines to crash in qemu if debugging options are enabled. Making CONFIG_SPLIT_PTE_PTLOCKS dependent on the existence of NR_CPUS does not work since a dependency on the existence of a numeric Kconfig entry always evaluates to false. Example: config HAVE_NO_NR_CPUS def_bool y depends on !NR_CPUS After adding this to a Kconfig file, "make defconfig" includes: $ grep NR_CPUS .config CONFIG_NR_CPUS=64 CONFIG_HAVE_NO_NR_CPUS=y Defining NR_CPUS for m68k does not help either since many architectures define NR_CPUS only for SMP configurations. Make SPLIT_PTE_PTLOCKS depend on SMP instead to solve the problem. Fixes: 394290cba966 ("mm: turn USE_SPLIT_PTE_PTLOCKS / USE_SPLIT_PTE_PTLOCKS into Kconfig options") Cc: David Hildenbrand Cc: Andrew Morton Cc: Geert Uytterhoeven Signed-off-by: Guenter Roeck Acked-by: David Hildenbrand Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven --- v3: Make SPLIT_PTE_PTLOCKS depend on SMP instead of defining NR_CPUS for m68k. Drop David's Acked-by: tag. v2: Instead of trying to make SPLIT_PTE_PTLOCKS depend on the existence of NR_CPUS, define NR_CPUS for m68k. https://lore.kernel.org/lkml/20240923235617.1584056-1-linux@roeck-us.net/ v1: https://lore.kernel.org/lkml/20240923142533.1197982-1-linux@roeck-us.net/ mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index e85164c2812b..33fa51d608dc 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -595,6 +595,7 @@ config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE config SPLIT_PTE_PTLOCKS def_bool y depends on MMU + depends on SMP depends on NR_CPUS >= 4 depends on !ARM || CPU_CACHE_VIPT depends on !PARISC || PA20