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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 49714C432C0 for ; Mon, 25 Nov 2019 17:44:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2374B20740 for ; Mon, 25 Nov 2019 17:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574703878; bh=BSk9W21ymT3GUtrMJxVZeQIVQDVGoURtfbhfzwz5Pmo=; h=Subject:To:Cc:From:Date:List-ID:From; b=Ten3xFYTqBKdaAI2FBqoRO/aNPIsdiAgje/qSahbqC+LUXkZOgEG8nf0i9qEOJI3f 1vY2/NawxgPJN91e6/Wt9rdo5SopfqS5DmsQn1emFE21oxkWAwjFezuTWfn6i01DfN b2lI5LaJljBdA6JTtL/yooabQLjSPkPpjK9A2NJo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727420AbfKYRoh (ORCPT ); Mon, 25 Nov 2019 12:44:37 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:55553 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfKYRoh (ORCPT ); Mon, 25 Nov 2019 12:44:37 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 89B432276D; Mon, 25 Nov 2019 12:44:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 25 Nov 2019 12:44:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=zJeieG Lk3OWbTGny4UMQIB6yWrjT84rwTj1uCj2Fpxg=; b=By+BT/OXwFP1YnQuyzzMxP shTO6+LWrN3EyZaOw/ojDukk1tTVcaYmZ95wui5W+Sd6MV4XAc8FV7TUIXE3bIqq au3Oq6ihtC3JATyVCT+s2/35OTGUkblP7rVP0Dm5NYEnTJ7MYkMxmz3dmAwhaXEG 2Hi4ZgnbOd4Tl67DDgNjc5ypbhwQDpGzNgpxPhOTFroDf/36+H1nB2wkUFGvNslM Wrs0r8Svy/2of0uc4L3g3xRwaKGdLtZaF6A8wXhIBs2nefhFioiHiVEkNHNo8XNB yJtco0mosgWxcy6OC0gFcUeeriiFWSC8RdlOlrHnaBZauV7YtLUNZ95+MV6R8/0g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeiuddguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertd dttdflnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdho rhhgqeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhroh hmpehgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpeef X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 23BC7306005C; Mon, 25 Nov 2019 12:44:36 -0500 (EST) Subject: FAILED: patch "[PATCH] virtio_ring: fix return code on DMA mapping fails" failed to apply to 4.9-stable tree To: pasic@linux.ibm.com, mimu@linux.ibm.com, mst@redhat.com Cc: From: Date: Mon, 25 Nov 2019 18:44:27 +0100 Message-ID: <1574703867181183@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f7728002c1c7bfa787b276a31c3ef458739b8e7c Mon Sep 17 00:00:00 2001 From: Halil Pasic Date: Thu, 14 Nov 2019 13:46:46 +0100 Subject: [PATCH] virtio_ring: fix return code on DMA mapping fails Commit 780bc7903a32 ("virtio_ring: Support DMA APIs") makes virtqueue_add() return -EIO when we fail to map our I/O buffers. This is a very realistic scenario for guests with encrypted memory, as swiotlb may run out of space, depending on it's size and the I/O load. The virtio-blk driver interprets -EIO form virtqueue_add() as an IO error, despite the fact that swiotlb full is in absence of bugs a recoverable condition. Let us change the return code to -ENOMEM, and make the block layer recover form these failures when virtio-blk encounters the condition described above. Cc: stable@vger.kernel.org Fixes: 780bc7903a32 ("virtio_ring: Support DMA APIs") Signed-off-by: Halil Pasic Tested-by: Michael Mueller Signed-off-by: Michael S. Tsirkin diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index a8041e451e9e..867c7ebd3f10 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -583,7 +583,7 @@ static inline int virtqueue_add_split(struct virtqueue *_vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) @@ -1085,7 +1085,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static inline int virtqueue_add_packed(struct virtqueue *_vq,