From patchwork Wed May 24 09:37:42 2023 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: 685320 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp150089wrt; Wed, 24 May 2023 02:39:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dIluATgoUDMLGjvdAvwEKrgC0oFkuWIK8K+qChaKjA4NNEblcKW2mrjLF3a75vv+1Sevk X-Received: by 2002:a05:6214:2309:b0:623:8818:197e with SMTP id gc9-20020a056214230900b006238818197emr28617431qvb.21.1684921162494; Wed, 24 May 2023 02:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684921162; cv=none; d=google.com; s=arc-20160816; b=ByTsB5PX+cOHt+8f9EBa8KwMfwW3otkhMEYXlgeF8Z+KhGubXsKN7envZcQsV4klo2 FGYdXeI/MJ9b75r0KHNt76Ky9Tr5ps65vvVj/Cd5wU7GaW7HxCYeVpFVntrPFufF5QMt fuLQNUxMtZ6VhJcnSiB/SU+sfQ9h18QEeuvkceArSYpwdqFJCWflzgM8zc1pZNtdkl1y 3mJFd8vVljp7qzkzCltGAV4cDzHSqBhZy+upXIAHYkCsuvY/d7myrh/xVxNX1BZmJV42 p2wUe7AGrANy4IXtY8e4fcDEoV7jCUQ3fgm8IQ7pMrrb5WCk0PcIS3t+w/12oMYjN5sc DHcg== 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=rA2E0VH092ZQeXxfwZplt9KPxzZ4le7EuV+DMB+BMgk=; b=s2YhrF2ACfzXeQPEkfxyVoOCnkDk91S1Kmt1+bq8TtdHNhVNu/pnC5xN9TyeCpQBpC lHRcUbpgV88a6d9B+NFrlF+2+hP3NEz38TrRYqJbogUP4k8K0JJrJlL8PYYswsiqKVDC Z0ef+ub4ay0Xqy2BWlDM9W90llIdAxCCW9SB+ocuN2Psz1BkCrlYnWCDt6ZIFn4cw1HF VCmxqkRkZGv2X/o6Ea6XKXnbI3bbohvefz0KhHzSkwLqWOBsRELuFWsxjKvxe53mebHe ZunU4OKbH77A/Uky2uvB418IHhozXjCgNeVAPA27od3Rd1r+xqg32Et+7377vkfO1z+a vWvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzdCTHDs; 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 kc6-20020a056214410600b005ea91383205si6134817qvb.603.2023.05.24.02.39.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 02:39:22 -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=bzdCTHDs; 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 1q1kxH-0007tO-3s; Wed, 24 May 2023 05:38:51 -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 1q1kxF-0007oY-NK for qemu-devel@nongnu.org; Wed, 24 May 2023 05:38:49 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1kxD-0006xf-AF for qemu-devel@nongnu.org; Wed, 24 May 2023 05:38:49 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-309550263e0so547523f8f.2 for ; Wed, 24 May 2023 02:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684921125; x=1687513125; 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=rA2E0VH092ZQeXxfwZplt9KPxzZ4le7EuV+DMB+BMgk=; b=bzdCTHDsrFLbd4FeluP1rhAMBAe2glkBNYTtOouvC2Ix8rLijsTEWUSChBgsJTrl1a XBQDoXcB0BfwcN2hQaHEpjBuXmd/XlkIGbtoGjpn3/PIq5VV9jdSFD40Eex7fstf0KE1 Cg2aOFbO4sN0WtF4Jol8j9HMPZmsyYuFLpn46+ILTpKvGS4ExuYQLykA4cqBGlvbz1IZ 9Z7SAj3zV6ECrmcI+9ZVCa7WDjJYX2lJ2z2POjjbiZvhpJuGhQDBdvb9hrg7dgob2Yrs FahIT5loF6cdmkhEWHww8gdwLiA0why4oM6DEWd11pWfCLWlM1zfwsgwcmsOvn3qRUrl PUQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684921125; x=1687513125; 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=rA2E0VH092ZQeXxfwZplt9KPxzZ4le7EuV+DMB+BMgk=; b=A/+2svSm0LhVjzDyq7fbJ7rJHyCBtPLKGnrHQvAkBsPa74IWFjB9cdUq04wZlHDYT7 H1TCFZk3U3BXYn+iIWF7vOM2pmcNT6QGnDGPcXzmtyL/7/azHzy++VnPYAon9+6VPXEm GBZTanaqa71Xbd5S3+XV84HuSDD/WZayC89zfgAcsFEuKuFtkAzm/jtjWCOxkIZxRJGs WFFY4/oaVPLnS+QyrOP1R96TOghCDFIqiJ2VE321pm8E5H3dfRWckKD2YIZ7xpvKR7Up PeDTV2F3TrCFioR5XXyMLuCChjctHukdfagnP+Aun0Q53QhH+AzQ+JFgNfFwjWdUuSKS tCZw== X-Gm-Message-State: AC+VfDyKWLDaDSQqTYQkfpNozKNslyShO5Wt+mht64dGJxvEGO04NqDa YRG76eV6bcrPw+xbxf8M7Xlb0mcnKt+5TvxXl5PjrQ== X-Received: by 2002:adf:ee44:0:b0:309:421a:192c with SMTP id w4-20020adfee44000000b00309421a192cmr11263859wro.7.1684921125488; Wed, 24 May 2023 02:38:45 -0700 (PDT) Received: from localhost.localdomain (fac34-h02-176-184-31-246.dsl.sta.abo.bbox.fr. [176.184.31.246]) by smtp.gmail.com with ESMTPSA id n1-20020a5d4001000000b003062ad45243sm13930442wrp.14.2023.05.24.02.38.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 02:38:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , Thomas Huth , Paolo Bonzini , Eric Farman , Peter Xu , Hanna Reitz , Christian Borntraeger , "Michael S. Tsirkin" , Raphael Norwitz , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eric Auger , "Gonglei (Arei)" , David Hildenbrand , Stefan Hajnoczi , qemu-s390x@nongnu.org, Cornelia Huck , Halil Pasic , qemu-block@nongnu.org, Kevin Wolf Subject: [PATCH v2 08/10] hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask() Date: Wed, 24 May 2023 11:37:42 +0200 Message-Id: <20230524093744.88442-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230524093744.88442-1-philmd@linaro.org> References: <20230524093744.88442-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In order to have virtio-iommu.c become target-agnostic, we need to avoid using TARGET_PAGE_MASK. Get it with the qemu_target_page_mask() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Reviewed-by: Alex Bennée --- hw/virtio/virtio-iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 1cd258135d..85905a9e3d 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qemu/iov.h" +#include "exec/target_page.h" #include "hw/qdev-properties.h" #include "hw/virtio/virtio.h" #include "sysemu/kvm.h" @@ -1164,7 +1165,7 @@ static void virtio_iommu_device_realize(DeviceState *dev, Error **errp) * in vfio realize */ s->config.bypass = s->boot_bypass; - s->config.page_size_mask = TARGET_PAGE_MASK; + s->config.page_size_mask = qemu_target_page_mask(); s->config.input_range.end = UINT64_MAX; s->config.domain_range.end = UINT32_MAX; s->config.probe_size = VIOMMU_PROBE_SIZE;