All of lore.kernel.org
 help / color / mirror / Atom feed
* Odd looking #PF fault code
@ 2022-04-03 23:50 Jarkko Sakkinen
  2022-04-04 16:27 ` Reinette Chatre
  2022-04-04 21:32 ` Jarkko Sakkinen
  0 siblings, 2 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-04-03 23:50 UTC (permalink / raw)
  To: linux-sgx; +Cc: dave.hansen, reinette.chatre

I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:

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

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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Odd looking #PF fault code
  2022-04-03 23:50 Odd looking #PF fault code Jarkko Sakkinen
@ 2022-04-04 16:27 ` Reinette Chatre
  2022-04-05  5:59   ` Jarkko Sakkinen
  2022-04-04 21:32 ` Jarkko Sakkinen
  1 sibling, 1 reply; 4+ messages in thread
From: Reinette Chatre @ 2022-04-04 16:27 UTC (permalink / raw)
  To: Jarkko Sakkinen, linux-sgx; +Cc: dave.hansen

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Odd looking #PF fault code
  2022-04-03 23:50 Odd looking #PF fault code Jarkko Sakkinen
  2022-04-04 16:27 ` Reinette Chatre
@ 2022-04-04 21:32 ` Jarkko Sakkinen
  1 sibling, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-04-04 21:32 UTC (permalink / raw)
  To: linux-sgx; +Cc: dave.hansen, reinette.chatre

On Mon, 2022-04-04 at 02:50 +0300, Jarkko Sakkinen wrote:
> I get this when trying to get EAUG-EACCEPTCOPY to run on Enarx and I get:
> 
> Unexpected PF: address: 0x007f7fff910000, error code 0x15
> 
> 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.
> 
> 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

Oops, off-by-one, I bit is set, not RSVD :-)

BR, Jarkko


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Odd looking #PF fault code
  2022-04-04 16:27 ` Reinette Chatre
@ 2022-04-05  5:59   ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-04-05  5:59 UTC (permalink / raw)
  To: Reinette Chatre, linux-sgx; +Cc: dave.hansen

On Mon, 2022-04-04 at 09:27 -0700, Reinette Chatre wrote:
> 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

Yeah, I misread it.

BR, Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-05  5:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 23:50 Odd looking #PF fault code Jarkko Sakkinen
2022-04-04 16:27 ` Reinette Chatre
2022-04-05  5:59   ` Jarkko Sakkinen
2022-04-04 21:32 ` Jarkko Sakkinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.