Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp49210ybr; Fri, 22 May 2020 00:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0AQkOM9y7zMmEkZBCCACTWisG/ge/7QN2kaJ9jwLqJ+3lvcg6h/hEdNWvi/nfRspnMvB0 X-Received: by 2002:a17:907:1199:: with SMTP id uz25mr7356244ejb.24.1590131867146; Fri, 22 May 2020 00:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590131867; cv=none; d=google.com; s=arc-20160816; b=QsOc03c7q+O2hsrAxqwRJ4JqcN3dF5nAUuFGALh0i6EqtApKzC+KvImb+XStHDELin CRq9EXpgnN4YIOzvzgPby2LvugD1EkhvIQOIzy+rqGJHCleiy3N4Aruguz59DloBlPMt N0GoTbmtM6K5S0A8kxz9DReSJ2z9CEOjoBs5oxSw1vJ95pxANJLfwuF7v5Qxdl6bNqpY QX7cGLRgOQXAtLPwuRwzFTwxZzCQb8I+dtA7uJO4O20eF1PVaktPliP6iNfSSsj+MnHT AX15E/39FEP+FDISrWbCHqBbbTrq+gI4JGrIGpPfOz/NPgUKOVUpZ9a38id3hoA3HWfb BIEA== 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:ironport-sdr:ironport-sdr; bh=ykNtN46qRG6xuRdYYQ7UwBbJvRM8MtS85+tWlML9tx4=; b=bRZm6lXE9U8B/6XUeQ4AFNc6Uv3GBUz+MkJQVwwOrk9pZvcd0Lyv3AxQ1YwdcujIwl tsWHR2xs8dopbUX8/ZOHHarXwUqb6S6Br/bwik4UJbgvuig8Sp3Cb4hqXeZG54EI+IgD VAysncqF+MkxZqJ1EP53LHFuC2N+d+4ZsfRevzuXtfRyWOnyvcwsQ6CcM0ixKqa4iotj V53IKJ4f/RGjp5pFov+ekKibFOx7vXr0krq6Z5r/pmhVtXhGwYBlEI7AfEptYzYhpLSB 9knUfPrBBCTmdX/qK63vKQs0fieV1g7ZCkUOjSjMc3qolj1ioNFqcReSxmjcoyk7yUED VvBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g17si4767920ejc.416.2020.05.22.00.17.21; Fri, 22 May 2020 00:17:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728434AbgEVHPz (ORCPT + 99 others); Fri, 22 May 2020 03:15:55 -0400 Received: from mga04.intel.com ([192.55.52.120]:46811 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728137AbgEVHPy (ORCPT ); Fri, 22 May 2020 03:15:54 -0400 IronPort-SDR: 7LB6WXHDPmM5eZ9wK08infduL20Nr1uKLQZyiXyjjejKYhV8/NVZA5cGiA2Cex/A64K83C3JCM 8GZUUCIli0uQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2020 00:15:54 -0700 IronPort-SDR: KY8FM2XvlW2PX8YM2WYKJFEgZsnlmqCYvrpnrZfhR2WhTrdD09HCdYjmObussU4WB2N7Dvyhfl x4YJVhq0HkFQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,420,1583222400"; d="scan'208";a="255525320" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by fmsmga008.fm.intel.com with ESMTP; 22 May 2020 00:15:53 -0700 Date: Fri, 22 May 2020 00:15:53 -0700 From: Sean Christopherson To: Jarkko Sakkinen Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.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-mm@kvack.org, Jethro Beekman , Jordan Hand , Chunyang Hui , Seth Moore Subject: Re: [PATCH v30 12/20] x86/sgx: Add a page reclaimer Message-ID: <20200522071553.GA24377@linux.intel.com> References: <20200515004410.723949-1-jarkko.sakkinen@linux.intel.com> <20200515004410.723949-13-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515004410.723949-13-jarkko.sakkinen@linux.intel.com> 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 Fri, May 15, 2020 at 03:44:02AM +0300, Jarkko Sakkinen wrote: > +static void sgx_reclaimer_write(struct sgx_epc_page *epc_page, > + struct sgx_backing *backing) > +{ > + struct sgx_encl_page *encl_page = epc_page->owner; > + struct sgx_encl *encl = encl_page->encl; > + struct sgx_backing secs_backing; > + int ret; > + > + mutex_lock(&encl->lock); > + > + if (atomic_read(&encl->flags) & SGX_ENCL_DEAD) { > + ret = __eremove(sgx_epc_addr(epc_page)); > + ENCLS_WARN(ret, "EREMOVE returned %d\n"); The " returned %d\n" is unnecessary and leads to a bad message, ENCLS_WARN handles the message and formatting, i.e. this should simply be: ENCLS_WARN(ret, "EREMOVE"); > + } else { > + sgx_encl_ewb(epc_page, backing); > + } > + > + encl_page->epc_page = NULL; > + encl->secs_child_cnt--;