Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp246432pxt; Fri, 6 Aug 2021 00:35:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW9mxLIjvdaQcDFN1Di2pJMKTe485LBiwBdZuHDZEiWoRh8gMOxcytYm/G0y3oQp2B8WQp X-Received: by 2002:a02:a795:: with SMTP id e21mr1350310jaj.103.1628235320684; Fri, 06 Aug 2021 00:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628235320; cv=none; d=google.com; s=arc-20160816; b=aXiR8TorjjNgFIWYwhR/FRMe5XHUqrL2AQ5UeU9a3qjY02dT2YpD2cSXbljASfTAwM ec/mvAK+naAguxAp335TnlMP/MZmbMnGjdTgsCZ4IrMo9K8ryYmjjTZcIrfamWYoLCXM QyVa841C16/Mqa9cB/uQk3Fh/uLJHQS3xekVM1OER1HO1J5Cpb7I0o41D1K0ryGN5DPZ lpk0N0oOL5DCGQQH9VCwiP6CgzQFHHToVFXwA/tRGVtkMfDVkToV7WXz+81nkkkega/p 3jsC220wAn8i+PaR7GaWEL1UuFra5j32JpEdTxLbcsS5PWaxgI5mQLBcTOr58X39P4dm HanA== 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; bh=jhojrL714s/51tNiQiZeNYTri92UB83zrMCCUwFtU14=; b=wC7IOfHmbNLTryT0LsAjLO/RGnaF6GL0xDNXPRxVfd9WZH3Wkt7EGUCoeOaQFQ3A1Y HJ//CKp1a3QFpfoMQy1r2wMogL80mWc3U8iCCt2cgvRLf5YO82Yh5NHgKps84txhPusp 4oMmHrIjbT5wnq9sr8FNJscn+DF/JUvQiPgWS+VLLRIxPmPYC1civ1w0CRUZr9vTW7Db YCQ1zdD0f7DKuyc8IL6XlJv6tjM7ThiGoO/jKNgUjGiyXZD5dkbwUIMa68RefWhZ59kb VBvE989Lf4YOeDNqlK0F1Yc47U6jcsXSw0VtmHr3vmNZRH6CvAV54/xStGT9/Xuk2y+Y IH4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si8850614ilu.13.2021.08.06.00.35.09; Fri, 06 Aug 2021 00:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237246AbhHFDB7 (ORCPT + 99 others); Thu, 5 Aug 2021 23:01:59 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:48803 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhHFDB6 (ORCPT ); Thu, 5 Aug 2021 23:01:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Ui5askT_1628218900; Received: from localhost(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0Ui5askT_1628218900) by smtp.aliyun-inc.com(127.0.0.1); Fri, 06 Aug 2021 11:01:40 +0800 From: Xianting Tian To: gregkh@linuxfoundation.org, jirislaby@kernel.org, amit@kernel.org, arnd@arndb.de, osandov@fb.com Cc: linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, guoren@kernel.org, Xianting Tian Subject: [PATCH v4 0/2] make hvc pass dma capable memory to its backend Date: Fri, 6 Aug 2021 11:01:36 +0800 Message-Id: <20210806030138.123479-1-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear all, This patch series make hvc framework pass DMA capable memory to put_chars() of hvc backend(eg, virtio-console), and revert commit c4baad5029 ("virtio-console: avoid DMA from stackā€) V1 virtio-console: avoid DMA from vmalloc area https://lkml.org/lkml/2021/7/27/494 For v1 patch, Arnd Bergmann suggests to fix the issue in the first place: Make hvc pass DMA capable memory to put_chars() The fix suggestion is included in v2. V2 [PATCH 1/2] tty: hvc: pass DMA capable memory to put_chars() https://lkml.org/lkml/2021/8/1/8 [PATCH 2/2] virtio-console: remove unnecessary kmemdup() https://lkml.org/lkml/2021/8/1/9 For v2 patch, Arnd Bergmann suggests to make new buf part of the hvc_struct structure, and fix the compile issue. The fix suggestion is included in v3. V3 [PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars() https://lkml.org/lkml/2021/8/3/1347 [PATCH v3 2/2] virtio-console: remove unnecessary kmemdup() https://lkml.org/lkml/2021/8/3/1348 For v3 patch, Jiri Slaby suggests to make 'char c[N_OUTBUF]' part of hvc_struct, and make 'hp->outbuf' aligned and use struct_size() to calculate the size of hvc_struct. The fix suggestion is included in v4. drivers/char/virtio_console.c | 12 ++---------- drivers/tty/hvc/hvc_console.c | 33 ++++++++++++++++++--------------- drivers/tty/hvc/hvc_console.h | 16 ++++++++++++++-- 3 file changed