From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH kvm-unit-tests 3/4] Add support for calling a function in guest mode Date: Sun, 28 Nov 2010 10:59:52 +0200 Message-ID: <20101128085952.GB3330@redhat.com> References: <1290595933-13122-1-git-send-email-avi@redhat.com> <1290595933-13122-4-git-send-email-avi@redhat.com> <20101126141748.GB6124@redhat.com> <4CF0CC26.8030407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10165 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751760Ab0K1JAL (ORCPT ); Sun, 28 Nov 2010 04:00:11 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAS90AGY030339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 28 Nov 2010 04:00:10 -0500 Content-Disposition: inline In-Reply-To: <4CF0CC26.8030407@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Nov 27, 2010 at 11:15:18AM +0200, Avi Kivity wrote: > On 11/26/2010 04:17 PM, Michael S. Tsirkin wrote: > >> + > >> +#include "kvmxx.h" > >> +#include > > > >This seems to use boost, which is not part of the standard library. > >Do we want this dependency? > >We'd need a configure check to verify it's installed. > > > > I don't mind a boost dependency, but given this is in tr1, I > switched to that instead. > > >> +#include > >> + > >> +namespace identity { > >> + > >> +void setup_vm(kvm::vm& vm); > >> + > >> +class vcpu { > >> +public: > >> + vcpu(kvm::vcpu& vcpu, boost::function guest_func, > >> + unsigned long stack_size = 256 * 1024); > > > >So the thread stack is moved to use the heap instead? > > Only in guest mode. > > >Can we use pthread_attr_getstacksize and use the regular thread stack? > >Good for portability. > > In practice 256K should be sufficient. This is for a unit test, not > a qemu replacement. Portability matters though. Isn't it a good idea to replace a bunch or asm calls with pthread use? > > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain.