KVM: x86 emulator: check io permissions only once for string pio
Do not recheck io permission on every iteration. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
@@ -1621,9 +1621,15 @@ static bool emulator_io_permited(struct x86_emulate_ctxt *ctxt,
|
||||
struct x86_emulate_ops *ops,
|
||||
u16 port, u16 len)
|
||||
{
|
||||
if (ctxt->perm_ok)
|
||||
return true;
|
||||
|
||||
if (emulator_bad_iopl(ctxt, ops))
|
||||
if (!emulator_io_port_access_allowed(ctxt, ops, port, len))
|
||||
return false;
|
||||
|
||||
ctxt->perm_ok = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user