From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD844C433DB for ; Thu, 4 Mar 2021 02:18:16 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0BCE64F72 for ; Thu, 4 Mar 2021 02:18:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BCE64F72 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hzPOY+2BGtN5bVCXvPU1fGF0CzvHddqRBZdjKJRr9sw=; b=dnTOfYCuQivDXrE/CoLxwis3m mJLzAu5k3jqeFVWT0UF1bX7XKzSumH4EUBcJmyZR+P6JfjlOXG85XsbW1/Lg6zTNmc02ypI+mfSL+ TAu11Jq0k8umYxyDO3YaOAxg0eY3J29SEf/zmKGLn0Dk0EBmKQyUEjVfR3A5ux0MrHZC3mJ3G5jN7 etkgnjjyhAMx4rQvAeVNZ2du0TK/w9W5G0qSTSAKSXCQMhI58X7auuOEkP7PiFYk7qdcDQRaMVoXq nTg/K7tCrDoIwtUh2Qyz6HsKQ7Kmrm/sfuGABDVZyrE6rD3Iv0LmLHcTGpq4Q1WRsPwdSxMYnJb5W hf74+JfXw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHdUb-007Rbe-OF; Thu, 04 Mar 2021 02:13:34 +0000 Received: from mail-pf1-f171.google.com ([209.85.210.171]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHaf4-006tEd-5W for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 23:12:23 +0000 Received: by mail-pf1-f171.google.com with SMTP id m6so17417473pfk.1 for ; Wed, 03 Mar 2021 15:12:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wVf1ZzqnDwgRm+R0xLH7iG9bt5jJx65TM96nbApldLk=; b=E8XsPdjoaucleTMFOEeV5oTbfIyjHRxSyUkEjzvE2unc1T6gWbJUDe0DEX8GF/w7a1 Jv1GwQH3t/HmsLpvQBKn4oB2ZZyxOhYdbksGihaP+XlLL9pX5cLmw80rfoKNPsDQSRD/ rEYMewnjOzFnRWs/9c9J5Cwj6Nvf5OWPDNYw9/7xdtXn7i9bjumS4sY68ZHtl1kOORYq jDvTCJRq0fArotffgMLwULiyg2B3ziw0fTHIDVTW4hDmOWpTBGQIPo10XwViQGNOx76U EpVtQIQxWKO2svXOHLKMYZfgcyX5DFu9rylJxA4TEcad6vw24BbRCb8NhsprAuLzOahu VXiQ== X-Gm-Message-State: AOAM530adc2jbhoqYx5QMafe4yetlwSXcLDJBvvIIN3pjKMqBE6NhsrT NLe3ndOhm1Df1/ufVialiIs= X-Google-Smtp-Source: ABdhPJypcbsrOH+c1S75BAXn+Z/NciXbC/GIVjTOGWi22I6ehV2xXikPNH2pCSGrGmYCJupDVg9GSQ== X-Received: by 2002:a63:e04d:: with SMTP id n13mr1074046pgj.185.1614813127492; Wed, 03 Mar 2021 15:12:07 -0800 (PST) Received: from localhost ([2601:647:5b00:1162:1ac0:17a6:4cc6:d1ef]) by smtp.gmail.com with ESMTPSA id mp19sm8656739pjb.2.2021.03.03.15.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 15:12:06 -0800 (PST) Date: Wed, 3 Mar 2021 15:12:06 -0800 From: Moritz Fischer To: Moritz Fischer Cc: Nava kishore Manne , trix@redhat.com, robh+dt@kernel.org, michal.simek@xilinx.com, linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, git@xilinx.com, chinnikishore369@gmail.com Subject: Re: [PATCH 1/2] fpga: mgr: Adds secure BitStream loading support Message-ID: References: <20210118025058.10051-1-nava.manne@xilinx.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Nava, On Thu, Jan 21, 2021 at 09:17:10PM -0800, Moritz Fischer wrote: > On Mon, Jan 18, 2021 at 08:20:57AM +0530, Nava kishore Manne wrote: > > This commit adds secure flags to the framework to support > > secure BitStream Loading. > > > > Signed-off-by: Nava kishore Manne > > --- > > drivers/fpga/of-fpga-region.c | 10 ++++++++++ > > include/linux/fpga/fpga-mgr.h | 12 ++++++++++++ > > 2 files changed, 22 insertions(+) > > > > diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c > > index e405309baadc..3a5eb4808888 100644 > > --- a/drivers/fpga/of-fpga-region.c > > +++ b/drivers/fpga/of-fpga-region.c > > @@ -228,6 +228,16 @@ static struct fpga_image_info *of_fpga_region_parse_ov( > > if (of_property_read_bool(overlay, "encrypted-fpga-config")) > > info->flags |= FPGA_MGR_ENCRYPTED_BITSTREAM; > > > > + if (of_property_read_bool(overlay, "userkey-encrypted-fpga-config")) > > + info->flags |= FPGA_MGR_USERKEY_ENCRYPTED_BITSTREAM; > > Can this just be encrypted-fpga-config/FPGA_MGR_ENCRYPTED? > > + > > + if (of_property_read_bool(overlay, "ddrmem-authenticated-fpga-config")) > > + info->flags |= FPGA_MGR_DDR_MEM_AUTH_BITSTREAM; > > + > > + if (of_property_read_bool(overlay, > > + "securemem-authenticated-fpga-config")) > > + info->flags |= FPGA_MGR_SECURE_MEM_AUTH_BITSTREAM; Shouldn't all these get binding docs? I remember Richard adding authentication support for an Intel platform, too and I'd like to avoid adding random bindings per vendor. Would it be possible to have an 'authentication method / type' that is more extensible with different methods maybe? > > + > > if (!of_property_read_string(overlay, "firmware-name", > > &firmware_name)) { > > info->firmware_name = devm_kstrdup(dev, firmware_name, > > diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h > > index 2bc3030a69e5..2f7455a60666 100644 > > --- a/include/linux/fpga/fpga-mgr.h > > +++ b/include/linux/fpga/fpga-mgr.h > > @@ -67,12 +67,24 @@ enum fpga_mgr_states { > > * %FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first > > * > > * %FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed > > + * > > + * %FPGA_MGR_USERKEY_ENCRYPTED_BITSTREAM: indicates bitstream is encrypted with > > + * user key > > + * > > + * %FPGA_MGR_DDR_MEM_AUTH_BITSTREAM: do bitstream authentication using DDR > > + * memory if supported > > + * > > + * %FPGA_MGR_SECURE_MEM_AUTH_BITSTREAM: do bitstream authentication using secure > > + * memory if supported > > */ > > #define FPGA_MGR_PARTIAL_RECONFIG BIT(0) > > #define FPGA_MGR_EXTERNAL_CONFIG BIT(1) > > #define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) > > #define FPGA_MGR_BITSTREAM_LSB_FIRST BIT(3) > > #define FPGA_MGR_COMPRESSED_BITSTREAM BIT(4) > > +#define FPGA_MGR_USERKEY_ENCRYPTED_BITSTREAM BIT(5) > > +#define FPGA_MGR_DDR_MEM_AUTH_BITSTREAM BIT(6) > > +#define FPGA_MGR_SECURE_MEM_AUTH_BITSTREAM BIT(7) > > > > /** > > * struct fpga_image_info - information specific to a FPGA image > > -- > > 2.18.0 > > > > Thanks, > Moritz Moritz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel