From patchwork Tue Sep 3 16:08:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172855 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp95334ily; Tue, 3 Sep 2019 09:40:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyy7bze9g1yC7cUEEMBd7Cimu99FCFgQf84Vpx3By0EIlHel284a+TY+56kfb5VsGFdYEsb X-Received: by 2002:a05:6214:1808:: with SMTP id o8mr10390683qvw.118.1567528834725; Tue, 03 Sep 2019 09:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567528834; cv=none; d=google.com; s=arc-20160816; b=dT6z14F2nWz93soj2KagrkFgdu0IsQ2cy2zXSR+BYSaQCj/xXB8n1yoxXT+3UsGTnh 6kLrxrSkZLaTHDgc8J3FQqXdcTebAQRUaBPdggH1qJ9BAg4/CUxMp3MYEUxRdchFlCau VaX3OynNVxhm21J6AQljBpSfWanEfd4K3OzeTaCMnvtVVNDzptP4KQSsYMJygjYfWs8i C70e2qXoBsHJlkZ7dF0Egijeos5adG9J3hw8e0HP22E8TVl7Mgu/UDsX+KzWiu3EALpt xAEa7u8gCLwF/1aVJSfpsokuPhwk4oJsnjZ6VkzQJxWXLQm487CXvn9EMzNcRtuavVDr SoDw== 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; bh=LJRcqdYb3KvBP4qjKS/2RBPcCRmkfX7I427R88Z1k+U=; b=EahWFWBnbExsIZkKDOtV3ccgAOKVYKhhFc1ociG3txPQuz+KSDAScyKFzRWAORxSMq 7XHlQaQwZKkIyrZG/KjfA5003MLnk5DkB7pXNiGp95HbMy+JvX+8VlavwDtoQleOaK4o AOOqRgGyXVrv5iZT0ku1RSDNziPmbTsLse4IbDnj/sGHuIKwncm3VuaSvapVUqxvVH0g 2zza6dYt5NGNh4lmhqZfbkFMBwTKjp0oK++dIExCf5jiaiXzCybCueZtE7UoQ9Wmy1/U MVhM5U669qBDmv0jmjbL8XekR9YfxRVMqUMLT74CyXZ9+G+9WoqQWEyf4aWrQ65qsJPu WQAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OeTCn8CP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id 26si11602182qvt.162.2019.09.03.09.40.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 09:40:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OeTCn8CP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:49134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Br8-0001DA-5h for patch@linaro.org; Tue, 03 Sep 2019 12:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37294) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BN1-0001Kx-4v for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5BMz-0003qe-S6 for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:26 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:38771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5BMz-0003pp-MQ for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:25 -0400 Received: by mail-pl1-x644.google.com with SMTP id w11so8120771plp.5 for ; Tue, 03 Sep 2019 09:09:25 -0700 (PDT) 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=LJRcqdYb3KvBP4qjKS/2RBPcCRmkfX7I427R88Z1k+U=; b=OeTCn8CPM3vXPBjvPE1+xu4yY6r0/bx/cms433UMqVJqebzYSoE8HG2ohsG7F5L+ew y1NAON3+ur98J99dhvWMBQ6M+g/mIIZD8Tu1bXfe7d4jp0zfdMNhwZPey0IW4py1Pa00 QRjiPwLgnc7Wc5cZtcXT6drU1gUSMyTLfxDU/iJnvNS7LGqB7t+ccRKRZfW5YnqWQPIt 9tc6FqckkgpVwSqS1CwHrzvKU2gaEEoV3vzT8AxiTmW6LwUKBpPLNdYiaYMxe4tPWijU fpRi87FF5yXvln0tdkbYeq180c6MZECi70KnEyvS/nPm13gKph1KgVVhpFREoiSZ2KAC FcXg== 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=LJRcqdYb3KvBP4qjKS/2RBPcCRmkfX7I427R88Z1k+U=; b=CRmOUGzgzmOxglocEtM+kEUgYPk/KYVwSZ9WtM7mrSAG7Aa0EVRV8ytZru9J5ovzY2 pBfSqHcqy4SIOATX1qiBq+2VhoQcKEAj+5Aduh346bL35W7jMcQQuVsQ9v41v3aJlo1W JyMeq7FfDJeyzJzXKOMLdFF1VtG/0G6uH3r5aHhkqAgKKUKi5C0awwHQl2J0lHdWFu13 0pimYdMRnvab/jhCKkDHFjEo967mpJOijx9+pEkm0wEF/EcxTzMissD3x8pfb8swt590 TDa7MsQpRKzQPDOwT0aGcRyfVJLS8kgJFjaMOeogm9ZP8GOqRu88BJNViEkmjY7+avpN sRGQ== X-Gm-Message-State: APjAAAXJ9eB4GSwpMiUse2r9n0JJkLk+ehy22hHWuZ4yxfOYTEcxY2ya clgE3/BoHxryfWpNcVVx3Qx2B+eGYCQ= X-Received: by 2002:a17:902:441:: with SMTP id 59mr36800764ple.62.1567526964476; Tue, 03 Sep 2019 09:09:24 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 127sm28089711pfy.56.2019.09.03.09.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:09:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2019 09:08:41 -0700 Message-Id: <20190903160858.5296-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903160858.5296-1-richard.henderson@linaro.org> References: <20190903160858.5296-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH 19/36] target/sparc: sun4u Invert Endian TTE bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Tony Nguyen Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Tony Nguyen This bit configures endianness of PCI MMIO devices. It is used by Solaris and OpenBSD sunhme drivers. Tested working on OpenBSD. Unfortunately Solaris 10 had a unrelated keyboard issue blocking testing... another inch towards Solaris 10 on SPARC64 =) Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Tested-by: Mark Cave-Ayland Message-Id: <3c8d5181a584f1b3712d3d8d66801b13cecb4b88.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 2 ++ target/sparc/mmu_helper.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 694d7139cf..490e14dfcf 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -275,6 +275,7 @@ enum { #define TTE_VALID_BIT (1ULL << 63) #define TTE_NFO_BIT (1ULL << 60) +#define TTE_IE_BIT (1ULL << 59) #define TTE_USED_BIT (1ULL << 41) #define TTE_LOCKED_BIT (1ULL << 6) #define TTE_SIDEEFFECT_BIT (1ULL << 3) @@ -291,6 +292,7 @@ enum { #define TTE_IS_VALID(tte) ((tte) & TTE_VALID_BIT) #define TTE_IS_NFO(tte) ((tte) & TTE_NFO_BIT) +#define TTE_IS_IE(tte) ((tte) & TTE_IE_BIT) #define TTE_IS_USED(tte) ((tte) & TTE_USED_BIT) #define TTE_IS_LOCKED(tte) ((tte) & TTE_LOCKED_BIT) #define TTE_IS_SIDEEFFECT(tte) ((tte) & TTE_SIDEEFFECT_BIT) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 826e14b6f0..77dc86ac5c 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -537,6 +537,10 @@ static int get_physical_address_data(CPUSPARCState *env, hwaddr *physical, if (ultrasparc_tag_match(&env->dtlb[i], address, context, physical)) { int do_fault = 0; + if (TTE_IS_IE(env->dtlb[i].tte)) { + attrs->byte_swap = true; + } + /* access ok? */ /* multiple bits in SFSR.FT may be set on TT_DFAULT */ if (TTE_IS_PRIV(env->dtlb[i].tte) && is_user) { @@ -792,7 +796,7 @@ void dump_mmu(CPUSPARCState *env) } if (TTE_IS_VALID(env->dtlb[i].tte)) { qemu_printf("[%02u] VA: %" PRIx64 ", PA: %llx" - ", %s, %s, %s, %s, ctx %" PRId64 " %s\n", + ", %s, %s, %s, %s, ie %s, ctx %" PRId64 " %s\n", i, env->dtlb[i].tag & (uint64_t)~0x1fffULL, TTE_PA(env->dtlb[i].tte), @@ -801,6 +805,8 @@ void dump_mmu(CPUSPARCState *env) TTE_IS_W_OK(env->dtlb[i].tte) ? "RW" : "RO", TTE_IS_LOCKED(env->dtlb[i].tte) ? "locked" : "unlocked", + TTE_IS_IE(env->dtlb[i].tte) ? + "yes" : "no", env->dtlb[i].tag & (uint64_t)0x1fffULL, TTE_IS_GLOBAL(env->dtlb[i].tte) ? "global" : "local");