From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzCMf-0002sG-Hs for qemu-devel@nongnu.org; Mon, 02 Oct 2017 21:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzCMe-0007QF-LV for qemu-devel@nongnu.org; Mon, 02 Oct 2017 21:51:17 -0400 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:45883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzCMe-0007Q0-GI for qemu-devel@nongnu.org; Mon, 02 Oct 2017 21:51:16 -0400 Received: by mail-qt0-x235.google.com with SMTP id b21so4553088qte.2 for ; Mon, 02 Oct 2017 18:51:16 -0700 (PDT) References: <20170928165414.7339-1-richard.henderson@linaro.org> <20170928165414.7339-5-richard.henderson@linaro.org> <17f88913-12dc-b462-d6fd-9b1c6cfbd6a9@amsat.org> <1085a4f8-d12b-f87c-caa7-a9927247d7e8@linaro.org> <1be5c928-43d0-e8d1-7c6b-0c37f40c7a54@amsat.org> From: Richard Henderson Message-ID: Date: Mon, 2 Oct 2017 21:51:12 -0400 MIME-Version: 1.0 In-Reply-To: <1be5c928-43d0-e8d1-7c6b-0c37f40c7a54@amsat.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 4/9] disas: Support the Capstone disassembler library List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Cc: qemu-devel@nongnu.org On 10/02/2017 02:45 PM, Philippe Mathieu-Daudé wrote: > On 10/02/2017 03:34 PM, Richard Henderson wrote: >> On 10/02/2017 09:36 AM, Philippe Mathieu-Daudé wrote: >>> Maybe some defines like: >>> >>> #define LARGEST_TARGET_INSTR_SIZE 32 >>> >>> #define MINIMUM_TARGET_PAGE_SIZE 1024 >> >> Eh.  If I weren't simply pulling numbers out of my hat, perhaps. >> Does it really make things clearer beyond sizeof or a great big comment? > > big comment is great! Like the one that's already there? + /* We want to read memory for one insn, but generically we do not + know how much memory that is. We have a small buffer which is + known to be sufficient for all supported targets. Try to not + read beyond the page, Just In Case. For even more simplicity, + ignore the actual target page size and use a 1k boundary. If + that turns out to be insufficient, we'll come back around the + loop and read more. */ r~