From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4A6AC433F5 for ; Tue, 8 Feb 2022 08:20:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 64746400D1; Tue, 8 Feb 2022 08:20:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3nmpHuozO15N; Tue, 8 Feb 2022 08:20:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id CB029404F9; Tue, 8 Feb 2022 08:20:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8757DC001A; Tue, 8 Feb 2022 08:20:15 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4FFE5C000B for ; Tue, 8 Feb 2022 08:20:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3E2C160C2F for ; Tue, 8 Feb 2022 08:20:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PpzlRvyYvBAY for ; Tue, 8 Feb 2022 08:20:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9AAD160C1E for ; Tue, 8 Feb 2022 08:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644308412; 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=EvHJf+2pzfovStVs+MZiZCf947haBubcOit7ajGSdfo=; b=QztkmezO2Fae9G5oXG76EU5uD6eJ26ZIuNH41cpuv0M6o8eBWd8y9b8ZrjwD9MCAMGvhla DltL6ITEoH7thXjcW3IRdEKMpyDn/qfWYY48xCeDIC1xbZPMUWlL7KLeAEOQGJ2BhBKh3H +HILvifpjLdgA0+fFqJoND/Em4P/0mE= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-FZdzEwXtNYyCPtz5GYbyDQ-1; Tue, 08 Feb 2022 03:20:09 -0500 X-MC-Unique: FZdzEwXtNYyCPtz5GYbyDQ-1 Received: by mail-pf1-f197.google.com with SMTP id t24-20020aa79398000000b004e025989ac7so346018pfe.18 for ; Tue, 08 Feb 2022 00:20:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=EvHJf+2pzfovStVs+MZiZCf947haBubcOit7ajGSdfo=; b=NBeCTQSZCRuVW9OpVmpxPqJzIGfIlDzsypGvZJUAptkeN7nQVXG41qjoca/7Ohx3Fj j3VRQdJEh1ERpHkO83zomdNOjwN2tz4WYcv4O8GOTFfinwKPggRXF4t9nHVcA4NNu1G+ iQxrdi8w/jyeBLlIpz8H9maYYqVwXYB8Vm0c5O24Qd3LnMAaHoPeNTkeLNu/qo1BPDtA vs0HWJKZFefwVOLWKdYkAd8RnBuH8mPM+iN9eqnhFI+QhudSLamLlv5t/wizVc+Qy4e2 3KiKgvEwvJE5slb1jP6Tg1Vvd2KyQiZgQVvP/tHctTd8zP1TH6guA8UmEB6p7qBtEqu2 wpKw== X-Gm-Message-State: AOAM532Z749+ZikNOY9uoGx0BpZRFdWQZAJ49mEFMsE376QT03tiryUA hW7zgtDsabaN+ZseqVxzhEdkdoM0LOrlT5iwCcDM5Cchdle3fipQdd3QSweLeib/FsTx5A3CEic Wi0VX3DK8cXGFww1I9LAWtqg4BRd/DgxiZzGLQsAaQw== X-Received: by 2002:aa7:9d9b:: with SMTP id f27mr3385566pfq.84.1644308408159; Tue, 08 Feb 2022 00:20:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVMEw3NTbVITKusdMFSzdE8bcRzr/AptfBE8JVpxlbacuCrC3xd44Hc+rj5P+ukq9peJgoqQ== X-Received: by 2002:aa7:9d9b:: with SMTP id f27mr3385550pfq.84.1644308407944; Tue, 08 Feb 2022 00:20:07 -0800 (PST) Received: from [10.72.13.12] ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p1sm15934541pfh.98.2022.02.08.00.19.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 00:20:07 -0800 (PST) Message-ID: <29c05c6b-3ecb-73c4-81d2-eae07c3477a3@redhat.com> Date: Tue, 8 Feb 2022 16:19:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ To: Eugenio Perez Martin References: <20220121202733.404989-1-eperezma@redhat.com> <20220121202733.404989-24-eperezma@redhat.com> From: Jason Wang In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: Laurent Vivier , Parav Pandit , Cindy Lu , "Michael S. Tsirkin" , Richard Henderson , qemu-level , Gautam Dawar , Markus Armbruster , Eduardo Habkost , Harpreet Singh Anand , Xiao W Wang , Stefan Hajnoczi , Eli Cohen , Paolo Bonzini , Zhu Lingshan , virtualization , Eric Blake X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" CuWcqCAyMDIyLzIvMSDkuIrljYgzOjExLCBFdWdlbmlvIFBlcmV6IE1hcnRpbiDlhpnpgZM6Cj4+ PiArICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwo+Pj4gKyAgICAgICAgfQo+Pj4gKwo+Pj4gKyAg ICAgICAgLyoKPj4+ICsgICAgICAgICAqIE1hcC0+aW92YSBjaHVuayBzaXplIGlzIGlnbm9yZWQu IFdoYXQgdG8gZG8gaWYgZGVzY3JpcHRvcgo+Pj4gKyAgICAgICAgICogKGFkZHIsIHNpemUpIGRv ZXMgbm90IGZpdCBpcyBkZWxlZ2F0ZWQgdG8gdGhlIGRldmljZS4KPj4+ICsgICAgICAgICAqLwo+ PiBJIHRoaW5rIHdlIG5lZWQgYXQgbGVhc3QgY2hlY2sgdGhlIHNpemUgYW5kIGZhaWwgaWYgdGhl IHNpemUgZG9lc24ndAo+PiBtYXRjaCBoZXJlLiBPciBpcyBpdCBwb3NzaWJsZSB0aGF0IHdlIGhh dmUgYSBidWZmZXIgdGhhdCBtYXkgY3Jvc3MgdHdvCj4+IG1lbW9yeSByZWdpb25zPwo+Pgo+IEl0 IHNob3VsZCBiZSBpbXBvc3NpYmxlLCBzaW5jZSBib3RoIGlvdmFfdHJlZSBhbmQgVmlydFF1ZXVl IHNob3VsZCBiZQo+IGluIHN5bmMgcmVnYXJkaW5nIHRoZSBtZW1vcnkgcmVnaW9ucyB1cGRhdGVz LiBJZiBhIFZpcnRRdWV1ZSBidWZmZXIKPiBjcm9zc2VzIG1hbnkgbWVtb3J5IHJlZ2lvbnMsIGlv dmVjIGhhcyBtb3JlIGVudHJpZXMuCj4KPiBJIGNhbiBhZGQgYSByZXR1cm4gZmFsc2UsIGJ1dCBJ J20gbm90IGFibGUgdG8gdHJpZ2dlciB0aGF0IHNpdHVhdGlvbgo+IGV2ZW4gd2l0aCBhIG1hbGZv cm1lZCBkcml2ZXIuCj4KCk9rLCBidXQgaXQgd29uJ3QgaGFybSB0byBhZGQgYSB3YXJuIGhlcmUu CgpUaGFua3MKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f ClZpcnR1YWxpemF0aW9uIG1haWxpbmcgbGlzdApWaXJ0dWFsaXphdGlvbkBsaXN0cy5saW51eC1m b3VuZGF0aW9uLm9yZwpodHRwczovL2xpc3RzLmxpbnV4Zm91bmRhdGlvbi5vcmcvbWFpbG1hbi9s aXN0aW5mby92aXJ0dWFsaXphdGlvbg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B74B2C433EF for ; Tue, 8 Feb 2022 10:12:03 +0000 (UTC) Received: from localhost ([::1]:55446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHNTe-0004vb-U1 for qemu-devel@archiver.kernel.org; Tue, 08 Feb 2022 05:12:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHLjg-0005GT-7U for qemu-devel@nongnu.org; Tue, 08 Feb 2022 03:20:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHLja-0001jD-Gb for qemu-devel@nongnu.org; Tue, 08 Feb 2022 03:20:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644308412; 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=EvHJf+2pzfovStVs+MZiZCf947haBubcOit7ajGSdfo=; b=QztkmezO2Fae9G5oXG76EU5uD6eJ26ZIuNH41cpuv0M6o8eBWd8y9b8ZrjwD9MCAMGvhla DltL6ITEoH7thXjcW3IRdEKMpyDn/qfWYY48xCeDIC1xbZPMUWlL7KLeAEOQGJ2BhBKh3H +HILvifpjLdgA0+fFqJoND/Em4P/0mE= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-303-CPsBZSROP62sTVu42qYMCw-1; Tue, 08 Feb 2022 03:20:09 -0500 X-MC-Unique: CPsBZSROP62sTVu42qYMCw-1 Received: by mail-pl1-f200.google.com with SMTP id j1-20020a170903028100b0014b1f9e0068so7017643plr.8 for ; Tue, 08 Feb 2022 00:20:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=EvHJf+2pzfovStVs+MZiZCf947haBubcOit7ajGSdfo=; b=mULLO2Y7YmBiSFQjqN8MgOZgsdqEuLsuwslfNPvmVrCSwrqtQmc0pAVTIezpg37IzJ Vacn/uJ1uPRPmYGfML72NTu9ZRe80xs+o4HXH57OW9AX7K21yZfYxg92qSgspFLSPzmv xfNTfPNrcbtu/DnLmx6orcOVxx+8JCt2zLlFC1o4onruJ3h6yzwRA+7oRDEmPuwjPQbx 7kvBAnsfQuNWj0xEX10zHGAtaKxMEPHds64D1V1RzgryZp3AOGcUQ/gOE+TSK3QOCsKh 6P/QP2XGwglzHeJ9fclCaAh6pGy9oTxCkO+q0M5lhDIRihMRPnzulh8mIFr9vWQA5jO5 cjyg== X-Gm-Message-State: AOAM530U8x2svyrotdjL17/ReTyKWhvAapZJKq5PvtqnWnWmDg5dpAoi GxBUrp1OCbjBf6w3eNBQ0FCzucg4ORxTTiZVQhgzSOOX19R7tmFCuDNy4DHJJ/Fe/Pm/H3WB0FB LbRUYyYAVZjb/fgY= X-Received: by 2002:aa7:9d9b:: with SMTP id f27mr3385579pfq.84.1644308408166; Tue, 08 Feb 2022 00:20:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVMEw3NTbVITKusdMFSzdE8bcRzr/AptfBE8JVpxlbacuCrC3xd44Hc+rj5P+ukq9peJgoqQ== X-Received: by 2002:aa7:9d9b:: with SMTP id f27mr3385550pfq.84.1644308407944; Tue, 08 Feb 2022 00:20:07 -0800 (PST) Received: from [10.72.13.12] ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p1sm15934541pfh.98.2022.02.08.00.19.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 00:20:07 -0800 (PST) Message-ID: <29c05c6b-3ecb-73c4-81d2-eae07c3477a3@redhat.com> Date: Tue, 8 Feb 2022 16:19:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ To: Eugenio Perez Martin References: <20220121202733.404989-1-eperezma@redhat.com> <20220121202733.404989-24-eperezma@redhat.com> From: Jason Wang In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, 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: , Cc: Laurent Vivier , Parav Pandit , Cindy Lu , "Michael S. Tsirkin" , Juan Quintela , Richard Henderson , qemu-level , Gautam Dawar , Markus Armbruster , Eduardo Habkost , Harpreet Singh Anand , Xiao W Wang , Peter Xu , Stefan Hajnoczi , Eli Cohen , Paolo Bonzini , Zhu Lingshan , virtualization , Eric Blake , Stefano Garzarella Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 在 2022/2/1 上午3:11, Eugenio Perez Martin 写道: >>> + return false; >>> + } >>> + >>> + /* >>> + * Map->iova chunk size is ignored. What to do if descriptor >>> + * (addr, size) does not fit is delegated to the device. >>> + */ >> I think we need at least check the size and fail if the size doesn't >> match here. Or is it possible that we have a buffer that may cross two >> memory regions? >> > It should be impossible, since both iova_tree and VirtQueue should be > in sync regarding the memory regions updates. If a VirtQueue buffer > crosses many memory regions, iovec has more entries. > > I can add a return false, but I'm not able to trigger that situation > even with a malformed driver. > Ok, but it won't harm to add a warn here. Thanks