From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbcDZWgT (ORCPT ); Tue, 26 Apr 2016 18:36:19 -0400 Received: from mail-ob0-f177.google.com ([209.85.214.177]:35539 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbcDZWgR (ORCPT ); Tue, 26 Apr 2016 18:36:17 -0400 MIME-Version: 1.0 In-Reply-To: <20160426215236.GA1605@amd> References: <1461605698-12385-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160426190009.GC8162@amd> <20160426194117.GA11111@amd> <20160426201154.GC11111@amd> <20160426215952.44ff82a6@lxorguk.ukuu.org.uk> <20160426215236.GA1605@amd> From: Andy Lutomirski Date: Tue, 26 Apr 2016 15:35:56 -0700 Message-ID: Subject: Re: [PATCH 0/6] Intel Secure Guard Extensions To: Pavel Machek Cc: One Thousand Gnomes , Jarkko Sakkinen , Greg KH , Andy Lutomirski , Borislav Petkov , Boris Ostrovsky , "open list:STAGING SUBSYSTEM" , Ingo Molnar , Kristen Carlson Accardi , "open list:DOCUMENTATION" , open list , Mathias Krause , Thomas Gleixner , Wan Zongshun Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 26, 2016 at 2:52 PM, Pavel Machek wrote: > On Tue 2016-04-26 21:59:52, One Thousand Gnomes wrote: >> > But... that will mean that my ssh will need to be SGX-aware, and that >> > I will not be able to switch to AMD machine in future. ... or to other >> > Intel machine for that matter, right? >> >> I'm not privy to AMD's CPU design plans. >> >> However I think for the ssl/ssh case you'd use the same interfaces >> currently available for plugging in TPMs and dongles. It's a solved >> problem in the crypto libraries. >> >> > What new syscalls would be needed for ssh to get all this support? >> >> I don't see why you'd need new syscalls. > > So the kernel will implement few selected crypto algorithms, similar > to what TPM would provide, using SGX, and then userspace no longer > needs to know about SGX? No, other way around. The kernel will provide a basic interface to SGX and userspace can do whatever it wants. If userspace wants to use RSA, userspace will provide an actual RSA implementation, in more or less normal x86 binary form, and will map it into user addresses. It will tell the kernel "hey, this address range is an enclave", and the kernel will set it up as such and tell the CPU about it. Userspace will then use SGX instructions to communicate with the enclave. It's pretty neat, and it's completely agnostic to the purpose of the enclave. --Andy