From: Bharata B Rao <bharata.rao@gmail.com>
To: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Bharata B Rao <bharata@linux.vnet.ibm.com>
Subject: Re: [PATCH] pseries: Make CPU hotplug path endian safe
Date: Fri, 5 Sep 2014 21:03:11 +0530 [thread overview]
Message-ID: <CAGZKiBpFoB2UrCPsEMHS-cJ-ffn1D7zcfznfp+P_gOGsigCPyg@mail.gmail.com> (raw)
In-Reply-To: <5409C3C6.90204@linux.vnet.ibm.com>
On Fri, Sep 5, 2014 at 7:38 PM, Nathan Fontenot
<nfont@linux.vnet.ibm.com> wrote:
> On 09/05/2014 04:16 AM, bharata.rao@gmail.com wrote:
>> From: Bharata B Rao <bharata@linux.vnet.ibm.com>
>>
>> - ibm,rtas-configure-connector should treat the RTAS data as big endian.
>> - Treat ibm,ppc-interrupt-server#s as big-endian when setting
>> smp_processor_id during hotplug.
>>
>> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/platforms/pseries/dlpar.c | 10 +++++-----
>> arch/powerpc/platforms/pseries/hotplug-cpu.c | 4 ++--
>> 2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
>> index 2d0b4d6..dc55f9c 100644
>> --- a/arch/powerpc/platforms/pseries/dlpar.c
>> +++ b/arch/powerpc/platforms/pseries/dlpar.c
>> @@ -48,11 +48,11 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
>> if (!prop)
>> return NULL;
>>
>> - name = (char *)ccwa + ccwa->name_offset;
>> + name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
>> prop->name = kstrdup(name, GFP_KERNEL);
>>
>> - prop->length = ccwa->prop_length;
>> - value = (char *)ccwa + ccwa->prop_offset;
>> + prop->length = be32_to_cpu(ccwa->prop_length);
>> + value = (char *)ccwa + be32_to_cpu(ccwa->prop_offset);
>> prop->value = kmemdup(value, prop->length, GFP_KERNEL);
>> if (!prop->value) {
>> dlpar_free_cc_property(prop);
>> @@ -78,7 +78,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
>> if (!dn)
>> return NULL;
>>
>> - name = (char *)ccwa + ccwa->name_offset;
>> + name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
>> dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
>> if (!dn->full_name) {
>> kfree(dn);
>> @@ -148,7 +148,7 @@ struct device_node *dlpar_configure_connector(u32 drc_index,
>> return NULL;
>>
>> ccwa = (struct cc_workarea *)&data_buf[0];
>> - ccwa->drc_index = drc_index;
>> + ccwa->drc_index = cpu_to_be32(drc_index);
>
> I need to look at this some more but I think this may cause an issue for
> partition migration. If I am following the code correctly, starting in
> pseries_devicetree_update(), the drc_index value passed to
> dlpar_configure_connector is pulled directly out of a buffer we get from
> firmware. This would mean the drc_index value is already in BE format.
Yes I see that now.
>
> Whereas for cpu hotplug the drc_index value is passed in from userspace
> via the cpu probe interface in sysfs. I assume that you are seeing the
> drc_index value getting passed in in LE format.
Yes I am seeing drc_index in LE format for an LE guest during CPU
hotplug operation.
Regards,
Bharata.
prev parent reply other threads:[~2014-09-05 15:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 9:16 [PATCH] pseries: Make CPU hotplug path endian safe bharata.rao
2014-09-05 14:08 ` Nathan Fontenot
2014-09-05 15:33 ` Bharata B Rao [this message]
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=CAGZKiBpFoB2UrCPsEMHS-cJ-ffn1D7zcfznfp+P_gOGsigCPyg@mail.gmail.com \
--to=bharata.rao@gmail.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nfont@linux.vnet.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 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).