Received: from eggs.gnu.org ([2001:4830:134:3::10]:49279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btf3O-0001o1-0B for qemu-devel@nongnu.org; Mon, 10 Oct 2016 14:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btf3J-0003tR-Mq for qemu-devel@nongnu.org; Mon, 10 Oct 2016 14:11:56 -0400 Received: from g4t3427.houston.hpe.com ([15.241.140.73]:7268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btf3J-0003qn-GA for qemu-devel@nongnu.org; Mon, 10 Oct 2016 14:11:53 -0400 From: Thomas Hanson Date: Mon, 10 Oct 2016 12:11:13 -0600 Message-Id: <1476123077-35698-1-git-send-email-thomas.hanson@linaro.org> Subject: [Qemu-devel] [PATCH v2 0/4] target-arm: Handle tagged addresses when loading PC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, grant.likely@hpe.com, thomas.hanson@linaro.org If tagged addresses are enabled, then addresses being loaded into the PC must be cleaned up by overwriting the tag bits with either all 0's or all 1's as specified in the ARM ARM spec. The decision process is dependent on whether the code will be running in EL0/1 or in EL2/3 and is controlled by a combination of Top Byte Ignored (TBI) bits in the TCR and the value of bit 55 in the address being loaded. TBI values are extracted from the appropriate TCR and made available to TCG code generation routines by inserting them into the TB flags field and then transferring them to DisasContext structure in gen_intermediate_code_a64(). New function gen_a64_set_pc_reg() encapsulates the logic required to determine whether clean up of the tag byte is required and then generating the code to correctly load the PC. In addition to those instruction which can directly load a tagged address into the PC, there are others which increment or add a value to the PC. If 56 bit addressing is used, these instructions can cause an arithmetic roll-over into the tag bits. The ARM ARM specification for handling tagged addresses requires that these cases also be addressed by cleaning up the tag field. This work has been deferred because there is currently no CPU model available for testing with 56 bit addresses. v1->v2: - Updated patch descriptions per Peter's commments - Added function header and other comments as recommended - Change return type from long to unit32_t for arm_regime_tbi0() & arm_regime_tbi1() - Moved prototype of gen_a64_set_pc_reg() from patch 1 to patch 2 - Moved assignment of dc->tbi0 & dc->tbi1 from patch 2 to patch 1 - Split out documentation comments into separate patch. Still looking into handling of tagged addresses for exceptions and exception returns. Will handle that as a separate patch set. Thomas Hanson (4): target-arm: Infrastucture changes to enable handling of tagged address loading into PC target-arm: Code changes to implement overwrite of tag field on PC load target-arm: Comments to mark location of pending work for 56 bit addresses target-arm: Comments added to identify cases in a switch target-arm/cpu.h | 39 ++++++++++++++++- target-arm/helper.c | 46 +++++++++++++++++++++ target-arm/translate-a64.c | 101 +++++++++++++++++++++++++++++++++++++++++---- target-arm/translate.h | 3 ++ 4 files changed, 179 insertions(+), 10 deletions(-) -- 1.9.1