All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS
@ 2020-11-16 20:13 Jessica Clarke
  2020-11-17  8:19 ` Paolo Bonzini
  2020-11-18 16:21 ` Roman Bolshakov
  0 siblings, 2 replies; 3+ messages in thread
From: Jessica Clarke @ 2020-11-16 20:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Richard Henderson, Cameron Esfahani,
	Roman Bolshakov, Paolo Bonzini, Jessica Clarke

These are meant to correspond to the error code reported for #PF, so fix
the definition for Instruction Fetch faults and add one for Reserved Bit
faults (checking for that is currently a TODO in x86_mmu.c).

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
---
 target/i386/hvf/x86_mmu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/i386/hvf/x86_mmu.h b/target/i386/hvf/x86_mmu.h
index cd6e137e79..710adb82b5 100644
--- a/target/i386/hvf/x86_mmu.h
+++ b/target/i386/hvf/x86_mmu.h
@@ -34,7 +34,8 @@
 #define MMU_PAGE_PT             (1 << 0)
 #define MMU_PAGE_WT             (1 << 1)
 #define MMU_PAGE_US             (1 << 2)
-#define MMU_PAGE_NX             (1 << 3)
+#define MMU_PAGE_RS             (1 << 3)
+#define MMU_PAGE_NX             (1 << 4)
 
 bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa);
 
-- 
2.28.0



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

* Re: [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS
  2020-11-16 20:13 [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS Jessica Clarke
@ 2020-11-17  8:19 ` Paolo Bonzini
  2020-11-18 16:21 ` Roman Bolshakov
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-11-17  8:19 UTC (permalink / raw)
  To: Jessica Clarke, qemu-devel
  Cc: Roman Bolshakov, Richard Henderson, Eduardo Habkost, Cameron Esfahani

On 16/11/20 21:13, Jessica Clarke wrote:
> These are meant to correspond to the error code reported for #PF, so fix
> the definition for Instruction Fetch faults and add one for Reserved Bit
> faults (checking for that is currently a TODO in x86_mmu.c).
> 
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
> ---
>   target/i386/hvf/x86_mmu.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/i386/hvf/x86_mmu.h b/target/i386/hvf/x86_mmu.h
> index cd6e137e79..710adb82b5 100644
> --- a/target/i386/hvf/x86_mmu.h
> +++ b/target/i386/hvf/x86_mmu.h
> @@ -34,7 +34,8 @@
>   #define MMU_PAGE_PT             (1 << 0)
>   #define MMU_PAGE_WT             (1 << 1)
>   #define MMU_PAGE_US             (1 << 2)
> -#define MMU_PAGE_NX             (1 << 3)
> +#define MMU_PAGE_RS             (1 << 3)
> +#define MMU_PAGE_NX             (1 << 4)
>   
>   bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa);

Since you are at it, can you instead replace these flags with 
PG_ERROR_{P,W,U,RSVD,I_D}_MASK from cpu.h?

Thanks,

Paolo



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

* Re: [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS
  2020-11-16 20:13 [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS Jessica Clarke
  2020-11-17  8:19 ` Paolo Bonzini
@ 2020-11-18 16:21 ` Roman Bolshakov
  1 sibling, 0 replies; 3+ messages in thread
From: Roman Bolshakov @ 2020-11-18 16:21 UTC (permalink / raw)
  To: Jessica Clarke
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Cameron Esfahani,
	Eduardo Habkost

On Mon, Nov 16, 2020 at 08:13:22PM +0000, Jessica Clarke wrote:
> These are meant to correspond to the error code reported for #PF, so fix
> the definition for Instruction Fetch faults and add one for Reserved Bit
> faults (checking for that is currently a TODO in x86_mmu.c).
> 
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
> ---
>  target/i386/hvf/x86_mmu.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/i386/hvf/x86_mmu.h b/target/i386/hvf/x86_mmu.h
> index cd6e137e79..710adb82b5 100644
> --- a/target/i386/hvf/x86_mmu.h
> +++ b/target/i386/hvf/x86_mmu.h
> @@ -34,7 +34,8 @@
>  #define MMU_PAGE_PT             (1 << 0)
>  #define MMU_PAGE_WT             (1 << 1)
>  #define MMU_PAGE_US             (1 << 2)
> -#define MMU_PAGE_NX             (1 << 3)
> +#define MMU_PAGE_RS             (1 << 3)
> +#define MMU_PAGE_NX             (1 << 4)
>  
>  bool mmu_gva_to_gpa(struct CPUState *cpu, target_ulong gva, uint64_t *gpa);
>  
> -- 
> 2.28.0
> 

Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>

But I agree with Paolo that eliminating HVF-only definition duplicates
would be helpful.

Thanks,
Roman


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

end of thread, other threads:[~2020-11-18 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 20:13 [PATCH] hvf: Fix value of MMU_PAGE_NX and add MMU_PAGE_RS Jessica Clarke
2020-11-17  8:19 ` Paolo Bonzini
2020-11-18 16:21 ` Roman Bolshakov

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.