Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2726572ybi; Thu, 18 Jul 2019 13:15:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzis7C/gaQ5wsC+LpZmGu21Bt2D8YX4Z0JkegymsJaNX/7GolTZ0n7E5fHnvWhBiq9a6wC+ X-Received: by 2002:a17:90a:2244:: with SMTP id c62mr54204146pje.29.1563480931954; Thu, 18 Jul 2019 13:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563480931; cv=none; d=google.com; s=arc-20160816; b=HueV/+OCfL/g/X2vyDg84l4XpvXpYfYdrSiiM3THhSsqy+722F6EEx2iPp2jhiIzmU zuqUFAfbnLJs8wdKdY12v4t3LIAM2HM1+LOM+HCaHhspEqqpLNyA62rU6XWuvl7xOFfV P0xtjFcDeVD6jd20vxUHDwTTNitnsoVJxixilGE1jESI2df6JCzZAvCCOblhd2q3OzEM UjvDgxpRVNGgvvBgmvWNrfXjZlnOQLoaCkzkF/HA4K/BVrMbwth+3A4SCWG5SVidtaW2 aGhcsmWsEpZna8dDU+sFyog2dCCYRqajrnnArl2Y0ZdEiWw8YAwKgYckP5fgCngUANUf QPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=EnQfrRZdkg/1ZsRyatpgKSJu5VYjpemCwIshhyOS6tw=; b=DZY4mETEE084TV7e63bLMsXyvcwz/BX5K7TJegCm7bvljUE8Cl1izuzfqoSu4VIQ2V CdFdUoMiCmCBcCgpcpRoHRtvnUTbnhrTuJCJV16Kev23NkS3kgMxypnc87n/pAHjsAgj f5Od7E81e7leaTVYT37ZIF9PmyKBnhLlIURdxi92oZzHNf/8Aue7ecGsqoS4gl3bfKeh dQH7EmEcmdCKyBTVbvQ+mMuPnIQTVgIo4CrGHSnpVwsFAuCylOhQTnyIaEUfgmlG2zli ee0Dx+q15aAllqHOfO/A1JG0CnxccLTZZM5kwIoaFFXojoXkzQCmBJi3ChF/kyJIjyc7 t7KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si1656971pgv.31.2019.07.18.13.15.15; Thu, 18 Jul 2019 13:15:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391475AbfGRUNS (ORCPT + 99 others); Thu, 18 Jul 2019 16:13:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26220 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbfGRUNS (ORCPT ); Thu, 18 Jul 2019 16:13:18 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6IK8ndj060325; Thu, 18 Jul 2019 16:12:56 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ttvupefxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jul 2019 16:12:55 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x6IKA5R7071430; Thu, 18 Jul 2019 16:12:55 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ttvupefwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jul 2019 16:12:55 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x6IK9wfn001885; Thu, 18 Jul 2019 20:12:54 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04dal.us.ibm.com with ESMTP id 2trtmrj63w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jul 2019 20:12:54 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6IKCrn934079156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jul 2019 20:12:53 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 995DB112066; Thu, 18 Jul 2019 20:12:53 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15580112062; Thu, 18 Jul 2019 20:12:51 +0000 (GMT) Received: from morokweng.localdomain (unknown [9.85.186.82]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTPS; Thu, 18 Jul 2019 20:12:50 +0000 (GMT) References: <20190713060023.8479-1-bauerman@linux.ibm.com> <20190713060023.8479-5-bauerman@linux.ibm.com> <4fcc84ae-b93a-b5f1-fba4-b0e2af7b727c@ozlabs.ru> User-agent: mu4e 1.2.0; emacs 26.2 From: Thiago Jung Bauermann To: Alexey Kardashevskiy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho Subject: Re: [PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE In-reply-to: <4fcc84ae-b93a-b5f1-fba4-b0e2af7b727c@ozlabs.ru> Date: Thu, 18 Jul 2019 17:12:47 -0300 Message-ID: <877e8f3xvk.fsf@morokweng.localdomain> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-18_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=8 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907180207 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Alexey, Thanks for your review! Alexey Kardashevskiy writes: > On 13/07/2019 16:00, Thiago Jung Bauermann wrote: >> From: Ram Pai >> >> These functions are used when the guest wants to grant the hypervisor >> access to certain pages. >> >> Signed-off-by: Ram Pai >> Signed-off-by: Thiago Jung Bauermann >> --- >> arch/powerpc/include/asm/ultravisor-api.h | 2 ++ >> arch/powerpc/include/asm/ultravisor.h | 15 +++++++++++++++ >> 2 files changed, 17 insertions(+) >> >> diff --git a/arch/powerpc/include/asm/ultravisor-api.h b/arch/powerpc/include/asm/ultravisor-api.h >> index fe9a0d8d7673..c7513bbadf57 100644 >> --- a/arch/powerpc/include/asm/ultravisor-api.h >> +++ b/arch/powerpc/include/asm/ultravisor-api.h >> @@ -25,6 +25,8 @@ >> #define UV_UNREGISTER_MEM_SLOT 0xF124 >> #define UV_PAGE_IN 0xF128 >> #define UV_PAGE_OUT 0xF12C >> +#define UV_SHARE_PAGE 0xF130 >> +#define UV_UNSHARE_PAGE 0xF134 >> #define UV_PAGE_INVAL 0xF138 >> #define UV_SVM_TERMINATE 0xF13C >> diff --git a/arch/powerpc/include/asm/ultravisor.h >> b/arch/powerpc/include/asm/ultravisor.h >> index f5dc5af739b8..f7418b663a0e 100644 >> --- a/arch/powerpc/include/asm/ultravisor.h >> +++ b/arch/powerpc/include/asm/ultravisor.h >> @@ -91,6 +91,21 @@ static inline int uv_svm_terminate(u64 lpid) >> return ucall(UV_SVM_TERMINATE, retbuf, lpid); >> } >> + >> +static inline int uv_share_page(u64 pfn, u64 npages) >> +{ >> + unsigned long retbuf[UCALL_BUFSIZE]; >> + >> + return ucall(UV_SHARE_PAGE, retbuf, pfn, npages); > > > What is in that retbuf? Can you pass NULL instead? I think so, that buffer isn't used actually. Claudio is working on a ucall_norets() which doesn't take the buffer and I can switch to that. -- Thiago Jung Bauermann IBM Linux Technology Center