Skip to contentSkip to conversation

x86/spec-ctrl: Fix backport of 1fdb25a614b

PATCH In review Andrew Cooper 2 participants 3 messages Aug 30, 2018 – Aug 31, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/spec-ctrl: Fix backport of 1fdb25a614b

Refreshing XenServer's patchqueue has shown that I missed this adjustment in the upstream backports of the final version of the XSA-273 fixes.

The code does work in 4.7 and earlier, but only because the eventual value of (opt_pv_l1tf & OPT_PV_L1TF_DOMx) is within range of a char.

---
CC: Jan Beulich <[email protected]>

---
 xen/include/asm-x86/shadow.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/asm-x86/shadow.h +2 -2
index de09e81..c720008 100644
@@ -215,8 +215,8 @@ void pv_l1tf_tasklet(unsigned long data);
 static inline void pv_l1tf_domain_init(struct domain *d)
 {
     d->arch.pv_domain.check_l1tf =
-        opt_pv_l1tf & (is_hardware_domain(d)
-                       ? OPT_PV_L1TF_DOM0 : OPT_PV_L1TF_DOMU);
+        !!(opt_pv_l1tf & (is_hardware_domain(d)
+                          ? OPT_PV_L1TF_DOM0 : OPT_PV_L1TF_DOMU));
 
 #ifdef CONFIG_SHADOW_PAGING
     tasklet_init(&d->arch.paging.shadow.pv_l1tf_tasklet,
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 30.08.18 at 20:37, <[email protected]> wrote:

Refreshing XenServer's patchqueue has shown that I missed this adjustment in the upstream backports of the final version of the XSA-273 fixes.

The code does work in 4.7 and earlier, but only because the eventual value of (opt_pv_l1tf & OPT_PV_L1TF_DOMx) is within range of a char.

And I had noticed this while pulling things into our trees, but decided to leave it since it's working.

Quoted 1 line

Jan

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

#2 lore raw
Quoted 11 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 30.08.18 at 20:37, <[email protected]> wrote:

Refreshing XenServer's patchqueue has shown that I missed this adjustment in the upstream backports of the final version of the XSA-273 fixes.

The code does work in 4.7 and earlier, but only because the eventual value of (opt_pv_l1tf & OPT_PV_L1TF_DOMx) is within range of a char.

And I had noticed this while pulling things into our trees, but decided to leave it since it's working.

Quoted 1 line

I figured that, especially as you've got a patch proposing to change these constants, that it would be safer to make it work now.

~Andrew

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