linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Nicholas Piggin" <npiggin@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	linuxppc-dev@lists.ozlabs.org
Cc: Haren Myneni <haren@linux.ibm.com>
Subject: Re: [PATCH] powerpc/pseries/vas: Don't print an error when VAS is unavailable
Date: Tue, 30 Nov 2021 10:25:35 +1100	[thread overview]
Message-ID: <87fsrepms0.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <1637922573.8ofrolskkj.astroid@bobo.none>

Nicholas Piggin <npiggin@gmail.com> writes:
> Excerpts from Cédric Le Goater's message of November 26, 2021 5:13 pm:
>> On 11/26/21 06:21, Nicholas Piggin wrote:
>>> KVM does not support VAS so guests always print a useless error on boot
>>> 
>>>      vas: HCALL(398) error -2, query_type 0, result buffer 0x57f2000
>>> 
>>> Change this to only print the message if the error is not H_FUNCTION.
>> 
>> 
>> Just being curious, why is it even called since "ibm,compression" should
>> not be exposed in the DT ?
>
> It looks like vas does not test for it. I guess in theory there can be 
> other functions than compression implemented as an accelerator. Maybe
> that's why?

Yeah I guess, or it's just not structured that well. The vas platform
code is a bit awkward, it's there to support drivers, but it's not
actually driver code.

I think we can probably rework it so the vas code does nothing until a
driver calls in to it.

eg. something like below.

cheers


diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c
index b043e3936d21..dc3491fc919d 100644
--- a/arch/powerpc/platforms/pseries/vas.c
+++ b/arch/powerpc/platforms/pseries/vas.c
@@ -454,6 +454,8 @@ static const struct vas_user_win_ops vops_pseries = {
 	.close_win	= vas_deallocate_window, /* Close window */
 };
 
+static int pseries_vas_init(void);
+
 /*
  * Supporting only nx-gzip coprocessor type now, but this API code
  * extended to other coprocessor types later.
@@ -463,7 +465,8 @@ int vas_register_api_pseries(struct module *mod, enum vas_cop_type cop_type,
 {
 	int rc;
 
-	if (!copypaste_feat)
+	rc = pseries_vas_init();
+	if (rc || !copypaste_feat)
 		return -ENOTSUPP;
 
 	rc = vas_register_coproc_api(mod, cop_type, name, &vops_pseries);
@@ -531,7 +534,7 @@ static int get_vas_capabilities(u8 feat, enum vas_cop_feat_type type,
 	return 0;
 }
 
-static int __init pseries_vas_init(void)
+static int pseries_vas_init(void)
 {
 	struct hv_vas_cop_feat_caps *hv_cop_caps;
 	struct hv_vas_all_caps *hv_caps;
@@ -592,4 +595,3 @@ static int __init pseries_vas_init(void)
 	kfree(hv_caps);
 	return rc;
 }
-machine_device_initcall(pseries, pseries_vas_init);

  parent reply	other threads:[~2021-11-29 23:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26  5:21 [PATCH] powerpc/pseries/vas: Don't print an error when VAS is unavailable Nicholas Piggin
2021-11-26  7:13 ` Cédric Le Goater
2021-11-26 10:31   ` Nicholas Piggin
2021-11-29 18:13     ` Tyrel Datwyler
2021-11-29 23:25     ` Michael Ellerman [this message]
2021-11-30  7:35       ` Haren Myneni
2021-11-30 11:21         ` Michael Ellerman
2021-12-21 12:14 ` Michael Ellerman

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=87fsrepms0.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=clg@kaod.org \
    --cc=haren@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).