From patchwork Fri Jan 12 21:06:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124382 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2509244qgn; Fri, 12 Jan 2018 13:11:08 -0800 (PST) X-Google-Smtp-Source: ACJfBosLCnHZzhyvT2D4wc6+9d3UI2JtoFwSexdqc6ztXkdDJFKuBvjnS358K2f+zpPdB0Gz3SAB X-Received: by 10.37.18.193 with SMTP id 184mr17550409ybs.127.1515791468543; Fri, 12 Jan 2018 13:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515791468; cv=none; d=google.com; s=arc-20160816; b=At+uY63lpl6Yq+X2m8wHkuJnz31MwKWk2U8QT1VjXvYT2UlTBFFsopJJLFPMua3dFV f28JOeFjopfWwdrxJBBeb5MER0g/Ef0mxigC4hFK2OrCGNvJGNmZHuxACnUMPo6L1vrK Wdrqk6wEho5JH8HsTjjQ5D0megJBWvIAN2l5qqHNjGYPdMGeG9Pnm1JgpKrhGF6DBBTs 2XWPjqG/7a1oxF6uMV9eceydCJQE0fjKy0w/09gHAhYePZDuNurg0cJ312lcYe4LMrro t2u2FmgOBHdkp4ioJ8ZnxESEfSKGK59rqEOamMVSThCX1NDj90CqQ6Kmh2m+7tuHykdL gG9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=RkJQxOnAGP0/1GM4j5AhPbVm0ZbUL4Gx9Je9FrSasnc=; b=QcimTi2U75DAofZedqZcfbBP7dFf6iB3l3eeX7kMLLhle+oyrmAwvzuj+EXrQyu2PH tHfBQ2ye68xRxi/6nWHPhcZPBHapUhQQBSDipjkuOYgkCFm0kuA01JCnIOHcOb8Pvu3x /wIAriu5Scs7W1IQ3sToCZn7sdK1ekY+ugHu29tbblVBu7YROkeG5FTbXC5a/uHSUj7o HuIESP28NOm2omFcXS0RUrUp5eWN392A7BZVDewiaNpZ4lhXeBmvLSw/cZsMc+LF8cLQ vX2gx1uN6sPfW3rDRITMQQh2uCPuPrix4y6KYLg3rRjpSSyG3BKpLbnd8uSNFl/cZoTh vvew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UPjYkbOA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g83si1283782ywc.687.2018.01.12.13.11.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 12 Jan 2018 13:11:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UPjYkbOA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea6bU-0003Yw-4C for patch@linaro.org; Fri, 12 Jan 2018 16:11:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea6Wt-0008O5-Fe for qemu-devel@nongnu.org; Fri, 12 Jan 2018 16:06:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea6Ws-0002n7-KQ for qemu-devel@nongnu.org; Fri, 12 Jan 2018 16:06:23 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:34990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ea6Ws-0002mS-Fb for qemu-devel@nongnu.org; Fri, 12 Jan 2018 16:06:22 -0500 Received: by mail-pg0-x244.google.com with SMTP id d6so5353089pgv.2 for ; Fri, 12 Jan 2018 13:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RkJQxOnAGP0/1GM4j5AhPbVm0ZbUL4Gx9Je9FrSasnc=; b=UPjYkbOAH/mxRFSgXKUOK2HXSnmj55DtWMlDR2vsIQuw6iGRFiTZxLmZ1KLqQHSbwX PLuoY2+DrMipZDNKMMoM3TvTHaDF6Zfyy7DbqE7KqJa0XcuR8mD+H/RwfDZjX8w8bG9y 1nShs3LPs/JpHg0sGql8EcrTfHnSDDfmWTokM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RkJQxOnAGP0/1GM4j5AhPbVm0ZbUL4Gx9Je9FrSasnc=; b=SJ0R4ABoiw5zA/IYvifxcg0waplEt50OP7lB6IscYSAyWRQ16H3nYjfg5bY7He4WOk vDlcw6+k/PdJos6VqAmm3aqdjnbM0RTsYjcYJWVGA5uySpVjj6F+2jIuk7CgoymnKWH0 +ARfSKgSolD9iTToPIE5X1lZkJO2We2V9UZiPSJnSUCiT4iCSo3amHNHBTpiHTy36yxJ vZTUpCBDl7HFGXj5ET8os02RoWcVsquRKsER2OA0NXyjjp+uBtJPVQJ6KyJlMZX8jW6g RlHRD4kaLwkU6wLO3GhKi4XGMm24/hOzjNwHRvCN/grN7R2ZzeBRHEJNMRJCtqcBFovA zV1w== X-Gm-Message-State: AKGB3mKTtnNzQFWOu3EN6xsrTe64VxqPKH/lJhpokvojNeLNBhHCjC/x bUABVhuTYrylDPz/oOBBH70YZ37foEo= X-Received: by 10.84.137.106 with SMTP id 97mr18236597plm.233.1515791181241; Fri, 12 Jan 2018 13:06:21 -0800 (PST) Received: from cloudburst.twiddle.net (50-78-183-178-static.hfc.comcastbusiness.net. [50.78.183.178]) by smtp.gmail.com with ESMTPSA id t80sm20197600pgb.88.2018.01.12.13.06.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jan 2018 13:06:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 13:06:12 -0800 Message-Id: <20180112210613.14124-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180112210613.14124-1-richard.henderson@linaro.org> References: <20180112210613.14124-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PULL 3/4] tcg/ppc: Support tlb offsets larger than 64k X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" AArch64 with SVE has an offset of 80k to the 8th TLB. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.14.3 diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 879885b68b..74f9b4aa34 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -1524,16 +1524,15 @@ static TCGReg tcg_out_tlb_read(TCGContext *s, TCGMemOp opc, /* Compensate for very large offsets. */ if (add_off >= 0x8000) { - /* Most target env are smaller than 32k; none are larger than 64k. - Simplify the logic here merely to offset by 0x7ff0, giving us a - range just shy of 64k. Check this assumption. */ - QEMU_BUILD_BUG_ON(offsetof(CPUArchState, - tlb_table[NB_MMU_MODES - 1][1]) - > 0x7ff0 + 0x7fff); - tcg_out32(s, ADDI | TAI(TCG_REG_TMP1, base, 0x7ff0)); + int low = (int16_t)cmp_off; + int high = cmp_off - low; + assert((high & 0xffff) == 0); + assert(cmp_off - high == (int16_t)(cmp_off - high)); + assert(add_off - high == (int16_t)(add_off - high)); + tcg_out32(s, ADDIS | TAI(TCG_REG_TMP1, base, high >> 16)); base = TCG_REG_TMP1; - cmp_off -= 0x7ff0; - add_off -= 0x7ff0; + cmp_off -= high; + add_off -= high; } /* Extraction and shifting, part 2. */