[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f313bf8-b366-e094-b5b6-c601458f5cfa@quicinc.com>
Date: Thu, 13 Oct 2022 16:00:10 -0700
From: Elliot Berman <quic_eberman@...cinc.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Bjorn Andersson <quic_bjorande@...cinc.com>,
Murali Nalajala <quic_mnalajal@...cinc.com>,
Trilok Soni <quic_tsoni@...cinc.com>,
"Srivatsa Vaddagiri" <quic_svaddagi@...cinc.com>,
Carl van Schaik <quic_cvanscha@...cinc.com>,
Prakruthi Deepak Heragu <quic_pheragu@...cinc.com>,
Andy Gross <agross@...nel.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Jassi Brar <jassisinghbrar@...il.com>,
<linux-arm-kernel@...ts.infradead.org>,
Mark Rutland <mark.rutland@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Sudeep Holla <sudeep.holla@....com>,
Marc Zyngier <maz@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Jonathan Corbet <corbet@....net>,
"Will Deacon" <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
"Arnd Bergmann" <arnd@...db.de>, <devicetree@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 06/13] virt: gunyah: Identify hypervisor version
On 10/10/2022 11:13 PM, Greg Kroah-Hartman wrote:
> On Mon, Oct 10, 2022 at 05:08:33PM -0700, Elliot Berman wrote:
>
> EXPORT_SYMBOL_GPL()? I have to ask.
typo only :)
>
> But why is it exported at all? No one is using it in this patch.
>
It's used later in the series by the message queue driver. The idea here
now is that gunyah.ko is capable of identifying Gunyah and other drivers
can check if they are individually compatible with the reported version
of Gunyah.
From Patch 9:
+static int __init gh_msgq_init(void)
+{
+ if (GH_API_INFO_API_VERSION(gunyah_api.api_info) != GUNYAH_API_V1) {
+ pr_warn("Unrecognized gunyah version: %llu. Currently supported: %d\n",
+ GH_API_INFO_API_VERSION(gunyah_api.api_info), GUNYAH_API_V1);
+ return -ENODEV;
+ }
+
+ return 0;
+}
>> +
>> +static int __init gunyah_init(void)
>> +{
>> + u32 uid[4];
>> +
>> + gh_hypercall_get_uid(uid);
>> +
>> + if (!(gh_uid_matches(GUNYAH, uid) || gh_uid_matches(QC_HYP, uid)))
>> + return 0;
>
> Why return success if this is not true? Shouldn't you return an error
> and fail to load?
>
That's fair -- easy to fix.
>> +
>> + gh_hypercall_hyp_identify(&gunyah_api);
>> +
>> + pr_info("Running under Gunyah hypervisor %llx/v%lld\n",
>> + GH_API_INFO_VARIANT(gunyah_api.api_info),
>> + GH_API_INFO_API_VERSION(gunyah_api.api_info));
>> +
>> + return 0;
>> +}
>> +arch_initcall(gunyah_init);
>> +
>> +static void __exit gunyah_exit(void)
>> +{
>> +}
>> +module_exit(gunyah_exit);
>
> Why do you need a module_exit() call?
>
I can remove.
>> +
>> +MODULE_LICENSE("GPL");
>> +MODULE_DESCRIPTION("Gunyah Hypervisor Driver");
>
> What will cause this module to be properly automatically loaded? I do
> not see that happening here at all.
>
>> diff --git a/include/asm-generic/gunyah.h b/include/asm-generic/gunyah.h
>> index 86eb59e203ef..8f9d4c649ba8 100644
>> --- a/include/asm-generic/gunyah.h
>> +++ b/include/asm-generic/gunyah.h
>> @@ -85,6 +85,8 @@ static inline int gh_remap_error(int gh_error)
>> ((uid)[0] == prefix ## _UID0 && (uid)[1] == prefix ## _UID1 && \
>> (uid)[2] == prefix ## _UID2 && (uid)[3] == prefix ## _UID3)
>>
>> +#define GUNYAH_API_V1 1
>
> You do not use this define anywhere in this patch.
>
>
>> +
>> #define GH_API_INFO_API_VERSION(x) (((x) >> 0) & 0x3fff)
>> #define GH_API_INFO_BIG_ENDIAN(x) (((x) >> 14) & 1)
>> #define GH_API_INFO_IS_64BIT(x) (((x) >> 15) & 1)
>> @@ -103,6 +105,7 @@ struct gh_hypercall_hyp_identify_resp {
>> u64 api_info;
>> u64 flags[3];
>> };
>> +extern struct gh_hypercall_hyp_identify_resp gunyah_api;
>
> Again, not used.
>
> thanks,
>
> greg k-h
Powered by blists - more mailing lists