Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp507992imu; Mon, 26 Nov 2018 14:07:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uw9o6IOHIwukhCZNwzvRyXQ3y+NrZ7ow5Ta27oW47LnZFSgBolQQJ25EBeLT2FKcHPv3jI X-Received: by 2002:a63:9501:: with SMTP id p1mr3045409pgd.149.1543270051455; Mon, 26 Nov 2018 14:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543270051; cv=none; d=google.com; s=arc-20160816; b=IrhBaydc9uyM+lfKibTqibmX2a13tWwknp/4bdCzgVHXC0cZ5/8vUoRYjT2ylpILqw Z4C2TTvRZIWl6nmR/EMqyYFpjr2DGIzwuJzAWNDibaZn3/GToNSzyz0ZD4U/nBKHTzJv 1K7t88zrMKGrop0u8WFvLoG/JpmFV4Dq7iO97RPSq3yFvYCZH0Dk6Omyqe3EclMt6LqT eeymu4uBjbj31ELFa6BpTCPpXxOKAL30ydnzi+nobTkXWgFog1ZCYPSYfyxnPFDggzVe PeqLBmDIeNVeDZMkDMF9GEe/WW0gLKhRv8b6mMwP8T8iV8g/BjZRa9BR/MIgycpuKpvm pAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jyxu9Plsa+D7LpjhwG6eE0fw5AscS/QmI9QJEiVUusw=; b=cGVPpUsbm+RupuCOgMELwcUuTWEKUPgMlr1rl972FCvzJa+b3pusKEwoWvLfSRM6op DW5bH8ul0QQMDb524WYaqIX9OMXktnFg1uww9hs4SmM2cLU1KRzFrFZkrCBM27zzEj1a yYa+gC1eAmKuusdMqRsu9zUaPIVXfDVxvJdS/SIHKzddFiQK93gudUSeuLmOtLwduSaS iE7f8oom1/ga5xsg6gV+NsXbL2uJmQqyt2aVbvxAHPIc6J8juE/C77y/vpASTWEpCyc4 5KGkAiSJx1sh8X2CmyIhNCB7t9TVrzChP6XjC8+wSpETMJsH6SmlKr7a2F4RcQqfZz9W ynQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b70si1671241pfe.168.2018.11.26.14.07.13; Mon, 26 Nov 2018 14:07:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727212AbeK0JCC (ORCPT + 99 others); Tue, 27 Nov 2018 04:02:02 -0500 Received: from mga04.intel.com ([192.55.52.120]:60344 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbeK0JCC (ORCPT ); Tue, 27 Nov 2018 04:02:02 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2018 14:06:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,284,1539673200"; d="scan'208";a="103528497" Received: from jsakkine-mobl1.jf.intel.com (HELO localhost) ([10.24.8.61]) by orsmga003.jf.intel.com with ESMTP; 26 Nov 2018 14:06:26 -0800 Date: Mon, 26 Nov 2018 14:06:27 -0800 From: Jarkko Sakkinen To: Sean Christopherson Cc: Jethro Beekman , Andy Lutomirski , Dave Hansen , Florian Weimer , Linux API , Jann Horn , Linus Torvalds , X86 ML , linux-arch , LKML , Peter Zijlstra , Rich Felker , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "shay.katz-zamir@intel.com" , "linux-sgx@vger.kernel.org" , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov Subject: Re: RFC: userspace exception fixups Message-ID: <20181126220627.GD868@linux.intel.com> References: <20181118071548.GA4795@linux.intel.com> <20181119160204.GD13298@linux.intel.com> <20181120101133.GA7319@linux.intel.com> <20181120225518.GE8391@linux.intel.com> <0a78772e-4f42-254b-d91a-f0f80a24ff90@fortanix.com> <20181121151734.GA16564@linux.intel.com> <20181126143534.GA25719@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126143534.GA25719@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 06:35:34AM -0800, Sean Christopherson wrote: > And how would you determine the #UD is related to SGX? Hardware doesn't > provide any indication that a #UD (or any other fault) is related to SGX > or occurred in an enclave. The only fault that is special-cased in a > non-virtualized environment is #PF signaled by the EPCM, which gets the > PF_SGX bit set in the error code. Could you not detect #UD from address where it happened? Kernel knows where enclaves are mapped. BTW, how does Intel run-time emulate opcodes currently? Anyway, I've fully discarded the whole idea because implementing single stepping w/o well defined AEP handler is nasty. I think vDSO's are the only viable path that at least I'm aware off... /Jarkko