Skip to contentSkip to conversation

x86/pv: Drop assertions from svm_load_segs()

PATCH In review Andrew Cooper 2 participants 3 messages Sep 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/pv: Drop assertions from svm_load_segs()

OSSTest has shown an assertion failure:
http://logs.test-lab.xenproject.org/osstest/logs/153906/test-xtf-amd64-amd64-1/serial-rimava1.log

These assertions were never appropriate, as they rule out legal (and, as it turns out, sensible perf-wise) inputs based on an expectation of how the sole caller would behave.

Fixes ad0fd291c5 ("x86/pv: Rewrite segment context switching from scratch")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>

---
 xen/arch/x86/hvm/svm/svm.c | 2 --
 1 file changed, 2 deletions(-)
xen/arch/x86/hvm/svm/svm.c +0 -2
index af584ff5d1..eaacbcb668 100644
@@ -1559,13 +1559,11 @@ bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
         vmcb->ldtr.base = ldt_base;
     }
 
-    ASSERT(!(fs_sel & ~3));
     vmcb->fs.sel = fs_sel;
     vmcb->fs.attr = 0;
     vmcb->fs.limit = 0;
     vmcb->fs.base = fs_base;
 
-    ASSERT(!(gs_sel & ~3));
     vmcb->gs.sel = gs_sel;
     vmcb->gs.attr = 0;
     vmcb->gs.limit = 0;
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andrew Cooper

OSSTest has shown an assertion failure:
http://logs.test-lab.xenproject.org/osstest/logs/153906/test-xtf-amd64-amd64-1/serial-rimava1.log

These assertions were never appropriate, as they rule out legal (and, as it turns out, sensible perf-wise) inputs based on an expectation of how the sole caller would behave.

I wouldn't put it this way - not coming here was a requirement in the old logic, when we expected non-null selectors to remain in sync with the GDT/LDT. But yes, they needs to be dropped now.

Quoted 1 line
Fixes ad0fd291c5 ("x86/pv: Rewrite segment context switching from scratch")

With your S-o-b added

Jan

#2 lore raw
Quoted 10 lines · Jan Beulich
Quoted 6 lines · Andrew Cooper

OSSTest has shown an assertion failure:
http://logs.test-lab.xenproject.org/osstest/logs/153906/test-xtf-amd64-amd64-1/serial-rimava1.log

These assertions were never appropriate, as they rule out legal (and, as it turns out, sensible perf-wise) inputs based on an expectation of how the sole caller would behave.

I wouldn't put it this way - not coming here was a requirement in the old logic, when we expected non-null selectors to remain in sync with the GDT/LDT. But yes, they needs to be dropped now.

Urgh.  That is a can of worms, as this path doesn't preserve the GDT attributes/limits.

Quoted 4 lines
Quoted 2 lines
Fixes ad0fd291c5 ("x86/pv: Rewrite segment context switching from scratch")

With your S-o-b added

Oops.  Thanks, but no - I retract this patch.  Will submit a different one shortly.

~Andrew