Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1104081ybb; Wed, 1 Apr 2020 15:58:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLMCwCaMBEOj5pqEFKjrTUtS52QU16VYfQmkBQomdS5Rpo9sgNuAkEZBsTmz7mC1CXaWwpK X-Received: by 2002:aca:a997:: with SMTP id s145mr228482oie.140.1585781919356; Wed, 01 Apr 2020 15:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585781919; cv=none; d=google.com; s=arc-20160816; b=EAzhbhh5tP2Cuo7GM7dGAd62/baXQt+CNA+209BTkuL5bLCo1i/+5T4GpUn+0AMkne ut3PviX1ep4t4+6g2ZCeL4VjfJ7zpwM0oiUrfsV0DswFIricILmH+6HpGG6bMdtD57Aw U9ABH7B8LUMMBfyk8xJOJywwQ5d+fRZGk/jGaLl6Xusp8qAS1Hq9UEh1YSHn7qHFsEFQ FNz2jbTff9ef0WVHTaNrU/gbWWOWgstEqFaAPrcvJ/Gws6RQe8ucmlXjkwZJQuWSSBBN O8p/kU5D+vs8RSxW0MJj8ZTihBWJ6ScJfB8l2NRkUXyiyE+OH3rL83nR1MiokhetqTv8 GUCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=BOdNcV8UJnLDgOQODaU0fROO7QPDWGi7VG1+IL23YOo=; b=eR7dOY1agYlEQu99exg3TdoXuiivHzDiSx7DgmBHsBXYzT+va4tXghMTvYLQO9dmNJ BixKFwwadqY9kQw/HemsRUHdP2Z9NYcbsMfEz8fTqXBRGqCNWJ5IHEpV5cMukaShrm6s 0nMpMmwgX8TaP9cb7xlbZ5pgi3MFxO2GQNXnp0wngaBPEHRgncsxi8psnNNjdKjNHK7m JI1oWnUNbHAED2JhiROjxWHnsVf/W1vtBDe3OHEyY35nhdugvA74Z0K58vvZLNP262Ol LGyg8jdlfIlxTEmvOR70UK1Rsy16SG5p/56Loop24Bg3uixw6FbJ93L9z6RAEgq2EZNX Cn8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=QYGtk3AH; 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 u3si1546504oth.152.2020.04.01.15.58.26; Wed, 01 Apr 2020 15:58:39 -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=@d-silva.org header.s=201810a header.b=QYGtk3AH; 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 S2389260AbgDAWvx (ORCPT + 99 others); Wed, 1 Apr 2020 18:51:53 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:36270 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389253AbgDAWvx (ORCPT ); Wed, 1 Apr 2020 18:51:53 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id 563302DC3330; Thu, 2 Apr 2020 09:51:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1585781508; bh=FgXrMZd5jgFgYwvk1rKNQ23NCAQq9Sxrzfkt7yVUPjk=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=QYGtk3AH0W2GW3xDqwILT4tWdRvwfukt/wtJfKxP3GeMIkwOcvxi4+bFTLeK7yG+2 QK6xQdg24HsMsrO96pzQzp7thT9OnH+T4/yu3go19x9bxZsYO5NlJv0CgTU9pVxohW KQJ7ZDAHLWkxg0LJ1OqUPhVMKcRhKtqvaK49TPOa4J4swSpzhvwUlGWHpq8nMLY9Ly Vu3DiOuAL2gubxA9ZbFj1JqQ4K9IlkSRcenYLBtTXq75bzFD851m4uhGrpdiUVXn/C xYFvA/Rmp5IP5yiGKQYiTLklvSDRR5jvaZQIEyqlOE1mS5D0AvD28BhaUjAKTArCoN xLLK+baQf/RyPZIGfFrlZcSyldovGznoCpUkK/BkN4eWPPuv3B4poiPOfQgWwQSfQg sHkxPI/TVU4tfkhNhDZIguM19nktovwPOgel+sGFHwKc3FPYkVGpat3Dr1kExYM2vc JJoWJhUH+zFmC6FT0WZMRa1HPdgoqc9nDa26VkS6riRQurzPFP7TrD10cEg99H5sMs U2tRswqCKr3RZ+yNiF41Vk8wrSpOlJFKm/gwDUHJhB93pS3IQx3r0NyJOFU6P009EI 4HDOv8cMGWuycKRawzl/BzpGQYXFmELX9appWWgEVeqyT8RUVn5oEkkYgQzQdJlkgd jakKdOir6MI9bh8Dme2Lw/KY= Received: from Hawking (ntp.lan [10.0.1.1]) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id 031Mpf9D088148 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Apr 2020 09:51:41 +1100 (AEDT) (envelope-from alastair@d-silva.org) From: "Alastair D'Silva" To: "'Dan Williams'" Cc: "'Aneesh Kumar K . V'" , "'Oliver O'Halloran'" , "'Benjamin Herrenschmidt'" , "'Paul Mackerras'" , "'Michael Ellerman'" , "'Frederic Barrat'" , "'Andrew Donnellan'" , "'Arnd Bergmann'" , "'Greg Kroah-Hartman'" , "'Vishal Verma'" , "'Dave Jiang'" , "'Ira Weiny'" , "'Andrew Morton'" , "'Mauro Carvalho Chehab'" , "'David S. Miller'" , "'Rob Herring'" , "'Anton Blanchard'" , "'Krzysztof Kozlowski'" , "'Mahesh Salgaonkar'" , "'Madhavan Srinivasan'" , "=?utf-8?Q?'C=C3=A9dric_Le_Goater'?=" , "'Anju T Sudhakar'" , "'Hari Bathini'" , "'Thomas Gleixner'" , "'Greg Kurz'" , "'Nicholas Piggin'" , "'Masahiro Yamada'" , "'Alexey Kardashevskiy'" , "'Linux Kernel Mailing List'" , "'linuxppc-dev'" , "'linux-nvdimm'" , "'Linux MM'" References: <20200327071202.2159885-1-alastair@d-silva.org> <20200327071202.2159885-2-alastair@d-silva.org> In-Reply-To: Subject: RE: [PATCH v4 01/25] powerpc/powernv: Add OPAL calls for LPC memory alloc/release Date: Thu, 2 Apr 2020 09:51:40 +1100 Message-ID: <2d6d01d60878$1c8c68f0$55a53ad0$@d-silva.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-au Thread-Index: AQJ5L4Hn/mp5p0p1jYAFWLJ+xmWSbgKnRjTFARH8J02nAMbrEA== X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Thu, 02 Apr 2020 09:51:42 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Dan Williams > Sent: Wednesday, 1 April 2020 7:48 PM > To: Alastair D'Silva > Cc: Aneesh Kumar K . V ; Oliver O'Halloran > ; Benjamin Herrenschmidt > ; Paul Mackerras ; Michael > Ellerman ; Frederic Barrat = ; > Andrew Donnellan ; Arnd Bergmann > ; Greg Kroah-Hartman ; > Vishal Verma ; Dave Jiang > ; Ira Weiny ; Andrew Morton > ; Mauro Carvalho Chehab > ; David S. Miller ; > Rob Herring ; Anton Blanchard ; > Krzysztof Kozlowski ; Mahesh Salgaonkar > ; Madhavan Srinivasan > ; C=C3=A9dric Le Goater ; Anju = T > Sudhakar ; Hari Bathini > ; Thomas Gleixner ; Greg > Kurz ; Nicholas Piggin ; Masahiro > Yamada ; Alexey Kardashevskiy > ; Linux Kernel Mailing List = ; > linuxppc-dev ; linux-nvdimm nvdimm@lists.01.org>; Linux MM > Subject: Re: [PATCH v4 01/25] powerpc/powernv: Add OPAL calls for LPC > memory alloc/release >=20 > On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva = > wrote: > > > > Add OPAL calls for LPC memory alloc/release > > >=20 > This seems to be referencing an existing api definition, can you = include a > pointer to the spec in case someone wanted to understand what these > routines do? I suspect this is not allocating memory in the = traditional sense as > much as it's allocating physical address space for a device to be = mapped? >=20 These API calls were introduced in the following skiboot commit: https://github.com/open-power/skiboot/commit/1a548857ce1f02f43585b326a891= eed18a7b43b3 I'll add it to the description. >=20 > > Signed-off-by: Alastair D'Silva > > Acked-by: Andrew Donnellan > > Acked-by: Frederic Barrat > > --- > > arch/powerpc/include/asm/opal-api.h | 2 ++ > > arch/powerpc/include/asm/opal.h | 2 ++ > > arch/powerpc/platforms/powernv/opal-call.c | 2 ++ > > 3 files changed, 6 insertions(+) > > > > diff --git a/arch/powerpc/include/asm/opal-api.h > > b/arch/powerpc/include/asm/opal-api.h > > index c1f25a760eb1..9298e603001b 100644 > > --- a/arch/powerpc/include/asm/opal-api.h > > +++ b/arch/powerpc/include/asm/opal-api.h > > @@ -208,6 +208,8 @@ > > #define OPAL_HANDLE_HMI2 166 > > #define OPAL_NX_COPROC_INIT 167 > > #define OPAL_XIVE_GET_VP_STATE 170 > > +#define OPAL_NPU_MEM_ALLOC 171 > > +#define OPAL_NPU_MEM_RELEASE 172 > > #define OPAL_MPIPL_UPDATE 173 > > #define OPAL_MPIPL_REGISTER_TAG 174 > > #define OPAL_MPIPL_QUERY_TAG 175 > > diff --git a/arch/powerpc/include/asm/opal.h > > b/arch/powerpc/include/asm/opal.h index 9986ac34b8e2..301fea46c7ca > > 100644 > > --- a/arch/powerpc/include/asm/opal.h > > +++ b/arch/powerpc/include/asm/opal.h > > @@ -39,6 +39,8 @@ int64_t opal_npu_spa_clear_cache(uint64_t phb_id, > uint32_t bdfn, > > uint64_t PE_handle); int64_t > > opal_npu_tl_set(uint64_t phb_id, uint32_t bdfn, long cap, > > uint64_t rate_phys, uint32_t size); > > +int64_t opal_npu_mem_alloc(u64 phb_id, u32 bdfn, u64 size, __be64 > > +*bar); int64_t opal_npu_mem_release(u64 phb_id, u32 bdfn); > > > > int64_t opal_console_write(int64_t term_number, __be64 *length, > > const uint8_t *buffer); diff --git > > a/arch/powerpc/platforms/powernv/opal-call.c > > b/arch/powerpc/platforms/powernv/opal-call.c > > index 5cd0f52d258f..f26e58b72c04 100644 > > --- a/arch/powerpc/platforms/powernv/opal-call.c > > +++ b/arch/powerpc/platforms/powernv/opal-call.c > > @@ -287,6 +287,8 @@ OPAL_CALL(opal_pci_set_pbcq_tunnel_bar, > OPAL_PCI_SET_PBCQ_TUNNEL_BAR); > > OPAL_CALL(opal_sensor_read_u64, > OPAL_SENSOR_READ_U64); > > OPAL_CALL(opal_sensor_group_enable, > OPAL_SENSOR_GROUP_ENABLE); > > OPAL_CALL(opal_nx_coproc_init, = OPAL_NX_COPROC_INIT); > > +OPAL_CALL(opal_npu_mem_alloc, OPAL_NPU_MEM_ALLOC); > > +OPAL_CALL(opal_npu_mem_release, > OPAL_NPU_MEM_RELEASE); > > OPAL_CALL(opal_mpipl_update, OPAL_MPIPL_UPDATE); > > OPAL_CALL(opal_mpipl_register_tag, > OPAL_MPIPL_REGISTER_TAG); > > OPAL_CALL(opal_mpipl_query_tag, > OPAL_MPIPL_QUERY_TAG); > > -- > > 2.24.1 > > >=20 >=20 > -- > This email has been checked for viruses by AVG. > https://www.avg.com --=20 Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva msn: alastair@d-silva.org blog: http://alastair.d-silva.org Twitter: @EvilDeece