From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCsva-0005lZ-Vb for qemu-devel@nongnu.org; Thu, 31 Jul 2014 12:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCsvU-0006eH-MB for qemu-devel@nongnu.org; Thu, 31 Jul 2014 12:10:02 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:51119 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCsvU-0006dS-FL for qemu-devel@nongnu.org; Thu, 31 Jul 2014 12:09:56 -0400 References: <20140731125321.1600.46604.stgit@PASHA-ISP.novsu.ac.ru> <20140731125452.1600.364.stgit@PASHA-ISP.novsu.ac.ru> From: Alex =?utf-8?Q?Benn=C3=A9e?= Date: Thu, 31 Jul 2014 17:07:32 +0100 In-reply-to: <20140731125452.1600.364.stgit@PASHA-ISP.novsu.ac.ru> Message-ID: <87lhr9ik6p.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH v3 15/49] softmmu: fixing usage of cpu_st/ld* from helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, real@ispras.ru, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Pavel Dovgalyuk writes: > MMU helper functions are called from generated code and other helper > functions. In both cases they try to get function's return address for > using it while restoring virtual CPU state. > > When MMU helper is called from some other helper function > (like helper_maskmov_xmm) through cpu_st* function, the return address > will point to that helper. That is why CPU state cannot be restored in > the case of MMU fault. > > This patch introduces several inline helpers to load return address > which points to the right place. > OK I find it fairly hard to follow all the glue magic (not your fault ;-) we have in QEMU. However wouldn't it be simpler for the helper pre-amble code to ensure the subject pc is updated in the CPU environment? Can QEMU only rectify the processor state from a TranlationBlock tc address? -- Alex Bennée