Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2305430pxa; Mon, 17 Aug 2020 06:34:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb5Jdr1UThtWB8EwEiIMvqcAJTX4gu5NB7Q0pGp1CN/86Nh/1gKokx2jbrMtsN9e3FF6Xj X-Received: by 2002:aa7:c30b:: with SMTP id l11mr14827234edq.253.1597671277473; Mon, 17 Aug 2020 06:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597671277; cv=none; d=google.com; s=arc-20160816; b=jFSismUpprr/l+dADrvpDulrTO08oqsxPpbPb/zE/P3N8gh2WnuyogP2hq4yAyYKYV HzpnLcwBacUBxu2UNCLSCeVohNjGoXVNqHMqML7WIUdCdm+zjT2dZPG26ZmBscvJr1Jl PDqtZOI7Q1qaLMN6VstPomG0+olGvFtrn30ZRUT1g5nhx/7Qa67mSb0+tMXDFbT2bCTE xnfgXYuD0PgMNU3EZ0DTHiL9tPNsZxRAOWixscAURUG83Qg1kKtWkr9wrW+ewvBIXPbZ gKL84iALkxJm8jefopfzsLqYqsqQjXyB3J9GAqFXkC6Z/6yiPhe8GTth+cuZt9HReJKI AWpA== 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 :ironport-sdr:ironport-sdr; bh=p8Y4g7ZwcSuKdUetYZ6iz8rQIVmO9UL+9QZBLsarn3Y=; b=hb0iIR5JBv8DKkETgTHFXo3M45+yis5JQC/V3SAvDUuH1lBsh6W/77U59EiHsZq1Zf GxDjRGbvPMQ6rJW8qlgsR2BLdKLnThZ+aa3e5Jfv9vhEVSopUqzYK7/4hdb/mt440OCZ 4GlvHc2fflPkRs3t5L0Y6dRD1VOtLQjmkwIJa03ZwvPe0DjzsGFHppZx7DDWCa4qpuEy RyVD0wQkzpKDY4avkaDOcaKmjL+k0m01VEd7HbnYCC25Y4dbW2nt3adiy2Rlmll/l2d6 hh9/NSdrTO80WLGWuMMJavdqK6hNFdG/gM1fa0VU1ClSpXdRt0Nd1FuinonG4hxvmAgJ YXdA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si11281327ejb.350.2020.08.17.06.34.13; Mon, 17 Aug 2020 06:34:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728503AbgHQNdc (ORCPT + 99 others); Mon, 17 Aug 2020 09:33:32 -0400 Received: from mga17.intel.com ([192.55.52.151]:35962 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728349AbgHQNdb (ORCPT ); Mon, 17 Aug 2020 09:33:31 -0400 IronPort-SDR: Zqd+1GQ132B98LPpABbjGyUe359esc4Plb3EsYBuZzc6KOjAmGvXurNpYitgj6haNerrgcSswG /HzMjD5vcLLQ== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="134759639" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="134759639" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 06:33:31 -0700 IronPort-SDR: E8WEF2UhFAYaIvOt4bObPNnuNOrUKIp59q5nUuKU6+1HdLopvbzewb86ff9KmBzhtV+NOrHO+v EIe8iW/nshXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="334075644" Received: from marshy.an.intel.com ([10.122.105.159]) by FMSMGA003.fm.intel.com with ESMTP; 17 Aug 2020 06:33:30 -0700 From: richard.gong@linux.intel.com To: derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, dinguyen@kernel.org, richard.gong@intel.com Subject: [PATCHv2 0/2] add Intel SoCFPGA crypto service driver Date: Mon, 17 Aug 2020 08:47:28 -0500 Message-Id: <1597672050-25829-1-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Gong This is the 2nd submission of Intel SoCFPGA crypto service driver. I followed the process to register or request a valid IOCTL number/letter, but I got the delivery failure status notification. Cypto service driver and service layer driver patches have been reviewed internally by colleagues at Intel. Intel SoCFPGA is composed of a 64 bit quad-core ARM Cortex A53 hard processor system (HPS) and Secure Device Manager (SDM). SDM is the hardware which does the FPGA configuration, QSPI, remote system update, crypto and warm reset. To meet the whole system security needs and support virtual machine requesting communication with SDM, only the secure world of software (EL3, Exception Level 3) can interface with SDM. All software entities running on other exception levels must channel through the EL3 software whenever it needs service from SDM. Intel Stratix10 service layer driver is added to provide the service for FPGA configuration, Remote System Update and FPGA crypto service (FCS). Running at privileged exception level (EL1, Exception Level 1), Intel Stratix10 service layer driver interfaces with the service clients at EL1 and manages secure monitor call (SMC) to communicate with secure monitor software at secure monitor exception level (EL3). The crypto services include security certificate, image boot validation, security key cancellation, get provision data, random number generation, advance encryption standard (AES) encryption and decryption services. To perform supporting crypto features on Intel SoCFPGA platforms, Linux user-space application interacts with FPGA crypto service (FCS) driver via structures defined in include/uapi/linux/intel_fcs-ioctl.h. The application allocates spaces for IOCTL structure to hold the contents or points to the data that FCS driver needs, uses IOCTL calls to passes data to kernel FCS driver for processing at low level firmware and get processed data or status back form the low level firmware via FCS driver. The user-space application named as fcs_client is at https://github.com/altera-opensource/fcs_apps/tree/fcs_client. Richard Gong (2): firmware: stratix10-svc: extend svc to support new crypto features misc: add Intel SoCFPGA crypto service driver drivers/firmware/stratix10-svc.c | 178 +++++- drivers/misc/Kconfig | 12 + drivers/misc/Makefile | 1 + drivers/misc/intel-fcs.c | 709 +++++++++++++++++++++ include/linux/firmware/intel/stratix10-smc.h | 147 ++++- .../linux/firmware/intel/stratix10-svc-client.h | 42 ++ include/uapi/linux/intel-fcs_ioctl.h | 222 +++++++ 7 files changed, 1292 insertions(+), 19 deletions(-) create mode 100644 drivers/misc/intel-fcs.c create mode 100644 include/uapi/linux/intel-fcs_ioctl.h -- 2.7.4