From patchwork Mon Dec 5 09:51:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 631049 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2427029pvb; Mon, 5 Dec 2022 02:05:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf6I3rfGoJhqWgdrk5XvDq+loDsTrgcJvqMU9tgasUOh52iJtJJ6135age9gy9uLvbB8yXnG X-Received: by 2002:a0c:ef0b:0:b0:4c6:e904:3582 with SMTP id t11-20020a0cef0b000000b004c6e9043582mr40483671qvr.112.1670234753929; Mon, 05 Dec 2022 02:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670234753; cv=none; d=google.com; s=arc-20160816; b=sQRbimAzrbhFCdv2CVEbdU1S3zmPg7e9hhViSnO4zEwP+ckNw5GeoLMOASE0utOyjO UXeig2AvPmcjlCqVg5FUox4rnLmXUPFP08fYb7/n9vZ3znwKY9axm80kueonBZTx8gh3 C7u1UL/2c5oqFYo1qWsspvNwlEyv2EcE2/2kLKJBebWZFPFFAY/4PmtW4x0zZYHq+hni J/iJPSTglihYiB0Gyd9jTQshBRwhBLo2/eJa1w5IzX7ETF/OB1ABTt9U2xqJz0uqbVVZ TvFZ+Zwx7wwpeCaoVhFqNNHiKvsR7wiSnFQ1trILIaFU5HwhCswlPfhgbwjPkablnPEf +Z4g== 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=vhSDhIeSjhWPGH/YRvNS3wqYgEd3nq856LWIZM6CoaU=; b=K1FNUqUn45oTA8i7NbsE3wo8gZSWZXeoEa0xtG+5VPM0V/c9+TfR34HGI6R96K8+T1 wXkxY9nSGvx1yGUgA9pWk2S/+D/VpJct59F5eN8HoLdSHcckFqeM7o1B/G03bggygcfm Ncrgp/CxR33V1+dfe52VyDCa4EeYl9LQJywdYmF5bX7TN9ajatgmp2zmU3Jf+UeNN7Ll 12kz0xOaD7Da2aKCIhEL2N411Q0H/qJkwG63unFErq9DSGeMrc5bmiu87gRSczN7cyKv 1iexkYwxG6uz3HD7/Xt4Tsr6aMYcmN87UYEGl3udvNmukQl66gnd8WiWNR+96xtfXcKO CyVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TQx617ha; 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 x12-20020a05620a14ac00b006febf853eb5si1251519qkj.759.2022.12.05.02.05.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Dec 2022 02:05:53 -0800 (PST) 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=TQx617ha; 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 1p28AM-0000lG-Ds; Mon, 05 Dec 2022 04:53:38 -0500 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 1p28AB-0000dX-9z for qemu-devel@nongnu.org; Mon, 05 Dec 2022 04:53:28 -0500 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 1p28A8-0006SA-NH for qemu-devel@nongnu.org; Mon, 05 Dec 2022 04:53:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670234004; 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=vhSDhIeSjhWPGH/YRvNS3wqYgEd3nq856LWIZM6CoaU=; b=TQx617hakVnVntdBm40+3qOPKND1LYLeR+cT0y44gHWmuhCuD6+bCDR/3A+AosvaKOPz0H A7vOmpEBT86sC8ntLofY4f9qzqXNKu+uHKN3WI2zzHtNq+BhyvCS9z+mz3poSbiblFlOxB pMeokZVgWrgaKYyB9+Pp9TqsXDurAgU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-8YXU1xDhMUavtm--5Ww-Tg-1; Mon, 05 Dec 2022 04:53:22 -0500 X-MC-Unique: 8YXU1xDhMUavtm--5Ww-Tg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1CC73C0E204; Mon, 5 Dec 2022 09:53:20 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C8BD2166B29; Mon, 5 Dec 2022 09:53:13 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Cc: Fam Zheng , Thomas Huth , Viresh Kumar , Kevin Wolf , Mathieu Poirier , Laurent Vivier , Eric Blake , Richard Henderson , Raphael Norwitz , Stefan Hajnoczi , Juan Quintela , virtio-fs@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Christian Borntraeger , "Gonglei (Arei)" , qemu-block@nongnu.org, Xiaojuan Yang , Thomas Huth , Ilya Leoshkevich , Eduardo Habkost , Gerd Hoffmann , "Dr. David Alan Gilbert" , Alex Williamson , Eric Farman , Halil Pasic , Peter Maydell , Vladimir Sementsov-Ogievskiy , Jason Wang , Laurent Vivier , Song Gao , qemu-s390x@nongnu.org, Pavel Dovgalyuk , Klaus Jensen , John Snow , Michael Tokarev , qemu-arm@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Keith Busch , David Hildenbrand , qemu-trivial@nongnu.org, Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= Subject: [PATCH v2 05/51] hw/display/qxl: Document qxl_phys2virt() Date: Mon, 5 Dec 2022 10:51:42 +0100 Message-Id: <20221205095228.1314-6-quintela@redhat.com> In-Reply-To: <20221205095228.1314-1-quintela@redhat.com> References: <20221205095228.1314-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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é Reviewed-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi Message-Id: <20221128202741.4945-3-philmd@linaro.org> --- hw/display/qxl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/display/qxl.h b/hw/display/qxl.h index e74de9579d..78b3a6c9ba 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -147,6 +147,25 @@ OBJECT_DECLARE_SIMPLE_TYPE(PCIQXLDevice, PCI_QXL) #define QXL_DEFAULT_REVISION (QXL_REVISION_STABLE_V12 + 1) /* qxl.c */ +/** + * qxl_phys2virt: Get a pointer within a PCI VRAM memory region. + * + * @qxl: QXL device + * @phys: physical offset of buffer within the VRAM + * @group_id: memory slot group + * + * Returns a host pointer to a buffer placed at offset @phys within the + * active slot @group_id of the PCI VGA RAM memory region associated with + * the @qxl device. If the slot is inactive, or the offset is out + * of the memory region, returns NULL. + * + * Use with care; by the time this function returns, the returned pointer is + * not protected by RCU anymore. If the caller is not within an RCU critical + * section and does not hold the iothread lock, it must have other means of + * protecting the pointer, such as a reference to the region that includes + * the incoming ram_addr_t. + * + */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...) G_GNUC_PRINTF(2, 3);