From owner-freebsd-current@freebsd.org Sun Jul 21 15:19:12 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E956B5F60 for ; Sun, 21 Jul 2019 15:19:12 +0000 (UTC) (envelope-from laurie_jennings_1977@yahoo.com) Received: from sonic307-55.consmr.mail.gq1.yahoo.com (sonic307-55.consmr.mail.gq1.yahoo.com [98.137.64.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3A72840FF for ; Sun, 21 Jul 2019 15:19:11 +0000 (UTC) (envelope-from laurie_jennings_1977@yahoo.com) X-YMail-OSG: dHxK9WAVM1mh3G03VyylTpdrK.CqXECjYU3UNKF65XsYckkr18EuXYJgQvj1t6O FL_SS1yaJ_sH_ZTEEPime4bfQmMPqjdTiQ9SBI9UZ7AovDFXcgAsq1Yq_OjJe0hsqiLqHui_s0Mj Lx_sTOZ7twY.cfokuSMjNiyKwpTm5CtXFRhprlWlmdV9B0zVmlTioKETK65Sjgz1vzX9yauNlkkk mntw.Dm_j2FB8XXwGlSWJjRw0hGAYkyiUyMhJxxm7oB7WHGApxh.1xR_0v7POYaN3y5y..HsiAxM 7RaLgDvJ3cucjPuK8FRBQJkeYBCOLgGYc3QMC5Jl_CiGP2gtO86YjdLuxcdnK3nQXzpWu2FC0_ob 9Q4haK4Kt7xQmvYvCQWpOQUZxgRKytcMUO0MsTeFvXwnPGGG2P3Rz5cC6ImCZk3iNXZFdhaTHZFf FxIjAA32D.nHD1XLtgO8syDXWcBJKFuWGeHRNba2KKqFPJqQx9fkAlsO4d9epawfA2rH7aAd7_c1 DedyBGrHT92fn22hVdIdB1QB2Dm4ljODMZ5UubvMahSsVlVkCzIDVnWIZqTi7dEYruEvB8YOLgWG 5HE7LEsfTQ9Xd.ZXkeabRb6pOn4EAki1M2TLajYlih9CVHt2NYu.ziLeWvfk4riHdEDneVb72Q8o MOaHPVX5bsHsNAC4jIQ_mxUlEpXrhJphyLeWdZtlg_LE85FhGwR2nJCVCOfO.j2rHpP9maFcNTHq 8fVW8C4HNjGhIVP4F.xQT8LnTz3jllls1bWylG3LSI2EVlRDuiGqP0_YPTZHdpoNY5NVdNvuHwc9 _EuqUxQzxw_WWljMUngQHqKzoE_c_fsTg.NL.Ahg5XRq2FlhyE49tOlnS8gWe0CgFka41tmRSMa0 bfK_d_zuAdJXmUk5AHL3XrG6ZZPOid0Ylsnio2Fvax69GPMOA1ztF9Ilz175wUTuIZtEUxIaDoHZ X7.iVMFHhVgPQxV5RQeIBptq1wqGDHdkJlTN.wI8EuUQrJOiCB8G43eMQ0ilwthx76ICSNvUZZPG xbYEUxmMai1aNkBzrc5sqJxsNVt5KysEw5fnODmk86KnFRLzHCc_EtRVAZB0iw1DPnOsJ0pCXucM 01CjNu2.RQ5pHfZvXkZGLnw.JFgIcUSWsEutV3EsMsEqfdJUU8.HYy0F1ayrn12LaN.bi4axlqCD uDI7c7pYWHIm4PzfX_Bsk8rF8lFnq9JMepsbkkre08NiE924gcpQxY7UYTuNzELAiFqJ1oP3nQBC l1lvqy2QTp0SwIRYCUg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sun, 21 Jul 2019 15:19:09 +0000 Date: Sun, 21 Jul 2019 14:58:53 +0000 (UTC) From: Laurie Jennings To: Konstantin Belousov Cc: FreeBSD Current Message-ID: <550659871.4389820.1563721133104@mail.yahoo.com> In-Reply-To: <20190721144404.GJ47193@kib.kiev.ua> References: <446145008.4396329.1563680883838.ref@mail.yahoo.com> <446145008.4396329.1563680883838@mail.yahoo.com> <20190721144404.GJ47193@kib.kiev.ua> Subject: Re: mmap port from 9 not working MIME-Version: 1.0 X-Mailer: WebService/1.1.13991 YMailNorrin Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15 X-Rspamd-Queue-Id: D3A72840FF X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-Mailman-Approved-At: Sun, 21 Jul 2019 21:50:58 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jul 2019 15:19:12 -0000 On Sunday, July 21, 2019, 10:44:14 AM EDT, Konstantin Belousov wrote: On Sun, Jul 21, 2019 at 03:48:03AM +0000, Laurie Jennings wrote: > I have some custom stuff I'm porting from Freebsd 9.x using mmap. I get a= pointer from the kernel via an ioctl and I map it into a shared buffer. > char *kptr; =C2=A0 // mem ptr from kernel > fd=3Dopen("/dev/kmem",O_RDWR);memp=3Dmmap(0,size,PROT_READ|PROT_WRITE,MAP= _SHARED,fd,(off_t) ptr); >=C2=A0 > This worked perfectly in 9; memp I had a shared block of memory between t= he kernel and user space. > In 11.3 this returns an errno 22, which is pretty murky. I did notice tha= t off_t doesnt yield an actual offset; I've tried putting in the correct va= lue manuallybut it just fails and fails.I've tried read only also.=C2=A0 > Please Help! | Start with providing (and looking yourself) at the output of kdump/ktrace | around the failing mmap.=C2=A0 The checks for correctness of the mmap(2) = arguments | were greatly improved during years after FreeBSD 9. Since posting this I found a thread that said something about mmap no longe= r supporting /dev/kmem. If that's that case I need to find another method. = No sense spending a day debugging something thatisn't supposed to work.=C2= =A0 SHOULD this still work? This always worked fine with non-wired memory but m= aybe things have changed since 9.=C2=A0