HLVX and PMP


Paul Donahue
 

HLVX requires execute permission "during address translation" and explicitly requires PMP read access.  Since PMP is not address translation, does HLVX require PMP execute permission in addition to read permission?



Thanks,


-Paul



andrew@...
 

It means what it says.  Execute-only PMP regions (or PMA regions, for that matter) cause HLVX to raise an exception.  This is consistent with how mstatus.MXR is defined.  (The implication is that code in PMP/PMA regions marked execute-only isn't readily emulatable, but this is a conscious tradeoff in favor of security.)

On Tue, Oct 6, 2020 at 5:47 PM Paul Donahue <pdonahue@...> wrote:

HLVX requires execute permission "during address translation" and explicitly requires PMP read access.  Since PMP is not address translation, does HLVX require PMP execute permission in addition to read permission?



Thanks,


-Paul



Paul Donahue
 

OK, that makes sense.  I think that this minor change would be clearer (and I can make a PR if you agree):
"HLVX cannot override machine-level physical memory protection (PMP), so attempting to read memory without PMP read permission still results in an access-fault exception."

Thanks,

-Paul


On Tue, Oct 6, 2020 at 5:56 PM Andrew Waterman <andrew@...> wrote:
It means what it says.  Execute-only PMP regions (or PMA regions, for that matter) cause HLVX to raise an exception.  This is consistent with how mstatus.MXR is defined.  (The implication is that code in PMP/PMA regions marked execute-only isn't readily emulatable, but this is a conscious tradeoff in favor of security.)

On Tue, Oct 6, 2020 at 5:47 PM Paul Donahue <pdonahue@...> wrote:

HLVX requires execute permission "during address translation" and explicitly requires PMP read access.  Since PMP is not address translation, does HLVX require PMP execute permission in addition to read permission?



Thanks,


-Paul



andrew@...
 



On Tue, Oct 6, 2020 at 6:46 PM Paul Donahue <pdonahue@...> wrote:
OK, that makes sense.  I think that this minor change would be clearer (and I can make a PR if you agree):
"HLVX cannot override machine-level physical memory protection (PMP), so attempting to read memory without PMP read permission still results in an access-fault exception."

I'll leave the wording decision up to John Hauser.


Thanks,

-Paul


On Tue, Oct 6, 2020 at 5:56 PM Andrew Waterman <andrew@...> wrote:
It means what it says.  Execute-only PMP regions (or PMA regions, for that matter) cause HLVX to raise an exception.  This is consistent with how mstatus.MXR is defined.  (The implication is that code in PMP/PMA regions marked execute-only isn't readily emulatable, but this is a conscious tradeoff in favor of security.)

On Tue, Oct 6, 2020 at 5:47 PM Paul Donahue <pdonahue@...> wrote:

HLVX requires execute permission "during address translation" and explicitly requires PMP read access.  Since PMP is not address translation, does HLVX require PMP execute permission in addition to read permission?



Thanks,


-Paul