From patchwork Sat Apr 17 10:30:17 2021 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: 1467477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qwtuGwtN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FMqBC0w2Mz9vGZ for ; Sat, 17 Apr 2021 20:31:31 +1000 (AEST) Received: from localhost ([::1]:46782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXiEa-0001HD-Md for incoming@patchwork.ozlabs.org; Sat, 17 Apr 2021 06:31:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXiDj-0001Gu-K2; Sat, 17 Apr 2021 06:30:35 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXiDh-0000fF-Pu; Sat, 17 Apr 2021 06:30:35 -0400 Received: by mail-wr1-x42e.google.com with SMTP id r7so17019985wrm.1; Sat, 17 Apr 2021 03:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RQcCnrkki2wULF0Ux+64ovXIK00r70LiEXiOjNlziVQ=; b=qwtuGwtNQyip9L2Z9LS33y0TYKmZcKyPKRpe/xXnCkLbBlu51+0HfSrWdMvotw+uAC abY87EALdyAOMRzSsGovYbhPEmrDuNfCV5tBhg4/rsvVQSZGBPWgN4A2jkbGL99+NqtC AbmK1gqpPTER+NFjDrz0YealRi+oqnAO6IaYmjgUf+45TJ1+n+gwqbXC/QA8pb/zT/HN 8C4kOkweoseKHOyAGjCyXdWLhBRCVd2UUP/6kXmJB3yHvsql8ubpKsfr4fwrd/W6DV5O 7qv2hIk2+eD7je4YgqB+v0cS9bTO3h9tDDdHWakOo5c/dhK10kdPbd+F9ny33fUoYI7U 8ijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=RQcCnrkki2wULF0Ux+64ovXIK00r70LiEXiOjNlziVQ=; b=YLfNEJzBue+o4S7Ukr42NJonB5m81xnM3teq4RmytVA+siFIJA6/oGODqNWHqdpqCs 1XNe+Cp7m80YcUbqG1wtvU/r8fFlSivdVW9BrwjiPWurSFBtHzCpqpxcNMdBvQ4fPfU7 HkkgWYbyTWlD1SqB1odpMYvTKuXD76EweQFqzejD22ZYigg+YcDQZq5ywJEpphjalun7 +wyf0t8FH0YCjjkA95h03lRgGn6QU18KpcyU6cJGVwLriCo9ccoNFR7rApdaS+ws1JyK fFeKIzpyKlsWV43IeDdJSGxThV4EstGrX0uLcskwSaIi2CemSD9i6I3wqzngvuLpjNwX l8IQ== X-Gm-Message-State: AOAM532GNixh/kuU4xwVES23c1H+NKZ03dtl9YNfyUSRlXBIKFecfnGM oUkTrtggJ4VoluOTfcCyKAbOD0HRhU0= X-Google-Smtp-Source: ABdhPJztc63fVTmn6hopGjfY/8QTl0gl/REHUF7xfc2kzPfLkCXaPIe0l5/27DXI6IOTryuTjyAThw== X-Received: by 2002:a05:6000:1449:: with SMTP id v9mr3744346wrx.295.1618655431257; Sat, 17 Apr 2021 03:30:31 -0700 (PDT) Received: from localhost.localdomain (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id 200sm12554254wmb.1.2021.04.17.03.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 03:30:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 00/11] memory: Forbid mapping AddressSpace root MemoryRegion Date: Sat, 17 Apr 2021 12:30:17 +0200 Message-Id: <20210417103028.601124-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Peter Xu , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hi, This series is the result of a long thread with Peter: https://www.mail-archive.com/qemu-devel@nongnu.org/msg788366.html and IRC chats... AddressSpace are physical address view and shouldn't be using non-zero base address. The correct way to map a MR used as AS root is to use a MR alias. Fix the current incorrect uses, then forbid further use. Since v1: - Split the Raven patch in multiple changes, easier to follow/review (https://www.mail-archive.com/qemu-devel@nongnu.org/msg791116.html) Note, the Aspeed patches are already queued in Cédric tree. I had to cherry-pick them from his tree to have the series pass CI. Cédric Le Goater (1): hw/aspeed/smc: Use the RAM memory region for DMAs Peter Xu (1): memory: Make sure root MR won't be added as subregion Philippe Mathieu-Daudé (9): hw/arm/aspeed: Do not directly map ram container onto main address bus hw/arm/aspeed: Do not sysbus-map mmio flash region directly, use alias hw/pci-host: Rename Raven ASIC PCI bridge as raven.c hw/pci-host/raven: Add PCI_IO_BASE_ADDR definition hw/pci-host/raven: Assert PCI I/O AddressSpace is based at 0x80000000 hw/pci-host/raven: Use MR alias for AS root, not sysbus mapped MR hw/pci-host/raven: Remove pointless alias mapping onto system bus hw/pci-host/prep: Do not directly map bus-master region onto main bus hw/pci-host/raven: Remove temporary assertion 'root MR is zero-based' include/exec/memory.h | 1 + include/hw/ssi/aspeed_smc.h | 1 + hw/arm/aspeed.c | 8 ++++++-- hw/pci-host/{prep.c => raven.c} | 19 ++++++++++--------- hw/ssi/aspeed_smc.c | 10 +++++----- softmmu/memory.c | 2 ++ MAINTAINERS | 2 +- hw/pci-host/Kconfig | 2 +- hw/pci-host/meson.build | 2 +- hw/ppc/Kconfig | 2 +- 10 files changed, 29 insertions(+), 20 deletions(-) rename hw/pci-host/{prep.c => raven.c} (96%)