From owner-freebsd-amd64@freebsd.org Sat Jul 11 21:32:21 2020 Return-Path: Delivered-To: freebsd-amd64@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 1891F37186D for ; Sat, 11 Jul 2020 21:32:21 +0000 (UTC) (envelope-from lytboris@gmail.com) Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B435v68L4z4dGv for ; Sat, 11 Jul 2020 21:32:19 +0000 (UTC) (envelope-from lytboris@gmail.com) Received: by mail-ua1-x942.google.com with SMTP id j21so2896175ual.11 for ; Sat, 11 Jul 2020 14:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=E6g24Mq9GnC4T9xDVkuQsYKn6cJJQlfy5a9WVCUTT5c=; b=BmqjJIEf5SHRLk8mp0f5R36IOS2c05g/CTdxHJLYQLwwGL9QX9Ug/gLbs8qEEGr//O X0ni9OII1IWYYpgx73ls9lUr0sC8q6eAlni2Hz5yAn2G0BdcdfbLyvqCuA6MKT1cj8rw IWbKKJhmyOAYsGA1LrlJJ0Gtd0YyIiCWHoxx5fmRRfUkRG4UosGu9oeLrbqk3zIe/fMM QOUVoJQbrqHTwOtMLRIgSw/eDanMfipV6xHbO8xXPwwlzT8rwhShA0N/eU2Noj1SOCjM pyPDf2U+6FYUEsHVAI1x7adtRooAqKtn9+MOgAHW1xZQ4eY6kEsXU6qJGW48DLt5810K W6Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=E6g24Mq9GnC4T9xDVkuQsYKn6cJJQlfy5a9WVCUTT5c=; b=oqbvmK32YDN6C8Oy6k+BxxMd3md4ucddJ5iwGRtRgnRYMJzJSBM71kg/rA1uIJ9uOo ID4pb9uMMpES76mVebsPA/4MxWlQK5a3qf8NRMW4rJ3OWWagUSGLz5nTuKTcg+l0bW3x C78t4+9tizro+IL+SzGIcvQaD5halRRqKiC0Dl2StQz6u12thXjMqtH6DjQLz3gnxCCB sWnIGSMqvpVJaRCVR/YN3fwQxYNQ6eo2TUdJxX16bpIExSMnW3/niC7/Y5GC96eM64MB tAzs19Vgf7FRp1KK0zcO3XF6Pym5i6wA1D898DZnG+Zh3qBOpPusSieqEofF1mPkjxv/ L7gA== X-Gm-Message-State: AOAM532DexujxNfz8LASS+EvS49lWtLCLh0Fcv6ocQsiy65QzWSo6PKa 33qwhOfqhcRv+DC+f6p9DuUc0fX0KRooMkYGaIG9yTJt X-Google-Smtp-Source: ABdhPJwuSemC/I2j10iFnmFXKWggdmgJt9CiWF50iNWey4LAEaz+0698/MXPM/ejkM35Eq3FFLLRj64tj8KsnTuNPIk= X-Received: by 2002:ab0:4d4d:: with SMTP id k13mr14652524uag.113.1594503138945; Sat, 11 Jul 2020 14:32:18 -0700 (PDT) MIME-Version: 1.0 From: Lytochkin Boris Date: Sun, 12 Jul 2020 00:32:08 +0300 Message-ID: Subject: More than 1G of loader-visible RAM? To: freebsd-amd64@freebsd.org X-Rspamd-Queue-Id: 4B435v68L4z4dGv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=BmqjJIEf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of lytboris@gmail.com designates 2607:f8b0:4864:20::942 as permitted sender) smtp.mailfrom=lytboris@gmail.com X-Spamd-Result: default: False [-2.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.986]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-amd64@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.01)[-1.006]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::942:from]; NEURAL_HAM_SHORT(-0.18)[-0.183]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 21:32:21 -0000 Hi. I am trying to make a patch that gives loader ability to bring whole partitions as preload md(4) items. While this could sound a bit crazy, it allows making an easy to get "diskless" routers: root partition is 2Gb stored on HDD and I have 4Gb of RAM loader can get root partition into memory and kernel will use it as a root partition. Once OS is up and running, HDD can be set to sleep mode (via /etc/rc.local or similar) Currently I do the same thing via init_script that detects boot partition, run mdconfig and dd. Delegating this job to loader will make this setup much more straightforward. Currently my patch for loader can copy partitions up to ~1G and it seems this is a limitation in stand/i386/libi386/elf64_freebsd.c: ==== /* * This is kinda brutal, but every single 1GB VM memory segment points to * the same first 1GB of physical memory. But it is more than adequate. */ for (i = 0; i < 512; i++) { ... ==== Comment comes from 2003 which was quite adequate back then. I am not that fluent in real memory programming thus I write this email seeking a hint if this 1Gb RAM limitation can be altered allowing more memory to be used by loader that will be functional. -- Boris Lytochkin