From patchwork Thu Dec 9 15:11:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brazdil X-Patchwork-Id: 1565799 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=qi9qUTtT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4J8yDT2kW9z9s5P for ; Fri, 10 Dec 2021 02:11:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234554AbhLIPPI (ORCPT ); Thu, 9 Dec 2021 10:15:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232836AbhLIPPH (ORCPT ); Thu, 9 Dec 2021 10:15:07 -0500 Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71708C061746 for ; Thu, 9 Dec 2021 07:11:33 -0800 (PST) Received: by mail-wm1-x34a.google.com with SMTP id z138-20020a1c7e90000000b003319c5f9164so5000914wmc.7 for ; Thu, 09 Dec 2021 07:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=LBECnREKPHDRg4E+pCsN1I2d9IcImWBPu4S35mqNBKU=; b=qi9qUTtTlW/2AeraLiOjix04O2Oby2w4PlV+g8wG73UkSDlX1bpswEXC/PfRH9WUSh q0fyMUJ8EuHqUC4qyYU9I0+odvpizV7hJU6/K9AteffBtI3wE1W+4gEfchpVUzoJffCe 65ToPSigml+wiXpZgE1WLrszCfY/vPtOOxHQ+jeSd0pDeUUo0d7K0lFmb74ev1a4GUh1 VQDxa/WLtvbspIAkDezALjWdylXPksfUWFlG4O+9iuqV7jIkfeSJKoN8dz2pnbH69dDV k78e4zS1c5LIRbYuImK+nSHx0zzCsY4KcaLXvzRisFih6doHEwDmKjE64C11ylIfiRvw 7rEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=LBECnREKPHDRg4E+pCsN1I2d9IcImWBPu4S35mqNBKU=; b=k4MOjGAeN1ciXrvn6m3DOWTetUb7qEce5JbBy0UGcQXT+TyoBOvKM1PZzJZEAe/hwW lYY116CebQPEIGCCPoOPes6uGPpK/WkYE1UpmXorgSrSWfcIdJxuTHZtJOGmpNZzL8ej aAY7CRKyrCfzNDYF7OiL6P8wO3bLF/UMYenaRvh68KzrSA3zSnnTDhFmoSdEif8EClTh C1jN+0UgqYWbm9jEg0vArOpIsILbLUuWpMTXfYRgUHbvRudQP7qCcTSWOMDVF7yntSeC dErH3fuke5aaQUIFJymOP15vxz7spO5Ve5/X/YuZG54/ES82Txz7CcqjIsUFwaYzAtc7 3G+A== X-Gm-Message-State: AOAM533Yhw+E1v0FFRRWMCQpRntwsGdCfz6l0G5RfjHZladaFzGFFArI COEXtDdm3fQQ16G3yyNPsFRqYIzavnP+6w== X-Google-Smtp-Source: ABdhPJxefyUfmKB1JnifoUejTcXsS/4eT0tMAE1ICnNUQrSJ8Xh9cZtVmSfLkneejLBVmE/Hg5LMsux6iA130A== X-Received: from dbrazdil.lon.corp.google.com ([2a00:79e0:d:209:8f9e:94f7:810:211b]) (user=dbrazdil job=sendgmr) by 2002:a1c:9d48:: with SMTP id g69mr8247086wme.188.1639062691952; Thu, 09 Dec 2021 07:11:31 -0800 (PST) Date: Thu, 9 Dec 2021 15:11:21 +0000 Message-Id: <20211209151123.3759999-1-dbrazdil@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH v2 0/2] Driver for Open Profile for DICE From: David Brazdil To: Greg Kroah-Hartman Cc: Rob Herring , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , David Brazdil , Hans de Goede , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Andrew Scull , Will Deacon Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Open Profile for DICE is a secret derivation protocol used by some Android devices. The firmware/bootloader generates the secrets and hands them over to Linux in a reserved memory region. See https://pigweed.googlesource.com/open-dice for more details. This patchset adds the corresponding DeviceTree bindings and a driver that takes ownership of the memory region and exposes it to userspace via a misc device. The patches are based on top of v5.16-rc4 and can also be found here: https://android-kvm.googlesource.com/linux topic/dice_v2 Changes since v1: * converted to miscdevice * all mappings now write-combine to simplify semantics * removed atomic state, any attempt at exclusive access * simplified wipe, applied on ioctl, not on release * fixed ioctl return value David Brazdil (2): dt-bindings: firmware: Add Open Profile for DICE misc: dice: Add driver to forward secrets to userspace .../devicetree/bindings/firmware/dice.yaml | 51 ++++++ .../userspace-api/ioctl/ioctl-number.rst | 1 + drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/dice.c | 161 ++++++++++++++++++ include/uapi/linux/dice.h | 14 ++ 6 files changed, 236 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/dice.yaml create mode 100644 drivers/misc/dice.c create mode 100644 include/uapi/linux/dice.h --- 2.34.1.400.ga245620fadb-goog