From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:54614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjCk-0003fj-Qt for qemu-devel@nongnu.org; Mon, 18 Feb 2019 08:43:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjCi-0000kv-TS for qemu-devel@nongnu.org; Mon, 18 Feb 2019 08:43:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjCi-0000gT-7V for qemu-devel@nongnu.org; Mon, 18 Feb 2019 08:43:28 -0500 References: From: Thomas Huth Message-ID: Date: Mon, 18 Feb 2019 14:43:20 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Testing sysbus devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stephen Checkoway , qemu-devel@nongnu.org On 18/02/2019 07.07, Stephen Checkoway wrote: > Hi all, >=20 > I've been working on some improvements to the pflash_cfi02 block device= (interleaved flash devices similar to pflash_cfi01, multi-sector erase, = nonuniform sector sizes, and some bug fixes and I'm planning on implement= ing sector erase suspend/resume commands in the near future). >=20 > There appear to be no existing tests for this device and I'm unsure wha= t the appropriate way to add tests for sysbus devices is. -device can't b= e used because sysbus devices aren't user-creatable (and even if they wer= e, creating the device wouldn't be sufficient since it wouldn't connect i= t to the sysbus). >=20 > Any suggestions would be appreciated. I think you could use one of the machines that has a cfi02 on board. For example: Write some random data to a temporary file. Run qemu with: QTestState *qts; qts =3D qtest_initf(" qemu-system-arm -M musicpal,accel=3Dqtest " "-drive if=3Dpflash,file=3D%s,format=3Draw", filename); Then you should be able to access the device with the qtest_read/write functions, e.g. use "qtest_memread(qts, 0x100000000ULL, ...)" to read the contents of the device. I haven't tried that though, that's just my quick assumption from looking at hw/arm/musicpal.c ... Thomas