From nobody Tue Dec 2 02:57:41 2025 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3668B3074BB; Tue, 18 Nov 2025 08:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763453241; cv=none; b=urZM7yoyfhFCtCL/1GfYzXTJ/fhsKrdh6McqC34OzgIA6DW+2Ihy07wECwqwK3Ar9lnmocbakL5K8QF/OTUiMGPjomiAnPjR8eFwHNT2jrEyiEDUMWZf2bYAG58crJwyD1Fiq42vCMQzI6vqZXCM3zRlrhhW+LJOGMHDN5stEog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763453241; c=relaxed/simple; bh=FHBYnYx9E71kz6F0WzQVGiFMwXRhZuGue7tKqX4UKcc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AZzMy+7JE9P7CcB0ToSuCliq5hjcWybaMUNZhVYw0SJfk1M+6OcSoUse8S12ZDCzfL5ccv3brARvrtiPbGWRrdW4nqYtWWmzVIACIRvbSU32qq85DEtBRxMMvtbKcM4U4SsAJfK9GkbaseNCPK7+AJHze11iDC2jxmV1bhXxrgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.2.5.213]) by gateway (Coremail) with SMTP id _____8Cxbb8yKRxpCtkkAA--.12932S3; Tue, 18 Nov 2025 16:07:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by front1 (Coremail) with SMTP id qMiowJBxC8EsKRxpbBc3AQ--.49231S2; Tue, 18 Nov 2025 16:07:13 +0800 (CST) From: Bibo Mao To: Paolo Bonzini , Huacai Chen , Juergen Gross , Ajay Kaher , Alexey Makhalov , Broadcom internal kernel review list , WANG Xuerui Cc: kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, x86@kernel.org Subject: [PATCH 3/3] LoongArch: Add paravirt preempt hint print prompt Date: Tue, 18 Nov 2025 16:06:56 +0800 Message-Id: <20251118080656.2012805-4-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20251118080656.2012805-1-maobibo@loongson.cn> References: <20251118080656.2012805-1-maobibo@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJBxC8EsKRxpbBc3AQ--.49231S2 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Content-Type: text/plain; charset="utf-8" Add paravirt preempt hint print prompt together with steal timer information, so that it is easy to check whether paravirt preempt hint feature is enabled or not. Signed-off-by: Bibo Mao --- arch/loongarch/kernel/paravirt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/kernel/paravirt.c b/arch/loongarch/kernel/parav= irt.c index b99404b6b13f..b7ea511c288b 100644 --- a/arch/loongarch/kernel/paravirt.c +++ b/arch/loongarch/kernel/paravirt.c @@ -294,6 +294,7 @@ static struct notifier_block pv_reboot_nb =3D { int __init pv_time_init(void) { int r; + bool pv_preempted =3D false; =20 if (!kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) return 0; @@ -316,8 +317,10 @@ int __init pv_time_init(void) return r; } =20 - if (kvm_para_has_feature(KVM_FEATURE_PREEMPT_HINT)) + if (kvm_para_has_feature(KVM_FEATURE_PREEMPT_HINT)) { mp_ops.vcpu_is_preempted =3D pv_vcpu_is_preempted; + pv_preempted =3D true; + } #endif =20 static_call_update(pv_steal_clock, paravt_steal_clock); @@ -328,7 +331,10 @@ int __init pv_time_init(void) static_key_slow_inc(¶virt_steal_rq_enabled); #endif =20 - pr_info("Using paravirt steal-time\n"); + if (pv_preempted) + pr_info("Using paravirt steal-time with preempt hint enabled\n"); + else + pr_info("Using paravirt steal-time with preempt hint disabled\n"); =20 return 0; } --=20 2.39.3