Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3626273lfb; Mon, 9 May 2022 00:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZfoUTNpMMdYHCd3zAbqYtbLYjt90zaxpadcuEY9ZRsQK1rVus9+H0G/aS0JtbCfDEoe4V X-Received: by 2002:a17:90b:380e:b0:1dc:d421:904a with SMTP id mq14-20020a17090b380e00b001dcd421904amr17323054pjb.152.1652080610173; Mon, 09 May 2022 00:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652080610; cv=none; d=google.com; s=arc-20160816; b=zzpOG+OUYyEsmy2+rmvZZXfj5BXb9HfMD6jCbjIjI8+nSMGB+GilBD4I3y+NnGADCL lVgAAeJzBTcToAM4gqeT57z7C2gHv04iTPlTwGaXcCizNqcKhs8ODl6if0t1KPMYye2+ 3Nib5U7w0s6EgexJQXBy0diULLmOr0BXDNj2wjMg/wp59u/wHpiVZFJGaUQft2CEtFs6 qam+TDK3myJ9yJhBTYeUrXeGrwWWj7cDwpOHvLLT5fnQTSZRsBhZaMyE5eSBdMDKGoYp 2EG54cCGgQZFxTqkIcKSUOVjGbZgKAoWw/ipSSNJTow/VmcBaA/3fhzEFtyERPw3lSQv VTjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+rG3u9WN3fpKsJ0oR6FOTx9SGcpcZNwJpHRZoiitWn0=; b=KDJ4JXClW0kQd8aG2HPINKh//DE6BASpIajtpwoDpBtrxsTVDr1FYIyVf4yGkx3Xyi 0qnGcsMYKyoEgkUhS4h4fJ0D2McMvPa44G8Lm2RxRHCHSNIAdFNYSEZFV0lXYsWGIiMO RrHPmOczS7hN3J56pHehPM5IcS0Amms+2oQsyc/x8L6r9WnuQ04uft7IhfvHNj/OmQTo cjjXvOI3gMzVmUfz112zEAAkE5YmhPDfxdSsR0Z5IFLMPLoSDYYPe8NgfchFH6QPM7xI NNW4W6ku0fNxMabK2abqLy6ePfF6VPtdREOebfY/QeQw8+7inhdTvUiCwuIoS/ITbD7p +GMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=iZYfwDJO; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k63-20020a638442000000b003c686c72a9bsi6952621pgd.395.2022.05.09.00.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:16:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=iZYfwDJO; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D8AF816A248; Mon, 9 May 2022 00:12:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347183AbiEEIUq (ORCPT + 99 others); Thu, 5 May 2022 04:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347014AbiEEIUY (ORCPT ); Thu, 5 May 2022 04:20:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5738F49264; Thu, 5 May 2022 01:16:45 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DD1AE1F37F; Thu, 5 May 2022 08:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651738603; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+rG3u9WN3fpKsJ0oR6FOTx9SGcpcZNwJpHRZoiitWn0=; b=iZYfwDJOH3Rm9o+MLXSeu50EFMfd04XPhuJ/CB2/T6Z6DRtP11UcKJwcKyHntgX/sKa2RI CH6o5/RIWxX7F43gvAY3CXkLN0l6PCPqFBQnpY4226kszreGPap8IbAxANXT9XN+5OGMsS 82Q6oURWAFQNrJrP+mu5LGGeKvQm574= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0D03F13B11; Thu, 5 May 2022 08:16:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QqHGAeuHc2K1BwAAMHmgww (envelope-from ); Thu, 05 May 2022 08:16:43 +0000 From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-integrity@vger.kernel.org, linux-pci@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jens Axboe , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "James E.J. Bottomley" , "Martin K. Petersen" , Greg Kroah-Hartman , Oleksandr Andrushchenko , David Airlie , Daniel Vetter , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Bjorn Helgaas Subject: [PATCH v3 00/21] xen: simplify frontend side ring setup Date: Thu, 5 May 2022 10:16:19 +0200 Message-Id: <20220505081640.17425-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Many Xen PV frontends share similar code for setting up a ring page (allocating and granting access for the backend) and for tearing it down. Create new service functions doing all needed steps in one go. This requires all frontends to use a common value for an invalid grant reference in order to make the functions idempotent. Changes in V3: - new patches 1 and 2, comments addressed Changes in V2: - new patch 9 and related changes in patches 10-18 Juergen Gross (21): xen: update grant_table.h xen/grant-table: never put a reserved grant on the free list xen/blkfront: switch blkfront to use INVALID_GRANT_REF xen/netfront: switch netfront to use INVALID_GRANT_REF xen/scsifront: remove unused GRANT_INVALID_REF definition xen/usb: switch xen-hcd to use INVALID_GRANT_REF xen/drm: switch xen_drm_front to use INVALID_GRANT_REF xen/sound: switch xen_snd_front to use INVALID_GRANT_REF xen/dmabuf: switch gntdev-dmabuf to use INVALID_GRANT_REF xen/shbuf: switch xen-front-pgdir-shbuf to use INVALID_GRANT_REF xen: update ring.h xen/xenbus: add xenbus_setup_ring() service function xen/blkfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/netfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/tpmfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/drmfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/pcifront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/scsifront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/usbfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/sndfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/xenbus: eliminate xenbus_grant_ring() drivers/block/xen-blkfront.c | 57 +++---- drivers/char/tpm/xen-tpmfront.c | 18 +-- drivers/gpu/drm/xen/xen_drm_front.h | 9 -- drivers/gpu/drm/xen/xen_drm_front_evtchnl.c | 43 ++---- drivers/net/xen-netfront.c | 85 ++++------- drivers/pci/xen-pcifront.c | 19 +-- drivers/scsi/xen-scsifront.c | 31 +--- drivers/usb/host/xen-hcd.c | 65 ++------ drivers/xen/gntdev-dmabuf.c | 13 +- drivers/xen/grant-table.c | 12 +- drivers/xen/xen-front-pgdir-shbuf.c | 18 +-- drivers/xen/xenbus/xenbus_client.c | 82 +++++++--- include/xen/grant_table.h | 2 - include/xen/interface/grant_table.h | 161 ++++++++++++-------- include/xen/interface/io/ring.h | 19 ++- include/xen/xenbus.h | 4 +- sound/xen/xen_snd_front_evtchnl.c | 44 ++---- sound/xen/xen_snd_front_evtchnl.h | 9 -- 18 files changed, 287 insertions(+), 404 deletions(-) -- 2.35.3