From patchwork Tue Jan 16 16:45:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124745 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1076344lje; Tue, 16 Jan 2018 08:49:34 -0800 (PST) X-Google-Smtp-Source: ACJfBovq0/t/BycYW9pVymnFavHiMpFVe+S0PEZTO1egRQCYm6uqTbAlY/f1wds69HMfgsosemZt X-Received: by 10.37.179.203 with SMTP id x11mr35264142ybf.20.1516121374198; Tue, 16 Jan 2018 08:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516121374; cv=none; d=google.com; s=arc-20160816; b=MquuwjeExi0fB+tFU+euUw809zXgL3uok1J7sXGWcVrbsxYIxygt2HEAG2lmaYBKW7 ZXe1CaYgr5DHcjrUWxl0+sRMNDb5BilRPZBcZ4qmt0YL1sfXubPMQXJqGAmnLAsnQLm8 noa9TxLSVAt28F2HFx6oVd1FLHmIQ2z5whDQhMv9ZMRtDIGytDrZ/p2oZ2ShYSAN4WNc d/i7ZHiulClSM0Z+JXQRmKkwG5eqmArvv60QcZnA78Kluds4hgE6JBma3V+I7T6+GBwx y+8N2Z0wn2TL/RAJiJ8M35jmr194gmoQG9KnxL+Fk+1Q/UwwwHU1uN5KS7+IzSJUVQGb mnOQ== 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=yLGxDDVt6/nof1zka14Eg9JuQebRrAcFmO7hmSnL9X4NOYB+uk1uLIQebzjb4hSAUE 6xHB1KFmaOG2bh7t3lUs44+iauE/aHCKH/oC1fsnzBwwgXwhZCBTAK8UHs9HP5BuXW9j uV3h30CKTTwKIqoTY9g9zw7fMDwFX2kt5WTrAJ2q6t75YNxkufabkt+7sntXGfh1sDR9 YFH1MO6p0kkBhWIBQWfVhFlSO+RUXuPv4+4PiyMYD9U7NsoCX9ASRpqaY+PFNHzkklol erPa8vWKfNOtXZ19+Q8i9jA5wffdmBE/J0v+e5lszS+FIsV265ET5ZTalvoCyoYqDOvn RunQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RLJIVa0W; 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 n73si589928yba.311.2018.01.16.08.49.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 16 Jan 2018 08:49:34 -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=RLJIVa0W; 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]:48220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUQX-0001nc-Kr for patch@linaro.org; Tue, 16 Jan 2018 11:49:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUNJ-0000Ur-5R for qemu-devel@nongnu.org; Tue, 16 Jan 2018 11:46:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebUNF-0008Q3-BE for qemu-devel@nongnu.org; Tue, 16 Jan 2018 11:46:13 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:46917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebUNF-0008PI-6O for qemu-devel@nongnu.org; Tue, 16 Jan 2018 11:46:09 -0500 Received: by mail-pg0-x243.google.com with SMTP id s9so7958782pgq.13 for ; Tue, 16 Jan 2018 08:46:09 -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=RLJIVa0WSpIBt4SM+ANf6dOPk3+HoICkMDWXQ4mQo6vmIv0vgsL3FsaKq0aNbAC5Jo oWVgPHBWBaf1E4wh/Tas6+LsP3mPWbugpEipvSni/engOU+/o63tto4VTSu9/VVYSMvC Xo7+0+9HvnU6wiC2z7hXulEWpvVewc4kdweYY= 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=ovH3BC5nBKchT8I6DmpPVaOOBItparsDY/+V1oNMfZ+lA9XTZpIIyELTOWcfskyFSz 6j4IsEedjgbHIT8/tVbA6RyR5mRAxH8RML5uj5JEYDHnXRh64a8x21j1/thnjrbO13RT WW8kIt/6flDKlfKo1huPFkbMr3aGEssrncclO11N9z2I7CKbJB9zyJiQeKcQXHJW2BIT BavhyWAi2bBSqWAhZvsr1Tw025EK8wPYsMI7MjijBX6c4D3jca4mlUYIhsDYK7RgzwsL jDpMc9d63l9xq0quQTCK7tDRuUqE6DDKNa+kpIWxBBZIoDTnajrJH1V80FeMEXqukGdZ cDRg== X-Gm-Message-State: AKwxytfTOaSsPUVKHuerd6nt6sBnmy1ptLoQ0wXACwLJXhty1utZLzyT ISmS+3CG6DKuoQ48lBBCFwv67QPqjto= X-Received: by 10.99.140.18 with SMTP id m18mr13221786pgd.59.1516121167879; Tue, 16 Jan 2018 08:46:07 -0800 (PST) Received: from cloudburst.twiddle.net.com (24-181-135-57.dhcp.knwc.wa.charter.com. [24.181.135.57]) by smtp.gmail.com with ESMTPSA id y7sm3875780pfe.48.2018.01.16.08.46.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jan 2018 08:46:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 08:45:59 -0800 Message-Id: <20180116164600.7480-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180116164600.7480-1-richard.henderson@linaro.org> References: <20180116164600.7480-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::243 Subject: [Qemu-devel] [PULL v2 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 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. */