From owner-freebsd-hackers@freebsd.org Tue May 28 04:46:27 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CBA215B5DCB for ; Tue, 28 May 2019 04:46:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 542EA9581C for ; Tue, 28 May 2019 04:46:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x742.google.com with SMTP id d10so20571621qko.4 for ; Mon, 27 May 2019 21:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LYTziAV32kqbAD06fdIn2YevrGVoLtxN68LH5exHUCQ=; b=tyVZ3eFHM5Vls1QAIMqD2BdbHoW6w0nom18sLynoHunuj4BWJ+qhiUhBf7ZUsPrjCa wslD47sVjadlN9CJdRQ7hln0BeK4FpEarxzSl/9ZgD80ujSBJNB09DOQjEZzkkfIqZbp VMbF4Z6TZRzwDVaGBVwqhkQajYB2rAW6KlXgL9hd00z4rOiF4cug4uVwItSFKqZxvsMg BlmCxQ0aZCcdjcmn75Hu0oIuFsq7Bl9edm5eqKHYj8/8LaI3c5MYMo138sXc5Njzp0qS vaU+n1s6V9PYmCwGE1pLPgHZsbmIh+q+STVILmQ/PvDnvqO2zvogezL6XMOUCIh3LDVd tkiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LYTziAV32kqbAD06fdIn2YevrGVoLtxN68LH5exHUCQ=; b=GOthc6Py70isO1ije5LysnGafwHRv2YUsoSyb1skdmMJsa1gNIbakFZ3qcJMAb21Zu q0Ruwdmf9VIvXUFVf69/LnUQaoroNNhUi6lS+ZrOnw9D2IS0slBlaU6+32yjstxirWDT 8Sk2Y0vQmP/0/lJgna2w8wgOT6wVKkbWt1CsvUD70U1lbibwQ7Os8TACLbY5AWtcLKEy LHQ7vujZUlbuxH4vi+PWpDoHhCKo9I4XXuiXyLxetb57f/X2GNg27O4DNIK9h6lFhZ8g KQEyy/KQX/D14VQurUMQwa+fyYOw0Eh4Lz5boFmuiZt0xLDkHBjd9hiifvoSwNiQ5/Zb h8uA== X-Gm-Message-State: APjAAAU3qcrA3lSM4yNB+1Wlq1zwqVjE6OpCu5qd4I4Gzu0GNpYNW+zW VcL+qYccQILeU+6vqGxbmcDe/3qihzUnfW+fifZrSQ== X-Google-Smtp-Source: APXvYqzf0il/NzHYHZFC6Shon9+uBIWylF3xebTDL0ITjGG6W0Xb9J2NvLxq1929KbODY7xSdyk7CEts6DxUI0aSYyw= X-Received: by 2002:a37:4b48:: with SMTP id y69mr86077271qka.77.1559018785613; Mon, 27 May 2019 21:46:25 -0700 (PDT) MIME-Version: 1.0 References: <4a6b0f1e-64ec-6b83-b43b-f9791ec8428f@metricspace.net> <1452db0c-1210-3230-c044-bc682e7e1745@metricspace.net> <3aa00c6b-2502-ffad-c915-a833292882bd@freebsd.org> <79c249c0-e6b0-a584-ad23-c9a4f57ff3c1@freebsd.org> In-Reply-To: <79c249c0-e6b0-a584-ad23-c9a4f57ff3c1@freebsd.org> From: Warner Losh Date: Mon, 27 May 2019 22:46:13 -0600 Message-ID: Subject: Re: FreeBSD and Coreboot To: Nathan Whitehorn Cc: Eric McCorkle , FreeBSD Hackers , FreeBSD Current , =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= X-Rspamd-Queue-Id: 542EA9581C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=tyVZ3eFH X-Spamd-Result: default: False [-2.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.36)[-0.364,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-0.54)[ip: (2.93), ipnet: 2607:f8b0::/32(-3.29), asn: 15169(-2.28), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 04:46:27 -0000 On Mon, May 27, 2019, 10:44 PM Nathan Whitehorn wrote: > > > On 2019-05-27 19:14, Warner Losh wrote: > > On Mon, May 27, 2019, 7:18 PM Nathan Whitehorn > > wrote: > > > >> > >> On 2019-05-27 15:50, Eric McCorkle wrote: > >>> On 5/27/19 5:53 PM, Edward Napierala wrote: > >>>> On Mon, 27 May 2019 at 16:14, Eric McCorkle > >> wrote: > >>>> [..] > >>>> > >>>>> My plan is roughly this: > >>>>> > >>>>> * Refurbish the GRUB port, get it working again in QEMU (possibly on > >> one > >>>>> of my machines), also possibly push a patch to GRUB to use the > keybufs > >>>>> mechanism to pass in GELI keys. > >>>>> > >>>>> * Get coreboot with GRUB/Seabios booting FreeBSD in QEMU > >>>>> > >>>>> * Possibly create a coreboot port (uncertain how this would work, > since > >>>>> Coreboot has its own extensive config menu) > >>>>> > >>>>> * Hold my breath and test it out on real hardware (I have a Librem 13 > >> r1 > >>>>> for this purpose) > >>>>> > >>>>> * Possibly try getting the FreeBSD kernel to work as a coreboot > >> payload. > >>>> Out of curiosity - why the kernel and not loader(8)? > >>>> > >>> If I understand coreboot correctly, loader would have to directly > >>> manipulate devices _without a BIOS_. That is, it would have to have an > >>> entire device detection/interface layer, which I don't believe is the > >>> case today. > >>> > >>> At least in the EFI case, loader is talking through the system's EFI > >>> implementation, which takes care of all that for you. BIOS works in a > >>> similar way. My sense is getting loader to the point where it could be > >>> a coreboot (without Seabios/GRUB/Tianocore) would be quite an > >> undertaking. > >> On IBM PowerNV systems, which also don't provide interfaces to a > >> second-stage loader, we just abandoned loader(8). It's way too much > work. > >> > > How do you use tunables and loadable modules? > > > > Warner > > > > The firmware on PowerNV has a way to write tunables to the device-tree, > which we rehydrate into something that looks like it came from loader. > > We don't usefully support loadable modules at the moment. The firmware > can optionally load exactly one file from the boot filesystem and pass > it to the kernel (for Linux, the initrd). There are a couple of ways to > imagine exploiting this for kernel modules, but all of them are kind of > crummy. > Now that the loader supports a ram disk, we are almost to something useful... but yea, almost and crummy often go hand in hand. Warner >