Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2693205ybg; Fri, 5 Jun 2020 22:08:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw15ox4nqLwzUaYDP7Dcs1xgiULlIbYXf2+0n34vEkZlZ1zZB3xfKIJcRyIwe07jUuK3XV0 X-Received: by 2002:a17:906:14db:: with SMTP id y27mr9752407ejc.225.1591420129213; Fri, 05 Jun 2020 22:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591420129; cv=none; d=google.com; s=arc-20160816; b=vV+i48eLRy+snHPU87c5I1sDUUf/7YC79WhgH37RSFEgdRLEwbmaK1q2NpH/BeBv3K bXDbUk+s38qsd39zLXFBAO0h0t0F/Pk3xDMfRfO3SfsNPy3LTdNjJeLQxeIjLahGEQO6 K7D4uMG9W3wDMCG4abOkmrCKlkYLHyWT4H29jeYLZw7lirw5QWMRVSngTi/Kue48xWiG 4nQqjpcsE+Ax/t0Ss+nmN2qme2yUCcbvDdI1e9OJo7UvPhYWX/4iTbeZnmzo4CsfueuL a9W5r7tXcScIhevi9E2TwcOenerBOnrPMtyGlp6qMsOLxAZcvomzL6f90yZAm+Emwok+ vIkQ== 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 :dkim-signature; bh=tZK4z4NpRXbZ8SJxKOE6PewY/fU6fvBPpDi8Rn1Dflg=; b=a7Gw+OuPQ/llH0JA5UoVIq7iKYwbgj31z20/JSaA1tylTKwJiDaMYJga7P+7+ZWbG6 3MYswQeQGEtEjFWHaMs70k5XyoXkUB+I4xW/w33PP2iXG07DzAJt6xA8428oM3OdUp6B rAUybuouB2N8lkcE+9mLLbhJQkp+88zMBTBeQnyYarzyEfSaDscd1F2ob6wnzRApKLI5 am6ObyyNc9KhWu5RxN2cNOO5IycqxHmlF25L+9yMw702wyv0BwyPZQ6ba7kBnORZsE67 OylnDFsFJAZFs6nyOMeGVrkcrXrjvaOEEJDZqnaTq0jIVkt3fHYxUoqhKDUtz75bYQg8 zs/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=BNngZ7SH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si4952302edq.435.2020.06.05.22.08.27; Fri, 05 Jun 2020 22:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=BNngZ7SH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbgFFFFp (ORCPT + 99 others); Sat, 6 Jun 2020 01:05:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbgFFFFo (ORCPT ); Sat, 6 Jun 2020 01:05:44 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D511C08C5C6 for ; Fri, 5 Jun 2020 22:05:44 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id d6so3681181pjs.3 for ; Fri, 05 Jun 2020 22:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=tZK4z4NpRXbZ8SJxKOE6PewY/fU6fvBPpDi8Rn1Dflg=; b=BNngZ7SHzjRf6h0P9KT4WtAybmmNTGYWY2Nie7eI7GIDB6ADUhA4NxRmqdoLcrhJA6 3EBImbWjgk0rjo6Pk3HclIPD8NLbduxN+xNIPWrCIGYMvcF3WF28ZCqWTmk5+IIFRhkv vB8odMxQz900yo2V6z3jc0h0Z78Ygosdfwm2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tZK4z4NpRXbZ8SJxKOE6PewY/fU6fvBPpDi8Rn1Dflg=; b=I6IZPiWeeggcYcWDTHitGG+g5JIIrfTDyqRBfhxuDhfSSGoCFviswzjbIded4abcrY mhabMYwy2hvr9yc0YQL3byacp0KELI2Vi05OC0HlT4aWVCdvjCdUR5AMLk+oMU+GNvgW nDi8lBKtJznPrxs2R67rNLpPxBR4payvcHICPCiE7TliTJ+3jTKJYaL71wNgi05qalf1 RnrxOh6l4ih9Yk65xEa+iwdKGQqLUGGCPyXuh+0ud+XrCw1Z63nfKMAgTbTwa1CQGF8G CJA8AxSbS0Q6Q9M36hDd3xrrFbCnN+0FPMo2vKi36EZjpzMm4jF+FEvR89OJ2SKHq5lV 7YFA== X-Gm-Message-State: AOAM531APniV1QmlX5o84Ijb/VuzihxSiuCAMZznxxCn2J6Y0Cj9hFAu taP7gf13RbqrE2gnuh46fYHujQ== X-Received: by 2002:a17:902:b706:: with SMTP id d6mr13046012pls.304.1591419943488; Fri, 05 Jun 2020 22:05:43 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id v8sm1057636pfn.217.2020.06.05.22.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 22:05:42 -0700 (PDT) From: Scott Branden To: Luis Chamberlain , Wolfram Sang , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann Cc: Mimi Zohar , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Scott Branden Subject: [PATCH v7 0/8] firmware: add partial read support in request_firmware_into_buf Date: Fri, 5 Jun 2020 22:04:50 -0700 Message-Id: <20200606050458.17281-1-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds partial read support in request_firmware_into_buf. In order to accept the enhanced API it has been requested that kernel selftests and upstreamed driver utilize the API enhancement and so are included in this patch series. Also in this patch series is the addition of a new Broadcom VK driver utilizing the new request_firmware_into_buf enhanced API. Further comment followed to add IMA support of the partial reads originating from request_firmware_into_buf calls. Changes from v6: - update ima_post_read_file check on IMA_FIRMWARE_PARTIAL_READ - adjust new driver i2c-slave-eeprom.c use of request_firmware_into_buf - remove an extern Changes from v5: - add IMA FIRMWARE_PARTIAL_READ support - change kernel pread flags to enum - removed legacy support from driver - driver fixes Changes from v4: - handle reset issues if card crashes - allow driver to have min required msix - add card utilization information Changes from v3: - fix sparse warnings - fix printf format specifiers for size_t - fix 32-bit cross-compiling reports 32-bit shifts - use readl/writel,_relaxed to access pci ioremap memory, removed memory barriers and volatile keyword with such change - driver optimizations for interrupt/poll functionalities Changes from v2: - remove unnecessary code and mutex locks in lib/test_firmware.c - remove VK_IOCTL_ACCESS_BAR support from driver and use pci sysfs instead - remove bitfields - remove Kconfig default m - adjust formatting and some naming based on feedback - fix error handling conditions - use appropriate return codes - use memcpy_toio instead of direct access to PCIE bar Scott Branden (8): fs: introduce kernel_pread_file* support firmware: add offset to request_firmware_into_buf test_firmware: add partial read support for request_firmware_into_buf firmware: test partial file reads of request_firmware_into_buf bcm-vk: add bcm_vk UAPI misc: bcm-vk: add Broadcom VK driver MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver ima: add FIRMWARE_PARTIAL_READ support MAINTAINERS | 7 + drivers/base/firmware_loader/firmware.h | 5 + drivers/base/firmware_loader/main.c | 59 +- drivers/i2c/i2c-slave-eeprom.c | 4 +- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/bcm-vk/Kconfig | 29 + drivers/misc/bcm-vk/Makefile | 11 + drivers/misc/bcm-vk/bcm_vk.h | 408 +++++ drivers/misc/bcm-vk/bcm_vk_dev.c | 1312 +++++++++++++++ drivers/misc/bcm-vk/bcm_vk_msg.c | 1438 +++++++++++++++++ drivers/misc/bcm-vk/bcm_vk_msg.h | 201 +++ drivers/misc/bcm-vk/bcm_vk_sg.c | 271 ++++ drivers/misc/bcm-vk/bcm_vk_sg.h | 60 + drivers/misc/bcm-vk/bcm_vk_tty.c | 352 ++++ drivers/soc/qcom/mdt_loader.c | 7 +- fs/exec.c | 101 +- include/linux/firmware.h | 8 +- include/linux/fs.h | 30 + include/uapi/linux/misc/bcm_vk.h | 99 ++ lib/test_firmware.c | 144 +- security/integrity/ima/ima_main.c | 24 +- .../selftests/firmware/fw_filesystem.sh | 80 + 23 files changed, 4598 insertions(+), 54 deletions(-) create mode 100644 drivers/misc/bcm-vk/Kconfig create mode 100644 drivers/misc/bcm-vk/Makefile create mode 100644 drivers/misc/bcm-vk/bcm_vk.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_dev.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_tty.c create mode 100644 include/uapi/linux/misc/bcm_vk.h -- 2.17.1