Skip to contentSkip to conversation

Don't clear HCR_VM bit when updating VTTBR.

PATCH In review Jun Sun 4 participants 7 messages Oct 10, 2016 – Nov 1, 2016

lore
Share & tools
lore

Jun Sun

author
#0 lore raw

PATCH 1/1 Don't clear HCR_VM bit when updating VTTBR.

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

---
 xen/arch/arm/p2m.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/p2m.c +0 -2
index cc5634b..e4991df 100644
@@ -140,8 +140,6 @@ void p2m_restore_state(struct vcpu *n)
         return;
 
     hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
 
     WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
     isb();
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

Sorry to be pushy - any feedback on this simple little patch?

Cheers.

Jun

Quoted 27 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

---
 xen/arch/arm/p2m.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/p2m.c +0 -3
index cc5634b..e4991df 100644
@@ -140,8 +140,6 @@ void p2m_restore_state(struct vcpu *n)
         return;
 
     hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
 
     WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
     isb();
--
Quoted 3 lines

2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
In reply to Jun Sun
Quoted 9 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

Hello Jun,

thanks for the patch and sorry for the late reply. I would appreciate feedback from Julien, but he is current AFK.

Steve,
can I have your Acked-by on this patch?

Quoted 19 lines
 xen/arch/arm/p2m.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/p2m.c +0 -2
index cc5634b..e4991df 100644
@@ -140,8 +140,6 @@ void p2m_restore_state(struct vcpu *n)
         return;
 
     hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
 
     WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
     isb();
Signature · 1 line
2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by
#3 lore raw
Quoted 11 lines · Stefano Stabellini
Quoted 9 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

Quoted 8 lines

Hello Jun,

thanks for the patch and sorry for the late reply. I would appreciate feedback from Julien, but he is current AFK.

Steve,
can I have your Acked-by on this patch?

Apologies for my very late reply on this.

I've taken a look and I think that this is okay, so please feel free to add:

Cheers,

Signature · 1 line
Steve
Quoted 15 lines
Quoted 15 lines
 xen/arch/arm/p2m.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/p2m.c +0 -2
index cc5634b..e4991df 100644
@@ -140,8 +140,6 @@ void p2m_restore_state(struct vcpu *n)
         return;
 
     hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
 
Quoted 5 lines
Quoted 5 lines
xen/arch/arm/p2m.c +0 -0
     WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
     isb();
Signature · 1 line
2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw
Quoted 21 lines · Steve Capper
Quoted 11 lines · Stefano Stabellini
Quoted 9 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

Quoted 8 lines

Hello Jun,

thanks for the patch and sorry for the late reply. I would appreciate feedback from Julien, but he is current AFK.

Steve,
can I have your Acked-by on this patch?

Quoted 5 lines

Apologies for my very late reply on this.

I've taken a look and I think that this is okay, so please feel free to add:

Thanks Steve. Given the state of the release, I am going to push the fix to Xen 4.9 unless you or Jun have a strong argument for committing this sooner.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
 xen/arch/arm/p2m.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/arm/p2m.c +0 -2
index cc5634b..e4991df 100644
@@ -140,8 +140,6 @@ void p2m_restore_state(struct vcpu *n)
         return;
 
     hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
 
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
xen/arch/arm/p2m.c +0 -0
     WRITE_SYSREG64(p2m->vttbr, VTTBR_EL2);
     isb();
Signature · 1 line
2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

Hi Stefano,

Quoted 24 lines · Stefano Stabellini
Quoted 23 lines · Steve Capper
Quoted 11 lines · Stefano Stabellini
Quoted 9 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not necessary. We are currently working on a new platform that would need this to be removed.

The patch is tested on FVP foundation model.

Quoted 8 lines

Hello Jun,

thanks for the patch and sorry for the late reply. I would appreciate feedback from Julien, but he is current AFK.

Steve,
can I have your Acked-by on this patch?

Apologies for my very late reply on this.

Quoted 7 lines
Quoted 3 lines

I've taken a look and I think that this is okay, so please feel free to add:

Thanks Steve. Given the state of the release, I am going to push the fix to Xen 4.9 unless you or Jun have a strong argument for committing this sooner.

Not related to this patch. Do you plan to have a branch for queuing all Xen 4.9 patches?

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#6 lore raw
Quoted 33 lines · Julien Grall

Hi Stefano,

Quoted 30 lines · Stefano Stabellini
Quoted 28 lines · Steve Capper
Quoted 13 lines · Stefano Stabellini
Quoted 11 lines · Jun Sun

Currently function p2m_restore_state() would clear HCR_VM bit, i.e., disabling stage2 translation, before updating VTTBR register. After some research and talking to ARM support, I got confirmed that this is not
necessary. We are currently working on a new platform that would need this
to be removed.

The patch is tested on FVP foundation model.

Quoted 8 lines

Hello Jun,

thanks for the patch and sorry for the late reply. I would appreciate feedback from Julien, but he is current AFK.

Steve,
can I have your Acked-by on this patch?

Apologies for my very late reply on this.

I've taken a look and I think that this is okay, so please feel free to add:

Quoted 6 lines
Quoted 3 lines

Thanks Steve. Given the state of the release, I am going to push the fix to Xen 4.9 unless you or Jun have a strong argument for committing this sooner.

Not related to this patch. Do you plan to have a branch for queuing all Xen 4.9 patches?

Hi Julien, thanks a good suggestion (I am already starting to lose patches). I created:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git xen-arm-next

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel