Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp264992ybl; Mon, 2 Dec 2019 10:25:14 -0800 (PST) X-Google-Smtp-Source: APXvYqw96++opOmKa4prlvhA2hoRLqnqfAmW7xZsLI8+bY2oNoI1a4ETWqeldH04pECXzTfuxgJf X-Received: by 2002:a5d:4dc9:: with SMTP id f9mr233882wru.297.1575311114523; Mon, 02 Dec 2019 10:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575311114; cv=none; d=google.com; s=arc-20160816; b=EacNEqFejXnnF+c672Cl8yloRONoQwQpU9IJl20V1L8+aJu93LzNbMXJ0iBajAnvcg oCIukMo5Jjkqi90mVzPt/SDg3rJSgGZMTuoxa1KXPkjgFtZRqs3GccRTTFZnI+GoVNMI /iUs9b/8Y4eg4f2pALoNjgDig6zvvarTlaP6pvyqsnt9WRhSE3k+cY2WaxI49tC0RvFJ WrXxABjwFNYN2sd8E3cmKb9BVy/WhtZnYNSnjfxlEPGHbQIfCZEwP8lvNFHErutu9PFO BaWbkIla+IH0VxtYf/4dWbI8dGUvSpYxJy5wRqAS6R7av1efh+pAQThgG/QXWKB8Xtkk 46pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=w+0eodRb1S85lm56jBM07tiqPKZL4wzAYhBGXwhPqfk=; b=BPapCpp1yqw4Iinlk254rKiupjL/Bigaa5PApBtLFc/SCINX/tYL3dqhva+MadwLSV CWud8o+BUXM8e2HKIlhKiyeTlloHdeOP5MpYbvr0kXdbI2sGXX/5A9uvuBXEiEWVZ3QY WFU2T8y9HGsjXRU+BgZSyGP+jyD1TBREJFxOxBFQ+gm6lPiicsBbde5WPC9cwDjokUZ9 t0lbjOAyVYkObutrHdl+i2rn5GTgIn7gXxe9JuEa1i32kuBIW3PnbIdaN78W1RSwKxcN iER9RMd1bfUwB+z8iCDXzewwG/xVkAwBvn3v0FPPwt3d5lxhsAAN8QHbuKjs5x/YedNW 36Qw== 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 l19si161786edq.133.2019.12.02.10.24.49; Mon, 02 Dec 2019 10:25:14 -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 S1727923AbfLBSVF (ORCPT + 99 others); Mon, 2 Dec 2019 13:21:05 -0500 Received: from mga07.intel.com ([134.134.136.100]:58535 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727671AbfLBSVF (ORCPT ); Mon, 2 Dec 2019 13:21:05 -0500 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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 10:21:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,270,1571727600"; d="scan'208";a="410523120" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga005.fm.intel.com with ESMTP; 02 Dec 2019 10:21:02 -0800 Date: Mon, 2 Dec 2019 10:21:03 -0800 From: Sean Christopherson To: Haitao Huang Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, Jarkko Sakkinen , akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com, linux-security-module@vger.kernel.org, Suresh Siddha Subject: Re: [PATCH v24 12/24] x86/sgx: Linux Enclave Driver Message-ID: <20191202182102.GF4063@linux.intel.com> References: <20191129231326.18076-1-jarkko.sakkinen@linux.intel.com> <20191129231326.18076-13-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 02, 2019 at 09:48:43AM -0600, Haitao Huang wrote: > On Fri, 29 Nov 2019 17:13:14 -0600, Jarkko Sakkinen > wrote: > > > >+ > >+ for (c = 0 ; c < addp.length; c += PAGE_SIZE) { > >+ if (signal_pending(current)) { > >+ ret = -ERESTARTSYS; > >+ break; > >+ } > > This IOC is not idempotent as pages EADDed at this point can not be > re-EADDed again. So we can't return ERESTARTSYS Ah, and now I remember why I opted for modifying the parameters directly instead of including a "number processed" field. Andy pointed out the ERESTARTSYS thing in the original multi-page add RFC[*], so presumably updating the params and returning ERESTARTSYS is legal/acceptable. [*] https://lkml.kernel.org/r/CALCETrUb4X9_L9RXKhmyNpfSCsbNodP=BfbfO8Fz_efq24jp8w@mail.gmail.com