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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 905ECE95367 for ; Wed, 4 Feb 2026 09:36:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1220308.1529015 (Exim 4.92) (envelope-from ) id 1vnZJS-0006Hr-1l; Wed, 04 Feb 2026 09:36:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1220308.1529015; Wed, 04 Feb 2026 09:36:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnZJR-0006Hk-VV; Wed, 04 Feb 2026 09:36:41 +0000 Received: by outflank-mailman (input) for mailman id 1220308; Wed, 04 Feb 2026 09:36:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vnZJR-0006He-6T for xen-devel@lists.xenproject.org; Wed, 04 Feb 2026 09:36:41 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 01437435-01ad-11f1-9ccf-f158ae23cfc8; Wed, 04 Feb 2026 10:36:39 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-43615d9c507so911854f8f.1 for ; Wed, 04 Feb 2026 01:36:39 -0800 (PST) Received: from [192.168.1.6] (user-109-243-67-101.play-internet.pl. [109.243.67.101]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436180640f2sm4813162f8f.39.2026.02.04.01.36.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Feb 2026 01:36:37 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 01437435-01ad-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770197798; x=1770802598; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=d8FhrIYvrBOrKBYpV2bfmalL8B4kMQdKJZx2ydgP9aU=; b=QZAM78nkocSE8OFlsXHtVQRCzA8xN4kUP162J3BXDBWEweakr3JifgEy15nFM0B3Yl w3/EZwdsmcv9VHV0Mtf4R4r5NOPrLXnPDHhq2G+azwD5eHiyygYXvh3pMUoyvq3gmvxD PEQPZSKT9D2NHh1d7Kj2uUOoJVLc254cOINidhSD/FrCcqC6f0ln3jFgVrQE+dd22Bkf CYN123CVWylnWD+wxTF1VMILXZNHSMb8iVkrkTs1DhetZexec6/OuK7yJOlQKOmtvkIT 9ivCZUdpaqV6NY40zN9YCNXl47peF+4iPiB28ElUOeTOtp5AhtEItf4v7OVzJal8w4vK 9nFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770197798; x=1770802598; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d8FhrIYvrBOrKBYpV2bfmalL8B4kMQdKJZx2ydgP9aU=; b=gpCBY+jWS9psXnLDVxqoxMGiLxKvaMo2n7IVHZPVPIRpYFYv2ND+Uzj5tzwZlIvGUn y7+PPNdvXcnaaoPJydHIHmnzvQoIFgg5Y+JKTYnHp5Ksi6vHgvoYhyCVrj+3pdvEkoPP ssSHbJtW4qeDoHHQUpBuMmDXtS72HVyeMbKgi7nqaaSZxEGB2yozzdltU5083CqVKnYH 3IfXU46MdQrIzmAmfa0GCfuWEQ1Vm7nY+s5GDBbhLBkOzmUXgqMrwXo6L4GO8Uey1w9U SaOdrPMqn9VpgHIzwq5MdFvDbPpyRkpzwQlbR80Qmn4sB7k80DzzLhm7YSjtLw4fc/fk aC2A== X-Forwarded-Encrypted: i=1; AJvYcCU7+BU55iWNUKRBoqMojKRredmQJPzoZaBzBrL5abtCgCEr8FpARRvAL/DNEtFU56KuoVAAa/TCaJI=@lists.xenproject.org X-Gm-Message-State: AOJu0Yz1jnYtVbTnVKlrCXs94Fg/JpsmT1TMsm/5FsEuktSoqAcHYaRS jPdO6fEZD8W6eXO5RaKt8QfQpQSTL+q2F1pgIt1ZF9KEy+f+W8ZliOtu X-Gm-Gg: AZuq6aIHtHer6bPKQi3VJfg1myhqC9Q3zHJvgSMsHbZ5jeUrfxlrc+x25KTwvHKUkhT Lwv89KHaHKndSw0oTSY8wMoVNQsPPQrfMQVBsHL4Nlb/MF2f858+QaWIt7UAVlIWfdjBoYxosiE RozxyT01DViLgnPZIBnTa/6745zwYSvd4Zdno3GxwEJFVOS51JPfAtmdmIrwl0D9axs5bivRN4a W/syRiG/nSy8I56U88WGq6I+5AKwSTbg/v5K3yyceXVMG0Y9Kn0ZUUwxH8nZxoHERJDN11yxotp tCG9X7uXqe1yxdp2qPIo/jfFhbekbOZK8IwESNhZk5/sySY37DYJekduD6iivwjx/h3/afLFD+n wTyPLJCM/IHVGNOKPYFD0BFmGTTcusT3MxfV+5j7hhiUXk/FA0cJ3JpApx/slL9O5K6ld3VHV/G tFGl9gEJPUo1cGOUFReoKZaLKWEOsEtfXnV0HOVA3d/riOf2Wb7LljofdP5C8bq6s= X-Received: by 2002:a05:6000:4211:b0:430:8583:d182 with SMTP id ffacd0b85a97d-436180575efmr3336352f8f.29.1770197798153; Wed, 04 Feb 2026 01:36:38 -0800 (PST) Message-ID: Date: Wed, 4 Feb 2026 10:36:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 12/16] xen/riscv: introduce sbi_set_timer() To: Jan Beulich Cc: Alistair Francis , Connor Davis , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Romain Caritey , xen-devel@lists.xenproject.org References: <2fd4da2ad7c4af2241368edba739b24d0e976552.1769099885.git.oleksii.kurochko@gmail.com> Content-Language: en-US From: Oleksii Kurochko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/4/26 7:50 AM, Jan Beulich wrote: > On 22.01.2026 17:47, Oleksii Kurochko wrote: >> --- a/xen/arch/riscv/include/asm/sbi.h >> +++ b/xen/arch/riscv/include/asm/sbi.h >> @@ -29,6 +29,10 @@ >> >> #define SBI_EXT_BASE 0x10 >> #define SBI_EXT_RFENCE 0x52464E43 >> +#define SBI_EXT_TIME 0x54494D45 >> + >> +/* SBI function IDs for TIME extension */ >> +#define SBI_EXT_TIME_SET_TIMER 0x0 > Nit: Do you really mean to have the time extension IDs above ... > >> /* SBI function IDs for BASE extension */ >> #define SBI_EXT_BASE_GET_SPEC_VERSION 0x0 > ... the base extension ones? I will move it after SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID to be aligned with how extensions are declared. > >> @@ -134,6 +138,20 @@ int sbi_remote_hfence_gvma(const cpumask_t *cpu_mask, vaddr_t start, >> int sbi_remote_hfence_gvma_vmid(const cpumask_t *cpu_mask, vaddr_t start, >> size_t size, unsigned long vmid); >> >> +/* >> + * Programs the clock for next event after stime_value time. This function also >> + * clears the pending timer interrupt bit. >> + * If the supervisor wishes to clear the timer interrupt without scheduling the >> + * next timer event, it can either request a timer interrupt infinitely far >> + * into the future (i.e., (uint64_t)-1), or it can instead mask the timer >> + * interrupt by clearing sie.STIE CSR bit. >> + * The stime_value parameter represents absolute time measured in ticks. >> + * >> + * This SBI call returns 0 upon success or an implementation specific negative >> + * error code. >> + */ >> +extern int (*sbi_set_timer)(uint64_t stime_value); > __read_mostly or even __ro_after_init? I will add __ro_after_init to be in sync with sbi_rfence. > >> @@ -326,6 +358,14 @@ int __init sbi_init(void) >> sbi_rfence = sbi_rfence_v02; >> printk("SBI v0.2 RFENCE extension detected\n"); >> } >> + >> + if ( sbi_probe_extension(SBI_EXT_TIME) > 0 ) >> + { >> + sbi_set_timer = sbi_set_timer_v02; >> + printk("SBI v0.2 TIME extension detected\n"); > Is this really relevant to log especially in release builds? IOW can this at > least be downgraded to dprintk()? Probably not, it could be useful for debugging to understand what kind and version of extension is used. I am okay with using of dprintk(). Thanks. ~ Oleksii