From patchwork Sat Sep 16 03:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 723570 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp710301wro; Fri, 15 Sep 2023 20:38:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQ8s4T8HX0rXEMapO4RgzHAgOxvqb5aS1dKowTiqCgf/pMJ8XrpM9Swjm5daHh2aFriLve X-Received: by 2002:ac8:5c91:0:b0:417:8db2:f5f8 with SMTP id r17-20020ac85c91000000b004178db2f5f8mr4000680qta.17.1694835506652; Fri, 15 Sep 2023 20:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694835506; cv=none; d=google.com; s=arc-20160816; b=eCUk4HYu7p58AB6wXR58AkvU+irdj41sIZMCzo/jDR6UDuXnnaRyckM/nhRZ30Tai3 P1pFTkAPJZqZQ4BbM4awOzG3emtYkt73ozZPq77s7XwbWIHVdVCjkqIoeyGYqMMLOps5 AHOpsSwz0cKMrv6T6IZ3WZ87AjWYfqxMeFIn2D65Vyfklro3APAyH8jx9Tlg6K5jCQ38 W0X8OLt56/s1kKhft1kF0sCICyGt92oMwzwWzbpmojmO+NmKrhnedgiXTp/jbWi/I+Oo 84V70k7DlCejCLPAI4eH0fvhaAoXxIPaeWv9gSwWM7LeyBmjoq9L9pEvdPTzyebyF3A+ +/5Q== 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=YfL9tsiO63q76WeotUMTf97+/PGlHSdV7QTLkU9d9lQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=dUl2uQwYcHgdTjPkZ8oiyzW2F1j5YxBhCx2FcLUOBIWEyJO5BmPonRu3THjb/FUa0i WNU554tkrlKIGgMq1PY23F2ryBzH55nW9ETGnPaB08CftLjoQmlYm/rzl+HVxsPns38p 8iZIc0mLifpNWm4AyTrFz042YHeBJmSy6OhI7bzDv73Tu9b+AaKMIkhexa4xhUZuETMw 1DDqO0yLeaOVrdyE0r4tsLtUWSSiyi+VPSoEUpW7wZPiJHvHMyH0UlVw5oSW9ZAdtAfy WzxJefW3H4HI2RTYnRJRNebqKy5acZFLfSxN/2I7drogMw/e16bVWPkDh83YXfi7/y+F aqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ppFVV7Kh; 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 tp11-20020a05620a3c8b00b0076db7d32da0si3027295qkn.100.2023.09.15.20.38.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2023 20:38:26 -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=pass header.i=@linaro.org header.s=google header.b=ppFVV7Kh; 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 1qhM15-000646-7R; Fri, 15 Sep 2023 23:30:43 -0400 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 1qhM12-00062t-6I for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:40 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhM10-00084E-II for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:39 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68bed2c786eso2611285b3a.0 for ; Fri, 15 Sep 2023 20:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694835037; x=1695439837; darn=nongnu.org; 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=YfL9tsiO63q76WeotUMTf97+/PGlHSdV7QTLkU9d9lQ=; b=ppFVV7KhBaNqSSWD7p0oqv+MWOn/kbtW4EffH7bcRNMjcfGtLHHFECu8ZQo6Cdq0yI dXXlXVa6zZ+LYdMF7qAvM54H+7bjKGTPe9ek8jrwdEYkOVMmLK+6MrTUQYha26xjj2OT 3L5BSnhRHx6aSNkyUlFJBRmsuGulSZLEA2ZhULYmnL0Sz8y8K6schbbcaPfCjQxTsjck IwKp0AG8UJQ2vRDSph9CpCeuJSDc5b2fSWqn/9XWHPq750iOn1VfnJ9cua7W8DKdosDa I91ZO/qJEY53o+bRzMggfe96W63uVchrwsPCgxYE6zm596FNLw/lcF8VrolqeAHTRxhN xbiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694835037; x=1695439837; 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=YfL9tsiO63q76WeotUMTf97+/PGlHSdV7QTLkU9d9lQ=; b=f/Vp2XCsjkLrqcYDH1EcRG+G4OzVSBscxV9rujkAcj0a0n7SS4GtgVj6Vx3Xp5g/29 3y7iKVY7Io8fZb1iLbpry9MN4MTeQQkM/RBynVK3EwR1LLobuwl56QFTC6zCvsjttihF LUHReMIwZiJtX9HpBS7vQY7OeaetRRfxbNFJKS+z5UlewUttcZjokKFLuexGzuIGxbT8 qCwthD1cu8Wmn/OHGd+T7Rqpj4A45/hOCVUIN8klEtCsJSNjwGl8AKSGpgYaj0t3TZW8 OQJwcRHk5ocrHh5nkraJ0/ajMhfHf0oS53601E6qaT/7EvuKWK76uRb7ULla7RiSvjeD C/Gw== X-Gm-Message-State: AOJu0Yx8CX0GDXGtfI8UNEfjpIZDGe1jOBZGV3FJMpm8u4Z13iJYwIXt 7T10zE7H0A+u2CYqAD228HS4AcDPRVImJH9TrL4= X-Received: by 2002:a05:6a00:2484:b0:68c:70f:ee3f with SMTP id c4-20020a056a00248400b0068c070fee3fmr4258627pfv.13.1694835037199; Fri, 15 Sep 2023 20:30:37 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id j26-20020aa783da000000b00687a4b70d1esm3577320pfn.218.2023.09.15.20.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 20:30:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 26/39] accel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed Date: Fri, 15 Sep 2023 20:29:58 -0700 Message-Id: <20230916033011.479144-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916033011.479144-1-richard.henderson@linaro.org> References: <20230916033011.479144-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 Since the introduction of CPUTLBEntryFull, we can recover the full cpu address space physical address without having to examine the MemoryRegionSection. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index ae4ad591fe..a46be6a120 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1388,13 +1388,9 @@ io_prepare(hwaddr *out_offset, CPUArchState *env, hwaddr xlat, static void io_failed(CPUArchState *env, CPUTLBEntryFull *full, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, - MemTxResult response, uintptr_t retaddr, - MemoryRegionSection *section, hwaddr mr_offset) + MemTxResult response, uintptr_t retaddr) { - hwaddr physaddr = (mr_offset + - section->offset_within_address_space - - section->offset_within_region); - + hwaddr physaddr = full->phys_addr | (addr & ~TARGET_PAGE_MASK); cpu_transaction_failed(env_cpu(env), physaddr, addr, size, access_type, mmu_idx, full->attrs, response, retaddr); } @@ -1420,7 +1416,7 @@ static uint64_t io_readx(CPUArchState *env, CPUTLBEntryFull *full, if (r != MEMTX_OK) { io_failed(env, full, addr, memop_size(op), access_type, mmu_idx, - r, retaddr, section, mr_offset); + r, retaddr); } return val; } @@ -1445,7 +1441,7 @@ static void io_writex(CPUArchState *env, CPUTLBEntryFull *full, if (r != MEMTX_OK) { io_failed(env, full, addr, memop_size(op), MMU_DATA_STORE, mmu_idx, - r, retaddr, section, mr_offset); + r, retaddr); } }