From patchwork Wed Oct 2 01:02:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1991761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=kuy4bQaO; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XJGpp3gfkz1xtY for ; Wed, 2 Oct 2024 11:06:26 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svnmD-0006rc-BO; Tue, 01 Oct 2024 21:03:37 -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 1svnm5-0006oq-EX for qemu-devel@nongnu.org; Tue, 01 Oct 2024 21:03:31 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svnm3-0002cn-UJ for qemu-devel@nongnu.org; Tue, 01 Oct 2024 21:03:29 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-20b90984971so28206775ad.3 for ; Tue, 01 Oct 2024 18:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727831004; x=1728435804; 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=wmgSaVL8dhq5nP6b5OzdsZKAt0sQ4+L9Gnx6E+G/OOg=; b=kuy4bQaOTyF7ajxxyWG/s9vXIDYJYrs99zBkemxpNM+kXGNl9/1tQsoKh8IXuCAAaT bEtmrozYEi8knF86lT+lh361HpZ5Wqelhq5hh4jAmMXbZJ2+BAxQ78lFGEKLzV/sGR7Z /auLPwpJdd8RAjaWSaE7/4hHaKg99BLpjxHvYtUpRkT+uGVl/YyOCLeATWZarAQv40id +hkZK7Qf2YYhy/rfjcqP2DXWX9nLPMTzZHtQ2cY0TSaW00iHskIRXPFc4VpzvyjiajVp QjlsUXNuunoN7ATun8JjSV+own3U86ocdq/B/XjDbU/l2S9ag9jiJrVbTXc5HHlXQYRU nqsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727831004; x=1728435804; 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=wmgSaVL8dhq5nP6b5OzdsZKAt0sQ4+L9Gnx6E+G/OOg=; b=Fi8FVTsj9YIah4K7NjCbemGEBEpcPGExOpD9dDStxFRW3sfRD5hbTOV30g3XHVlxVP EUkHw2a4pGVGbkyLRGSly7dxSEmCBK7fcq5NDkbWg/ran4K+wQizWnu6E/S1R7dcigYB eGJRLCY7jqyc1J39ne8RryIZ8iZ0Xe3lD3qNcSFxEweGnkmCjYERcIdH1RAJYvWv45cs x7LXLK8bGwl/5moSXRI301oXJh5HIH4hs9v9rmwMFJgw6qi0fnUGXsunVNrjrAERIKsu oQCnLRvCnwq+7Cn7Y60EpTqncBIUsXVt0K/W81maR+6TaSGkerf94nnTQDiDxndqxuc9 xT0A== X-Gm-Message-State: AOJu0YzHlSWlilNpcST6Bv1SaM2PzaS3n0MHbbENfFy47TPnsq5+rD7v SGhQiX+V3UBUj8YpwSGatLaIimyfM6wTAPplr0HFVwDvhYk0Nj+dRbB/m7vNGUY7pUEqtSe65TF U X-Google-Smtp-Source: AGHT+IH6JuTJ5NboyDCO+EIPRQeTUc8JJYhB/Pse/bvHGVO2ayP+knEHQdoqII+cVOKaBEMjXHHteg== X-Received: by 2002:a17:903:986:b0:205:968b:31ab with SMTP id d9443c01a7336-20bc5b0016amr22693675ad.58.1727831004546; Tue, 01 Oct 2024 18:03:24 -0700 (PDT) Received: from grind.. (200-206-229-93.dsl.telesp.net.br. [200.206.229.93]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37d63971sm76061295ad.4.2024.10.01.18.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 18:03:24 -0700 (PDT) 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, peter.maydell@linaro.org, Tomasz Jeznach , Frank Chang , Jason Chien , Daniel Henrique Barboza Subject: [PATCH v8 01/12] exec/memtxattr: add process identifier to the transaction attributes Date: Tue, 1 Oct 2024 22:02:56 -0300 Message-ID: <20241002010314.1928515-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002010314.1928515-1-dbarboza@ventanamicro.com> References: <20241002010314.1928515-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=dbarboza@ventanamicro.com; helo=mail-pl1-x62f.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=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Tomasz Jeznach Extend memory transaction attributes with process identifier to allow per-request address translation logic to use requester_id / process_id to identify memory mapping (e.g. enabling IOMMU w/ PASID translations). Signed-off-by: Tomasz Jeznach Reviewed-by: Frank Chang Reviewed-by: Jason Chien Reviewed-by: Alistair Francis Signed-off-by: Daniel Henrique Barboza --- include/exec/memattrs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 14cdd8d582..e27c18f3dc 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -52,6 +52,11 @@ typedef struct MemTxAttrs { unsigned int memory:1; /* Requester ID (for MSI for example) */ unsigned int requester_id:16; + + /* + * PID (PCI PASID) support: Limited to 8 bits process identifier. + */ + unsigned int pid:8; } MemTxAttrs; /* Bus masters which don't specify any attributes will get this,