Received: by 10.223.164.202 with SMTP id h10csp1017400wrb; Tue, 7 Nov 2017 19:54:14 -0800 (PST) X-Google-Smtp-Source: ABhQp+Sav3ACk90tAPrLaSLpdlRrd/ngXVPG8L/RNU16SkSN575CrQePnn6khnSsjJuRuNIbr36R X-Received: by 10.99.3.1 with SMTP id 1mr943025pgd.111.1510113254784; Tue, 07 Nov 2017 19:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510113254; cv=none; d=google.com; s=arc-20160816; b=k9uF2Q60LZqw/O8Oc1pVi6g7HRB5QBbJSFM2G+FHbNdGfw+SQauVBmreVnefLoozvD Pd3Czgk7/8ytXTvhK/5wY9QIXUIT5B9QH75V0/HlvxfF4n09K1gEaR/ahzxCwHqooeNa UiReMvAMqTkioT/AxgVK63xHOVG1N8wBDoh0JsjntEe1EAy8HGhsloQKu8jYq392f+Ol +IqWwYtmkHGz8TuLMKQ02auHxTwFlBM8G+FLAXaw7Gw+DtFKUcd1/tnuG70gIue1uu1R o/i7IZU1XWhnrPDHqS26xFGxk79Zb9P8rc12f0fHoMhZAwSEhGrPMeVLmYu54CPiOnHU mzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=/r9ivKMaVkz79fSEA17DPpl12G0qLifFTCEzcgBZfJ4=; b=bvQtDnnrsT+TIn9CnJeYLwt0X5UFiNfBZxy8yynFMw+QxZN6q/eb2yQfXfi99XLnU2 rv37pm3rw4XKWvET3Wl1ZZhjPH6DyP7rS11rstUnMdsrpTpVLkJRRpyG9WODmyd35d7X 19WwNMFhK0icYXiUJiE7bR/hrKqqflw7tHuh08mz3GfzEuvvPwObaE3eScQfc/EGSTSs HdxU1EHzRRqhJmXa+g9eqls6tH4abqtEwsIKn6lODSEMV3RyXqxXc7+6dpegxJMv8eVh cRiGO//dhxjRLXTaeE/Aw58hWmT6Ysh6miWh31Q6+4C7f/FBYEpHYOYj4sO2hzezc85h Q8mg== 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 d8si2678202pgt.286.2017.11.07.19.54.02; Tue, 07 Nov 2017 19:54:14 -0800 (PST) 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 S1753394AbdKHCYb (ORCPT + 90 others); Tue, 7 Nov 2017 21:24:31 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40472 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304AbdKHCY2 (ORCPT ); Tue, 7 Nov 2017 21:24:28 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA82NtBX107783 for ; Tue, 7 Nov 2017 21:24:28 -0500 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e3q7fcswc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 07 Nov 2017 21:24:27 -0500 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Nov 2017 19:24:26 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 Nov 2017 19:24:24 -0700 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA82OOMY4325692; Tue, 7 Nov 2017 19:24:24 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 227816A03B; Tue, 7 Nov 2017 19:24:24 -0700 (MST) Received: from suka-w540.usor.ibm.com (unknown [9.70.94.25]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id A41156A03C; Tue, 7 Nov 2017 19:24:23 -0700 (MST) From: Sukadev Bhattiprolu To: Michael Ellerman Cc: Benjamin Herrenschmidt , mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com, linuxppc-dev@ozlabs.org, Subject: [PATCH v3 16/18] powerpc/vas: Define vas_win_paste_addr() Date: Tue, 7 Nov 2017 18:23:56 -0800 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510107838-15181-1-git-send-email-sukadev@linux.vnet.ibm.com> References: <1510107838-15181-1-git-send-email-sukadev@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17110802-0016-0000-0000-000007C5B18F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008029; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00942691; UDB=6.00475553; IPR=6.00722979; BA=6.00005677; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017903; XFM=3.00000015; UTC=2017-11-08 02:24:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110802-0017-0000-0000-00003C2A38F6 Message-Id: <1510107838-15181-17-git-send-email-sukadev@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-07_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711080027 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define an interface that the NX drivers can use to find the physical paste address of a send window. This interface is expected to be used with the mmap() operation of the NX driver's device. i.e the user space process can use driver's mmap() operation to map the send window's paste address into their address space and then use copy and paste instructions to submit the CRBs to the NX engine. Note that kernel drivers will use vas_paste_crb() directly and don't need this interface. Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/include/asm/vas.h | 7 +++++++ arch/powerpc/platforms/powernv/vas-window.c | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/powerpc/include/asm/vas.h b/arch/powerpc/include/asm/vas.h index 044748f..f98ade8 100644 --- a/arch/powerpc/include/asm/vas.h +++ b/arch/powerpc/include/asm/vas.h @@ -10,6 +10,8 @@ #ifndef _ASM_POWERPC_VAS_H #define _ASM_POWERPC_VAS_H +struct vas_window; + /* * Min and max FIFO sizes are based on Version 1.05 Section 3.1.4.25 * (Local FIFO Size Register) of the VAS workbook. @@ -165,4 +167,9 @@ int vas_copy_crb(void *crb, int offset); */ int vas_paste_crb(struct vas_window *win, int offset, bool re); +/* + * Return the power bus paste address associated with @win so the caller + * can map that address into their address space. + */ +extern u64 vas_win_paste_addr(struct vas_window *win); #endif /* __ASM_POWERPC_VAS_H */ diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c index c030d4c..d7d0653 100644 --- a/arch/powerpc/platforms/powernv/vas-window.c +++ b/arch/powerpc/platforms/powernv/vas-window.c @@ -40,6 +40,16 @@ static void compute_paste_address(struct vas_window *window, u64 *addr, int *len pr_debug("Txwin #%d: Paste addr 0x%llx\n", winid, *addr); } +u64 vas_win_paste_addr(struct vas_window *win) +{ + u64 addr; + + compute_paste_address(win, &addr, NULL); + + return addr; +} +EXPORT_SYMBOL(vas_win_paste_addr); + static inline void get_hvwc_mmio_bar(struct vas_window *window, u64 *start, int *len) { -- 2.7.4 From 1583465547567394645@xxx Wed Nov 08 03:07:03 +0000 2017 X-GM-THRID: 1583465547567394645 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread