From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j6Km8-0006Ce-Ei for mharc-qemu-trivial@gnu.org; Mon, 24 Feb 2020 15:56:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Km4-00063y-UM for qemu-trivial@nongnu.org; Mon, 24 Feb 2020 15:56:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Km2-0002xz-Io for qemu-trivial@nongnu.org; Mon, 24 Feb 2020 15:56:20 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:41402 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6Km2-0002wr-E1 for qemu-trivial@nongnu.org; Mon, 24 Feb 2020 15:56:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582577777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aBf1Nz3dO7lmnq6x8HgckUD4/9P7/UEzlUI+mgbV/5Q=; b=Z7IFn7uMULPt+eEx54eV8f1N9jpH0HtqbV/jXBGsuPXv2eqlqXjaJP/arRvd559dcfotUJ SpWvpQM4SwpnHK3GgYRe0Jo1RXXLlp4saq37BttCMSee1NnHQW9gHpDBr8kJ7uom03lYHk jKC4UKb5LHddmKs5AUnaSDXe6MXxLi8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-vv3vpfscMoS28J8ygPcnhA-1; Mon, 24 Feb 2020 15:56:15 -0500 X-MC-Unique: vv3vpfscMoS28J8ygPcnhA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E001B107ACC4; Mon, 24 Feb 2020 20:56:10 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-162.brq.redhat.com [10.40.205.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C390B5C883; Mon, 24 Feb 2020 20:55:52 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini , Peter Maydell Cc: Kevin Wolf , Alistair Francis , qemu-block@nongnu.org, Marcel Apfelbaum , Joel Stanley , qemu-ppc@nongnu.org, Alistair Francis , Sagar Karandikar , Magnus Damm , Aleksandar Markovic , Aleksandar Rikalo , Jason Wang , Igor Mitsyanko , Bastian Koppelmann , Laurent Vivier , Palmer Dabbelt , Peter Chubb , Max Reitz , Subbaraya Sundeep , KONRAD Frederic , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Andrzej Zaborowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-arm@nongnu.org, Aurelien Jarno , Michael Walle , Artyom Tarasenko , Eduardo Habkost , "Michael S. Tsirkin" , Richard Henderson , David Gibson , Jean-Christophe Dubois , "Edgar E. Iglesias" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Fabien Chouteau , qemu-trivial@nongnu.org Subject: [PATCH RESEND v2 01/32] memory: Correctly return alias region type Date: Mon, 24 Feb 2020 21:55:02 +0100 Message-Id: <20200224205533.23798-2-philmd@redhat.com> In-Reply-To: <20200224205533.23798-1-philmd@redhat.com> References: <20200224205533.23798-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 20:56:22 -0000 Since memory region aliases are neither rom nor ram, they are described as i/o, which is often incorrect. Return instead the type of the original region we are aliasing. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Cc: qemu-trivial@nongnu.org memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory.c b/memory.c index aeaa8dcc9e..ce1179874e 100644 --- a/memory.c +++ b/memory.c @@ -2818,6 +2818,9 @@ void address_space_destroy(AddressSpace *as) =20 static const char *memory_region_type(MemoryRegion *mr) { + if (mr->alias) { + return memory_region_type(mr->alias); + } if (memory_region_is_ram_device(mr)) { return "ramd"; } else if (memory_region_is_romd(mr)) { --=20 2.21.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:cb43:0:0:0:0:0 with SMTP id b64csp774135lfg; Mon, 24 Feb 2020 13:01:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzVkwMhzZsrNao3SowUngQnmX4sFzNBFCYiPduQH84MQXRUIyZsf6udao7P3y2JWfVCpyXH X-Received: by 2002:a0c:ac4e:: with SMTP id m14mr45497677qvb.37.1582578062143; Mon, 24 Feb 2020 13:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582578062; cv=none; d=google.com; s=arc-20160816; b=cEIpJ57wUWyaMLUhB/FaTZlIurr3k355xibp5gJCkPXoCiFQHihBRbT1TcfJcKxLyj 2hY10Y0OGr5cmEUCsv9N4SwxtdXnwNH5vlao09m6QvALL0onWP+Dmy+sUq+xI6x3oQUa 2fSPwk5S2X5ZlxGyu7/EF/tJrjrSAmTC4CPI/ujXP2Itpnv+S7rJGZZI0Et3Std4Ylng CvB7dbkW2zM49Os73JgrUkMzMWOaAmKAKsGyvV07dm+2rlfrif8CE4PmEShbhKVKEHh3 CqvnTPN/Uh91dE4qBR+vqtAPwFDY/Cb1ygoK8P2TqexKtw6nkGm4HJsS1RhQJnWUX6+i DPEQ== 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=aBf1Nz3dO7lmnq6x8HgckUD4/9P7/UEzlUI+mgbV/5Q=; b=k6kJkflbfmIyeb86kvcKXjzCH53OvhxM61mcqpU2JQ6nHamzFzlwsAciqGO0NGPTmC NlcWACZRBOBuCRRBSqQfjPJFhNJgTgF+iTyqbXu6NGK67kwGx8o3UsLi6U5op5YdB2nM yGv0MNo5YkUZPWvttDc3SySyM3Z3lW/gExr8msz5QE+JVaxKMi+vTcOz3MFWKLsPRlOW qGhHczMuXy0vrA1u5HloqpmwR4kztKpVAs3jjsk7mcItTO6q5JSkPOhQzJOBBx0Ztj+3 eQ4SQ6a4h+3MVt/YGy/I1Wzf+1TbYNu1YWLSG2wdcHNrmR8zbDPXmlEoujtAmls3jgon k3NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=Z7IFn7uM; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c8si6476958qtg.53.2020.02.24.13.01.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 13:01:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=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=@redhat.com header.s=mimecast20190719 header.b=Z7IFn7uM; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:43032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Kqb-0005KF-Dq for alex.bennee@linaro.org; Mon, 24 Feb 2020 16:01:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50187) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Km4-00063N-MG for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Km2-0002xu-KL for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:20 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:48018 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6Km2-0002wv-Dm for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582577777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aBf1Nz3dO7lmnq6x8HgckUD4/9P7/UEzlUI+mgbV/5Q=; b=Z7IFn7uMULPt+eEx54eV8f1N9jpH0HtqbV/jXBGsuPXv2eqlqXjaJP/arRvd559dcfotUJ SpWvpQM4SwpnHK3GgYRe0Jo1RXXLlp4saq37BttCMSee1NnHQW9gHpDBr8kJ7uom03lYHk jKC4UKb5LHddmKs5AUnaSDXe6MXxLi8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-vv3vpfscMoS28J8ygPcnhA-1; Mon, 24 Feb 2020 15:56:15 -0500 X-MC-Unique: vv3vpfscMoS28J8ygPcnhA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E001B107ACC4; Mon, 24 Feb 2020 20:56:10 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-162.brq.redhat.com [10.40.205.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C390B5C883; Mon, 24 Feb 2020 20:55:52 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini , Peter Maydell Subject: [PATCH RESEND v2 01/32] memory: Correctly return alias region type Date: Mon, 24 Feb 2020 21:55:02 +0100 Message-Id: <20200224205533.23798-2-philmd@redhat.com> In-Reply-To: <20200224205533.23798-1-philmd@redhat.com> References: <20200224205533.23798-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Sagar Karandikar , "Michael S. Tsirkin" , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , KONRAD Frederic , Alistair Francis , "Edgar E. Iglesias" , Subbaraya Sundeep , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Magnus Damm , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Joel Stanley , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , Jean-Christophe Dubois , Alistair Francis , Fabien Chouteau , qemu-arm@nongnu.org, Peter Chubb , Palmer Dabbelt , Richard Henderson , Kevin Wolf , qemu-riscv@nongnu.org, Igor Mitsyanko , Bastian Koppelmann , Laurent Vivier , Max Reitz , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: 38sZ89wdlojU Since memory region aliases are neither rom nor ram, they are described as i/o, which is often incorrect. Return instead the type of the original region we are aliasing. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Cc: qemu-trivial@nongnu.org memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory.c b/memory.c index aeaa8dcc9e..ce1179874e 100644 --- a/memory.c +++ b/memory.c @@ -2818,6 +2818,9 @@ void address_space_destroy(AddressSpace *as) =20 static const char *memory_region_type(MemoryRegion *mr) { + if (mr->alias) { + return memory_region_type(mr->alias); + } if (memory_region_is_ram_device(mr)) { return "ramd"; } else if (memory_region_is_romd(mr)) { --=20 2.21.1