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 X-Spam-Level: X-Spam-Status: No, score=-20.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D989DC433FE for ; Mon, 6 Sep 2021 12:29:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 52BE961039 for ; Mon, 6 Sep 2021 12:29:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52BE961039 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNDkc-0002ZX-1A for qemu-devel@archiver.kernel.org; Mon, 06 Sep 2021 08:29:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNDjB-0001SZ-5T for qemu-devel@nongnu.org; Mon, 06 Sep 2021 08:27:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNDhD-00012W-CM for qemu-devel@nongnu.org; Mon, 06 Sep 2021 08:27:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630931152; 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=qdR2xbRj4VqzaCSz8E/O96zK/L3Jz0A73ySsrzdYY60=; b=WBVAtqDBeLMkKq+Pzfu43OcYEBeG9qgFeFlXPlhCyyM+kyL3UL0ujIH98T91FOyTuG+fUQ bH4YmhSxwCwqZAROglDZZ0lLJZ/SZwy87+aiRXLOtWlQjGlSLNsFXn0fhR8Z0XjZSGgvDJ IfyDj1UxOgRgqTdi/bU6PQ+73ezoNps= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-2tRs1cWePaSBmrdnxzcauw-1; Mon, 06 Sep 2021 08:25:51 -0400 X-MC-Unique: 2tRs1cWePaSBmrdnxzcauw-1 Received: by mail-wr1-f72.google.com with SMTP id r17-20020adfda510000b02901526f76d738so1170656wrl.0 for ; Mon, 06 Sep 2021 05:25:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=qdR2xbRj4VqzaCSz8E/O96zK/L3Jz0A73ySsrzdYY60=; b=aeSBhoygNHskKMha2i2ghCmUu9drOupK+KLfoUZLRvvFA58NinZhSfRudf94yrucjx h2gKKemKnzljq0LrmFXuOxH4zdhzGO3T1VgvkvQVUn89Lqn6KkAWxsWKm21BnLcGt5Ld uVCEcLSjS7leMlT/9rFeoXiIFJsI5G1gIZda0B+OdjvCiNwWumQ4jTe6xkA3TkKwNM1K aN7GvZaXQwThNGLCyg1Cs39B7DvwuiNfs5WClee4E81WbvfsIzopjaVUvu7hvcFYWKM+ HB0l2sTYIHxo46pjmOLTTIGyqOAJHDvYmqRoizYBgQrgh7N1uRS7wi3UsvZ3h/4jMmib FqaA== X-Gm-Message-State: AOAM530h7RK11eyMA69sqT9NDswoSXAs4GT4JhQe5gasQVUjwNCA6iVv B5P3aT9yRZBwzbIxwoo8Udd3HkBvQ/GgzAQYSyiDyLazDpck70ZfbInhOpLCeQNAMFBIGmEVfI0 ZU5paPBh5msWqAfzgD97upde6tbeoE9mzhJEjH4fIgF/JLAfnagSeTajMe1xfZ9g= X-Received: by 2002:a05:6000:23a:: with SMTP id l26mr12690715wrz.369.1630931150189; Mon, 06 Sep 2021 05:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMyP+taC4esGgk6nlc8RRXDFqVrlrC6PHHkYNfD0BhsUO76OMv4syAQzGu3cdVgKPyq0rOnA== X-Received: by 2002:a05:6000:23a:: with SMTP id l26mr12690692wrz.369.1630931149940; Mon, 06 Sep 2021 05:25:49 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6323.dip0.t-ipconnect.de. [91.12.99.35]) by smtp.gmail.com with ESMTPSA id 17sm6973161wmj.20.2021.09.06.05.25.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Sep 2021 05:25:49 -0700 (PDT) Subject: Re: [PATCH] docs/devel: memory: Document MemoryRegionOps requirement To: Bin Meng , Paolo Bonzini , Peter Xu References: <20210906122020.5793-1-bmeng.cn@gmail.com> From: David Hildenbrand Organization: Red Hat Message-ID: <5ca64439-7d68-e7d4-975c-429a9e744825@redhat.com> Date: Mon, 6 Sep 2021 14:25:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210906122020.5793-1-bmeng.cn@gmail.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=david@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 06.09.21 14:20, Bin Meng wrote: > It's been a requirement that at least one function pointer for read > and one for write are provided ever since the MemoryRegion APIs were > introduced in 2012. > > Signed-off-by: Bin Meng > --- > > docs/devel/memory.rst | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/docs/devel/memory.rst b/docs/devel/memory.rst > index 5dc8a12682..7b589b21d2 100644 > --- a/docs/devel/memory.rst > +++ b/docs/devel/memory.rst > @@ -344,6 +344,11 @@ based on the attributes used for the memory transaction, or need > to be able to respond that the access should provoke a bus error > rather than completing successfully; those devices can use the > ->read_with_attrs() and ->write_with_attrs() callbacks instead. > +The requirement for a device's MemoryRegionOps is that at least > +one callback for read and one for write are provided. If both > +->read() and ->read_with_attrs() are provided, the plain ->read() > +version takes precedence over the with_attrs() version. So does > +the write callback. Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb