From patchwork Wed Jun 12 13:25:29 2024 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: 803470 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:e87:b0:35b:5a80:51b4 with SMTP id dz7csp788238wrb; Wed, 12 Jun 2024 06:26:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUsMs/UfL7f3ZDMLWLGQlIvF/ZcSxLqK2XW/dNnVzScCPftNqlyYSJR2hVuacBc7UQg6KUnj7pJdcmRKL0OfcjP X-Google-Smtp-Source: AGHT+IFwq3Kpk+Tl2d1LK+2VfEIBOQvJ5RCugVmwVMLPe+CwoHuYMa+xeLsJ8dKKXxaVtQxrIlqM X-Received: by 2002:adf:ee92:0:b0:35f:1d7a:c420 with SMTP id ffacd0b85a97d-35fdf770cccmr1430426f8f.10.1718198765871; Wed, 12 Jun 2024 06:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718198765; cv=none; d=google.com; s=arc-20160816; b=UB26iWNU0sMtw7YcyU/I75MKoFfeghrbMJfLHqYDMrdNJ43gU4QVR6sXrHv5OYy5ih B9LFexTUcuxeD+P8Urya+WOn9OwwnX+6bCJWxt7JfZy94ePoKHK99tL4LDB33vn+jn6W 30s9zrWLseFr93sMWbstffCFTOMDuYpcVSNQdwtcmDdMgrZ59OXeVGRaAQXb4pk6+Hpo o5XnswwceL3SL124IJrTeL0ux8paRzxr9pSLbGO/B7/VcA1SQD4X236nN0kTm7fUscTB EOp2tyyu4wR5COXtgU142+/pBXKnkHLFN6HXAtadkdoTmlV37M8triOkCEYJ21flQixY uGGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=JM/gzg6Fck9TlOnDm2ZflmX6hvT5QMqxJafFp7HjnSg=; fh=4INC/jqaTEcPrU1WI6YvMwfNxFbPxxEt8cBO3UjtE/E=; b=vZA3BQ0jWLxTcwBCtmDtlThuvtRJyJUlRnKG6vU3pnNFdTKKV8gEbOhqoygx16Z8dn mSbQ6tHljECFQHl9bA5xMq6Oehg7th4O+PUDNIEah9vbjfoYqmOWhdbjpXLhOMVs1F/n Xztr8XC/aFAu2luWQfUbSZsY+OJGa67bFd+t+2w9jzRFThKxkOo9lvFIuMWe+ySqMdQb pc+smr15pk5YyEJzaJgpS89xYBHp3oGy4bl8zIcH/HSY1hDPLj834ScDgaAP/+0kJM/K PhCBPkkEiLxZqUKgBSjV2P/qFXxmZc6V4oeh9jKOi8s9cyS2zs0yKQOL/h6wSx3nVkD9 brtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aqC9typc; 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=pass (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 ffacd0b85a97d-35f1917d22dsi5803714f8f.958.2024.06.12.06.26.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jun 2024 06:26:05 -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=pass header.i=@linaro.org header.s=google header.b=aqC9typc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHNz1-0003YF-T1; Wed, 12 Jun 2024 09:25:47 -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 1sHNz0-0003Xa-GO for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:25:46 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHNyy-0004xK-Rs for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:25:46 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-579fa270e53so3704827a12.3 for ; Wed, 12 Jun 2024 06:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718198743; x=1718803543; 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=JM/gzg6Fck9TlOnDm2ZflmX6hvT5QMqxJafFp7HjnSg=; b=aqC9typcPzjbBDUqGAhWTBc0rZSCGq2yG7J0RWpWK9Ju8QPos3LJ6WWHLxaOLp9eFb ZACJlHLps03K/sJ5po8kyqpYUzGjXE+CP5VAUmfVwSeuYnNHcxAlm9hfQtlGpPizcVTD EUrzno7XZJFeJ0tffIp5CQ3ChkLLCrDatVRdy8tmYwuxfcyTEYtP1eNsV4eL56Ap0Dnw 5SfG9lqccC+Tes4GsOjVTlIZjpQFgvzTolZjs038SQqQ9eG4ROdo9MpGXiFpNGFZtBnK FBNSbQgvEvxAauMpigd6Cp7AvlscWcxXvFQe7QvKvlp2tba4b987nxxjDH8axqTGoCnw bfOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718198743; x=1718803543; 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=JM/gzg6Fck9TlOnDm2ZflmX6hvT5QMqxJafFp7HjnSg=; b=lmE/Q/75hZv3Csuy+/Pmyo3F5r9Ui+dUjGHgDOUssJ+F7iZLPPPFpwPVhZ4lKMHQl7 rc17udksndB8wdcJ/qGJ6L2dWa7r4+nTp+3RDfbtWcBOBqcxs+xx9oto4aK6NJGc0J6y 2QMCfK2ObdV/tmqBG0Guaf4COc7f1c4Uc1vElE+AmcTYlF2duJ4F3aqmA3j8Byl4wEiZ L5tiZ9edyDDyXLAkqmsHh/YaK79zzpWen+EUXLiW6kivDS2y0ucuViSiohmvPKmtTUsI dD4QfDTP+OIAXdvxKjszjDuztstzSJ5YnmdU3WW3e/o68t7sChZjTTCOhGJZnkXwSoUv s1rQ== X-Gm-Message-State: AOJu0YwCHwwxXJvU/IpI31pVKLz7IZVrcYIqtBSAN/SPxsQfCe/kwlP1 nxEpMzuj44AAUIgUtGPu7w9ZwAe/WHIkHgPbaHJ/8YEggUBkKPVPNCOr4BW1gkYSzjT2GjmvVGd G X-Received: by 2002:a50:951e:0:b0:57c:6004:4375 with SMTP id 4fb4d7f45d1cf-57ca97513b7mr1433782a12.15.1718198742823; Wed, 12 Jun 2024 06:25:42 -0700 (PDT) Received: from m1x-phil.lan (ram94-h02-176-184-0-172.dsl.sta.abo.bbox.fr. [176.184.0.172]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c6c95bb33sm7851525a12.8.2024.06.12.06.25.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Jun 2024 06:25:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Jason Wang , David Hildenbrand , Paolo Bonzini , "Michael S. Tsirkin" , Richard Henderson Subject: [PATCH 1/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one() Date: Wed, 12 Jun 2024 15:25:29 +0200 Message-ID: <20240612132532.85928-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240612132532.85928-1-philmd@linaro.org> References: <20240612132532.85928-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org @event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- system/memory.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1be58f694c..2bf5e23b6a 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1852,7 +1852,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr, * range. */ void memory_region_notify_iommu_one(IOMMUNotifier *notifier, - IOMMUTLBEvent *event); + const IOMMUTLBEvent *event); /** * memory_region_unmap_iommu_notifier_range: notify a unmap for an IOMMU diff --git a/system/memory.c b/system/memory.c index 74cd73ebc7..f3a37c97c1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2006,9 +2006,9 @@ void memory_region_unregister_iommu_notifier(MemoryRegion *mr, } void memory_region_notify_iommu_one(IOMMUNotifier *notifier, - IOMMUTLBEvent *event) + const IOMMUTLBEvent *event) { - IOMMUTLBEntry *entry = &event->entry; + const IOMMUTLBEntry *entry = &event->entry; hwaddr entry_end = entry->iova + entry->addr_mask; IOMMUTLBEntry tmp = *entry; From patchwork Wed Jun 12 13:25:30 2024 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: 803472 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:e87:b0:35b:5a80:51b4 with SMTP id dz7csp788412wrb; Wed, 12 Jun 2024 06:26:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW4X/AS1WYeo55mbEqsdthY77rlinQf9FpiK8GXHiQBD5Yyc99SoNdzB2Ixh9wKwXKalUQ01oXpBu1zBfa5rDvM X-Google-Smtp-Source: AGHT+IHsqhYGzstirQaxQNnfj1ORXJTACk74/8SqV0CQWZh9Y90U1bcWcmo+3fLB+euTkYkX7Nyt X-Received: by 2002:a05:600c:4fc5:b0:421:81b6:b9d4 with SMTP id 5b1f17b1804b1-422863a8b26mr13517695e9.7.1718198787097; Wed, 12 Jun 2024 06:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718198787; cv=none; d=google.com; s=arc-20160816; b=yQ27rlblGNQo+SfMcLUwhuwXXqOaag5Mvyjmk3gzU7WQXkOjxOLmmsFM2YFV+38su0 IdgeobsyJZHPTsKbL9Cyn6cnQlh8dzkXZAWJTIn2AIUTYtJIzncc9RzYHoMGZnCWpXxA 461kDbY5x3HXrWu4+5dadJRb+kgOLfWVPMhsw4daWUOUIEbO51uNKOHwqTWpjdBBrKXf dGx6sK8wIlyKicTJ8D8htq+9MFQeVR2silrBt0AyyrvBScLPJsBoEk29pNHxcdJTIEFO 6xmZ3DmAqBBnkz+SZVhArlMIXbj31UA41cATxrwzeA511Apj5qIX+M8TfcTGln94nSh9 jqkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=N/V34NJr+rWIWxDjERHJ009gIapl2SiDYy6zj1sgQb8=; fh=4INC/jqaTEcPrU1WI6YvMwfNxFbPxxEt8cBO3UjtE/E=; b=c8ooO3u3ebd3rxOJbz8YdZCqjPoAgsllG5YZ6sRbZdB+in5htirDfcDLtgN3Hf5CvQ 5wk/zOMWzxpqnwQcNJc8vidHyIL+q1bB+4ffhRjydin3q9MtIoAtvvQWRzQkcbb7brQu RCOSIQ+5DPqQVBGLl9xq/yGt3PsrpkBbGLDxBbaunp0iS64EvClvnm3viklNDxdU3q4q Io6+KI6CTWadDbk83Q5p8BJjTegbYGnsvrkDYzEMvAWsPT5eLQzCSib/r8QdU2kE/qvt e50cb3frAY899hactRIupoF4zQNQ7Sa/YesaBmNRu9MVZRls/GqftaC8grNNBI83TchX S6CQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WI02i4AU; 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=pass (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 5b1f17b1804b1-42286fe54casi9707295e9.47.2024.06.12.06.26.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jun 2024 06:26:27 -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=pass header.i=@linaro.org header.s=google header.b=WI02i4AU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHNz7-0003ZI-IK; Wed, 12 Jun 2024 09:25:53 -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 1sHNz6-0003Z5-9A for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:25:52 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHNz4-0004ym-N4 for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:25:52 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-57c8353d8d0so4419097a12.1 for ; Wed, 12 Jun 2024 06:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718198749; x=1718803549; 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=N/V34NJr+rWIWxDjERHJ009gIapl2SiDYy6zj1sgQb8=; b=WI02i4AU9dNJCmZrGXPUOBgOUyZD5xV2NNhS45BF94K6tGxO55FAgyTLe7vihbSZwa IVpWE3P3pvYYb1zDwbk9TF9imjR5GBjH5Ud+TVvD/tBNfKqyX6lHVlsn7pkCjeJDaMfG PePuyN5TqPBBOPiK7fkRcC7GTcM2KOps8eni2GY9gT+mtOX/gsvEffe1HxdkICeWjC0i xftNrYn2/zZPks3RlZVBuLpkJm39AKbdfVqaUjFuEuCMLS7r4eJ2koYjef9XpbNhe/wg aBwJgNE3manV1bwu50kBFIlwr6uycbOwrBWRtLsEzzlyvr5F27lMMV6iCsHkkKH0adny uBwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718198749; x=1718803549; 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=N/V34NJr+rWIWxDjERHJ009gIapl2SiDYy6zj1sgQb8=; b=PsKqUru2NTwniZPUxd31ULUrTczezR77HNGa+OuXRU43gpsoMe9C6CJJNW0OIOGOBs zWOQE8DIiadKw6YMc3PE3R8+fDTbszjfovHPAkFV7GID0Zm5jXbB7zgZbq5DzBFO9fXl LwB74yrg3HthzeucnZsENYoJ9XlsYY7oO8sxKa75w03RqI19H3b15ndKb+9G+AkABTMC ZfSyiHcTJPMfUZq550t+1tag2An6Ca1RnmEpUV1OaaFoU2gNv4URK3ESd5kGQ0Tol6b6 ommA+Th7A52fABvcQmxgB3Vp/K3itEyCHx0uitxtJVcBS8Gp9fdqXiK6E+kF+8B0HWRq NfXg== X-Gm-Message-State: AOJu0Yyiq3WHGtCX1sf4H6YiWloiTmtdIAdqZf5K9ZQrrN/3fkldhUac Oy5hch6XLka/zqvq3AJX/6MfVFaQcjH1asM1tRsLrcO3wk4IJlZsB+XMwDwiXfCR4D0Pow+lDWw V X-Received: by 2002:a50:a6db:0:b0:57a:2f68:fe7b with SMTP id 4fb4d7f45d1cf-57caaad8c50mr1375473a12.31.1718198748924; Wed, 12 Jun 2024 06:25:48 -0700 (PDT) Received: from m1x-phil.lan (ram94-h02-176-184-0-172.dsl.sta.abo.bbox.fr. [176.184.0.172]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c741b0581sm7036325a12.57.2024.06.12.06.25.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Jun 2024 06:25:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Jason Wang , David Hildenbrand , Paolo Bonzini , "Michael S. Tsirkin" , Richard Henderson Subject: [PATCH 2/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() Date: Wed, 12 Jun 2024 15:25:30 +0200 Message-ID: <20240612132532.85928-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240612132532.85928-1-philmd@linaro.org> References: <20240612132532.85928-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org @event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- system/memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 2bf5e23b6a..2d7c278b9f 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1837,7 +1837,7 @@ uint64_t memory_region_iommu_get_min_page_size(IOMMUMemoryRegion *iommu_mr); */ void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr, int iommu_idx, - IOMMUTLBEvent event); + const IOMMUTLBEvent event); /** * memory_region_notify_iommu_one: notify a change in an IOMMU translation diff --git a/system/memory.c b/system/memory.c index f3a37c97c1..47c600df63 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2052,7 +2052,7 @@ void memory_region_unmap_iommu_notifier_range(IOMMUNotifier *notifier) void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr, int iommu_idx, - IOMMUTLBEvent event) + const IOMMUTLBEvent event) { IOMMUNotifier *iommu_notifier; From patchwork Wed Jun 12 13:25:31 2024 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: 803471 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:e87:b0:35b:5a80:51b4 with SMTP id dz7csp788286wrb; Wed, 12 Jun 2024 06:26:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1E+Xw2wlkoFzWqFfH3hyarx6ZsBmcqerGvZYTYhw3N2NxNkCO4QDBrcw9yIoIwvhT8u9MupCb4IVNXYixrpiX X-Google-Smtp-Source: AGHT+IEmuoLqK1nLbSnQyGG6xK9J8eG+BGf4KcMBJwn/OHRFJc7N+6B0yUk+qoQHP1fU5LpX+r4s X-Received: by 2002:a05:600c:3551:b0:421:de31:81 with SMTP id 5b1f17b1804b1-422864af043mr15906965e9.24.1718198773677; Wed, 12 Jun 2024 06:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718198773; cv=none; d=google.com; s=arc-20160816; b=c7Qhwtj0RC8b0os/oFjFL4FOBbR+m3Qc7SkkD+UL9Sdg6SMIPZ7p4oVVgtzIB/XB2L DkPbhIK+kfC+ESAgXAWBCpbK1Lsg1u4TV9IamkJTDtR4jihpX5FVdZnXI9cz5s7wy9TE yzMipGeB1qDwkMSaUI4/j+XUWQ6k/dz+8Aj0/dl18s45wbsA7eKxnV8PWoO9ag0FX3cZ srJAanL6ZoTe4wtvctZosmaQSGSSmVyDwfDnutlpNuCe60ld5UoKkhsRfJRRXKOaxPdN oHHxsQaJV+yCaGQs//72bMyhUrEm53uc8nk/BUrC9wvkiY19GsrcolGngi/cWJlcK84F dXjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=CnsmHcs0edIXhpdRXi0WlorEVmnbvVWBV0YISj9sdg8=; fh=4INC/jqaTEcPrU1WI6YvMwfNxFbPxxEt8cBO3UjtE/E=; b=Qb4qAhyR01CjxlFBxJXiQxSSMlQJav6p9O7Nly3U6Q/k6+KiRCpWoL2BLvFt89rRdV y8+fH1uyImocUXLvYusviDHcs3MBGvz6OVUUUr/IiuGRDoojeFYY5ZcTwLx81q8wAlsE xJ6E9kL2mGXxDciWADSGyCAmJMP1G/Xar7mkK7pupmOh83ODFQ1KAfzNC6f9tyzU0iyK HT9bGTKvfqxi5aCT1XspKDE5o3OHMFHDaZOXxyQ1R9IF7lOUQHQ0I7yYHiakFRy5EjWA lrpAZDzy16iAxGWx5ZEvSQPGn9UyMrIBwIzSBAZZSy3PMhHaugi5KqxfHTNcBG2IYFS6 VUQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FF/VLiol"; 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=pass (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 ffacd0b85a97d-35f24fb100fsi3981764f8f.107.2024.06.12.06.26.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jun 2024 06:26: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=pass header.i=@linaro.org header.s=google header.b="FF/VLiol"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHNzG-0003tb-Jh; Wed, 12 Jun 2024 09:26:02 -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 1sHNzD-0003kA-Tf for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:26:00 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHNzB-0004zW-VH for qemu-devel@nongnu.org; Wed, 12 Jun 2024 09:25:59 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-57c68682d1aso5283857a12.3 for ; Wed, 12 Jun 2024 06:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718198756; x=1718803556; 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=CnsmHcs0edIXhpdRXi0WlorEVmnbvVWBV0YISj9sdg8=; b=FF/VLiolOt7umJdAJnG9nIyhOuerq7aSQ1nzNnYvEB55sGGE7EyyiJeH0PZBWTr8cQ nFcdczuRkua8sSW///iX95AnBSwV0o0DeXbZjJqYSodzylmZG5rok9sRDyRafLb4fDTN 3QKwlEQD+UtfWgBLF6Z3Mt8kymioKufQtgPMzAGjUQgFLY5vnxuTIhM3SqbrCtnGdiGr 1p7eKRhcRmZgXp2DA8fKe/XSGO+VY0u7yXU+S+vIjCMnKoHvAy6G4pBzbvUVlOoc5sLg oUMlvXBf1cHLkm9KpW60LaAvvX/CoJ1b63YmoH5rayAuX1MGVJYTEHC1+R/jccUoFGdp QcWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718198756; x=1718803556; 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=CnsmHcs0edIXhpdRXi0WlorEVmnbvVWBV0YISj9sdg8=; b=tPHjLMq7DGslx+HP36WSVmAz6mCATC5PaT95MLhpbQ4wgqkweKNC2aK0KfRhhhBlAM +26E9331CRVWCrqfTxIvVBj8F7NqDAmiSRSsN14yVAJfudjxCwbYqDp34kYqH5DmJyDX g9/WOpr4XM8h8CbFNZvr/MKodCtyshgY7wYopesUUX27sfyOwONWJtC7rhYLMslJPG2q gEJr3PCdQYbtR7OIZ9GNZ1kzvk0vZI+5LnTDV7P49iOYC/qTHBFsaIBWhF2uLRwAuF0w /lytY6i6Mh8vp9fM3ZsS0rLgTSyKCsI3+mnBeVVbINgS7zpZu4GDS3zUIj66JoBNMOyO Lyaw== X-Gm-Message-State: AOJu0Yz/kiZsMGgxLN2ME9x0pJ3B6PzHhPqywGSv19oJydKOsNM0tz+o qrPm6Yld/vURkelCZ1uKFPrTZAh0JXGfcLGrhdCl+ByBCM2hAE8KCo7GikM4vJi1qnrkXYTgnls t X-Received: by 2002:a50:8713:0:b0:57c:740b:c87f with SMTP id 4fb4d7f45d1cf-57ca9743dfamr1049802a12.9.1718198756075; Wed, 12 Jun 2024 06:25:56 -0700 (PDT) Received: from m1x-phil.lan (ram94-h02-176-184-0-172.dsl.sta.abo.bbox.fr. [176.184.0.172]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c92901b05sm3193394a12.73.2024.06.12.06.25.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Jun 2024 06:25:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Jason Wang , David Hildenbrand , Paolo Bonzini , "Michael S. Tsirkin" , Richard Henderson Subject: [PATCH 3/3] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype Date: Wed, 12 Jun 2024 15:25:31 +0200 Message-ID: <20240612132532.85928-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240612132532.85928-1-philmd@linaro.org> References: <20240612132532.85928-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org @event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/intel_iommu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index cc8e59674e..c4350e0ff0 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1170,7 +1170,7 @@ static int vtd_iova_to_slpte(IntelIOMMUState *s, VTDContextEntry *ce, } } -typedef int (*vtd_page_walk_hook)(IOMMUTLBEvent *event, void *private); +typedef int (*vtd_page_walk_hook)(const IOMMUTLBEvent *event, void *private); /** * Constant information used during page walking @@ -1533,7 +1533,7 @@ static int vtd_dev_to_context_entry(IntelIOMMUState *s, uint8_t bus_num, return 0; } -static int vtd_sync_shadow_page_hook(IOMMUTLBEvent *event, +static int vtd_sync_shadow_page_hook(const IOMMUTLBEvent *event, void *private) { memory_region_notify_iommu(private, 0, *event); @@ -2219,7 +2219,7 @@ static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s, * page tables. We just deliver the PSI down to * invalidate caches. */ - IOMMUTLBEvent event = { + const IOMMUTLBEvent event = { .type = IOMMU_NOTIFIER_UNMAP, .entry = { .target_as = &address_space_memory, @@ -3889,7 +3889,7 @@ static void vtd_address_space_refresh_all(IntelIOMMUState *s) vtd_switch_address_space_all(s); } -static int vtd_replay_hook(IOMMUTLBEvent *event, void *private) +static int vtd_replay_hook(const IOMMUTLBEvent *event, void *private) { memory_region_notify_iommu_one(private, event); return 0;