Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp397323ybk; Wed, 13 May 2020 03:07:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLRoPS29ycXv7wsBYZzfENIi07EcULepRR1QRj5GfiiOSfA6gcVM6vCLGrCn9JuAq01oOo4 X-Received: by 2002:a17:906:8611:: with SMTP id o17mr21214513ejx.221.1589364456294; Wed, 13 May 2020 03:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589364456; cv=none; d=google.com; s=arc-20160816; b=korSBg8rjx+ywc4xomBmKxJZPXKVtPQ3mCqtPp1z/V1BeKdcunWW971qv34PHZHbwW Wjg7+K7HrvS//v+Ubm1ogg8SIyr6lSsJwY7Dumwv7TeHiJSJHLqIt1lCLOGp5pgdmKpm rME1lfp32knTgSG38Qta9oJ2SERX3XbQspNdZwXGjV3N7QOcvpKJJdhGTQzF7MWANjiI bYOUCbxGpFgbu+L2XUTvFnK0akY5CUYaw7/j+o98G77fsyZAPn3fXZftqR+vzL+EctGl erWyc5CPJSmbPR8eajoI5kHxVIzcf2XOuv0+QrxJ3tKzIf0F+PptFv0BNpcPm9ENGE7N etoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NUV55Xm3hCbn3rzgcKao/BsDsGHwEHbDl7tn0QObSVY=; b=uTSV/KyGj5YGMebHuCPln4kr8xwekGpkaevAMT7mXUo5qUNdET4knUgJv54IMiikNH yZcEQe6+yTgYL6pgEwHSgBJh9FO8T4C2PmPDKf1+ntw4LLCIjqYtp3judpY1nGR1QCMI TLH2mCjW6PcfIDnKVfxxQHfOw9KnJL3uWbAuECpZXquOZyASo1SVdBr5AVs/CP1O0YOY IRFS4FDKGItdnfp8MtUAYIjGo3qcSuoOWo5eRGiSpP/BIz3tWOuI0fBllUOlDI8zdhPO ZDSvgWBdvRO7dXSzCaiy2NqJNqiCyTQCXn3qgKWOtJmIuf4mjctb0C8zsDRYAjrRE+kF RN5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PV5yqOxp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d22si8509921ejj.389.2020.05.13.03.07.13; Wed, 13 May 2020 03:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PV5yqOxp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388708AbgEMKEv (ORCPT + 99 others); Wed, 13 May 2020 06:04:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732876AbgEMKEt (ORCPT ); Wed, 13 May 2020 06:04:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E505A206B8; Wed, 13 May 2020 10:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589364288; bh=BkUzNAvRjDhZ5sh9KsFgyFVKv9jNomu1O2R+MD3pou8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PV5yqOxp7v0teWZ5crR2ehluwOXrr3DcmlDcWZhM/f7bVtRBh3J3jGfx5jnfBhP2B 176rRIBdxukTGVFgS0qqR0iPcOSHajdIJXAg4RNUMFJJLU3l1lzt9L6CKaKl6WEa5S EoNHAQIZWgoUsUYUmjrmADoa3W7ZzdcmSboXjA8g= Date: Wed, 13 May 2020 12:04:46 +0200 From: "gregkh@linuxfoundation.org" To: "Ravich, Leonid" Cc: "Idgar, Or" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: CMA enhancement - non-default areas in x86 Message-ID: <20200513100446.GB868852@kroah.com> References: <20200513064755.GA763968@kroah.com> <20200513071413.GB766804@kroah.com> <20200513083343.GA772573@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 09:43:45AM +0000, Ravich, Leonid wrote: > > On Wed, May 13, 2020 at 08:29:16AM +0000, Ravich, Leonid wrote: > > > PCIe NTB > > > Documentation/driver-api/ntb.rst > > > > > 1) Basically PCI bridge between to root complex / PCI switches > > > 2) using out of OS memory is one solution but then this memory is > > > Limited for usage by other stack, ex: get_user_pages on this memory > > > will fail, Therefore attempting to use it for block layer with (o_direct) will > > fail. > > > > > > Acutely any generic stack which attempts to "pin" this memory will fail. > > > > So why isn't the BIOS/UEFI properly reserving this from the general operating > > system's pages so that the driver knows to use them instead? > > > > Is UEFI wrong here about these being valid memory ranges for general use? > > If so, why not fix that? If not, how in the world is the OS supposed to know > > these memory ranges are _not_ for general use? I feel like there is > > something missing here... > > > Maybe I am miss understanding something here , but if BIOS/UEFI will reserve this pages > They will be "out of kernel" which will work for propriety driver but this memory will not > be useable for generic driver which will attempt to pin this memory with get_user_pages() . > so we can go and try to fix that (not sure this is the right way) . What do you mean by "propriety" driver vs. "generic" driver? Shouldn't there be some "generic" way that UEFI tells any driver where these memory locations are that can not be used as general memory? If not, try fixing up UEFI for that. > another option here is to use some kernel infrastructure which from one side reserve the memory from general use > on the other hand kernel will be aware of this pages so get_user_pages() will work on this memory . > > from what we saw CMA infrastructure can support such requirements. CMA needs to be told where to reserve the memory at boot time. If you want to use that, great, but something has to tell it, so perhaps just get that info from UEFI as that is the "equilivant" to a device tree, right? Try it all out and see, all of this is pointless without real patches, which is why we almost never have these kinds of discussions without working code. thanks, greg k-h