From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: mpe@ellerman.id.au, nathanl@linux.ibm.com, tyreld@linux.ibm.com,
npiggin@gmail.com, mahesh@linux.ibm.com,
naveen.n.rao@linux.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp
Date: Fri, 16 Aug 2024 22:33:22 +0530 [thread overview]
Message-ID: <252ed56a-cec7-4d3e-b90e-fa8798856ee2@linux.ibm.com> (raw)
In-Reply-To: <20240815195355.GW26466@kitsune.suse.cz>
On 8/16/24 01:23, Michal Suchánek wrote:
> On Fri, Apr 12, 2024 at 02:50:47PM +0530, Shrikanth Hegde wrote:
>> Couple of Minor fixes:
>>
>> - hcall return values are long. Fix that for h_get_mpp, h_get_ppp and
>> parse_ppp_data
>>
>> - If hcall fails, values set should be at-least zero. It shouldn't be
>> uninitialized values. Fix that for h_get_mpp and h_get_ppp
>>
>> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
>> ---
>> arch/powerpc/include/asm/hvcall.h | 2 +-
>> arch/powerpc/platforms/pseries/lpar.c | 6 +++---
>> arch/powerpc/platforms/pseries/lparcfg.c | 6 +++---
>> 3 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
>> index a41e542ba94d..3d642139b900 100644
>> --- a/arch/powerpc/include/asm/hvcall.h
>> +++ b/arch/powerpc/include/asm/hvcall.h
>> @@ -570,7 +570,7 @@ struct hvcall_mpp_data {
>> unsigned long backing_mem;
>> };
>>
>> -int h_get_mpp(struct hvcall_mpp_data *);
>> +long h_get_mpp(struct hvcall_mpp_data *mpp_data);
>>
>> struct hvcall_mpp_x_data {
>> unsigned long coalesced_bytes;
>> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
>> index 4e9916bb03d7..c1d8bee8f701 100644
>> --- a/arch/powerpc/platforms/pseries/lpar.c
>> +++ b/arch/powerpc/platforms/pseries/lpar.c
>> @@ -1886,10 +1886,10 @@ notrace void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf)
>> * h_get_mpp
>> * H_GET_MPP hcall returns info in 7 parms
>> */
>> -int h_get_mpp(struct hvcall_mpp_data *mpp_data)
>> +long h_get_mpp(struct hvcall_mpp_data *mpp_data)
>> {
>> - int rc;
>> - unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
>> + unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
>> + long rc;
>>
>> rc = plpar_hcall9(H_GET_MPP, retbuf);
>>
>> diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
>> index 5c2a3e802a02..ed2176d8a866 100644
>> --- a/arch/powerpc/platforms/pseries/lparcfg.c
>> +++ b/arch/powerpc/platforms/pseries/lparcfg.c
>> @@ -113,8 +113,8 @@ struct hvcall_ppp_data {
>> */
>> static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
> Hello,
>
> Shouldn't the ^^^ return value also be long?
>
> Thanks
>
Yes. You are right. missed to notice that. Thanks for pointing it out.
There might be other places where similar pattern maybe there.
Will fix it.
> Michal
>> {
>> - unsigned long rc;
>> - unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
>> + unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
>> + long rc;
>>
>> rc = plpar_hcall9(H_GET_PPP, retbuf);
>>
>> @@ -197,7 +197,7 @@ static void parse_ppp_data(struct seq_file *m)
>> struct hvcall_ppp_data ppp_data;
>> struct device_node *root;
>> const __be32 *perf_level;
>> - int rc;
>> + long rc;
>>
>> rc = h_get_ppp(&ppp_data);
>> if (rc)
>> --
>> 2.39.3
>>
next prev parent reply other threads:[~2024-08-16 23:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 9:20 [PATCH v2 0/2] powerpc/pseries: Fixes for lparstat boot reports Shrikanth Hegde
2024-04-12 9:20 ` [PATCH v2 1/2] powerpc/pseries: Add pool idle time at LPAR boot Shrikanth Hegde
2024-04-12 9:20 ` [PATCH v2 2/2] powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp Shrikanth Hegde
2024-08-15 19:53 ` Michal Suchánek
2024-08-16 17:03 ` Shrikanth Hegde [this message]
2024-04-29 5:55 ` [PATCH v2 0/2] powerpc/pseries: Fixes for lparstat boot reports Shrikanth Hegde
2024-04-30 3:54 ` Michael Ellerman
2024-05-03 10:41 ` 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=252ed56a-cec7-4d3e-b90e-fa8798856ee2@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=nathanl@linux.ibm.com \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=tyreld@linux.ibm.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 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.