From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52C047DA6D for ; Thu, 24 Apr 2025 11:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745492456; cv=none; b=UrlxAzHtPT0lDh6AEOXutKnAu+CIw+s9szyonNmtgdPffaQ2Jp1l6WyliU9mJ2TMko/PQL2h0QW6tGZh9eNS6V+2SREA3F8X4mtHsv8nBAMoOjrLdPKP9EVsxht/tnpOmPqtysGRfYa6dTT7QqZDc+idNgl7+OYeRkWqGVtIMO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745492456; c=relaxed/simple; bh=ilVhurOAgxRINQp4J4plZnQ/Sve+oq9bjuZtm3BKBho=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HoU3lsxioIXKnW5YPhUeb43qqkxwdg7fUUV0F/cGick1dbpsUt3H/tLSjaUzAgHPsdf/v/CGtJhZjiOzKG7rO3Q1ARW4UwKCzHpJhnThnrbExEV7883MgjZhr8m1EneeLTOLEOMxLn8UOibKyIFAb8tZkHq5JUAKUxZN37sH6pM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=Efqg4ej0; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Efqg4ej0" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43cf06eabdaso7715155e9.2 for ; Thu, 24 Apr 2025 04:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1745492451; x=1746097251; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=zHHJnHHyOrnNtHHA6vr6DrZ0IO7tPD+NYSLx8YKZu70=; b=Efqg4ej0lfczL7FUZMe+hb4klNfVw/eDNsSA+9s0AdXbElMqmfSag5n8/TalQ4w67U rYN0sFThg8wrStkkiUfwGCTGnU6FCTOK27qaeiA5YrPR1prbXomZx3wkyWFhhULs6p+s e+rDC7xWWv5L8pP0W2VgLErtPHmcCWM89Av8+km5aujoYhqgM5pDHkZcHMlV1CRGzMct o824a2B4a24tvH/2Z6ozeTJbefOZ4O6ACD+9hCcd20FUkvOnS5gIhuCu6ob2/Npc8G3u 5rjNFcXH3GTFfIMZw3F38cnncuzVp0g+eM3lKdBqPJhljMeoFyhvG1snvHKaWPaYAmaX nFNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745492451; x=1746097251; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zHHJnHHyOrnNtHHA6vr6DrZ0IO7tPD+NYSLx8YKZu70=; b=Z7ePGqd9pyLFLwjMNeYO5yUUTJUE6585f6WGeVWZ9F/P/Ivbycuieply/BpLqOEO7W abaODagllSG2fXz0Xen6VhrBWSbPwJnWDmLZlpi33LHpkF0Hu8lYMlD3g4Ljt15VoJ9v 5bVM+rMoBaQkbgOpGppH1CnFJqWkzN+VtezTZ5fJwSmXkeewwKrk9siDYHGzL3jIdhOJ 633PFFAzNqPjQULwR02j4Kgl0P6G83Gm4ny3DlSS1S9RjOWKaBV3g1atUTtamiybls7R syXCPWHmHIKX6+Eqi25cy1OVSVbSUc0tWi4ErzFoC7pMvn0U0WH+zh4Ud43MUtPYuBiD OCJQ== X-Forwarded-Encrypted: i=1; AJvYcCXFSfsYJ87Bv6mZ6ovJnnhijbxa0o55GmRqdSger2hJ9/dVITXpPe4B2IvZ5ht7A/erw3pg2gNOzZ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy++ju2RyHaKK/m6w1UZViiZGn3EZ6XQpp3hWXyZER4FHT8qJUq qwkwLWdo8DSWy6YnjB12kX20hNVrr262FNI+2aBRewuvMYchvoBA6ppMdX+Dm3UGb/AUwXhP0sC Pi0o= X-Gm-Gg: ASbGnctByBOl/WiBoxUn5FCMa5e4G/zkSCFJF5NYrmJlJIVzHzB60Vll0AqsROfLwv9 nTtQ4+t0nCDoD9sjvIJTvhlFBu78Rf8zVAeH+ZNOiZ0YOZVtgYglXYq+urJrouyGKzMJpPNs0Gz KDHyAIpFNvQ20JIZHZdQOFvI+3l4OBm0GxgZqV76XGPnZ9DZIkaKQ8tBjSjaMKz8AU0JslVP9/X qivEaTjzvcR+aRFI3HPgO8+cpRb4s2+VLfVrrLa+kKwOuqud40UhOBmLh2Sr+RQ/XOyJCInwgOO +0E/gWgJG47Gv+J1VE1yO8MSRFdhCPSVrNaYexA= X-Google-Smtp-Source: AGHT+IGP6Ut82q/OqGuYzCaYu8ri2NvYSY5EYxmJ9hg0Kbk3eysivoE/mXbwZrGhC5aaW7QaraDYhg== X-Received: by 2002:a05:600c:3b9a:b0:439:9424:1b70 with SMTP id 5b1f17b1804b1-4409bd8a761mr17964535e9.30.1745492451468; Thu, 24 Apr 2025 04:00:51 -0700 (PDT) Received: from localhost ([2a02:8308:a00c:e200::f716]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4409d2d8479sm16884645e9.29.2025.04.24.04.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 04:00:51 -0700 (PDT) Date: Thu, 24 Apr 2025 13:00:50 +0200 From: Andrew Jones To: =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= Cc: Paul Walmsley , Palmer Dabbelt , Anup Patel , Atish Patra , Shuah Khan , Jonathan Corbet , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, Samuel Holland Subject: Re: [PATCH v5 03/13] riscv: sbi: add FWFT extension interface Message-ID: <20250424-c85c9d2f189fe4470038b519@orel> References: <20250417122337.547969-1-cleger@rivosinc.com> <20250417122337.547969-4-cleger@rivosinc.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250417122337.547969-4-cleger@rivosinc.com> On Thu, Apr 17, 2025 at 02:19:50PM +0200, Clément Léger wrote: > This SBI extensions enables supervisor mode to control feature that are > under M-mode control (For instance, Svadu menvcfg ADUE bit, Ssdbltrp > DTE, etc). Add an interface to set local features for a specific cpu > mask as well as for the online cpu mask. > > Signed-off-by: Clément Léger > Reviewed-by: Andrew Jones > --- > arch/riscv/include/asm/sbi.h | 17 +++++++++++ > arch/riscv/kernel/sbi.c | 57 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 74 insertions(+) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index 7ec249fea880..c8eab315c80e 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -503,6 +503,23 @@ int sbi_remote_hfence_vvma_asid(const struct cpumask *cpu_mask, > unsigned long asid); > long sbi_probe_extension(int ext); > > +int sbi_fwft_set(u32 feature, unsigned long value, unsigned long flags); > +int sbi_fwft_local_set_cpumask(const cpumask_t *mask, u32 feature, > + unsigned long value, unsigned long flags); I'm confused by the naming that includes 'local' and 'cpumask' together and... > +/** > + * sbi_fwft_local_set() - Set a feature on all online cpus > + * @feature: The feature to be set > + * @value: The feature value to be set > + * @flags: FWFT feature set flags > + * > + * Return: 0 on success, appropriate linux error code otherwise. > + */ > +static inline int sbi_fwft_local_set(u32 feature, unsigned long value, > + unsigned long flags) > +{ > + return sbi_fwft_local_set_cpumask(cpu_online_mask, feature, value, flags); ...that something named with just 'local' is applied to all online cpus. I've always considered 'local' functions to only affect the calling cpu. Thanks, drew