public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@linux•ibm.com>
To: Ram Pai <linuxram@us•ibm.com>
Cc: aik@ozlabs•ru, andmike@linux•ibm.com, groug@kaod•org,
	kvm-ppc@vger•kernel.org, clg@fr•ibm.com,
	sukadev@linux•vnet.ibm.com, linuxppc-dev@lists•ozlabs.org,
	david@gibson•dropbear.id.au
Subject: Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.
Date: Fri, 03 Apr 2020 15:24:12 -0300	[thread overview]
Message-ID: <87pncobf77.fsf@morokweng.localdomain> (raw)
In-Reply-To: <20200401053200.GE5903@oc0525413822.ibm.com>


Ram Pai <linuxram@us•ibm.com> writes:

> On Tue, Mar 31, 2020 at 08:53:07PM -0300, Thiago Jung Bauermann wrote:
>> 
>> Hi Ram,
>> 
>> Ram Pai <linuxram@us•ibm.com> writes:
>> 
>> > diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
>> > index 55dc61c..608b52f 100644
>> > --- a/arch/powerpc/sysdev/xive/spapr.c
>> > +++ b/arch/powerpc/sysdev/xive/spapr.c
>> > @@ -26,6 +26,8 @@
>> >  #include <asm/xive.h>
>> >  #include <asm/xive-regs.h>
>> >  #include <asm/hvcall.h>
>> > +#include <asm/svm.h>
>> > +#include <asm/ultravisor.h>
>> >  
>> >  #include "xive-internal.h"
>> >  
>> > @@ -501,6 +503,9 @@ static int xive_spapr_configure_queue(u32 target, struct xive_q *q, u8 prio,
>> >  		rc = -EIO;
>> >  	} else {
>> >  		q->qpage = qpage;
>> > +		if (is_secure_guest())
>> > +			uv_share_page(PHYS_PFN(qpage_phys),
>> > +					1 << xive_alloc_order(order));
>> 
>> If I understand this correctly, you're passing the number of bytes of
>> the queue to uv_share_page(), but that ultracall expects the number of
>> pages to be shared.
>
>
> static inline u32 xive_alloc_order(u32 queue_shift)
> {
>         return (queue_shift > PAGE_SHIFT) ? (queue_shift - PAGE_SHIFT) : 0;
> }
>
> xive_alloc_order(order) returns the order of PAGE_SIZE pages.
> Hence the value passed to uv_shared_pages is the number of pages,
> and not the number of bytes.
>
> BTW: I did verify through testing that it was indeed passing 1 page to the
> uv_share_page().  

Ah, my mistake. I misunderstood the code. Sorry for the noise and thanks
for clarifying.

-- 
Thiago Jung Bauermann
IBM Linux Technology Center

  reply	other threads:[~2020-04-03 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  8:38 [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor Ram Pai
2020-03-26  8:45 ` Cédric Le Goater
2020-03-26 10:04 ` Greg Kurz
2020-03-31 23:53 ` Thiago Jung Bauermann
2020-04-01  5:32   ` Ram Pai
2020-04-03 18:24     ` Thiago Jung Bauermann [this message]
2020-04-26  2:05 ` [PATCH v3] " Ram Pai
2020-04-26  7:27   ` Ram Pai
2020-05-27  3:48     ` Michael Ellerman
2020-06-09  5:29   ` 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=87pncobf77.fsf@morokweng.localdomain \
    --to=bauerman@linux$(echo .)ibm.com \
    --cc=aik@ozlabs$(echo .)ru \
    --cc=andmike@linux$(echo .)ibm.com \
    --cc=clg@fr$(echo .)ibm.com \
    --cc=david@gibson$(echo .)dropbear.id.au \
    --cc=groug@kaod$(echo .)org \
    --cc=kvm-ppc@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=linuxram@us$(echo .)ibm.com \
    --cc=sukadev@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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