From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thiago Jung Bauermann Date: Fri, 03 Apr 2020 18:24:12 +0000 Subject: Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor. Message-Id: <87pncobf77.fsf@morokweng.localdomain> List-Id: References: <1585211927-784-1-git-send-email-linuxram@us.ibm.com> <87r1x86pzw.fsf@morokweng.localdomain> <20200401053200.GE5903@oc0525413822.ibm.com> In-Reply-To: <20200401053200.GE5903@oc0525413822.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Ram Pai 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 Ram Pai writes: > On Tue, Mar 31, 2020 at 08:53:07PM -0300, Thiago Jung Bauermann wrote: >> >> Hi Ram, >> >> Ram Pai 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 >> > #include >> > #include >> > +#include >> > +#include >> > >> > #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