From patchwork Tue Jun 18 16:00:21 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: 805267 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp276071wrx; Tue, 18 Jun 2024 09:11:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMSjHjO0NDZ4fi/p6FQh4KppbfklNHYP9KsNY3yD9xQV3FdE76Q/moJKXf4tNk1l791jgjhwAqiKWNPQq9vm2w X-Google-Smtp-Source: AGHT+IGbmYDUTflYOFry5uiYFtYhmmtAmLh2OHbAGneT7nQyDt6i80fAwal5QF5wy57TBV1UYcrU X-Received: by 2002:a05:620a:4496:b0:795:5ca2:374e with SMTP id af79cd13be357-79bb3eca9cemr12149985a.54.1718727094086; Tue, 18 Jun 2024 09:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718727094; cv=none; d=google.com; s=arc-20160816; b=w8IGFmv6tJCC1qL0f4I09t94uknznK+yVGPDywxzhwjVudJHmOAAwyJpEpv9MNiDUD TMlPg3ANESdfKD0nanMC+k2SlWuhnd2HsjiQ7bNGigl3Cny1DdDg+yZZtHX1b832iQ9+ kKCkYLcGnQSZFKfbT5jhtOiFrPf04eXOA6dsT6d0PoNoK9KMxrKKjn9pKwZrDrahYeiX O++hfgkkikT4lGF9xs0Y2RX2dlsbjpjOA3d3qDghXdwFF6m6RZFWdbctKNGsgnIxq9/T oR8QY7Po8rvGcqGU2QyoJ2yzsnnj3d9ZzbKBEiW4VMY55CcwPogdy/H6/7W+D6CcSwXR D7LQ== 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=aZqLfefuSJqvtpGWlLdOMb144pE69iIqAnMbzj9lfMc=; fh=vbGUDJIv0td6conUnGz4oHw5hGzDnkUZulGjJDPiw2E=; b=vRTnm5lYch/I4UB/zrMeZwRfBs/qUNwO6xrzfJ5PaLQcDkZizJknnCtWfzEvgrk7VI Wj7Hyd8YD/TViJDGTagf01pIvOaALbmHjKr5xFHKnhPJJ3pCjJnDCjwHdINiG1W7f85b CxbOfiNqbcQoZcopHKoxFElJzQr7P9EgXV+S0lOOGWrxenSwDs8Mtz07WuRRiSJIcG6e 7cxSbtuj7xkFgq9n4lun7n9uGlsaZo6fI+a+Y4yWONjzDDS185NxaR+foDJ/JM8FO/F6 0pLM2VdmfarX7TvNcN7XGovAokIq7ZuAv2bedsOjKz1MsgHdnoNY3T3Imey+ffea1zp5 2P4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gYJRYVCX; 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 af79cd13be357-798abd17131si1219606985a.392.2024.06.18.09.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:11:34 -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=gYJRYVCX; 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 1sJbLs-0008QE-Ll; Tue, 18 Jun 2024 12:06:34 -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 1sJbLp-0008GX-6a for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:06:29 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbLm-0007lr-Nq for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:06:28 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52c819f6146so7474894e87.1 for ; Tue, 18 Jun 2024 09:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726784; x=1719331584; 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=aZqLfefuSJqvtpGWlLdOMb144pE69iIqAnMbzj9lfMc=; b=gYJRYVCXAQ050McA92JbN+Q9sRO4AFPx+ViK3Xd6Pe0a/9tKU4ydROA7WBNQKBgjUF vLRBbjoc2QVNlYlQ6EQiMEUv/v6HacerdOWf2nx3IqhCP3n+zj8yON1U5XF5KuXCBJZw OoEQTyR6Id2DpkICJxkCdTKDhXw9IYhE8XBd85uN1roaD5LhwmliJBiB5OYKp4pc8hMn 9Tj9vf3PZ8XagmpJ61JNk1uPFLpNLTCbUTk+17C5LJ7OUbyQml4uJUriSlp6SDi+LD32 qX1OGuOOTN5R4Wq4Xtb3BYuMRkwYGmTjwHR0KNZvejyH/qwUHb2XClZVEj30rMx3u3iI uSkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726784; x=1719331584; 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=aZqLfefuSJqvtpGWlLdOMb144pE69iIqAnMbzj9lfMc=; b=YOagtMuLN43NhQ9Ghvr2c9SHPZVlKZCLX9VGFSZBd/6MPMmNYteSxn9oxgLqT15Gn1 6V9TJQ1yIwTmUVGasNukIZqxKeI/limqRrZK0btDcQQ8c/J5aLYMheGVqgfmXuApS53d bsVRlz2jIvxffMjbthK0Kiw8NXGI1qtZj5kO/wT7rRBQsGhYhiCPKewtQHCuT6HcEYMF oF93iLGgWRML+qUFQmb1aCap5GA22tVRLHrocJP8rVKSmO7VcOO4EvlO8yLsR0AyXe8a MHXMlqN+phjXczUMlhiGo2Zd7GMis82KVMPZcIwuyFUKrJajbO2g4mSP9cS8NxVZHbhH 4FOA== X-Gm-Message-State: AOJu0Yyiaw0XlBBcwhspr8oi9pVFuvlANn+mXfAMNGLP5u2WOp8FfYMu gV84KQNXLJSAcLLYkQzXtdPnk8o1aK8fmDmIUtUDoRJLkaLgj+42jGt1AvesuzzjQuQV75dnUD8 0 X-Received: by 2002:a05:6512:3691:b0:52c:8316:d0c9 with SMTP id 2adb3069b0e04-52ccaa0a1c5mr64321e87.0.1718726783668; Tue, 18 Jun 2024 09:06:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-360750f2489sm14358289f8f.69.2024.06.18.09.06.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:06:23 -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 Subject: [PULL 59/76] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype Date: Tue, 18 Jun 2024 18:00:21 +0200 Message-ID: <20240618160039.36108-60-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=philmd@linaro.org; helo=mail-lf1-x12d.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é Reviewed-by: Peter Xu Message-Id: <20240612132532.85928-4-philmd@linaro.org> --- 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;