From patchwork Mon Jun 26 12:28:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 696438 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3203812wrm; Mon, 26 Jun 2023 05:40:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w+NKrClhUAjEeau9ShZrlempC3KYsBEVWNrx70RHWmcZrs79T9mqc720SkSo+HIbvjPc+ X-Received: by 2002:a05:620a:31aa:b0:765:43f0:f049 with SMTP id bi42-20020a05620a31aa00b0076543f0f049mr10952229qkb.56.1687783255891; Mon, 26 Jun 2023 05:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687783255; cv=none; d=google.com; s=arc-20160816; b=Vc34xRiBypGggudh3ekC5uLWwWEh+HOZFdlRlZHXW8dR0oXNBHbKkUd79yRkiy3uH7 d884MK6WRRF8G2nQTGDuYruT5InVyeBD1HAoGwmaP2HP8nzaeyFyFaJIp1Eq7fAwZu0n RCkOLIdpAs/sYTLnz8N3/y5eYWHXcJFaTCZYA0UeoADN3ZI/WKybh2mE/HXA/civoCfF Qioy1DDfBtIGKLrlleiKZRrb9rH63iLRtj4FT3uomGABov21bmbl4ktF2fJ1i6BSN2Mw l/oZaJ9fmYD/RmDr1DNkLWO3PAyPM41mW7hdv/F71CZr9bW0W/gNkSRe5KDh1Dt1cKeN 2rww== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p3R7bbX1OVcHwyYU8dbH6MaxjId8JlY7Jg13CA3d3Lg=; fh=b0OXIHipuTiLhvESrVB5FcKtQVSMfI4pXaUSbTK3/Jc=; b=e1YvjSmpTsPS0/muAWEplTUGWpeGjlr57rFplME+dUmb0w1iO/wkbKj/E87+l9MHP3 m0EJfmRnSSuZ9NQVzndnq1F5PNdlzkRYfflTAQsUU2dq5BeOETahMUof8ysdkAgLKqF2 sFL+7DWD2FpAjroKKP1vdDL29Y0Guzf1cjez8d3sj5JdAtgnkBLsAISqIpF3QtV5JCO7 ufkavs+r1CWxqr0ZA92aJomFbg5Z5xnOafHBf8JjElf7X6Gim7FcFD3pmAeUI4dgEmCe cOBCKfsKEGx+8IuvT6LY/hNaDgu3N1r3vzqrFqpK8VufJvsA7UwFS8EX/uhtdCyWphGu PIPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A+afMQ0U; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a3-20020a05620a438300b0073baab85585si1931630qkp.297.2023.06.26.05.40.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 05:40:55 -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=@redhat.com header.s=mimecast20190719 header.b=A+afMQ0U; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDlMR-0005S8-98; Mon, 26 Jun 2023 08:30:27 -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 1qDlL0-0002NU-LZ for qemu-devel@nongnu.org; Mon, 26 Jun 2023 08:29:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDlKx-00032E-9a for qemu-devel@nongnu.org; Mon, 26 Jun 2023 08:28:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687782534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p3R7bbX1OVcHwyYU8dbH6MaxjId8JlY7Jg13CA3d3Lg=; b=A+afMQ0UqVRO/Io7gVdV+QfcOxb1Jv7mNq1EiSh+lTdQ1WQdkdqcjzeC1/02oFgiwvIlPm Ly8ZphUx+GIe+JXt8WaGwUpwGn8f0lRb7ds3H9khSlCEeNiqAfJ0cFn4NZuuWr2ywyCVG/ FfgbpDiYsgorTUwBWgYQkE/2HS7to44= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-e7PrP15wP5qFLmZW_dgkbw-1; Mon, 26 Jun 2023 08:28:53 -0400 X-MC-Unique: e7PrP15wP5qFLmZW_dgkbw-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-313f371b0d9so385488f8f.3 for ; Mon, 26 Jun 2023 05:28:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687782532; x=1690374532; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p3R7bbX1OVcHwyYU8dbH6MaxjId8JlY7Jg13CA3d3Lg=; b=kXw4CCwjznRnHLJbakA+sB9CkxIne1OPh1ka1AWxv5VF96zCwiMHIZNjMBPuc0JyRc TGuYmpL1/Fbe0SX3N6RSoEmdBP61BP8z1aBpGpOJPfsXM7dPGhU+vQdA86lD31Qj6h4t /5MjSa4uVDBc+/fSyBlYvid3AH6wEn0q2mupPgwZJj8nojJytDQWNrfrssN2QJwDQqkA wXgLv6so8pXbqlYjTRiLMNfEt+vn8twQr5ae+32TAo38mWOXugvV39ntQzNA+8I4Q6wJ IvowcsHAxVWriemk9bKqvDBH4ejMCB0bd+nl/0ytrR9qDX8ICYosQVWoHfZIB8BZEfs1 /sew== X-Gm-Message-State: AC+VfDxKFhUrTBprzKCsJB+dEfPOP0dFOCb0o0tZciUSFy+vxIb4Zs9/ qwxJ92m2GwoaZjKJi47PbjymMHFupi8OSxBIMQoEkQsEfPpsfskwR9Y92WmCEVywb5NFnUhwIVa zBcCJSDpxL7VQnmMKBAS3OoCL7Gw54Lpatgw5Oi+snZsxHI+FW+B+gOW+rQiwYX4MKGo8 X-Received: by 2002:adf:f80e:0:b0:313:f3c5:dac9 with SMTP id s14-20020adff80e000000b00313f3c5dac9mr1227676wrp.41.1687782531995; Mon, 26 Jun 2023 05:28:51 -0700 (PDT) X-Received: by 2002:adf:f80e:0:b0:313:f3c5:dac9 with SMTP id s14-20020adff80e000000b00313f3c5dac9mr1227660wrp.41.1687782531723; Mon, 26 Jun 2023 05:28:51 -0700 (PDT) Received: from redhat.com ([2.52.156.102]) by smtp.gmail.com with ESMTPSA id v11-20020a5d610b000000b00313e2abfb8dsm6719036wrt.92.2023.06.26.05.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 05:28:51 -0700 (PDT) Date: Mon, 26 Jun 2023 08:28:49 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?q?Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , Eric Auger , Alex =?utf-8?q?Benn=C3=A9e?= Subject: [PULL 20/53] hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 From: Philippe Mathieu-Daudé 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 Message-Id: <20230524093744.88442-9-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin 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;