On Tue, Nov 18, 2014 at 2:10 PM, Nilay Vaish via gem5-dev <[email protected]
> wrote:

> On Tue, 18 Nov 2014, Steve Reinhardt via gem5-dev wrote:
>
>  I haven't looked at the code in question, so I'm just going by what I've
>> seen in this email thread.  However, it seems like there ought to be some
>> alternative solutions here.  I like the general direction Andreas is
>> going,
>> though it would be nice to avoid more multiple inheritance :).  The way I
>> see it, the basic idea there is to create an API (either on an existing
>> object like System or on a new object) that the device can call
>> irrespective of whether KVM is configured or not, but which gives enough
>> information to get the job done; then the other object can be responsible
>> for either coordinating with KVM or (presumably) ignoring all those calls
>> if KVM is not configured.
>>
>> As a simpler alternative, maybe we don't need to give the kvm pointer to
>> the device via python; if the System object has an accessor that would
>> return the vm pointer, then the device could call that during
>> initialization, and it would of course just return NULL if kvm is not
>> configured
>>
>>
> But would not this also cause the same problem that we cannot compile on
> systems that do not have kvm support?  In Andreas' suggestion, we would be
> selectively compiling certain file(s) which should resolve the issue.
>


I don't follow your question, Nilay.  The former suggestion is really a
generalization of Andreas's idea, so the same answer holds.  In the latter
case, you'd still need to ifdef some C++ code with USE_KVM (as Ali
originally suggested), but you wouldn't need a KvmVM param in the python,
which Gabe pointed out was a problem with Ali's suggestion.

As Nate points out, if USE_KVM is exposed as a top-level config variable,
then it should be accessible from Python too, which perhaps a better way of
fixing Ali's approach.

But I still think the former approach is preferable, if you can get to the
point where the device doesn't really know if KVM is configured or not, but
just gives some other part of the system the information it needs to do the
right thing as appropriate.

Steve



>
> --
> Nilay
>
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to