From: Andrew Jones <ajones@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v6 0/7] lib: sbi: Ensure SBI extension is available
Date: Mon, 15 May 2023 13:12:33 +0200 [thread overview]
Message-ID: <20230515111240.95059-1-ajones@ventanamicro.com> (raw)
Ensure attempts to invoke SBI extension functions fail with
SBI_ERR_NOT_SUPPORTED when the extension's probe function has reported
that the extension is not available. To avoid invoking probe too
frequently, we check extension availability at init time and skip
registering them in the extension list when their probe fails. If the
probes succeed, we keep them, and then later seeing them is enough to
know they're available. Extensions which have multiple IDs may also need
to narrow their ID range or remove IDs from their range to ensure when
the IDs are seen they are valid.
To handle both the available and valid cases at init time we introduce a
new callback which gets invoked instead of just registering the
extensions. We then modify the callbacks for probing and narrowing as
necessary. Additionally, considering the Base extension probe function
already knows how to set out_val to 1 for available extensions, we simply
remove all the probe functions, as now they must all succeed and none of
them return anything other than 1 on success.
v6:
- Remove the check in sbi_ecall_vendor_handler() when adding it to
sbi_ecall_vendor_register_extensions()
- Better line wrapping of the comments added for documenting the
extension struct members
- Added Anup's r-b's
v5:
Another rework where I finally take Anup's advice that he gave on
the initial posting and more or less replace probe with a new
init callback.
v4:
Almost a total redesign. Patch1 of the v4 (now series) does keep
hunk 2 of the v3 patch, but the changes to sbi_ecall_find_extension()
of the v3 patch have been dropped. Instead multi-ID extensions can
now make use of a new extension callback (Patch2) which gets invoked
at init time. This new callback has been applied to vendor extensions
with Patch3.
v3: http://lists.infradead.org/pipermail/opensbi/2023-May/004894.html
Andrew Jones (6):
lib: sbi: Introduce register_extensions extension callback
lib: sbi: Narrow vendor extension range
lib: sbi: pmu: Remove unnecessary probe function
lib: sbi: Only register available extensions
lib: sbi: Remove 0/1 probe implementations
lib: sbi: Document sbi_ecall_extension members
Xiang W (1):
lib: sbi: Optimize probe of srst/susp
include/sbi/sbi_ecall.h | 36 ++++++++++++++++++++++++++++++++++++
lib/sbi/sbi_ecall.c | 5 ++++-
lib/sbi/sbi_ecall_base.c | 14 +++++++++++---
lib/sbi/sbi_ecall_cppc.c | 18 +++++++++++-------
lib/sbi/sbi_ecall_dbcn.c | 18 +++++++++++-------
lib/sbi/sbi_ecall_hsm.c | 14 +++++++++++---
lib/sbi/sbi_ecall_ipi.c | 14 +++++++++++---
lib/sbi/sbi_ecall_legacy.c | 14 +++++++++++---
lib/sbi/sbi_ecall_pmu.c | 16 ++++++++--------
lib/sbi/sbi_ecall_rfence.c | 14 +++++++++++---
lib/sbi/sbi_ecall_srst.c | 28 ++++++++++++++++++----------
lib/sbi/sbi_ecall_susp.c | 27 ++++++++++++++++++---------
lib/sbi/sbi_ecall_time.c | 14 +++++++++++---
lib/sbi/sbi_ecall_vendor.c | 38 +++++++++++++++++++-------------------
14 files changed, 191 insertions(+), 79 deletions(-)
--
2.40.0
next reply other threads:[~2023-05-15 11:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 11:12 Andrew Jones [this message]
2023-05-15 11:12 ` [PATCH v6 1/7] lib: sbi: Introduce register_extensions extension callback Andrew Jones
2023-05-21 15:26 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 2/7] lib: sbi: Narrow vendor extension range Andrew Jones
2023-05-15 13:43 ` Anup Patel
2023-05-21 15:26 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 3/7] lib: sbi: pmu: Remove unnecessary probe function Andrew Jones
2023-05-21 15:26 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 4/7] lib: sbi: Only register available extensions Andrew Jones
2023-05-21 15:31 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 5/7] lib: sbi: Optimize probe of srst/susp Andrew Jones
2023-05-21 15:31 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 6/7] lib: sbi: Remove 0/1 probe implementations Andrew Jones
2023-05-21 15:31 ` Anup Patel
2023-05-15 11:12 ` [PATCH v6 7/7] lib: sbi: Document sbi_ecall_extension members Andrew Jones
2023-05-21 15:32 ` Anup Patel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230515111240.95059-1-ajones@ventanamicro.com \
--to=ajones@ventanamicro.com \
--cc=opensbi@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.