From patchwork Tue Jul 20 23:26:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 481696 Delivered-To: patch@linaro.org Received: by 2002:a17:907:d92:0:0:0:0 with SMTP id go18csp6018601ejc; Tue, 20 Jul 2021 16:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEMtq2668XHi+F/f+lvGwLTfWrdREmazmNAgUO+U1EwFBNyV7gifQIQ1uBzj5xgTPJoDZJ X-Received: by 2002:a25:8441:: with SMTP id r1mr35414797ybm.468.1626825073824; Tue, 20 Jul 2021 16:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626825073; cv=none; d=google.com; s=arc-20160816; b=ZaZ7MHoy7ari7l7CAquSkuSpGVUCphb4j5nlZGAhyGlT73/vw+jN4A3m2uVNuKdGr4 hrh6SDghZ1etCFtUSgj+3EvUl0tUZWQRlPXe8DVKtiY6drI9rf/6FsOVkR7/akcx++rG csZz4qnZyfM1EPfIjEcaq7cMuC2YUuJWM0jsyRmqe3AbGk5oO+Kg3o6AGs9roaKMHFz2 7KBc91rpIbLGO9atGP9mKr1BXpy5AqBfIZGf3tfNyoTWlpoItyP/q6OrPNYCJGfM+QZx 6alwi7ZtzQTOUaSF3BHz7Db5Zxxxe54cl5dOk41+tHPMza760v5BCgnI0TyThebfGnA4 FyRQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ie+/p3TrTh/Nerm8Urh8vvJTzslzpin/JxtRrKzIVBI=; b=kkdWUBElf9rYK8VlTt7bRyirkOnFImGs7zybuPYmpr4uLLzAp9Qg5xtt44lLa2+CzK t10HGXQLoSpsUm4LKQEVJe2/ZdVlceGRbtmPxQDEAt+ERzBUuS84ZBPxmhU9fLHsHeMW nQCqHtmQ45wXRi1mxXjSD1I1481fycGgc3cf591u6+3+a5w31YfVH1PYvvXFm0KqTSN4 exb3r+djMEELXxuI6bFFVO/IFg0ST8Age+XvZEORn7hp6KstqBnXdyN/+LNaq6SZcUaj Xy1RP4Dw5Dy4BQkTnzgdTwPgS0ymX8P+lhEqgZ+pEoDUpTuHGosaAIsdPLc7dr0HTPTW aOMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qUmeyKi2; 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 w202si21173084ybg.296.2021.07.20.16.51.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jul 2021 16:51:13 -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=qUmeyKi2; 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]:40688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5zW5-0002gT-5y for patch@linaro.org; Tue, 20 Jul 2021 19:51:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5zG0-0004Ri-9G for qemu-devel@nongnu.org; Tue, 20 Jul 2021 19:34:36 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:50938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5zFy-0001jE-Le for qemu-devel@nongnu.org; Tue, 20 Jul 2021 19:34:36 -0400 Received: by mail-wm1-x329.google.com with SMTP id l6so323060wmq.0 for ; Tue, 20 Jul 2021 16:34:34 -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 :mime-version:content-transfer-encoding; bh=Ie+/p3TrTh/Nerm8Urh8vvJTzslzpin/JxtRrKzIVBI=; b=qUmeyKi2/gAEM2FRnwFeTVVYgOsqCqq30FH60NmD/iwIGf8n0KozaY3YnPORIaUjOt UmsRNIRdguEY4LXYDfwxQIzlD3ZCshavfJpH8P5KjkpIO/TL1eBykmBql8/GiswVmF7N /oyNxlZyv9pmfz8v+78SS75AGwRm9EPF3QoXJyIZn5nyrVSe/WPr3BaRIF/R0pOBi1yf lj5RDCqIyqe7mUqJCk9Un5IHAIDLoedI5+1A+7/Q02ju5HUQFFhkVGLWHukHkjCBjgJG TMcsYFLkeTQkahwHAvhcRJkP7NpnVpmLB8M/vxn2w2ADlyisREI6myzes8W0ZBC9skY5 S1ng== 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:mime-version:content-transfer-encoding; bh=Ie+/p3TrTh/Nerm8Urh8vvJTzslzpin/JxtRrKzIVBI=; b=kmJ8bckH3aWmwPLQt3n48ecwg/YLkPI0z/RkiJmdxc05A5cdCN98Pb0Q4umbt78/Jq 1FzHZacbMZeAtcJTpCJtXqG0t2LxiH4aZD0paqCwOQHlUabPcMgz0oc7ABU5ZecmnJQA WJJoIFCA1etkWH97YvO6NeLJz9jQVWqsN554G0RDDEB67QEv+Cv2UM7/TdojxsDLKsyl H+3dDq8pa88XXszKpFDuuMuFIJ6wm/YAoHuoUy2k1k5E8KgKqgr0wqw43lCeIa8TjqlJ mbiIGiRddoD8IJQrtPponnoczofNAtwCF4HUPcT2GdKSPMgNAbUCdQofH2Qt6OEiWME9 Lcbg== X-Gm-Message-State: AOAM532CkBhgNzCmpWEEwn3DhyHhop4caliuSgZYsD0JYggx9M++divr ujL+gGvQdmTeGmire4JwolzAQQ== X-Received: by 2002:a05:600c:4656:: with SMTP id n22mr29489656wmo.37.1626824073271; Tue, 20 Jul 2021 16:34:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p12sm3704822wma.19.2021.07.20.16.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 16:34:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 158711FFAE; Wed, 21 Jul 2021 00:27:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 24/29] plugins: Fix physical address calculation for IO regions Date: Wed, 21 Jul 2021 00:26:58 +0100 Message-Id: <20210720232703.10650-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.32.0.264.g75ae10bc75 In-Reply-To: <20210720232703.10650-1-alex.bennee@linaro.org> References: <20210720232703.10650-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Aaron Lindsay , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, Mahmoud Mandour , Alexandre Iooss , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Aaron Lindsay The address calculation for IO regions introduced by commit 787148bf928a54b5cc86f5b434f9399e9737679c Author: Aaron Lindsay plugins: Expose physical addresses instead of device offsets is not always accurate. Use the more correct MemoryRegionSection.offset_within_address_space. Signed-off-by: Aaron Lindsay Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210720195735.3934473-1-aaron@os.amperecomputing.com> Signed-off-by: Alex Bennée --- plugins/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0.264.g75ae10bc75 diff --git a/plugins/api.c b/plugins/api.c index 78b563c5c5..2d521e6ba8 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -319,7 +319,7 @@ uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) return block->offset + offset + block->mr->addr; } else { MemoryRegionSection *mrs = haddr->v.io.section; - return haddr->v.io.offset + mrs->mr->addr; + return mrs->offset_within_address_space + haddr->v.io.offset; } } #endif