From patchwork Wed Jun 22 06:38:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 12890245 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 0D76AC43334 for ; Wed, 22 Jun 2022 06:40:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BJGZHQjDar15y/C1DgjAJmpvV0bd+h6MEPK6GlTmG/k=; b=BcvEzjCH5f77Wh H+O7kLLBk8jsYjjX0s6jRX6ObRq6R8rjvmha/Acl7bRcrFUC8JD+p5jgcxt+znbPPOczAky6Cuj+W swIrP4BtNWdigd6I5cywl+vNEBBc15nGRrYroYgQVeXxJNVNrHj//s853OfMnftJhlb22cN5e0kL+ tlRJ7SCkV75pefOTAyAlbXcVxif/WZKjt4rPCbmyktinKH3osE4/Ep005q/ANUfMa95LdeI/PqBOv KhU6wzt8iAOK3dOKRbPywS0hgX6GfDcrO4iYAMW677L6vTVcrc0XEcsL2UPr+iV1HdmUsd/F/O8RF JRg+ESxJUciKLhdHk07A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3u0y-008rSY-A6; Wed, 22 Jun 2022 06:39:00 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3u0k-008rO8-GA for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 06:38:47 +0000 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 E416D1FA12; Wed, 22 Jun 2022 06:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1655879922; 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=QMRrUcaW7noQ1pULOfC6DTDxjpRydqT5qx5KdCmqN2s=; b=F2GAX4tgcaaJK09IKfBFeDbtHvOq+IkDEU7l7PrA3RhoibYo+uttdFz2t+qPZAaQOwDw3A fHEDcSKePj6ww5nUqqNiqcxwleIRpxn45rgsUtNEvK5o15XMISBUcJfW8fMTMeto1TiYz1 6avqbbonITmQT2qBICWookqie0msOhY= 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 31A45134A9; Wed, 22 Jun 2022 06:38:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gMq2CvK4smKNUAAAMHmgww (envelope-from ); Wed, 22 Jun 2022 06:38:42 +0000 From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Juergen Gross , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Michael S. Tsirkin" , Jason Wang , Stefano Stabellini , Oleksandr Tyshchenko , Arnd Bergmann , Russell King , Boris Ostrovsky , linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/3] virtio: support requiring restricted access per device Date: Wed, 22 Jun 2022 08:38:35 +0200 Message-Id: <20220622063838.8854-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220621_233846_724833_EA469B34 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of an all or nothing approach add support for requiring restricted memory access per device. Changes in V3: - new patches 1 + 2 - basically complete rework of patch 3 Juergen Gross (3): virtio: replace restricted mem access flag with callback kernel: remove platform_has() infrastructure xen: don't require virtio with grants for non-PV guests MAINTAINERS | 8 -------- arch/arm/xen/enlighten.c | 4 +++- arch/s390/mm/init.c | 4 ++-- arch/x86/mm/mem_encrypt_amd.c | 4 ++-- arch/x86/xen/enlighten_hvm.c | 4 +++- arch/x86/xen/enlighten_pv.c | 5 ++++- drivers/virtio/Kconfig | 4 ++++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio.c | 4 ++-- drivers/virtio/virtio_anchor.c | 18 +++++++++++++++++ drivers/xen/Kconfig | 9 +++++++++ drivers/xen/grant-dma-ops.c | 10 ++++++++++ include/asm-generic/Kbuild | 1 - include/asm-generic/platform-feature.h | 8 -------- include/linux/platform-feature.h | 19 ------------------ include/linux/virtio_anchor.h | 19 ++++++++++++++++++ include/xen/xen-ops.h | 6 ++++++ include/xen/xen.h | 8 -------- kernel/Makefile | 2 +- kernel/platform-feature.c | 27 -------------------------- 20 files changed, 84 insertions(+), 81 deletions(-) create mode 100644 drivers/virtio/virtio_anchor.c delete mode 100644 include/asm-generic/platform-feature.h delete mode 100644 include/linux/platform-feature.h create mode 100644 include/linux/virtio_anchor.h delete mode 100644 kernel/platform-feature.c Tested-by: Oleksandr Tyshchenko # Arm64 Reviewed-by: Stefano Stabellini