Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3108726lqo; Tue, 14 May 2024 22:51:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpOuJwxKHkGxy1fwBdGUZIWj4j5N+9qFhu/UCMiHqbAEODugMqoy+KfIiiEpQ81jpJFx6IHtRBFIHhjdQHH9pHRVbTAjG6XRPbAUaWhA== X-Google-Smtp-Source: AGHT+IGoYxRhFYDGHxExs26yof2PUUSFskGitAKvaGWZBl8Kq7GsHE8DbgIfWFgrbZBQJC00DLLz X-Received: by 2002:a05:6214:4890:b0:6a0:cef9:d45e with SMTP id 6a1803df08f44-6a168211714mr167812656d6.50.1715752266114; Tue, 14 May 2024 22:51:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715752266; cv=pass; d=google.com; s=arc-20160816; b=ckZHuoRnnFnWaQjNtaT1gG1qFzndq3vbPyaOMMZTjUXrWA+6aluRBpHlmTotYQi1+m 7XynumoOT5RCSAZPsC0HxthF6mhf/laiTlbif7DplLS6Gq7dxaZNG/aRmv0QYHnjsrFk j01VIlmHvlRSIRgIkRuM99XhOZ2wFVsq62IjEcHaqlm7GTev4bjqKWpXgaxTnigVu7/0 WPGgXh3ZSk6PNi6fuGapz0iwh9hm8lnqPWTHLQvk6/bEPb5gGE9wT8qh6hw1SuFzN/CK /8wLxQWg7z9SWtw584rPRAvKBtDHJeNTJN5QVTcfxnUrhc4mMojFZFxlHufzk2aSjNfT lw3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :dkim-signature:dkim-signature:from; bh=p2pxGrHqcjpgn9i44FUKrB0I06kYBSdcJdo4aSs08Lg=; fh=XQ/TRuLBEe8rSeQndCGgph29Fl+bkGv50Y6A78PoM+w=; b=gbMhCOQ3Qm0kaHdLuFEdDeD7WWa5PeUNYYEMyrw+LFmpYUo5lM5fpi/wyu77zdq/KQ XA6Oj1yHP7GyJo8oiuXjCIe0ifMLNkGLBCTT8jNkfTh4d8EpofWfP7AGGS6ZWr/Wh6cW hXwXxu61F9OaE1jjBkv+NU4+qvGW318mSaP9nLbnYuS1IdZo1/UAh34gXnOZ/0uzy9Qy yjatGwUcDov7JP/QKyR7ypFHSWRM+2M3L5rlgdxkci90jlOxbwfFiIoZCKw8MIEWcVjT CvfPCXN5GLyyM4YS13ligeL/qku5qphch+ZjPDQDSCZXEpS3GpzpLWGNr+dBNVIaRa1l 7CBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="o/bOdpdC"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-179475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2b73b1si131801296d6.376.2024.05.14.22.51.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 22:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="o/bOdpdC"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-179475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D17241C20C33 for ; Wed, 15 May 2024 05:51:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF85C3BB24; Wed, 15 May 2024 05:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="o/bOdpdC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lYMY5V7K" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 958D03A1CA for ; Wed, 15 May 2024 05:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752252; cv=none; b=YsfONrFap37dYjLMAgOQ0kpVJJKgIVvdfGsQevhiCRqjrohONSKtQkFMVn0j2mWITO8xdFc/8aIBf4XDsQ/J4bkG9TbVrRk+eVNBYrlrMIHaMPKLnKgwqCLfA7D4W14YTJv9uDxQZQ0IqN9tedkbO2p0grl46e+nGahjze5EcxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752252; c=relaxed/simple; bh=bAhNtYpeytHIayczbtI9m47isJ2hviPgeSm8Ha+G1DA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=qaaEr8SRVm/p3VQTeSFBKrJv9voWnoe7q0KkfBinFOjrBFkS/kJKMtJPMzpmmZMpmVG3Rfq6olAqOznO/FmRMpV861KqClvkn+Ounlh0Qd3ANjdE8pDwCp5ZuuEYfxmmT0HSz0z9bv00zsdobCo56IxmBB9gUoHlMTjYBMzaFpk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=o/bOdpdC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lYMY5V7K; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715752248; 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; bh=p2pxGrHqcjpgn9i44FUKrB0I06kYBSdcJdo4aSs08Lg=; b=o/bOdpdCDquB2BlFy1SOm8ptdjQk1Wy0EJxJU10EVxhf/3zddi8KYBjen+BJft7tspUzz+ 3TXyQ1tD9gIdLSxQWq5yLiLaHxmW6Gfbik5S8LjQ2d+4SEr+EoYJBRWsTx3oM3kAQOFtzU /NajR4h76N+T2SM0/I4Y5CAQhDSRus+mpiKRxsA5UQ8zq617yWUJEfktC/XkfLoqq6vJtX VV+YF6ooh4gYzOwEqbhpubpYIJP1D6rn4Ih+LAC1xsh9PA+UNwVOGWaJe8C7iLEvOZInMy EjvzsNY4KDpcVCenBLH1JTJO+zkaSD30UYlf5xeF0Ptejdhr0m3kiE21tl3P0w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715752248; 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; bh=p2pxGrHqcjpgn9i44FUKrB0I06kYBSdcJdo4aSs08Lg=; b=lYMY5V7KUQISQ2HASD43vvZqJJHHtRBbloeGv92BmKsbcn9ty5ajUkzdhTFvsbAQojHY+e JlbaGrUKwJH2R3Dg== To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Nam Cao Subject: [PATCH 0/2] riscv: fix debug_pagealloc Date: Wed, 15 May 2024 07:50:38 +0200 Message-Id: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The debug_pagealloc feature is not functional on RISCV. With this feature enabled (CONFIG_DEBUG_PAGEALLOC=y and debug_pagealloc=on), kernel crashes early during boot. QEMU command that can reproduce this problem: qemu-system-riscv64 -machine virt \ -kernel Image \ -append "console=ttyS0 root=/dev/vda debug_pagealloc=on" \ -nographic \ -drive "file=root.img,format=raw,id=hd0" \ -device virtio-blk-device,drive=hd0 \ -m 4G \ This series makes debug_pagealloc functional. Nam Cao (2): riscv: force PAGE_SIZE linear mapping if debug_pagealloc is enabled riscv: rewrite __kernel_map_pages() to fix sleeping in invalid context arch/riscv/mm/init.c | 3 +++ arch/riscv/mm/pageattr.c | 28 ++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) -- 2.39.2