From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCU7I-0001tU-6c for qemu-devel@nongnu.org; Mon, 04 Mar 2013 07:03:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCU7G-0005Nw-Td for qemu-devel@nongnu.org; Mon, 04 Mar 2013 07:03:40 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41469 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCU7G-0005Nq-KZ for qemu-devel@nongnu.org; Mon, 04 Mar 2013 07:03:38 -0500 Message-ID: <51348D97.4060400@suse.de> Date: Mon, 04 Mar 2013 13:03:35 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v1 0/7] Reset and Halting modifications + Zynq SMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Anthony Liguori , Peter Maydell , qemu-devel@nongnu.org, dantesu@faraday-tech.com, Juan Quintela Hi Peter, Am 04.03.2013 10:01, schrieb Peter Crosthwaite: > Hi All. The clock controller module in the Zynq platform has the abilit= y to halt > and reset arbitrary devices, including the CPU. We use this feature to = implement > SMP Linux - the kernel halts CPU1 then rewrites the vector table to the > secondary entry point and unhalts. >=20 > The clock controller however is reasonable generic, in that in has the = ability > to halt and reset any arbitrary device in the Zynq SoC. The interface f= or doing > this is reasonably consistent. So im looking for unified way to halt an= d reset > arbitrary devices CPUs included. So given we already have reset() defin= ed on the > TYPE_DEVICE level, i've added halt as well. >=20 > This series is based on v3 of the current qom-cpu queue to pick up the = move of > cpu halt out of the env. From this I attach the cpu::halted bit to the > Device::(un)halt function. I have doubts whether that is a suitable API... My initial thought was: Isn't that pretty much realize/unrealize according to Anthony's definition via Vcc? The technical difference I see is that in your case devices are still migrated, not sure if that makes a difference, assuming unhalt/realize puts them into a defined state (i.e., reset). Reminds me that some time ago we had a discussion about enabling/disabling/reconfiguring ISA devices. realize/unrealize might be a solution there too, but it may still be tied to the concept of hot-plug, which is disabled for ISA and SysBus. > Next up, CPUs seem to have a different reset path to normal devices. So= I have > trivially hooked up CPU::Reset to Device::Reset. This means that anyone= who > holds a DeviceState pointer to the CPU can reset it properly without ac= tually > knowing its a CPU. If we do that, it needs a better explanation of *why* this is okay. Regards, Andreas >=20 > With the halt API I played with changing an existing device over to use= it in > place of the CPU halted bit (sun4m). >=20 > I then finally add SMP support to the Zynq machine, and patch the Zynq = SLCR > (my clock controller) to have DeviceState pointers to the CPUs. device_= reset() > and device_halt() is where the magic happens. >=20 > Future work, more devices in Zynq will have halt and reset. My agenda f= or > abstracting away the fact that attached device is a CPU is to allow for > consistent implementation and a single code path for the clock controll= ed > devices. >=20 >=20 > Peter A. G. Crosthwaite (3): > xilinx_zynq: added smp support > zynq_slcr: Add links to the CPUs > zynq_slcr: Implement CPU reset and halting >=20 > Peter Crosthwaite (4): > qdev: Define halting API > qom/cpu.c: Encapsulate cpu halting > qom/cpu.c: Hook CPU reset up to device reset > sun4m: Use halting API to halt/unhalt CPUs >=20 > hw/qdev-core.h | 17 ++++++++++++++ > hw/qdev.c | 18 ++++++++++++++ > hw/sun4m.c | 24 +++++++++--------- > hw/xilinx_zynq.c | 66 ++++++++++++++++++++++++++++++++++++++++++++--= ------- > hw/zynq_slcr.c | 30 ++++++++++++++++++++++++ > qom/cpu.c | 22 ++++++++++++++++++ > 6 files changed, 153 insertions(+), 24 deletions(-) >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg