Intel SGX development
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>, <linux-sgx@vger.kernel.org>
Cc: <dave.hansen@linux.intel.com>
Subject: Re: Odd looking #PF fault code
Date: Mon, 4 Apr 2022 09:27:10 -0700	[thread overview]
Message-ID: <3d2b5a6e-f59a-e5fc-9349-5449d6cc7267@intel.com> (raw)
In-Reply-To: <YkoyvdqIqkaOk8NL@kernel.org>

Hi Jarkko,

On 4/3/2022 4:50 PM, Jarkko Sakkinen wrote:
> I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:
> 

There seems a difference in the error codes described:

> Unexpected PF: address: 0x007f7fff910000, error code 0x15

Error code 0x15 translates to binary 10101 which is:
BIT 0: Present
BIT 2: User
BIT 4: Instruction fetch

> 
> I'm using patches from:
> 
> https://github.com/rchatre/linux/tree/sgx/sgx2_submitted_v2_plus_rwx
> 
> Fault code is in other words PROT|WRITE|USER|RSVD.

PROT|WRITE|USER|RSVD is bits 0,1,2,3 which is 0xF

Did you obtain 0x15 or 0xF as error code?

If EAUG/EACCEPTCOPY was followed by an attempt to execute that page
then 0x15 error could be explained since the page would only support
RW permissions at that time.


> According to arch/x86/kernel/fault.c:
> 
> 	/*
> 	 * Reserved bits are never expected to be set on
> 	 * entries in the user portion of the page tables.
> 	 */
> 	if (unlikely(error_code & X86_PF_RSVD))
> 		pgtable_bad(regs, error_code, address);
> 
> Any clue how this fault code could emit?
> 
> [*] https://github.com/enarx/enarx/pull/1608
> 
> BR, Jarkko


Reinette

  reply	other threads:[~2022-04-04 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 23:50 Odd looking #PF fault code Jarkko Sakkinen
2022-04-04 16:27 ` Reinette Chatre [this message]
2022-04-05  5:59   ` Jarkko Sakkinen
2022-04-04 21:32 ` 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=3d2b5a6e-f59a-e5fc-9349-5449d6cc7267@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    /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