Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1970774ybi; Thu, 18 Jul 2019 01:15:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZA3QualoV03ujiwTiM4/M6KHTCb9dIN7Lz3ydk704xfYbu358FWVIf5rh5sQqMTZfb1OI X-Received: by 2002:a17:90a:ab0b:: with SMTP id m11mr51097597pjq.73.1563437727243; Thu, 18 Jul 2019 01:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563437727; cv=none; d=google.com; s=arc-20160816; b=yCK83l8KiFWDgv5xKmbg8N8Rwbs5xlsgMlr8T8f7LeXolc/rXn56UzfGrOpRisuOhP 3YcZ6+g/F+eMgSdolu9cW5qFoP4fpESIiaHDTgShufVl1pDYe9e0aAcJX8psqTt3vhuH +dUHTwhiiKXYmgDyTkLQRzTrDdHo9gfky0X9l691GefpnMQwzdiGchnI4Lsx6PbcWO4A 3of66Bl51cs3wwnWADN2FNCdUxuhd70SHZ3tmyhj2qS35vhnN2Pi0SQODAGaQ3Os3oMP DlxP8rAC4PltirV6uQri+EMLL31x6ikTSEUnNPpTOrcqmDiovTHY+0SJkR1MOBDAOpbp IY6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=WEPQWB9mL7qVaCOqVBJLCz5vsDHBMIw1+BdS4ATmzgQ=; b=dmaj+2I5SiWAMyj/JwdP60F5afgEx8eq8UM0+hIguYfHrx8tkwm2mQzA+rH+tUHdbe UIhaJ7qXm4ho0/Nvw7rBl9qvxE0p5BGNF9XKhBAU1hi6g6Rm88OPcK+fbYhcF5Kw8K8+ brE7uAXhQ/sdvEAeqXRDg9XjilMApFplKXJcJWkNKf1U3QP1jSmOtWGnoPwjiV6QrZcr CztH3VHCOQ6P5Q6hJDmFoAqp/5+hSUwAB0N3q9XGhPQgKCKD+L/nPbZLphvrSiHGYOEK +L9pxn5X2a3AbuCOISrFe6xbzo+Bvnlf6GIMcW0y7AdOiua70OmqdcGph/riSgvoEhB1 +Ujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=MfU7zanx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si1757629pgj.437.2019.07.18.01.15.10; Thu, 18 Jul 2019 01:15:27 -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; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=MfU7zanx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389446AbfGRINq (ORCPT + 99 others); Thu, 18 Jul 2019 04:13:46 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44159 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387777AbfGRINo (ORCPT ); Thu, 18 Jul 2019 04:13:44 -0400 Received: by mail-pf1-f195.google.com with SMTP id t16so12228993pfe.11 for ; Thu, 18 Jul 2019 01:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WEPQWB9mL7qVaCOqVBJLCz5vsDHBMIw1+BdS4ATmzgQ=; b=MfU7zanxbv9W4UR9Jm9cRC1ssg0R8tJalTrmiDVVaixvRRDkLeAVGFMA/uNkbpOa+D jvpp9Z5eb417ob7VF4kFtVHZC48Lck2SAulQIXeJgt1v8Dl7LeD5SOsZ2Mbw/OPTZDQR 9CrmsuhLaWXhojYzNwye0Px6EFygP/7sSZUBBK/dh8/PlRTfwvsVYh3w0WVGd4sm32W8 OfFCrOH5636iRoq5zvvnmEI0Gwp093U9jrZm8W6O9jCtw75PA8Hmnzyi+lPlhfYn3h1s z/y3Qu9eORQGiqfnYehet7qlxgR+YqMzKt9G4yVGU7yp5SdTh1GSD+3b8ywVvgFXWIJ4 +d9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WEPQWB9mL7qVaCOqVBJLCz5vsDHBMIw1+BdS4ATmzgQ=; b=XzLKjEqauHrMdakV2m0SZnX8ChO0avvcq5ArS+n3WBiilBAdX7LNcMzqPXUqo7/XQN 0eb2oHvSHE9w51U+2cj/d7KvF3I2du5bhJ+EbvIBh1BG1oERC/l3+Cpk0Mwub9EJwpXO TN7l0N4AXPgbzxlsuJh1QddvvDWiSt6VnPJj0X7qj11Z26CRw9gKTu0w1DCD1lW6Embw KTbc+APq90DlHpMLwCxntq5HX4jFdfTPR7wNPBjZyZfbRF6N3ns4at/TEkemYgBVvJfU 1bwjID0hdwxQO8+wa4fbodxz7Hn7+N4Vg5+Dkha2tnNl5F2Rz/FF0YUdIgGi1vXvU361 H2AQ== X-Gm-Message-State: APjAAAWfaDPHbOoDM2qZcTyZ2/8g1TyDSOWMFh/m0lNPc3Gwx8liQPsO b+Oh/xxgQ7JCH8nqpaPtK2Q= X-Received: by 2002:a63:490a:: with SMTP id w10mr45466506pga.6.1563437623905; Thu, 18 Jul 2019 01:13:43 -0700 (PDT) Received: from [10.61.2.175] ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id f72sm37999820pjg.10.2019.07.18.01.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jul 2019 01:13:43 -0700 (PDT) Subject: Re: [PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE To: Thiago Jung Bauermann , linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho References: <20190713060023.8479-1-bauerman@linux.ibm.com> <20190713060023.8479-5-bauerman@linux.ibm.com> From: Alexey Kardashevskiy Message-ID: <4fcc84ae-b93a-b5f1-fba4-b0e2af7b727c@ozlabs.ru> Date: Thu, 18 Jul 2019 18:13:37 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190713060023.8479-5-bauerman@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > +} > + > +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 */ > -- Alexey