Skip to contentSkip to conversation

A wrong assert in get_ioreq()?

DISCUSSION Paul Samon 2 participants 4 messages Jul 4, 2007 – Jul 5, 2007

lore
Share & tools
lore

Paul Samon

author
#0 lore raw

In the function get_ioreq(), there is a line:
ASSERT((v == current) || spin_is_locked(&d->arch.hvm_domain.ioreq.lock));
I don't think it should be
ASSERT(v == current).
we don't get the lock first, and I think we needn't it.

Am I missing something?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#1 lore raw

Sorry, I meant the assert should "ASSERT(v == current)."

Quoted 8 lines · Paul Samon

I don't think it should be

    ASSERT(v == current).

we don't get the lock first, and I think we needn't it.

Am I missing something?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

The lock is taken in, for example, hvm_vcpu_initialise(), which calles get_ioreq(v) with v!=current. So the assertion is correct as-is.

-- Keir

Quoted 12 lines · Paul Samon

Sorry, I meant the assert should "ASSERT(v == current)."

Quoted 7 lines · Paul Samon

I don't think it should be

    ASSERT(v == current).

we don't get the lock first, and I think we needn't it.

Am I missing something?

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#3 lore raw

Yes, the lock is necessary (for hvm_vcpu_initialise()), but my question is:
in the ASSERT of get_ioreq(), we shouldn't check if we have got the lock, and we don't have the lock in it (if I'm wrong, please point out where we get the lock), that is, in get_ioreq(), I think spin_is_locked(&d-> arch.hvm_domain.ioreq.lock) always returns false.

-- Paul S.

Quoted 6 lines · Keir Fraser

The lock is taken in, for example, hvm_vcpu_initialise(), which calles get_ioreq(v) with v!=current. So the assertion is correct as-is.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel