Received: by 10.192.165.148 with SMTP id m20csp2598120imm; Sun, 29 Apr 2018 02:40:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMfO5uHh8GKJdeL6dAeaPIdbvZO9/nNL3owSVeepXesg7n6nnO7QaOkaqbwsR8vGwsX5l/ X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr8390296plc.368.1524994807485; Sun, 29 Apr 2018 02:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524994807; cv=none; d=google.com; s=arc-20160816; b=PaqibiSYes++g1RarqucUehGHhdMLefQ49+KJUMnUA2ZsexmXO2CiG98QdgAVFejiv 2ex4yfWVLjnIDDKaZjScgyXAUW2TwttoXC9GfIf9nEf5xwclvZS1fhOk9mLroQnWu9un p0RLWULCHMCbYYJEhuqUvtUfXzgZJFqdf5YIRjsSuXjWy7xwHRo9iMGJfgdhHmIMoXIi bIkfIkJA0tTKkij5/r4cABf02ptLXl29KURXLbyoAAx84ythARzjCF94w3fp7o3enLAp IN7PwemdUXn+GDChjRpyQ4RtAX0ANgv/90dKiU0Ldvoqiz3KcGpLpmwyx7OzXLsO/WkE uu6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+vBip1QzbO//OkxTsTNKeKunUHXRLODC1tD+pToYqfk=; b=F1XfF1920ASG0smdTwdC9vrlNEyKzVFNxOPb/bB4A1EvXbj7iJlFuRaZMxl6YvHzaY CL7EeIpy4qQyWOOaDYq4gZHcW/vxysKE19OGsBes94t8muCb8xnHfC8tHpFyZyFuMIas kZpOjfF4+khlKeK/0RLxGnf4gwsPv/mc9snfCUkYDqjudlcT1AoKmM3C6jDXxjGBd7Dm 8aceG/j+Vc9SjvtJ1VteJLRgcdQhx5kURfsrGezY55I/GfMhtI0pddC6ENNUpyjYeAs5 4RYy3rxgAV02WSswI4/8/XDZFF0q0+CyIHDqYcWkdpk03AnhLIf0HIzasVXU42z4H62+ Wsew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4-v6si5288013plt.581.2018.04.29.02.39.53; Sun, 29 Apr 2018 02:40:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752937AbeD2JgH (ORCPT + 99 others); Sun, 29 Apr 2018 05:36:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752415AbeD2JgE (ORCPT ); Sun, 29 Apr 2018 05:36:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F26B9427096A; Sun, 29 Apr 2018 09:36:03 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6AAB2166BAD; Sun, 29 Apr 2018 09:35:59 +0000 (UTC) From: Hans de Goede To: Ard Biesheuvel , "Luis R . Rodriguez" , Greg Kroah-Hartman , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: Hans de Goede , Peter Jones , Dave Olsthoorn , Will Deacon , Andy Lutomirski , Matt Fleming , David Howells , Mimi Zohar , Josh Triplett , dmitry.torokhov@gmail.com, mfuzzey@parkeon.com, Kalle Valo , Arend Van Spriel , Linus Torvalds , nbroeking@me.com, bjorn.andersson@linaro.org, Torsten Duwe , Kees Cook , x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/5] efi/firmware/platform-x86: Add EFI embedded fw support Date: Sun, 29 Apr 2018 11:35:53 +0200 Message-Id: <20180429093558.5411-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 29 Apr 2018 09:36:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sun, 29 Apr 2018 09:36:04 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, Here is v5 of my patch-set to add support for EFI embedded fw to the kernel. Changes since v4: -Rename the EFI_BOOT_SERVICES flag to EFI_PRESERVE_BS_REGIONS So I think this patch-set is getting close to ready for merging, which brings us to the question of how to merge this, I think that patches 1 and 2 should probably both be merged through the same tree. Then an unmutable branch should be created on that tree, merged into the platform/x86 tree and then the last 3 patches can be merged through that tree. Ard has already indicated he is fine with the EFI bits going upstream through another tree, so perhaps patches 1-2 can be merged through the firmware-loader-tree and then do an unmutable branch on the firmware-loader-tree for the platform/x86 tree to merge? I don't think taking all 5 through 1 tree is a good idea because of the file rename under platform/x86. For the record here are the cover letters of the previous versions: Changes since v3: -Drop note in docs about EFI_FIRMWARE_VOLUME_PROTOCOL, it is not part of UEFI proper, so the EFI maintainers don't want us referring people to it -Use new EFI_BOOT_SERVICES flag -Put the new fw_get_efi_embedded_fw() function in its own fallback_efi.c file which only gets built when EFI_EMBEDDED_FIRMWARE is selected -Define an empty stub for fw_get_efi_embedded_fw() in fallback.h hwen EFI_EMBEDDED_FIRMWARE is not selected, to avoid the need for #ifdefs in firmware_loader/main.c -Properly call security_kernel_post_read_file() on the firmware returned by efi_get_embedded_fw() to make sure that we are allowed to use it The 3 most prominent changes in v2 are: 1) Add documentation describing the EFI embedded firmware mechanism to: Documentation/driver-api/firmware/request_firmware.rst 2) Instead of having a single dmi_system_id array with its driver_data members pointing to efi_embedded_fw_desc structs, have the drivers which need EFI embedded-fw support export a dmi_system_id array and register that with the EFI embedded-fw code This series also includes the first driver to use this, in the form of the touchscreen_dmi code (formerly silead_dmi) from drivers/platfrom/x86 3) As discussed during the review of v1 we want to make the firmware_loader code fallback to EFI embedded-fw optional. Rather the adding yet another firmware_request_foo variant for this, with the risk of later also needing firmware_request_foo_nowait, etc. variants I've decided to make the code check if the device has a "efi-embedded-firmware" device-property bool set. This also seemed better because the same driver may want to use the fallback on some systems, but not on others since e.g. not all (x86) systems with a silead touchscreen have their touchscreen firmware embedded in their EFI. Note that (as discussed) when the EFI fallback path is requested, the usermodehelper fallback path is skipped. Here is the full changelog of patch 2/5 which is where most of the changes are: Changes in v2: -Rebased on driver-core/driver-core-next -Add documentation describing the EFI embedded firmware mechanism to: Documentation/driver-api/firmware/request_firmware.rst -Add a new EFI_EMBEDDED_FIRMWARE Kconfig bool and only build the embedded fw support if this is set. This is an invisible option which should be selected by drivers which need this -Remove the efi_embedded_fw_desc and dmi_system_id-s for known devices from the efi-embedded-fw code, instead drivers using this are expected to export a dmi_system_id array, with each entries' driver_data pointing to a efi_embedded_fw_desc struct and register this with the efi-embedded-fw code -Use kmemdup to make a copy instead of efi_mem_reserve()-ing the firmware, this avoids us messing with the EFI memmap and avoids the need to make changes to efi_mem_desc_lookup() -Make the firmware-loader code only fallback to efi_get_embedded_fw() if the passed in device has the "efi-embedded-firmware" device-property bool set -Skip usermodehelper fallback when "efi-embedded-firmware" device-property is set Patches 3-5 are new and implement using the EFI embedded-fw mechanism for Silead gslXXXX and Chipone icn8505 touchscreens on x86 devices. Regards, Hans