From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Date: Fri, 1 Mar 2024 12:14:09 +0100 Subject: [PATCH v4 04/15] RISC-V: Add SBI PMU snapshot definitions In-Reply-To: <20240229010130.1380926-5-atishp@rivosinc.com> References: <20240229010130.1380926-1-atishp@rivosinc.com> <20240229010130.1380926-5-atishp@rivosinc.com> Message-ID: <20240301-1a1aa2a2c04640c34749cb5f@orel> List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Feb 28, 2024 at 05:01:19PM -0800, Atish Patra wrote: > SBI PMU Snapshot function optimizes the number of traps to > higher privilege mode by leveraging a shared memory between the S/VS-mode > and the M/HS mode. Add the definitions for that extension and new error > codes. > > Reviewed-by: Anup Patel > Acked-by: Palmer Dabbelt > Signed-off-by: Atish Patra > --- > arch/riscv/include/asm/sbi.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index ef8311dafb91..dfa830f7d54b 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -132,6 +132,7 @@ enum sbi_ext_pmu_fid { > SBI_EXT_PMU_COUNTER_STOP, > SBI_EXT_PMU_COUNTER_FW_READ, > SBI_EXT_PMU_COUNTER_FW_READ_HI, > + SBI_EXT_PMU_SNAPSHOT_SET_SHMEM, > }; > > union sbi_pmu_ctr_info { > @@ -148,6 +149,13 @@ union sbi_pmu_ctr_info { > }; > }; > > +/* Data structure to contain the pmu snapshot data */ > +struct riscv_pmu_snapshot_data { > + u64 ctr_overflow_mask; > + u64 ctr_values[64]; > + u64 reserved[447]; > +}; > + > #define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(47, 0) > #define RISCV_PMU_RAW_EVENT_IDX 0x20000 > > @@ -244,9 +252,11 @@ enum sbi_pmu_ctr_type { > > /* Flags defined for counter start function */ > #define SBI_PMU_START_FLAG_SET_INIT_VALUE (1 << 0) A patch before this which changes all flags to use BIT() instead of shifts would be good, since otherwise the new flags are inconsistent. > +#define SBI_PMU_START_FLAG_INIT_FROM_SNAPSHOT BIT(1) This is named SBI_PMU_START_FLAG_INIT_SNAPSHOT in the spec. > > /* Flags defined for counter stop function */ > #define SBI_PMU_STOP_FLAG_RESET (1 << 0) > +#define SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT BIT(1) > > enum sbi_ext_dbcn_fid { > SBI_EXT_DBCN_CONSOLE_WRITE = 0, > @@ -285,6 +295,7 @@ struct sbi_sta_struct { > #define SBI_ERR_ALREADY_AVAILABLE -6 > #define SBI_ERR_ALREADY_STARTED -7 > #define SBI_ERR_ALREADY_STOPPED -8 > +#define SBI_ERR_NO_SHMEM -9 > > extern unsigned long sbi_spec_version; > struct sbiret { > -- > 2.34.1 > Thanks, drew From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 B232F6BFC9 for ; Fri, 1 Mar 2024 11:14:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291654; cv=none; b=uySwHrf1/CzGZvXytRtnC6hZyK8jkx8OmGfoWL6QhtpvlFwqlnL+Ml+q5QvGAYIJ/9fB56Ei7Iymf0pDo2xwJfIq6kQaOgALewbbyco280ZHYVHisu0FBnhxQp4cCu7SUtaRxHWbcQDRNqOHL5YsMBWU3l7Ddohim2TtrnNIkPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291654; c=relaxed/simple; bh=zkbtf2XhdXqJAJc2oYBIfqC9jUyxnkqSO9tew8V0bg8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=unog0ZAeeeDbhhPGiTZz5y/0RDDzI4MvrxJARCnf/kHVMovCn9fbzaDusq1fpznrappUAoEIZN8hlDV8brGTzrvYGUVZeQvHkTRJ9X+Cp5QxMw7s60efUf95GgxOTiw8klXiJHXXHIkxW/KuQhOE2s+9aosnDwGtV3aIla2M18Q= 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=ojxr+zuC; arc=none smtp.client-ip=209.85.167.54 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="ojxr+zuC" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-512fb30dbc9so1793666e87.2 for ; Fri, 01 Mar 2024 03:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1709291651; x=1709896451; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jXt56DDN1trQQI8RIOoz0OKV0RNEBNHuWLr8xaraJVQ=; b=ojxr+zuC/PpK426wnS6w13kYyIzL9mBC8UehHmts6Yk/0Z9Qw8Cstg9MvvOL9+Lvte lHCuR63R26xspRTGe2jEJiy4suoIIdhHSPJ/34rjXLIU2tKl/p3+WS4UM8BmvqTPYl55 QkhFiLiOJHmYnFv3YKsrLvOLWlD+ds4EBnQ2Cuk+00DpEUVZqpRyN7jZ6H1E85n5Fbr/ L38Es5opuNC6cPXWNcxrmRPEWXZ+HB/nH3OLJvm/dto6FeuqSpiCeXqf6tcga/f3R+IV rNETlhe409XcbtV1NkVXIPL5XcqutRt2Tw97zmhL+KI+UiZH5bVzvzd5k/4Rm8ZrHZfz Zdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291651; x=1709896451; h=in-reply-to: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=jXt56DDN1trQQI8RIOoz0OKV0RNEBNHuWLr8xaraJVQ=; b=hClDqs1LIzlWRj5taaIBxMIXTf9FZf1INEmC98ndt3MzenyzHufAxLNNorBOD38zXf 344Vf8qhEEjLTG3xKGHCBvofYSxySkCVA4qrDnNoRGx5mGWI2nburKc1fJJJ6vyTGciv nn8Lliv56/4MLims92kajPL252ScJspgjOLiTKY2LswZf6d98aneBctpyLTaPtPhFvEz UL9DhYPRpUXYWN2+kJmWC+Emp02VKxJfSzUH8SuCf+zedq+U1zR2ZEcT+tmLWlaFa9I1 cVsUKIUAeOnEnNWXCNR0mWjBLEMzItuwnduVmqB/0VLbbwM+kfocsvQHXbVIkUdTG4HV eCvg== X-Forwarded-Encrypted: i=1; AJvYcCUXyM0OKHqhaEdIV3Pz10kMzM56caO5nGDdJn/lNMXdR+A8f4MY7Dbx1KfpUNhOhLoEzmShNwpIjdwJkwylYCb1ZsRQPGeTQ9DB8Xqd806F X-Gm-Message-State: AOJu0YzIEKoeqZtJk/PPW9eIkS/hZwttadRxVaN2vVoDtnOnoiqzFq5s 0/6pC9dQ/oIGXaZtTHp5WNRzgR5MfliMi0mkf7jbLphQwHBCoJFz0u93yHf3eMk= X-Google-Smtp-Source: AGHT+IEMU3X0u8IVUbmn5Hd0kEbruFTDCYQR+XS7mqKnTdFj2a5iVEk93dn2ijW3fSXhfMFxgwHqFQ== X-Received: by 2002:a05:6512:2388:b0:512:be8e:79da with SMTP id c8-20020a056512238800b00512be8e79damr1364981lfv.8.1709291650643; Fri, 01 Mar 2024 03:14:10 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id q16-20020a5d6590000000b0033d56aa4f45sm4292371wru.112.2024.03.01.03.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:14:10 -0800 (PST) Date: Fri, 1 Mar 2024 12:14:09 +0100 From: Andrew Jones To: Atish Patra Cc: linux-kernel@vger.kernel.org, Anup Patel , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Atish Patra , Conor Dooley , Guo Ren , Icenowy Zheng , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paolo Bonzini , Paul Walmsley , Shuah Khan , Will Deacon Subject: Re: [PATCH v4 04/15] RISC-V: Add SBI PMU snapshot definitions Message-ID: <20240301-1a1aa2a2c04640c34749cb5f@orel> References: <20240229010130.1380926-1-atishp@rivosinc.com> <20240229010130.1380926-5-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240229010130.1380926-5-atishp@rivosinc.com> On Wed, Feb 28, 2024 at 05:01:19PM -0800, Atish Patra wrote: > SBI PMU Snapshot function optimizes the number of traps to > higher privilege mode by leveraging a shared memory between the S/VS-mode > and the M/HS mode. Add the definitions for that extension and new error > codes. > > Reviewed-by: Anup Patel > Acked-by: Palmer Dabbelt > Signed-off-by: Atish Patra > --- > arch/riscv/include/asm/sbi.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index ef8311dafb91..dfa830f7d54b 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -132,6 +132,7 @@ enum sbi_ext_pmu_fid { > SBI_EXT_PMU_COUNTER_STOP, > SBI_EXT_PMU_COUNTER_FW_READ, > SBI_EXT_PMU_COUNTER_FW_READ_HI, > + SBI_EXT_PMU_SNAPSHOT_SET_SHMEM, > }; > > union sbi_pmu_ctr_info { > @@ -148,6 +149,13 @@ union sbi_pmu_ctr_info { > }; > }; > > +/* Data structure to contain the pmu snapshot data */ > +struct riscv_pmu_snapshot_data { > + u64 ctr_overflow_mask; > + u64 ctr_values[64]; > + u64 reserved[447]; > +}; > + > #define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(47, 0) > #define RISCV_PMU_RAW_EVENT_IDX 0x20000 > > @@ -244,9 +252,11 @@ enum sbi_pmu_ctr_type { > > /* Flags defined for counter start function */ > #define SBI_PMU_START_FLAG_SET_INIT_VALUE (1 << 0) A patch before this which changes all flags to use BIT() instead of shifts would be good, since otherwise the new flags are inconsistent. > +#define SBI_PMU_START_FLAG_INIT_FROM_SNAPSHOT BIT(1) This is named SBI_PMU_START_FLAG_INIT_SNAPSHOT in the spec. > > /* Flags defined for counter stop function */ > #define SBI_PMU_STOP_FLAG_RESET (1 << 0) > +#define SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT BIT(1) > > enum sbi_ext_dbcn_fid { > SBI_EXT_DBCN_CONSOLE_WRITE = 0, > @@ -285,6 +295,7 @@ struct sbi_sta_struct { > #define SBI_ERR_ALREADY_AVAILABLE -6 > #define SBI_ERR_ALREADY_STARTED -7 > #define SBI_ERR_ALREADY_STOPPED -8 > +#define SBI_ERR_NO_SHMEM -9 > > extern unsigned long sbi_spec_version; > struct sbiret { > -- > 2.34.1 > Thanks, drew From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 066A7C5478C for ; Fri, 1 Mar 2024 11:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0rCEOHLdKBiB2iMoNoAMUQlV8XMYzy+rUkboVEl4TzI=; b=kDFQEeaRl7gTZ+ mEbDxjt7IMq+felNgOjTQCSV58KVAfukO865n6r4mCsE6ZLshKuiRibN04gDa/l6jx9wNSyVR6bg8 /OsUe5SU7q4WxLMU0iGaLMnUfwuGd3Yx858wIlSmyJ7hzpcapwvt8bwLBWB9B7/aIPmFLKj9l4LlE RaZsYu3b/3guLKRIRQDC/TOMV4GaETQCB0FAFryanv9I4GHU3mwvF17JoiAXnGwDpljuP9tyhDdU+ QC56xq5sh67ZnuACKQr7b9p/rI1uCvd8i+nI8vG9x3YaKPOH71WtK98v8lasTaKIXStTlM7QmyJWZ wW0zrBAx/PGc7cMdOzZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg0qH-0000000HWCl-2wSy; Fri, 01 Mar 2024 11:14:17 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg0qE-0000000HWAT-1YGe for linux-riscv@lists.infradead.org; Fri, 01 Mar 2024 11:14:15 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-512b3b04995so1686941e87.3 for ; Fri, 01 Mar 2024 03:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1709291651; x=1709896451; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jXt56DDN1trQQI8RIOoz0OKV0RNEBNHuWLr8xaraJVQ=; b=dZjyw9c1HdE2YBPJNeUNuasrJAZmYtmi5mHwRQHlVUdjDpIYH0mqupYDYxqRV2CUz1 X4h3UFR7AXI78KCUJqNALdu1xtIS4YQqNphfsRz6mwRKrfkt2lk4I/SWTBsKSxzeznwd 6AIgZnJSDqf9lh0FQJpQVpL8fKTBCNvZo3LF42SjHLWBvKX8EqK576moBEby8jqyJ9ed z5I6Z7IQ4HPrG/Yo34jEnrix31lIFQnK5UIQN0jz2aFxkXEL59q41vkD5EK/fHrvC0jq WYqFd866brxAnACte9EdxfG6DmHV07JtbXzBJTlcclSCP3CSus9/RD0yE7O+ple9wkFC fi+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709291651; x=1709896451; h=in-reply-to: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=jXt56DDN1trQQI8RIOoz0OKV0RNEBNHuWLr8xaraJVQ=; b=qO0Xxana/TRH7WjkbEqG1BEzLNdgiFS6Dq2EEKVAJU4QeKgGW13PsSJI8sMu5e/sjA guxxI366HJyFjsOwPGEKQQEqVWEx6oEuRAYok6mTB6lmbeHZ+Y3CsuWqIbOxFEPjKrAE HZWbLFygFSj3nP4NZpe0vQOOViw1CBkI7kZOWW+fumZHI+k7nnJwaRRqQjVoUQqkjWUq mMZ2ZTGACkcgL+1SZRUK7AaKkxCLcMqZTBSo5duCnpNT4ilR8SIFPAYcLI2C3x+oaSKa uGX3gA0LwaAoKOa8u5K0hJs1kj5FWkoB68LF6XRhlO72R0aPbzRyTo++d+sx7sxhXx+E JO5Q== X-Forwarded-Encrypted: i=1; AJvYcCUlCubBvfGzV+LNDM7Tr+ieBtz3tVnxfaEUfCAaBaDb+knuf4jVS2fSCxd1q3YRI8wNGyNLmpuCPkHKIONab3cc4GmRhYq8FPFVsZRdWDCA X-Gm-Message-State: AOJu0YxjSwWsbewdyRm2TqxHZVpaBPZB347poe1Ps3ZnJCbGt+G/VCtA LrF775V5L6hTq5UQmIyuCFjKBsQgNMAuxE+Fk3KBHbtIWbJUYX/jf8aaSLqjX9o= X-Google-Smtp-Source: AGHT+IEMU3X0u8IVUbmn5Hd0kEbruFTDCYQR+XS7mqKnTdFj2a5iVEk93dn2ijW3fSXhfMFxgwHqFQ== X-Received: by 2002:a05:6512:2388:b0:512:be8e:79da with SMTP id c8-20020a056512238800b00512be8e79damr1364981lfv.8.1709291650643; Fri, 01 Mar 2024 03:14:10 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id q16-20020a5d6590000000b0033d56aa4f45sm4292371wru.112.2024.03.01.03.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:14:10 -0800 (PST) Date: Fri, 1 Mar 2024 12:14:09 +0100 From: Andrew Jones To: Atish Patra Subject: Re: [PATCH v4 04/15] RISC-V: Add SBI PMU snapshot definitions Message-ID: <20240301-1a1aa2a2c04640c34749cb5f@orel> References: <20240229010130.1380926-1-atishp@rivosinc.com> <20240229010130.1380926-5-atishp@rivosinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240229010130.1380926-5-atishp@rivosinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240301_031414_436662_B2F95393 X-CRM114-Status: GOOD ( 20.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-kselftest@vger.kernel.org, Albert Ou , Alexandre Ghiti , kvm@vger.kernel.org, Anup Patel , Paul Walmsley , Will Deacon , linux-kernel@vger.kernel.org, Palmer Dabbelt , Conor Dooley , Paolo Bonzini , Guo Ren , kvm-riscv@lists.infradead.org, Atish Patra , Palmer Dabbelt , linux-riscv@lists.infradead.org, Shuah Khan Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Feb 28, 2024 at 05:01:19PM -0800, Atish Patra wrote: > SBI PMU Snapshot function optimizes the number of traps to > higher privilege mode by leveraging a shared memory between the S/VS-mode > and the M/HS mode. Add the definitions for that extension and new error > codes. > > Reviewed-by: Anup Patel > Acked-by: Palmer Dabbelt > Signed-off-by: Atish Patra > --- > arch/riscv/include/asm/sbi.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index ef8311dafb91..dfa830f7d54b 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -132,6 +132,7 @@ enum sbi_ext_pmu_fid { > SBI_EXT_PMU_COUNTER_STOP, > SBI_EXT_PMU_COUNTER_FW_READ, > SBI_EXT_PMU_COUNTER_FW_READ_HI, > + SBI_EXT_PMU_SNAPSHOT_SET_SHMEM, > }; > > union sbi_pmu_ctr_info { > @@ -148,6 +149,13 @@ union sbi_pmu_ctr_info { > }; > }; > > +/* Data structure to contain the pmu snapshot data */ > +struct riscv_pmu_snapshot_data { > + u64 ctr_overflow_mask; > + u64 ctr_values[64]; > + u64 reserved[447]; > +}; > + > #define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(47, 0) > #define RISCV_PMU_RAW_EVENT_IDX 0x20000 > > @@ -244,9 +252,11 @@ enum sbi_pmu_ctr_type { > > /* Flags defined for counter start function */ > #define SBI_PMU_START_FLAG_SET_INIT_VALUE (1 << 0) A patch before this which changes all flags to use BIT() instead of shifts would be good, since otherwise the new flags are inconsistent. > +#define SBI_PMU_START_FLAG_INIT_FROM_SNAPSHOT BIT(1) This is named SBI_PMU_START_FLAG_INIT_SNAPSHOT in the spec. > > /* Flags defined for counter stop function */ > #define SBI_PMU_STOP_FLAG_RESET (1 << 0) > +#define SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT BIT(1) > > enum sbi_ext_dbcn_fid { > SBI_EXT_DBCN_CONSOLE_WRITE = 0, > @@ -285,6 +295,7 @@ struct sbi_sta_struct { > #define SBI_ERR_ALREADY_AVAILABLE -6 > #define SBI_ERR_ALREADY_STARTED -7 > #define SBI_ERR_ALREADY_STOPPED -8 > +#define SBI_ERR_NO_SHMEM -9 > > extern unsigned long sbi_spec_version; > struct sbiret { > -- > 2.34.1 > Thanks, drew _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv