From owner-freebsd-amd64@FreeBSD.ORG Mon Nov 3 21:53:12 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AB19E81 for ; Mon, 3 Nov 2014 21:53:12 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32E98F6D for ; Mon, 3 Nov 2014 21:53:12 +0000 (UTC) Received: from pippin.baldwin.cx (unknown [129.253.54.225]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4066DB945; Mon, 3 Nov 2014 16:53:11 -0500 (EST) From: John Baldwin To: Sourish Mazumder Subject: Re: memory type e820 Date: Mon, 03 Nov 2014 13:52:44 -0500 Message-ID: <3381641.WgZAz21Lfu@pippin.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/11.0-CURRENT; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <201410301353.05185.jhb@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 03 Nov 2014 16:53:11 -0500 (EST) Cc: freebsd-amd64@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:53:12 -0000 On Saturday 01 November 2014 18:55:53 Sourish Mazumder wrote: > Hi John, > > I tried the pmap_mapdev() as suggested by you. Works perfectly. Thanks for > the information. Sure. > What is required, If I want to add this nvram memory to VM pages? Hmm. If this is device memory you generally don't want that. I'm not actually sure how to do this at runtime. If you don't mind having a local hack you can add a change in the MD startup code (e.g. in hammer_time() in sys/amd64/amd64/machdep.c) to adjust the ranges added to phys_avail[] and dump_avail[]. -- John Baldwin From owner-freebsd-amd64@FreeBSD.ORG Tue Nov 4 08:46:38 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB10AF8; Tue, 4 Nov 2014 08:46:38 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E17737EE; Tue, 4 Nov 2014 08:46:37 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA48kU5o057730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2014 10:46:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA48kU5o057730 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA48kSZF057727; Tue, 4 Nov 2014 10:46:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2014 10:46:28 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: memory type e820 Message-ID: <20141104084628.GN53947@kib.kiev.ua> References: <201410301353.05185.jhb@freebsd.org> <3381641.WgZAz21Lfu@pippin.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3381641.WgZAz21Lfu@pippin.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-amd64@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 08:46:38 -0000 On Mon, Nov 03, 2014 at 01:52:44PM -0500, John Baldwin wrote: > On Saturday 01 November 2014 18:55:53 Sourish Mazumder wrote: > > Hi John, > > > > I tried the pmap_mapdev() as suggested by you. Works perfectly. Thanks for > > the information. > > Sure. > > > What is required, If I want to add this nvram memory to VM pages? > > Hmm. If this is device memory you generally don't want that. I'm not > actually sure how to do this at runtime. If you don't mind having a local > hack you can add a change in the MD startup code (e.g. in hammer_time() > in sys/amd64/amd64/machdep.c) to adjust the ranges added to > phys_avail[] and dump_avail[]. The facility exists to do this. It is OBJT_MGTDEVICE pager and vm_phys_fictitious_reg_range(). This is used by i915 and TTM for aperture, and seems XEN dom0 code uses it for mapping pages from other domains into dom0. From owner-freebsd-amd64@FreeBSD.ORG Wed Nov 5 17:52:30 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A13C81A for ; Wed, 5 Nov 2014 17:52:30 +0000 (UTC) Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9DB3F32 for ; Wed, 5 Nov 2014 17:52:29 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id tr6so1217358ieb.18 for ; Wed, 05 Nov 2014 09:52:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=QzhKclLinZcc1W6IGtN+RECBqE4pAOARa8QMVj70VOo=; b=C9sxMn4NOyxjJKQB+gOBlS28BAPeJMTJ5w3R4dVel0Tt2Z2W1fQrJiEEtfiKOGbxnS WHn9lMws6rpy0pQk1r0dICzrMcXAfT7RC0HvRElaDvePDsCS5st+w5ydx58YhUkamhr8 j1aODCvOxZHVmL7+fXBOnYyMSp+IVqjgVuJyvrJ4NJYRFx0EL6fmCm1Q1ozPladMgEB1 TcVtnKkp4ByNFNRyLlxEQfgk3NoOJsyUBxWIkBLDTBRZMcj0ab4pZ2KXHwGY/wc7pOvj KHNOP4Fy0a33Wgz+w+rInWAvEISbs0cSs75FIM0o/I8zRkvgZE5UGSXo82dDZVugpu01 W4Ag== X-Gm-Message-State: ALoCoQl2kbnmfN87Aj5AcAwk0RypuJa8BZian2TKH3JivCrKvePmIKkYKhELCd2/N9xWptD7QhTT MIME-Version: 1.0 X-Received: by 10.43.87.79 with SMTP id av15mr6179809icc.44.1415209942052; Wed, 05 Nov 2014 09:52:22 -0800 (PST) Received: by 10.107.52.144 with HTTP; Wed, 5 Nov 2014 09:52:21 -0800 (PST) In-Reply-To: <20141104084628.GN53947@kib.kiev.ua> References: <201410301353.05185.jhb@freebsd.org> <3381641.WgZAz21Lfu@pippin.baldwin.cx> <20141104084628.GN53947@kib.kiev.ua> Date: Wed, 5 Nov 2014 23:22:21 +0530 Message-ID: Subject: Re: memory type e820 From: Sourish Mazumder To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-amd64@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 17:52:30 -0000 Should there be any difference in performance while writing to a memory as cached versus uncached mapping? On Tue, Nov 4, 2014 at 2:16 PM, Konstantin Belousov wrote: > On Mon, Nov 03, 2014 at 01:52:44PM -0500, John Baldwin wrote: > > On Saturday 01 November 2014 18:55:53 Sourish Mazumder wrote: > > > Hi John, > > > > > > I tried the pmap_mapdev() as suggested by you. Works perfectly. Thanks > for > > > the information. > > > > Sure. > > > > > What is required, If I want to add this nvram memory to VM pages? > > > > Hmm. If this is device memory you generally don't want that. I'm not > > actually sure how to do this at runtime. If you don't mind having a > local > > hack you can add a change in the MD startup code (e.g. in hammer_time() > > in sys/amd64/amd64/machdep.c) to adjust the ranges added to > > phys_avail[] and dump_avail[]. > > The facility exists to do this. It is OBJT_MGTDEVICE pager and > vm_phys_fictitious_reg_range(). This is used by i915 and TTM for > aperture, and seems XEN dom0 code uses it for mapping pages from > other domains into dom0. > -- Sourish Mazumder 9986309755 From owner-freebsd-amd64@FreeBSD.ORG Wed Nov 5 18:28:49 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 957234DE; Wed, 5 Nov 2014 18:28:49 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 048B8386; Wed, 5 Nov 2014 18:28:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA5ISfA5045716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Nov 2014 20:28:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA5ISfA5045716 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA5ISfTD045715; Wed, 5 Nov 2014 20:28:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 5 Nov 2014 20:28:41 +0200 From: Konstantin Belousov To: Sourish Mazumder Subject: Re: memory type e820 Message-ID: <20141105182841.GJ53947@kib.kiev.ua> References: <201410301353.05185.jhb@freebsd.org> <3381641.WgZAz21Lfu@pippin.baldwin.cx> <20141104084628.GN53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-amd64@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 18:28:49 -0000 On Wed, Nov 05, 2014 at 11:22:21PM +0530, Sourish Mazumder wrote: > Should there be any difference in performance while writing to a memory as > cached versus uncached mapping? Obviously, there should. On the other hand, I do not understand how this question is related to the discussion below. > > On Tue, Nov 4, 2014 at 2:16 PM, Konstantin Belousov > wrote: > > > On Mon, Nov 03, 2014 at 01:52:44PM -0500, John Baldwin wrote: > > > On Saturday 01 November 2014 18:55:53 Sourish Mazumder wrote: > > > > Hi John, > > > > > > > > I tried the pmap_mapdev() as suggested by you. Works perfectly. Thanks > > for > > > > the information. > > > > > > Sure. > > > > > > > What is required, If I want to add this nvram memory to VM pages? > > > > > > Hmm. If this is device memory you generally don't want that. I'm not > > > actually sure how to do this at runtime. If you don't mind having a > > local > > > hack you can add a change in the MD startup code (e.g. in hammer_time() > > > in sys/amd64/amd64/machdep.c) to adjust the ranges added to > > > phys_avail[] and dump_avail[]. > > > > The facility exists to do this. It is OBJT_MGTDEVICE pager and > > vm_phys_fictitious_reg_range(). This is used by i915 and TTM for > > aperture, and seems XEN dom0 code uses it for mapping pages from > > other domains into dom0. > > > > > > -- > Sourish Mazumder > 9986309755