Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1726549ybi; Fri, 12 Jul 2019 23:01:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjoc8SoIKVCAzCeQzoKFmqL1S2aWeia7NO4NgKKiZr6XtsQVJdKz3LN14saWnwPTINv3CE X-Received: by 2002:a63:4f45:: with SMTP id p5mr15490964pgl.326.1562997712786; Fri, 12 Jul 2019 23:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562997712; cv=none; d=google.com; s=arc-20160816; b=LXfGknwWZdh5a+e6+FUm2+QqWYyOedcmd+cCmfEDNER7+uHcLD364hQrzW89xlO/L5 a9Ug8v8Cg5v8WWVtUok9Bbh7LRTn0/mgVhubNyLW0wwaJD5aIdCgslDBvPoWoO25ndZk HkXTZKofNsWLzVX8dBFnYnb/nEL5J6jAva+1NvkOTV8wMUCoamxWEjgi4YhcbmTbViRy 3WyOZ7x1BPH96uzZ0KakOS+A7ZVZtAN4YJKkwiP1Bndy4cNQh3TSc7f2jI5oh6mZP2KX MYaHsap2RF+5jjMOxRlhdf0rvEvlNwOVEiDnrwdEmi6uLSEOwfo3ajjmp1sFQ83fVVJi iV4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=dDqM6Vm3cE3tctF4PimgCmChVlVf4gktIf6paWP7Nos=; b=t2tyXVVgaGYGXxLQC+tIwb08F2twmzlcOtI67oo3ApkP/2DbZp9pcxgmwr4vQGkSKk /K13dATx5TVGMZ9L1dAYZgp3hiWEPCTeMx8fhGWrWIy52pRujeuslxpXmj1J2TA3ho6D kDtLv++ENr5AzhGKHCKEfHgefj9jkRJ1cKBrlM8v6uJ1Y1s4ANzn+tO7wGJdbw8qgy9D Na9KHbAaiymxHTIoA/5IXdNlop4mCWA6u6zmtzIQGK4TPyrcyJYMjOgZSV7zxn8ZGZhc PetYMW76KIhndzZ2Z1hAEBy6r1YNzACSbhRX/CNyPBPBfZge5c1WGuK5frDjTRup0+vW G58w== 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 t4si9729995pjr.31.2019.07.12.23.01.37; Fri, 12 Jul 2019 23:01:52 -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 S1727603AbfGMGBA (ORCPT + 99 others); Sat, 13 Jul 2019 02:01:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41530 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726274AbfGMGBA (ORCPT ); Sat, 13 Jul 2019 02:01:00 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6D5uMd6137455 for ; Sat, 13 Jul 2019 02:00:58 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tq9er0a4e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 13 Jul 2019 02:00:58 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 13 Jul 2019 07:00:57 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 13 Jul 2019 07:00:53 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6D60qao62456118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Jul 2019 06:00:52 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71AB8C605F; Sat, 13 Jul 2019 06:00:52 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76CDDC6057; Sat, 13 Jul 2019 06:00:49 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.85.135.203]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Sat, 13 Jul 2019 06:00:49 +0000 (GMT) From: Thiago Jung Bauermann To: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Alexey Kardashevskiy , Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho , Thiago Jung Bauermann Subject: [PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE Date: Sat, 13 Jul 2019 03:00:14 -0300 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com> References: <20190713060023.8479-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19071306-0036-0000-0000-00000AD65FE9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011419; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01231434; UDB=6.00648705; IPR=6.01012726; MB=3.00027699; MTD=3.00000008; XFM=3.00000015; UTC=2019-07-13 06:00:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071306-0037-0000-0000-00004C91A6D1 Message-Id: <20190713060023.8479-5-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-13_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=746 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907130070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); +} + +static inline int uv_unshare_page(u64 pfn, u64 npages) +{ + unsigned long retbuf[UCALL_BUFSIZE]; + + return ucall(UV_UNSHARE_PAGE, retbuf, pfn, npages); +} + #endif /* !__ASSEMBLY__ */ #endif /* _ASM_POWERPC_ULTRAVISOR_H */