Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp868329pxv; Thu, 1 Jul 2021 11:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu0mwqLQgos6f1az5GnbBHmQ27WuvzqcqPXQgXS8fl825CAfFJ0OB6h9wLwHmw+hAxpTvo X-Received: by 2002:a05:6e02:1d8e:: with SMTP id h14mr469493ila.47.1625162725526; Thu, 01 Jul 2021 11:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625162725; cv=none; d=google.com; s=arc-20160816; b=aaVVlKrBS+zo0TTezrcQjnQacRlY27yl+r7aEjtvmd5QrFdLmadu+BHNshCMrBcoOI yjYF/48OIsfeN98HrJF1dv/4fh53sS5S4vp7Op3jWlcbXIXXn8h6bwSCC5p21xSDfYkT 85cvqag58LuGXmowihFod/POngEXtJ/p4NUlxjEXtKwpCRKi7BcuoNrSDz/m/AAGyVz/ DOj4oIC/5xR3NWi1BiqtQPoIMQvoFS2zgCpEgPkowOqjXARmpsnUVpZbiXJong8bdPWy 5Jzv0PEWdIh1tagmeM0tA4lyucFtPWyHduBahMILOz3I+b0J1PQD0fjdRcIkbGi+liUb fO0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pA5qidpGRMz4iB462uPn953XJs14KjqFbjDwTnvDnKg=; b=J/cnOuWqHTOd7D9bXZoTeUMZxLqk5lev8R/zLqKc5kBwXPBqzhrh24udqt5EKUgZQe BMSGVyEI+iBGDsPl1svCD/JE0EMLR1HVibVPmp3qpJ94glJydqXAu1O7Al4GewzQJJNx j3/1jxLjYQCE3UYfWAkqJV62Fo3XHzB4R6Qr67V2JfBtC8HPUUE8RzgZwiK5qoyDm1DJ G3b6A4BnAnWUNHNHt6xFSayeKDsSh7Es+ALJoC0L9gWJ3I6I9/oodjBSjK4//8W9aLhc 0yhEobd5Tb0Bu2CfjsOTINNwsZAr+5U1Q/I8kc2Jl6K8J/Hdsc/VCVuzk+AXFTkyKA1t yvPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=OHT4NlQL; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si506966ils.127.2021.07.01.11.05.04; Thu, 01 Jul 2021 11:05:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@alien8.de header.s=dkim header.b=OHT4NlQL; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbhGASGd (ORCPT + 99 others); Thu, 1 Jul 2021 14:06:33 -0400 Received: from mail.skyhub.de ([5.9.137.197]:44848 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbhGASGc (ORCPT ); Thu, 1 Jul 2021 14:06:32 -0400 Received: from zn.tnic (p200300ec2f129e0080cb4010141c3d3f.dip0.t-ipconnect.de [IPv6:2003:ec:2f12:9e00:80cb:4010:141c:3d3f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7547E1EC054E; Thu, 1 Jul 2021 20:04:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1625162640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=pA5qidpGRMz4iB462uPn953XJs14KjqFbjDwTnvDnKg=; b=OHT4NlQL9fVtGHXge2xZSd0T4EtBcQOmHUNmaE2UC612fKA/8lwfY5w8HH19skwww6/STE w59gY7ILIMMe0ZyN6jwbgjjR4zWs30kvUfgtbeBw73IN/ywKqCl1h2D8vx+XtIEcdzKNGg kS/Fvml/488FUBEJyM1T7mfITHlUCSg= Date: Thu, 1 Jul 2021 20:03:55 +0200 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , tony.luck@intel.com, npmccallum@redhat.com, Dov Murik Subject: Re: [PATCH Part1 RFC v3 22/22] virt: Add SEV-SNP guest driver Message-ID: References: <20210602140416.23573-1-brijesh.singh@amd.com> <20210602140416.23573-23-brijesh.singh@amd.com> <46499161-0106-3ae9-9688-0afd9076b28b@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <46499161-0106-3ae9-9688-0afd9076b28b@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jun 30, 2021 at 11:26:46AM -0500, Brijesh Singh wrote: > As you have noticed that Dov is submitting the SEV specific driver. Well, reportedly that driver is generic-ish as it only handles the EFI-provided sekrits and is not SEV-specific - the SEV use is only exemplary. > I was thinking that it will be nice if we have one driver that covers > both the SEV and SEV-SNP. That driver can be called "sevguest". The > kernel will install the appropriate platform device. The sevguest > driver can probe for both the "sev-guest" and "snp-guest" and delegate > the ioctl handling accordingly. > > In the kernel the directory structure may look like this: > > virt/coco/sevguest > sevguest.c // common code > snp.c // SNP specific ioctl implementation > sev.c // SEV specific ioctl or sysfs implementation > > Thoughts ? Sure, but I'd call it sevguest.c and will have it deal with both SEV and SNP ioctls depending on what has been detected in the hardware. Or is there some special reason for having snp.c and sev.c separate? > I followed the naming convension you recommended during the initial SEV driver > developement. IIRC, the main reason for us having to add "user" in it because > we wanted to distinguious that this structure is not exactly same as the what > is defined in the SEV-SNP firmware spec. I most definitely have forgotten about this. Can you point me to the details of that discussion and why there's a need to distinguish? > Good question, I am not able to find a generic place to document it. Should we > create a documentation "Documentation/virt/coco/sevguest-api.rst" for it ? I am > open to other suggestions. Well, grepping the tree for "ioctl" I see: Documentation/driver-api/ioctl.rst Documentation/process/botching-up-ioctls.rst Documentation/userspace-api/ioctl/cdrom.rst Documentation/userspace-api/ioctl/hdio.rst Documentation/userspace-api/ioctl/index.rst Documentation/userspace-api/ioctl/ioctl-decoding.rst Documentation/userspace-api/ioctl/ioctl-number.rst Documentation/userspace-api/media/cec/cec-func-ioctl.rst Documentation/userspace-api/media/mediactl/media-func-ioctl.rst Documentation/userspace-api/media/mediactl/request-func-ioctl.rst Documentation/userspace-api/media/v4l/func-ioctl.rst and there's some good info as to what to do. In any case, Documentation/virt/coco/sevguest-api.rst doesn't sound too bad either, actually, as it collects everything under virt/ Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette