Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1318AD44D5E for ; Wed, 6 Nov 2024 13:34:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8gB1-0001eM-4M; Wed, 06 Nov 2024 08:34:27 -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 1t8gAz-0001dj-Cp for qemu-riscv@nongnu.org; Wed, 06 Nov 2024 08:34:25 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8gAx-0001ZV-K4 for qemu-riscv@nongnu.org; Wed, 06 Nov 2024 08:34:24 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-71e8235f0b6so5841080b3a.3 for ; Wed, 06 Nov 2024 05:34:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1730900062; x=1731504862; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6bdbdz8vU0Bbihl18UjLAjwVvI21BGXXW+x8R30xk2M=; b=eDBbFTdxnflfsC6Yt4E3bXlm9gaAxsfQINXdRImj7x8472GCPwcqOpWHx3MpMc6ARk SfeasvRYTw83ZFCHOZw+jGcSCINPNDDVtkj3Sfoz/2ieRr22HtLWUmMEdB3+BEFQ5hPt 8Eyes+ep/X2o+Dsq769ipnpqYuIhnd/vYbcaBmvg+z9XyEV4R9KhC3Ik66HiHS9Sn7+P i9sDEJ0lZlUaG/itCHqQ8c4h3tPqaQIyvqEHlNrPisOmLc/qfr3M6D9uVFGsSTNfMYYD Whpo1oW6221KWtOGP+SWIfsspn+OqYL3wpPS8sIwU31ihpxMlLTIgh+Ul+06x7VNrbOf 21Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730900062; x=1731504862; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6bdbdz8vU0Bbihl18UjLAjwVvI21BGXXW+x8R30xk2M=; b=rUJw4kV9a88xo106Y1gIRBmnVIue4BPvPsFrZBBOfZsIB0KZyriw4AA6FurYALt54s B7ZTL+JLKQURdO6Xa7I8f0OOIYUjGz/9kHTWUpiAFjGXizFhMs5rU/VnSnbIepOUPvSo xKTMooQjNbcRJLpbqkCxZZN2dBlIYoVZ8TX66geZxjP6+8A97LyP16fI8AnNsMVywoWl SY6nu74StKRDrqNTrjdgqJNBvrQXfwpNMyd5x5VAhoHxQqIIs5qTfcsZ5QFbtE4L1s7W mmwRQK/STw4l3f25kBexA2Qz/JLq29afXXrfcTzQMjJth208r/kpi3WmA9dj0DRuyTU0 E/Jg== X-Gm-Message-State: AOJu0YzJZwz5t3NMeeOXKezbY0fwIdLBSupBzV1H38copUGzgrfxTa9e 0EG9dWihh3LowwUoBEnt/QHULvf/fVkn/UyKW+V8Ygo9TuKrstmCBC5hxV7qyoc= X-Google-Smtp-Source: AGHT+IFFgz97DkAlOq5csTvhDrpBAGsm2N8BS5PnUS3m9dNi3TvNz/r1V4Za1oYBXe7wlAZrg0wmKw== X-Received: by 2002:a05:6a00:cc3:b0:71e:744a:3fbc with SMTP id d2e1a72fcca58-720b9d9490fmr31457555b3a.21.1730900061698; Wed, 06 Nov 2024 05:34:21 -0800 (PST) Received: from grind.. ([189.79.22.174]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc2eb64esm11749765b3a.168.2024.11.06.05.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 05:34:21 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, Daniel Henrique Barboza Subject: [PATCH for-10.0 0/7] hw/riscv: riscv-iommu-sys device Date: Wed, 6 Nov 2024 10:34:00 -0300 Message-ID: <20241106133407.604587-1-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=dbarboza@ventanamicro.com; helo=mail-pf1-x42e.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-riscv@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-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Hi, Now that we have merged the base IOMMU support we can re-introduce the riscv-iommu-sys platform device that was taken away from the initial posting. Aside from adding support for the device in the 'virt' machine we're also adding MSI support for it, something that we weren't doing before. The Linux driver is then free to choose either MSI or WSI to use the device. Patches based on master. Daniel Henrique Barboza (5): hw/riscv/riscv-iommu.c: add riscv_iommu_instance_init() hw/riscv/riscv-iommu: parametrize CAP.IGS hw/riscv/virt.c, riscv-iommu-sys.c: add MSIx support hw/riscv/riscv-iommu: implement reset protocol docs/specs: add riscv-iommu-sys information Sunil V L (1): hw/riscv/virt: Add IOMMU as platform device if the option is set Tomasz Jeznach (1): hw/riscv: add riscv-iommu-sys platform device docs/specs/riscv-iommu.rst | 30 ++++- docs/system/riscv/virt.rst | 10 ++ hw/riscv/meson.build | 2 +- hw/riscv/riscv-iommu-bits.h | 6 + hw/riscv/riscv-iommu-pci.c | 21 +++ hw/riscv/riscv-iommu-sys.c | 256 ++++++++++++++++++++++++++++++++++++ hw/riscv/riscv-iommu.c | 114 +++++++++++----- hw/riscv/riscv-iommu.h | 5 + hw/riscv/trace-events | 4 + hw/riscv/virt.c | 108 ++++++++++++++- include/hw/riscv/iommu.h | 10 +- include/hw/riscv/virt.h | 6 +- 12 files changed, 530 insertions(+), 42 deletions(-) create mode 100644 hw/riscv/riscv-iommu-sys.c -- 2.45.2