Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2297913rdb; Mon, 25 Dec 2023 05:03:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8Cd754/5NW2yHRwYtvy3E0MXrWB5KrV9rCLzLapKv5oIKd17o5c7fa5vxiQx+KshGlevU X-Received: by 2002:a05:6214:5691:b0:67f:bc1e:d4f8 with SMTP id qm17-20020a056214569100b0067fbc1ed4f8mr925554qvb.33.1703509437165; Mon, 25 Dec 2023 05:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703509437; cv=none; d=google.com; s=arc-20160816; b=j9sRezlo50IS5gvvgQqTd2klZz3Q+eTl/JErBTusv2gdGr+hbo1QY1zbUzexYqZBx5 6tZN+zes7KWyBahy9atcM2aBrb+387kjprw7CW/3T+GiBIXmUxkZfkbUdypFMZzhnT8a nPSTm41SeuyMxgwR22FXeBS4E3eEW2MG3TkgUIG2skgfp6r7mdHflU2V/wfFAo6hn9i8 1JcAF9EpV+Ekd+17t8/Rw7EcwQQJwFHh8j3Ag4mPmiX9iQBJjz8Px8uPtiOCf5LndGBD KpGgSqKfzSKbsRHX9+ARG64fDdNon4ja+YiDgTQFvLo6bCu9KNu+p/5tW9e19HeBXgmL OEmA== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RerE6EiVWkxn17M5ODYAV9l8KSfD1gwdYoQViWYSpSE=; fh=aos4oD+Llfsos2DBOalqQJ69U2YLuKYcVP3FbCBwZDg=; b=A545v1J2WLvQjzNV/wkxSFSB5GFwYt8g9UO9Zzp4h6JKhQLlyIep654jqFFSdN+eG+ m1+nzqAktDA9anf4IRbeyLBQYrRfrJo92PxWkQIa7KxDC1qI+4pz1HIAy4tD2B/bY1vt nzr6kjIlapfFbTjn9nzYp4uKzaI1jZ/ItzLRmhlr6bZ9f1lNf9cdi47hl2ys0BBPJFHz vBM6dOhJgB1LIIdA964M3g42sBPvt504udKPoXzbrPFPUtECsHQpw6PAOoEfigDFFwNm OiHe6QuwVgOBMEaRVeMe72Yuk+xgwCl1ID7hv9GP/Bty+upT3beGlnDk/3eOqLbrpWOk Dp/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sYOnsCqw; spf=pass (google.com: domain of linux-kernel+bounces-11055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g1-20020a0ce4c1000000b0067f668e360csi10457189qvm.401.2023.12.25.05.03.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 05:03:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sYOnsCqw; spf=pass (google.com: domain of linux-kernel+bounces-11055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 E67F71C2185A for ; Mon, 25 Dec 2023 13:03:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9A3956390; Mon, 25 Dec 2023 13:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sYOnsCqw" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 269C456380; Mon, 25 Dec 2023 13:00:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B638FC433C7; Mon, 25 Dec 2023 13:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703509205; bh=StaFuzcUuHAmdOS1W5kvlQVaB4JSpyMdgCSoJ5pjJQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYOnsCqwgW1tcB47qW116GGBQZB/reWYmeKv8UYPQHedatg3VxtJfbdBfVGXMQevr JeywBCUgiEQ3YDWKXmC6KX2u2QKvcmgG9DWgQj7ygvxrpF99qol9yCZrgIg0tJZ38w RygQO05nm3btR9KtQ9RSuhb+KX474IW6gTMveqDA0D92U8yTKieklcIcwsz1Rxngwe Nqq4IW5JlgtqZh5FI+f4t1Oen+Q/EgnW2Cx+hx5SEW5sOEYCL3p94rgX59YmVKukbk s3HQ08nKf8P5EWFKjk8tAXFqELPR5S1t26WTmTy+BbHx4uXCoyk7ATebs4LR3cBS+l 2a9uuVpXNhkLw== From: guoren@kernel.org To: paul.walmsley@sifive.com, palmer@dabbelt.com, guoren@kernel.org, panqinglin2020@iscas.ac.cn, bjorn@rivosinc.com, conor.dooley@microchip.com, leobras@redhat.com, peterz@infradead.org, anup@brainfault.org, keescook@chromium.org, wuwei2016@iscas.ac.cn, xiaoguang.xing@sophgo.com, chao.wei@sophgo.com, unicorn_wang@outlook.com, uwu@icenowy.me, jszhang@kernel.org, wefu@redhat.com, atishp@atishpatra.org Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Guo Ren Subject: [PATCH V12 13/14] RISC-V: paravirt: pvqspinlock: Add kconfig entry Date: Mon, 25 Dec 2023 07:58:46 -0500 Message-Id: <20231225125847.2778638-14-guoren@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231225125847.2778638-1-guoren@kernel.org> References: <20231225125847.2778638-1-guoren@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Guo Ren Add kconfig entry for paravirt_spinlock, an unfair qspinlock virtualization-friendly backend, by halting the virtual CPU rather than spinning. Reviewed-by: Leonardo Bras Signed-off-by: Guo Ren Signed-off-by: Guo Ren --- arch/riscv/Kconfig | 12 ++++++++++++ arch/riscv/kernel/Makefile | 1 + 2 files changed, 13 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index b7673c5c0997..7df3d50733c6 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -780,6 +780,18 @@ config RANDOMIZE_BASE If unsure, say N. +config PARAVIRT_SPINLOCKS + bool "Paravirtualization layer for spinlocks" + depends on QUEUED_SPINLOCKS + default y + help + Paravirtualized spinlocks allow a unfair qspinlock to replace the + test-set kvm-guest virt spinlock implementation with something + virtualization-friendly, for example, halt the virtual CPU rather + than spinning. + + If you are unsure how to answer this question, answer Y. + endmenu # "Kernel features" menu "Boot options" diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index fee22a3d1b53..2e0754e422cf 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -102,3 +102,4 @@ obj-$(CONFIG_COMPAT) += compat_vdso/ obj-$(CONFIG_64BIT) += pi/ obj-$(CONFIG_ACPI) += acpi.o +obj-$(CONFIG_PARAVIRT_SPINLOCKS) += qspinlock_paravirt.o -- 2.40.1