From patchwork Wed Jan 4 13:39:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 639037 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1749332pvb; Wed, 4 Jan 2023 05:42:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXvNrW196REPF9lC1bNguU4iP1ZoLarCemKko6w/NqOhEizc165z70rbAe/k2rctnMBNIaXe X-Received: by 2002:a0c:ec10:0:b0:531:c3b8:fdbc with SMTP id y16-20020a0cec10000000b00531c3b8fdbcmr18233072qvo.43.1672839724999; Wed, 04 Jan 2023 05:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672839724; cv=none; d=google.com; s=arc-20160816; b=qGCvafjKcUql9ILxTwpfYwTsYoZDHfrGibUQ/FpAuPvE4xHZSN+bSrBHYpN8/OW4oL /HbIOK8mTFK5/0y73o7FqLbexVXn3MqLjldidJGb1SV9FQRu1iRmG7XHn+ZLGA1Vai6S vdPFE7xc5lWYbOhi4HufwBNLj2/Tu4sxMwjpnpJ5zVhRaU9fI+PgIOWrZmGdocsEA+C2 O8sJ/nIE2h0yR6vZS4wAScvJHIQGxLQw4Fn7xhurXkBCYfQBFNNLfUPqq3D5XV/wV7gs Wt3LcNhg1su3DtBwrblFvcYB0DL1TFeY0uk7s4sJp0eCE6V0jvYGfc0v4xksXpLIB3Y3 patw== 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=P/Y2LlHycAcX9mSOeT6G6dar2QR0XkVS2EXSvJD6ZwQ=; b=HHX0sQqWJXWW61CZ6HmMjEeeujZrHx9JY4D9NNu5iRJ2592+U2JzHwX9ZL7xqUOuho dwS4T6JWgK7DcLWI+83SM9diNFaWTnDLkDJLOso6YrFSbEDMQLfLAz1mPyq9ESyJGHsI DPWxORQRfN3exb1B/YgAT90OOX6HAEOtDWwkVCb6WI4ZmvzIcgH/eAiGsRkUEPDZyckK GayWHYdMlWuOuzGR0u9DSocuSSrjFYUCCIYcx6ocorBGD4jId3xb1QeiaQHI4FwiygVG Srrf9FtgcLfz+GQR23NhCV0QW9nfsQA814/90r7dA6GQmPZJdP5GjuEdUMtEQV2PDMWm D1bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U1YvcaiE; 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 eq4-20020ad45964000000b004c6a0939a4dsi16886105qvb.57.2023.01.04.05.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2023 05:42:04 -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=U1YvcaiE; 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 1pD400-0003il-Uv; Wed, 04 Jan 2023 08:40: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 1pD3zy-0003hj-Ig for qemu-devel@nongnu.org; Wed, 04 Jan 2023 08:40:06 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pD3zw-0001bk-HH for qemu-devel@nongnu.org; Wed, 04 Jan 2023 08:40:06 -0500 Received: by mail-wr1-x433.google.com with SMTP id t15so24112532wro.9 for ; Wed, 04 Jan 2023 05:39:59 -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=P/Y2LlHycAcX9mSOeT6G6dar2QR0XkVS2EXSvJD6ZwQ=; b=U1YvcaiEVIzLO++FM31iBtpHiiFt3u5zsOUbwAsW70AmXtWSbjhYhpgdTjnBReYoDO Fz8m6xY9x0Hz21ozXffWhUnA5yxhqnQSRObom3LBSthNXCi3En9+2Yv6q2ZKe6YY/fT0 a/AUUzh7cPXDI//BQ5TaIXTGzSIeNv0UKa6yqoRfotR3JOw+7GTY3Qc34T7Og5l1bQN/ AhYkBdB5R5ph2QJ8eFkGuUfXu38sFJQ99VWZLpT6efhhBeTcUqYNhX+rKK44wA1XRXl2 TrSZwnwFW7/6mNGEQZk1rfpajtgjyV5WUuYymOn7IEWe07K0K/nGqWNA9JxMYzBNwlzW 3HdA== 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=P/Y2LlHycAcX9mSOeT6G6dar2QR0XkVS2EXSvJD6ZwQ=; b=svBuxS1HxcyVTP4ADLyj7mK7qZOOd4jDZ4QjLvbtV+PTpA25aPzTOg+AyXa7sk8lun 24myOGI3O8wdDsVaCPCc0TYgk9JDickRv559+iLyE9lHtgaNljkdU7dhFUM8vFXevq80 qSPRvh0pHE/AsvnWB9wj/ZvUQkKHPdlWTydB3vUAF9VJ1iaybtpPMexkR2sad9YUSTwA 87TZ6yKStFalqr8WmOw5yIls7+CMd8hv0c6DdlpNO+uWyVk8KTNWjwkmflpuo1EUysKB DXE6yESDgO1vA5BtEbhD9wjWHa7FqXEyH4cAxvgpAvlTHNVTb2aKukWq+9hhA4QdJitw T/vQ== X-Gm-Message-State: AFqh2koS1SNpXOFY/6p0t0Nq2CHxE+7ZVCu3A6DYRvxQcDkMkJ0opSCH 2aX/dG64VwWKSBrz2CBofokYS1CHjnKkgRYc X-Received: by 2002:adf:f54a:0:b0:242:2e1e:23a6 with SMTP id j10-20020adff54a000000b002422e1e23a6mr31180610wrp.22.1672839598729; Wed, 04 Jan 2023 05:39:58 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i23-20020adfaad7000000b002421ce6a275sm34401345wrc.114.2023.01.04.05.39.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Jan 2023 05:39:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Aurelien Jarno , Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/6] hw/mips/gt64xxx_pci: Accumulate address space changes Date: Wed, 4 Jan 2023 14:39:33 +0100 Message-Id: <20230104133935.4639-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104133935.4639-1-philmd@linaro.org> References: <20230104133935.4639-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Single registers access in ISD can produce multiple changes in the address spaces. To reduce computational effort, accumulate these as a single memory transaction. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 19d0d9889f..d84c2b7349 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -282,6 +282,8 @@ static void gt64120_isd_mapping(GT64120State *s) hwaddr start = ((hwaddr)s->regs[GT_ISD] << 21) & 0xFFFE00000ull; hwaddr length = 0x1000; + memory_region_transaction_begin(); + if (s->ISD_length) { memory_region_del_subregion(get_system_memory(), &s->ISD_mem); } @@ -292,10 +294,14 @@ static void gt64120_isd_mapping(GT64120State *s) s->ISD_start = start; s->ISD_length = length; memory_region_add_subregion(get_system_memory(), s->ISD_start, &s->ISD_mem); + + memory_region_transaction_commit(); } static void gt64120_pci_mapping(GT64120State *s) { + memory_region_transaction_begin(); + /* Update PCI0IO mapping */ if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD]) { /* Unmap old IO address */ @@ -354,6 +360,8 @@ static void gt64120_pci_mapping(GT64120State *s) &s->PCI0M1_mem); } } + + memory_region_transaction_commit(); } static int gt64120_post_load(void *opaque, int version_id)