Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2639611imd; Fri, 2 Nov 2018 15:09:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5dyfiFvXtWQ3/jmTZT6T5s+t/xl09vlnQR97EQ0+5lF85HRXRxmvKFcSaI/88ZLCtEXCYW9 X-Received: by 2002:a63:f844:: with SMTP id v4mr12360808pgj.82.1541196546999; Fri, 02 Nov 2018 15:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541196546; cv=none; d=google.com; s=arc-20160816; b=O4eOPFMQdLymL/MC+EUtEHfHZsxK8k+riJjyG48IJO/qCFX/cjCu+Q7yvpP7BGENjL lEuwR0/e1q8odujBvlwtAbyA1YtiBeGvxUBK7/wcBFn+9PwE4m0+R5c9/ptxB0xr2vci 6L7ZV2SnXW0MyoVqIRHPysUQkRLRS3nFB7a4ehKDWHO5mjrRgULhGU5Wn5WvImdkeCd/ cqYRdWzb4bsE3A1E0FY9fb6rKMP3coG1BCrM0saU8YeILejwOjs5QAzmLEZ16VxrmzAF GW/Z/atNkqc3EL+iJzvZx3bplwwCJMz46+gLb8XndbzoKrPEv9aAikSq4xGVG7x3Hsht V6xw== 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=GbHeHnFPpwWBjr1xXe9PavLGL2eH/BZqGS+1tZXY9kI=; b=EKOD5KDUtXeXos3bMlkrXtp7yT8cV8+HRWkza31LHDVTliHHenW1YMv2fqCG8E8PGF 6rEZ6twpEaFeUYY7jB6E7FviVBjlDdHOyGbbMDe0/IHRCXwqGnoG4pGSBzUeR4NoZvbK nzkqZPaYDNBvE9ugWVaSjauDO0TgYYe0wU4KG/f6c0wGIP0E/m9slVpLBqBhDzPaV28R 9yOhaaNtGQUuJ1/kYU/WBKqA7WQUqSz8bIR8GTXap301KgDO0EsNNLRd13mBqJCEcHM6 f15mRX8TBHoAnwjf1REavpGMD6CR+08yXXIEv1uKDVz5YWGSS4rZWhyifTcFeVbNNvZE kqSg== 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 z11-v6si33529108plk.90.2018.11.02.15.08.52; Fri, 02 Nov 2018 15:09:06 -0700 (PDT) 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 S1728404AbeKCHQ6 (ORCPT + 99 others); Sat, 3 Nov 2018 03:16:58 -0400 Received: from mga01.intel.com ([192.55.52.88]:58967 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbeKCHQ6 (ORCPT ); Sat, 3 Nov 2018 03:16:58 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2018 15:08:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,457,1534834800"; d="scan'208";a="276703322" Received: from btyborox-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.138]) by fmsmga005.fm.intel.com with ESMTP; 02 Nov 2018 15:07:52 -0700 Date: Sat, 3 Nov 2018 00:07:52 +0200 From: Jarkko Sakkinen To: Andy Lutomirski Cc: Dave Hansen , "Christopherson, Sean J" , Jethro Beekman , 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: <20181102220752.GA24373@linux.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Nov 01, 2018 at 10:53:40AM -0700, Andy Lutomirski wrote: > If a handler is registered, then, if a synchronous exception happens > (page fault, etc), the kernel would set up an exception frame as usual > but, rather than checking for signal handlers, it would just call the > registered handler. That handler is expected to either handle the > exception entirely on its own or to call one of two new syscalls to > ask for normal signal delivery or to ask to retry the faulting > instruction. Why the syscalls are required? Couldn't the handler have just a return value to indicate the appropriate action? Another thing that I'm wondering is that what if a signal occurs inside the exception handler? /Jarkko