From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRMaX-0002uZ-76 for qemu-devel@nongnu.org; Mon, 26 Nov 2018 14:30:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRMaU-0006K5-1M for qemu-devel@nongnu.org; Mon, 26 Nov 2018 14:30:33 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:36408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRMaT-0006Jq-Iq for qemu-devel@nongnu.org; Mon, 26 Nov 2018 14:30:29 -0500 Received: by mail-pl1-x636.google.com with SMTP id g9so1873994plo.3 for ; Mon, 26 Nov 2018 11:30:29 -0800 (PST) References: <20181025172057.20414-1-cota@braap.org> <20181025172057.20414-24-cota@braap.org> <87lg5f51sz.fsf@linaro.org> <20181126190733.GC6688@flamenco> From: Richard Henderson Message-ID: <7ff01881-3130-ef72-217d-511b4de0cd3c@linaro.org> Date: Mon, 26 Nov 2018 11:30:25 -0800 MIME-Version: 1.0 In-Reply-To: <20181126190733.GC6688@flamenco> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 23/48] translator: add plugin_insn argument to translate_insn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Stefan Hajnoczi , Peter Maydell , qemu-devel@nongnu.org, Pavel Dovgalyuk , =?UTF-8?Q?Llu=c3=ads_Vilanova?= On 11/26/18 11:07 AM, Emilio G. Cota wrote: > The main reason why I added the qemu_plugin_insn_append calls > was to avoid reading the instructions twice from guest memory, > because I was worried that doing so might somehow alter the > guest's execution, e.g. what if we read a cross-page instruction, > and both pages mapped to the same TLB entry? We'd end up having > more TLB misses because instrumentation was enabled. A better solution for this, I think is to change direct calls from cpu_ldl_code(env, pc); to translator_ldl_code(dc_base, env, pc); instead of passing around a new argument separate from DisasContextBase? r~