Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdPcL-0000wU-JT for qemu-devel@nongnu.org; Tue, 18 Aug 2009 10:24:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdPcG-0000s2-Bm for qemu-devel@nongnu.org; Tue, 18 Aug 2009 10:24:52 -0400 Received: from [199.232.76.173] (port=41150 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdPcG-0000rU-3p for qemu-devel@nongnu.org; Tue, 18 Aug 2009 10:24:48 -0400 Received: from mail.gmx.net ([213.165.64.20]:55396) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MdPcF-0001Hj-Ab for qemu-devel@nongnu.org; Tue, 18 Aug 2009 10:24:47 -0400 Date: Tue, 18 Aug 2009 16:24:43 +0200 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Subject: Re: [Qemu-devel] [PATCH 5/5] Port apic to new VMState design Message-ID: <20090818142443.GB16563@1und1.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, sorry for replying in the middle of the thread, I was to fast and deleted the other mails already. And just in case I mention I am new around here, so feel free to ignore me if you feel I am completely wrong. One thing I don't like too much about it is that you can't really handle "calculated" fields. It seems qemu does not use this (much/yet?), but it seems good design to me that when a device emulation can handle multiple devices, you store in one place the device name but to avoid switch...case in lots of places you also have capability flags stored somewhere. Saving both seems a bit like a bad design: the value of one implies the exact value of the other, so it is at least pointless. More importantly (though I do not know if qemu intends to care about this) it might be able to hand-craft a saved vm that after loading then violates some assumptions of the emulation code, possibly being exploitable. If nothing else, I'd at least add support for a "verify" function that gets a "const state *" and can abort loading the VM in case someone tries something evil (or can print some useful hint instead of having qemu crash silently on the user, possibly at some later time). And yes I see that today almost nothing (of what I saw) verifies anything, but it feels wrong to me to code that into a API design. Greetings, Reimar Döffinger