[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Is it safe to assume that v == current in hvm_do_resume()?


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Wed, 22 Oct 2014 12:10:13 +0300
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Wed, 22 Oct 2014 09:10:21 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=fgXOoOPwJUG5W+6HfDG0kiWWPUBikP1cRNLCTL2JlIL0tK2G6+aX97ybz3gg4Q4eWJ3BaunTLVGBLfgzE6556oU0DROreebMBeSDpRqswGvrlXSZtU4OsigRsLmWb587Z5Jeorpz/Rp/Q69PoBzSguTzeok/V64rzVwrD7g1ikZMo/C7FHb7Q64VXBQszsBGMyNUjJmU9OwLTOM7EU4wbirrFbe+V5gycSPbmv9FttVDAXPkYkhXUHl305hZ+p96WwEPKQBBjODK/6AbQpO8taz16O2+DQqg7fIx8fOcytCvwspZv4oUmrh0HpMBqW3E4a0raMn2X8pdEf5Aq+TE4A==; h=Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 10/22/2014 12:04 PM, Andrew Cooper wrote:
> On 22/10/14 09:11, Razvan Cojocaru wrote:
>> Hello,
>>
>> As far as I've understood the code, and based on several tests, it would
>> appear that in xen/arch/x86/hvm/hvm.c, the struct vcpu *v parameter to
>> hvm_do_resume() is always equal to current.
>>
>> Is that a reasonable assumption to make? I could have missed some use
>> cases for the function.
> 
> The calls look like this:
> 
> {vmx,svm}_do_resume is the schedule_tail function pointer, which is a
> no-return function and called on the way out of a context switch.
> 
> They call hvm_do_resume() followed by a reset_stack_and_jump() to
> {vmx,svm}_asm_do_vmentry.
> 
> So yes - you can be guaranteed that the v in hvm_do_resume() is current.
> 
> If you do come to explicitly rely on this behaviour, and it is in any
> way unclear, it might be worth introducing an ASSERT(v == current) near
> to the expectation.

Thanks for the confirmation!

Indeed, I had placed an ASSERT() before the code that needs v == current.


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.