All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: David Gibson <dgibson@redhat.com>, Laurent Vivier <lvivier@redhat.com>
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com
Subject: Re: [PATCH v3] powerpc: Add tests for sPAPR h-calls
Date: Thu, 03 Mar 2016 08:58:13 +0000	[thread overview]
Message-ID: <56D7FCA5.2050100@redhat.com> (raw)
In-Reply-To: <20160303102332.66345df6@voom.fritz.box>

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

On 03.03.2016 00:23, David Gibson wrote:
> On Wed, 2 Mar 2016 11:07:55 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
>> On 02/03/2016 09:40, Thomas Huth wrote:
>>> Introduce a test for sPAPR hypercalls, starting with the
>>> three hypercalls H_SET_SPRG0, H_PAGE_INIT and H_RANDOM.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
...
>>> +static int h_random(uint64_t *val)
>>> +{
>>> +	register uint64_t r3 asm("r3") = H_RANDOM;
>>> +	register uint64_t r4 asm("r4");
>>> +
>>> +	asm volatile (" sc 1 " : "+r"(r3), "=r"(r4) : "r"(r3));  
>>
>> as you use "+r" with r3 in the output operands field, I think you don't
>> have to declare it in the input operands field.
> 
> More importantly, I think a hypercall is allowed to clobber any of the
> volatile registers (r0 & r3..r12), so they probably need to be declared
> in the clobbers as well.

Ok, that's a point ... I'll fix it up and send a v4.

 Thomas




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Huth <thuth@redhat.com>
To: David Gibson <dgibson@redhat.com>, Laurent Vivier <lvivier@redhat.com>
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, drjones@redhat.com
Subject: Re: [PATCH v3] powerpc: Add tests for sPAPR h-calls
Date: Thu, 3 Mar 2016 09:58:13 +0100	[thread overview]
Message-ID: <56D7FCA5.2050100@redhat.com> (raw)
In-Reply-To: <20160303102332.66345df6@voom.fritz.box>

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

On 03.03.2016 00:23, David Gibson wrote:
> On Wed, 2 Mar 2016 11:07:55 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
>> On 02/03/2016 09:40, Thomas Huth wrote:
>>> Introduce a test for sPAPR hypercalls, starting with the
>>> three hypercalls H_SET_SPRG0, H_PAGE_INIT and H_RANDOM.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
...
>>> +static int h_random(uint64_t *val)
>>> +{
>>> +	register uint64_t r3 asm("r3") = H_RANDOM;
>>> +	register uint64_t r4 asm("r4");
>>> +
>>> +	asm volatile (" sc 1 " : "+r"(r3), "=r"(r4) : "r"(r3));  
>>
>> as you use "+r" with r3 in the output operands field, I think you don't
>> have to declare it in the input operands field.
> 
> More importantly, I think a hypercall is allowed to clobber any of the
> volatile registers (r0 & r3..r12), so they probably need to be declared
> in the clobbers as well.

Ok, that's a point ... I'll fix it up and send a v4.

 Thomas




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2016-03-03  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02  8:40 [PATCH v3] powerpc: Add tests for sPAPR h-calls Thomas Huth
2016-03-02  8:40 ` Thomas Huth
2016-03-02 10:07 ` Laurent Vivier
2016-03-02 10:07   ` Laurent Vivier
2016-03-02 10:22   ` Paolo Bonzini
2016-03-02 10:22     ` Paolo Bonzini
2016-03-02 10:33     ` Laurent Vivier
2016-03-02 10:33       ` Laurent Vivier
2016-03-02 10:56   ` Thomas Huth
2016-03-02 10:56     ` Thomas Huth
2016-03-02 11:37     ` Paolo Bonzini
2016-03-02 11:37       ` Paolo Bonzini
2016-03-02 23:23   ` David Gibson
2016-03-02 23:23     ` David Gibson
2016-03-03  8:58     ` Thomas Huth [this message]
2016-03-03  8:58       ` Thomas Huth

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=56D7FCA5.2050100@redhat.com \
    --to=thuth@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.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.