From patchwork Thu Feb 23 20:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656003 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp539410wrb; Thu, 23 Feb 2023 12:46:09 -0800 (PST) X-Google-Smtp-Source: AK7set8bPei2AhfhzDaN1v5sZs4fLylQm6EwEeoC+terQK40Mv2/2U5ALLvf7zq9CcOB4LQ0Lm+o X-Received: by 2002:a05:622a:174d:b0:3bd:16cf:2f37 with SMTP id l13-20020a05622a174d00b003bd16cf2f37mr23751813qtk.60.1677185169116; Thu, 23 Feb 2023 12:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677185169; cv=none; d=google.com; s=arc-20160816; b=Y9/a5caGtHsDfUzXYE7ucEn+lAtgM++22VfiKpWqLUc8L6lV5Hhjr1k7CUUiTw/eH5 jdU9OAU55GjNsAHtV0JDAgy/Isll8tAMt/Sjm+2M9mSwnltY7i/WFcgX8aH/XVC38Qw/ KZUK2MCuMolUIwVNxH778Qv86VPEsPcxVCD/7Zi1wF7pwGi+jAik5XmXkAaQ1ADNDg7q mlVm4Avs02jslQ/kSIKwVO8Y1CSzuTQiwlg4dqjbp3ZwLRQjXMoEdlX5VxOyXR/7KGUy TqqmcZBEYwf1wdAXqrbZy2dux0wTNmlQx+AYwml7gcrwWM86ydhSJIDQt+ueJg8Lm8bi 23aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1qnhwX4yflIrdAFP6huqsV3m6ZntpB/Nux3MPFDNhmI=; b=UveJa8JQ/LDWU5TTqwLnwY9ksJYKK7UCjWNlpgJOfnEP6fxFkBPVAyyxi7EvCgxov6 Zrz4s8wmRG08jRq1bBrLbDaOx2wU3z6g0WJmm6ifREnrAYuNaSVQMzwlbmmoKVI5wVJo IjFYXWHFb1l0t1vh2WAju9KLfF4yCQ7H+JjNLEsIKmr9s22RjFaDy/ed6qgsD75jLpGN +6d4otYppQ2mAkESmaJMUzEMPwq+oYoog3OLweZK39qlR11pTTLClHThSzCPjFtAeOmv 2L88b56LdE0uXc+FfkwzvCaXcz/jaa9dtTBicdekS10AN2peUykF1vDQnvYtNel4x3M5 MwTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e2+Z/XP3"; 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=pass (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 201-20020a3706d2000000b00742335f6e1esi5354735qkg.520.2023.02.23.12.46.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 12:46:09 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="e2+Z/XP3"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVIRk-0002tv-4Q; Thu, 23 Feb 2023 15:44:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVIRi-0002tB-8t for qemu-devel@nongnu.org; Thu, 23 Feb 2023 15:44:06 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVIRg-0007To-Hi for qemu-devel@nongnu.org; Thu, 23 Feb 2023 15:44:05 -0500 Received: by mail-pl1-x632.google.com with SMTP id l15so15653875pls.1 for ; Thu, 23 Feb 2023 12:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1qnhwX4yflIrdAFP6huqsV3m6ZntpB/Nux3MPFDNhmI=; b=e2+Z/XP3GFTAF/aOVg0WIAh+mexIOmxR6DFmL8nqNwpeOGXlbSdc7YSTz8r4M7ToI8 ZWDtc1zQJExswHP5rn0tEKWJBLfpVX0st6uTYnqRiurhfkRgtU++7BVbpEpG5w+3kR88 d99YdhT7AyYfTCdO6XlS1vSV91l/1HUa9jGThgEFxudiIL8FHk59+hxMqJya3DSFuuv6 98JBCWpnq/ZAxFb5UQtEhI8tieMs+jJBh5RgzQYyqFEox4KwYXP+IcZF+M4VDwH0eZ7E 6oBHiVKRuGVo/n8x526VnCe6Jqx1C/WDWOsjx4C9PW11P9c2mI9sK1XDHMME22Y4O6tL GPUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1qnhwX4yflIrdAFP6huqsV3m6ZntpB/Nux3MPFDNhmI=; b=hRZoomptDmLGdVviNHt9PaW60lKcmGz5GZBEYiR62l9wlnqTGNjSOp+YnKsr9oxFF1 uFaWS2w7eAWjHfDQpCNEVq2jtpiTHz/6V6HN9V9t/onKjOtyW1/TxMdFKhNWGpxlkLgW LAwOmD97277Yck1wtx0gWGb4FeFuR3Y0NJaqeeoB2ENDfcKJ7aAD285P0KurCehZ1GdG EcaC4pKdxHz6o5sgax5AQBNmPAW799Z2ebMd/hczoG6bPO3K93fcFP8Ibu41d+c5dX/v HFeSx7suiLsuxkQ3dccDusFNrdt5QK9mS2gUPbmXkbAP1Ux/Zf7zxbCfU1Bg8848aq1m ATuA== X-Gm-Message-State: AO0yUKUA4M4JIwxta5LL6KKKN0Wziq7RdTNcztMUWA84mGm1LReXa6HU hppLHFjiVZVRQKUIo7zKwaydq54EuwgQhyZtx7g= X-Received: by 2002:a05:6a20:ba9e:b0:c0:c9b8:56 with SMTP id fb30-20020a056a20ba9e00b000c0c9b80056mr4821871pzb.29.1677185043203; Thu, 23 Feb 2023 12:44:03 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id e187-20020a6369c4000000b004b1fef0bf16sm5992850pgc.73.2023.02.23.12.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 12:44:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 10/13] accel/tcg: Add tlb_fill_flags to CPUTLBEntryFull Date: Thu, 23 Feb 2023 10:43:39 -1000 Message-Id: <20230223204342.1093632-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230223204342.1093632-1-richard.henderson@linaro.org> References: <20230223204342.1093632-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Allow the target to set tlb flags to apply to all of the comparators. Remove MemTxAttrs.byte_swap, as the bit is not relevant to memory transactions, only the page mapping. Adjust target/sparc to set TLB_BSWAP directly. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/cpu-defs.h | 3 +++ include/exec/memattrs.h | 2 -- accel/tcg/cputlb.c | 5 +---- target/sparc/mmu_helper.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index ef10c625d4..53743ff3f2 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -170,6 +170,9 @@ typedef struct CPUTLBEntryFull { /* @lg_page_size contains the log2 of the page size. */ uint8_t lg_page_size; + /* Additional tlb flags requested by tlb_fill. */ + uint8_t tlb_fill_flags; + /* * Additional tlb flags for use by the slow path. If non-zero, * the corresponding CPUTLBEntry comparator must have TLB_FORCE_SLOW. diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 1bd7b6c5ca..5300649c8c 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -45,8 +45,6 @@ typedef struct MemTxAttrs { unsigned int memory:1; /* Requester ID (for MSI for example) */ unsigned int requester_id:16; - /* Invert endianness for this page */ - unsigned int byte_swap:1; } MemTxAttrs; /* Bus masters which don't specify any attributes will get this, diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index cc98df9517..a90688ac30 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1168,14 +1168,11 @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx, " prot=%x idx=%d\n", vaddr, full->phys_addr, prot, mmu_idx); - read_flags = 0; + read_flags = full->tlb_fill_flags; if (full->lg_page_size < TARGET_PAGE_BITS) { /* Repeat the MMU check and TLB fill on every access. */ read_flags |= TLB_INVALID_MASK; } - if (full->attrs.byte_swap) { - read_flags |= TLB_BSWAP; - } is_ram = memory_region_is_ram(section->mr); is_romd = memory_region_is_romd(section->mr); diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index a98dd0abd4..fa58b4dc03 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -580,7 +580,7 @@ static int get_physical_address_data(CPUSPARCState *env, CPUTLBEntryFull *full, int do_fault = 0; if (TTE_IS_IE(env->dtlb[i].tte)) { - full->attrs.byte_swap = true; + full->tlb_fill_flags |= TLB_BSWAP; } /* access ok? */