Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp518115ybm; Mon, 20 May 2019 21:54:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqybKCcP7xsOj+WTrdsnqke606S81kS0MBTNhS/ocdGPoTKGCDlnXY/B6LJIJ4bPGUNF2yj3 X-Received: by 2002:a63:ce54:: with SMTP id r20mr81232691pgi.37.1558414441381; Mon, 20 May 2019 21:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558414441; cv=none; d=google.com; s=arc-20160816; b=rqcTsUjyMPP1zGIJ8r3JMf2BKa1kz7Oa0D0ZC03jQWp7TMRmS0tkhss62Mlua1jtt+ pKyliPfV45SL0qDVF1eqgjSIp58WGvMIquIZPcYPzG75Bs4nUZGYBKC7P9ozy7b3l5uU bsJ9hw81cJhktPlSKCXUWo+mMpiHdEWkHDF89LvnCufr2yb6PvdhXQbozsLONU3ZEeND 8mq6tQh0SkkTNfr9sjnVJMuagrla/Bp/qW6nxuRZDlkdBSvae9xQeejpMo5JegNui37J Y+EYw4aCO2gbu1uMZA+f5xJsA/GAQTWr0YJLQ9MZzQtk//YvJ4esx5g5gEf6NF+BffvA RChA== 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=SDhEbNUsQYkTQfCYD+9FV/BztZMuBJbcKAFLj9CkbBA=; b=QDUu35J+zL9O0NIfY2LvR6TzEENOp5RbIfRN2qvGuQB3eHMw+L5+sBzyst0B/b6Dr8 d+fkgaM8JfgGiJE2MJEVwGXECJmcQfw9hvS2BK+XHTzaKSHVxG08ZSbb8MrYweOr1lqF sAvaxKrzfJSZtwN1r3pwOJ5sZAJ/+1SNARZGPmfB44BlFiTBhAd33MWjZXgWwS62+qI8 fzRPd27OR+4RnXAzctFt2XJEIqCWupAUQmdbdE+uN5MvZ5zBDq58eeHEW5B3Btpn1i6w ITE18ajG466h2wMMUiR97Jp8KwQTfDLhQ6KKAtJtn2JZRomyzU5+DpYqQXwoYA5k0adf FE5Q== 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 l192si10097795pge.230.2019.05.20.21.53.46; Mon, 20 May 2019 21:54:01 -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 S1727710AbfEUEwI (ORCPT + 99 others); Tue, 21 May 2019 00:52:08 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45408 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727686AbfEUEwI (ORCPT ); Tue, 21 May 2019 00:52:08 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4L4l7D8070782 for ; Tue, 21 May 2019 00:52:07 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sma1g13mf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 21 May 2019 00:52:07 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 May 2019 05:52:05 +0100 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 21 May 2019 05:52:01 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4L4q0ap38535210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 May 2019 04:52:00 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9E70C605D; Tue, 21 May 2019 04:51:59 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 210A2C6057; Tue, 21 May 2019 04:51:49 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.80.203.157]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 21 May 2019 04:51:48 +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 04/12] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE Date: Tue, 21 May 2019 01:49:04 -0300 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521044912.1375-1-bauerman@linux.ibm.com> References: <20190521044912.1375-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19052104-0004-0000-0000-000015120A2D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011134; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01206343; UDB=6.00633450; IPR=6.00987310; MB=3.00026980; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-21 04:52:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052104-0005-0000-0000-00008BBE4BEA Message-Id: <20190521044912.1375-5-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-20_09:,, 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=700 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905210030 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 | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/powerpc/include/asm/ultravisor-api.h b/arch/powerpc/include/asm/ultravisor-api.h index 0e8b72081718..ed68b02869fd 100644 --- a/arch/powerpc/include/asm/ultravisor-api.h +++ b/arch/powerpc/include/asm/ultravisor-api.h @@ -20,6 +20,8 @@ /* opcodes */ #define UV_WRITE_PATE 0xF104 #define UV_ESM 0xF110 +#define UV_SHARE_PAGE 0xF130 +#define UV_UNSHARE_PAGE 0xF134 #define UV_RETURN 0xF11C #endif /* _ASM_POWERPC_ULTRAVISOR_API_H */ diff --git a/arch/powerpc/include/asm/ultravisor.h b/arch/powerpc/include/asm/ultravisor.h index 09e0a615d96f..537f7717d21a 100644 --- a/arch/powerpc/include/asm/ultravisor.h +++ b/arch/powerpc/include/asm/ultravisor.h @@ -44,6 +44,20 @@ static inline int uv_register_pate(u64 lpid, u64 dw0, u64 dw1) return ucall(UV_WRITE_PATE, retbuf, lpid, dw0, dw1); } +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 */