From owner-svn-src-head@freebsd.org Thu Sep 7 07:17:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74320E0D22A for ; Thu, 7 Sep 2017 07:17:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1ABE14E2 for ; Thu, 7 Sep 2017 07:17:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id p6so2992506itb.1 for ; Thu, 07 Sep 2017 00:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hPgimyARU+u1x2x9dGdXeyXAl/ohOabs7yt/N3TXrJ0=; b=VKm1bFN69rLwH8CXJnQd5UDGqYcQcY7TSxS1QWZzAvcMQTljLFHj0/UhkRJ0mlTlR7 uu4HqJBHW+UzRoCVYl5oTV2GxKcxokUt8RePj4aQvjGC+LtGJb1OzjdYHGZhWvR+2rXm 4koj4L4DDhVpelpxyD9Gm9VMte0aOCLKjXUyVruNp0kAnjJUHCu8CABWA7bj5lcy/0AA 4uz110H3Lq6FbqFfZMHLWgKPuXS8K0hrmA4l8XPeIf8T8AYUXQBWd0TmkfBMNoU9VYX3 lKke6p1KePP+TEV5sFvpfBriYdPW0QsIOtQ1Q7yIKpsFm9eFZgfUMV/78em6RPl0FOMl yPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hPgimyARU+u1x2x9dGdXeyXAl/ohOabs7yt/N3TXrJ0=; b=A+630H3g8at0Ca3Z1eBlLur+IcqbqAuGnArXPjsedhw0hSZ7yWsEvd633NSyuqfe4b hIy0sl/Yzg6MoIgTC26ld5OYklmZcmwq4Sk08Zj9mguWF8XY3VIwy/fMDpAod+jyFOyK oPZf934P16UnpAibuzP/bT9BgIuHwx5Jv+X73ZYEjtJ7BCZPcBDUNoI00swo+yQDoCN7 Okdgx1E3wprgvxJUnO9g6xQ8GcnVIL3jXw5xivND4qHTbRJCuuEud/xGkfQHQxe0lbn4 AbFf+qSYBmrgl5Qc8pjmMLD51LGpML7KrmDySx0dreuu/J2zW82RCEXbAnWjaiVYAcBb ZD0Q== X-Gm-Message-State: AHPjjUi9JRrOkRUnwuohaclwqdKf3/Cz20gdYgGdc35aJHQQSrOFBjeG AvkxkTLZOvxB3opeKIVY/wfRSKfTfXmf X-Google-Smtp-Source: ADKCNb6hXvMt42qr3VzZErd5ACeX+UhohG/qmeVjtVA7ZyXx5ZP9c7+CpIPT58TtgpmxO9WauEcpZ105+lb4nQmJzy4= X-Received: by 10.36.40.138 with SMTP id h132mr2586797ith.26.1504768658179; Thu, 07 Sep 2017 00:17:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Thu, 7 Sep 2017 00:17:37 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:db2:4927:5bc2:25d6] In-Reply-To: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> From: Warner Losh Date: Thu, 7 Sep 2017 01:17:37 -0600 X-Google-Sender-Auth: 6QYSmvm1pnaxadb94wieTK59HkA Message-ID: Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 To: Andrew Turner Cc: "Conrad E. Meyer" , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:17:39 -0000 Yup. I have those patches in my tree, pending testing after a day or so of fires at work. They are a hack and I wanted to stop duplicating so much Makefile code between sys/boot and lib/libstand before I pushed them in. I think there's no issues with other versions of the loader. We can also lie and cast the strings, but that has other issues. So I'll fix this shortly. Warner On Thu, Sep 7, 2017 at 1:04 AM, Andrew Turner wrote: > And we need a constant wchar_t between loader and libstand as ld.bfd > checks the attributes across these when linking. > > There are a few options, the simplest is probably to make sys/boot and > libstand all build with 16bit wchar_t, but it would need someone to check > on wchar_t usage in other loader versions. > > Andrew > > On 7 Sep 2017, at 07:25, Conrad Meyer wrote: > > > > This seems to break world on ARM due to the size difference CHAR16 vs > > ARM wchat_t (currently 32-bit in loader, apparently). > > > > Best, > > Conrad > > > > On Thu, Aug 31, 2017 at 10:32 AM, Warner Losh wrote: > >> Author: imp > >> Date: Thu Aug 31 17:32:14 2017 > >> New Revision: 323063 > >> URL: https://svnweb.freebsd.org/changeset/base/323063 > >> > >> Log: > >> boot1.efi: print more info about where boot1.efi is loaded from > >> > >> Print the device that boot1.efi was loaded from. Print the path as > >> well (since it isn't included in DeviceHandle). Move block where we do > >> this earlier so all the block handle code is now together. > >> > >> Sponsored by: Netflix > >> > >> Modified: > >> head/sys/boot/efi/boot1/boot1.c > >> > >> Modified: head/sys/boot/efi/boot1/boot1.c > >> ============================================================ > ================== > >> --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 > (r323062) > >> +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 > (r323063) > >> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; > >> SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; > >> UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; > >> + CHAR16 *text; > >> > >> /* Basic initialization*/ > >> ST = Xsystab; > >> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> } > >> putchar('\n'); > >> > >> + /* Determine the devpath of our image so we can prefer it. */ > >> + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > >> + imgpath = NULL; > >> + if (status == EFI_SUCCESS) { > >> + text = efi_devpath_name(img->FilePath); > >> + printf(" Load Path: %S\n", text); > >> + efi_free_devpath_name(text); > >> + > >> + status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > >> + (void **)&imgpath); > >> + if (status != EFI_SUCCESS) { > >> + DPRINTF("Failed to get image DevicePath > (%lu)\n", > >> + EFI_ERROR_CODE(status)); > >> + } else { > >> + text = efi_devpath_name(imgpath); > >> + printf(" Load Device: %S\n", text); > >> + efi_free_devpath_name(text); > >> + } > >> + > >> + } > >> + > >> /* Get all the device handles */ > >> hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); > >> if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void > **)&handles)) > >> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE > *Xsystab) > >> nhandles = hsize / sizeof(*handles); > >> printf(" Probing %zu block devices...", nhandles); > >> DPRINTF("\n"); > >> - > >> - /* Determine the devpath of our image so we can prefer it. */ > >> - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); > >> - imgpath = NULL; > >> - if (status == EFI_SUCCESS) { > >> - status = BS->HandleProtocol(img->DeviceHandle, > &DevicePathGUID, > >> - (void **)&imgpath); > >> - if (status != EFI_SUCCESS) > >> - DPRINTF("Failed to get image DevicePath > (%lu)\n", > >> - EFI_ERROR_CODE(status)); > >> -#ifdef EFI_DEBUG > >> - { > >> - CHAR16 *text = efi_devpath_name(imgpath); > >> - DPRINTF("boot1 imagepath: %S\n", text); > >> - efi_free_devpath_name(text); > >> - } > >> -#endif > >> - } > >> > >> for (i = 0; i < nhandles; i++) > >> probe_handle_status(handles[i], imgpath); > >> > > > >