linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Haitao Huang" <haitao.huang@linux.intel.com>
To: "Jarkko Sakkinen" <jarkko@kernel.org>
Cc: linux-sgx@vger.kernel.org, dave.hansen@linux.intel.com,
	reinette.chatre@intel.com, vijay.dhanraj@intel.com
Subject: Re: [RFC PATCH 2/4] x86/sgx: Implement support for MADV_WILLNEED
Date: Mon, 24 Oct 2022 10:14:03 -0500	[thread overview]
Message-ID: <op.1ujtxux7wjvjmi@hhuan26-mobl1.amr.corp.intel.com> (raw)
In-Reply-To: <Y1Ww0vEHcQDitaYJ@kernel.org>

Hi Jarkko,

On Sun, 23 Oct 2022 16:23:30 -0500, Jarkko Sakkinen <jarkko@kernel.org>  
wrote:
...
>> +	/* Here: vm_start <= pos < end <= vm_end */
>> +	while (pos < end) {
>> +		if (xa_load(&encl->page_array, PFN_DOWN(pos)))
>> +			continue;
>> +		if (signal_pending(current)) {
>> +			if (pos == start)
>> +				ret = -ERESTARTSYS;
>> +			else
>> +				ret = -EINTR;
>> +			goto unlock;
>> +		}
>> +		ret = sgx_encl_eaug_page(vma, encl, pos);
>
> You should instead just do the export in the previous commit,
> and convert the return values here. Less pollution to the
> existing code base.
>

Thanks for the feedback. Just to clarify, you prefer following:

1. do export only in separate patch, no return type and value change
2. change return type and value in this patch.

Note the sgx_fadvise function needs to stop EAUGing and return in case of  
-EBUSY. So sgx_encl_eaug_page has to return error code -EBUSY separately,  
instead of lumping -EBUSY with VM_FAULT_NOPAGE which was fine for page  
fault handler.

Thanks
Haitao

  reply	other threads:[~2022-10-24 16:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 19:14 [RFC PATCH 0/4] x86/sgx: implement support for MADV_WILLNEED Haitao Huang
2022-10-19 19:14 ` [RFC PATCH 1/4] x86/sgx: Export sgx_encl_eaug_page Haitao Huang
2022-10-19 19:14   ` [RFC PATCH 2/4] x86/sgx: Implement support for MADV_WILLNEED Haitao Huang
2022-10-19 19:14     ` [RFC PATCH 3/4] selftests/sgx: add len field for EACCEPT op Haitao Huang
2022-10-19 19:14       ` [RFC PATCH 4/4] selftests/sgx: Add test for madvise(..., WILLNEED) Haitao Huang
2022-10-23 21:23     ` [RFC PATCH 2/4] x86/sgx: Implement support for MADV_WILLNEED Jarkko Sakkinen
2022-10-24 15:14       ` Haitao Huang [this message]
2022-11-01  0:49         ` Jarkko Sakkinen
2022-10-23 21:22   ` [RFC PATCH 1/4] x86/sgx: Export sgx_encl_eaug_page Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.1ujtxux7wjvjmi@hhuan26-mobl1.amr.corp.intel.com \
    --to=haitao.huang@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=vijay.dhanraj@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).