Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1431135pxb; Fri, 20 Aug 2021 05:35:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoFzgsycPD/wSX6CjuLAANLzrRIH1V4/HJ7FyJzhYh6YrZaT5IKOqZkb2isZvy3RhHzQOZ X-Received: by 2002:a5d:81c1:: with SMTP id t1mr15964454iol.31.1629462936887; Fri, 20 Aug 2021 05:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629462936; cv=none; d=google.com; s=arc-20160816; b=o7iaD/RR7AqzyiSdGSlR7uqicfxD2W4WTGc87vYzAEhk/lju29wh1hZm6j3qhjiHz1 0vN8JOhEdKCQUvfLhf32jBVU/CcH+heRb6ALxzfLlrNNmXMStA1zSOtR6ke18f3KjxG0 CqAcboOiTYAslfDQKoXumExHKLXaSvo7gGGKuutwxv19LtR5biVQs/nod5rwUGsJJF8N NpMEC/hpZ5oqsUG8eO80JybIYs1Im2YAYcpmpdTnF6kYxInL5CFcMhBI3yourdHURAw3 VhN94iy5pVCHVJxYCd1FlmmjPl8sB3d+roItLdSBMgxufe/6ItHk35URsD/DBEO2FtHv 6y5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=RvSoZj9qGbuGPBLusBDgZESowYHwhMMiBJyC8aIMk60=; b=O8p/UZKKd9NYXBsrpYL9MaW07B6DE+oxzkd10NokrHAuVn7pWQ8nxQuK+e92iaRdln EMsX9F9rsy8emLUts3KK1sVd8CmlHq5Bd40BtiC1PcHbRpI/3mfqjTR7XI9r0FeaIleW FkfHQbl+Odm/sBfYF1J6nucsCeEeQBrfr+k1/e1ybAn9uCUpnATo9UK2828SazwdEoak wDk1sxg2qthwZp73Bw9ak95whSeHwTfOdmSCWqxG1ZEPzw4y60EpC2cEdeFPH4bpTPki l9Dv0tbIAGR347v4/Gp9kHGw3NN2Rlvq484j/PhaI+0fdQYNKk+7gGEGs5vuQ9A3tSnI Dr1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=mtQUVDWV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si6159955jan.7.2021.08.20.05.35.25; Fri, 20 Aug 2021 05:35:36 -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; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=mtQUVDWV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240589AbhHTMer (ORCPT + 99 others); Fri, 20 Aug 2021 08:34:47 -0400 Received: from ozlabs.org ([203.11.71.1]:43873 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240538AbhHTMeo (ORCPT ); Fri, 20 Aug 2021 08:34:44 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Grgzv3Qhxz9sWq; Fri, 20 Aug 2021 22:34:03 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1629462845; bh=RvSoZj9qGbuGPBLusBDgZESowYHwhMMiBJyC8aIMk60=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mtQUVDWVN21fl7CB8Gv+bXzF4FyNyW44mL2BYz7qsbt/eYeNT69e584cR6zMVbxqO ynl5XZWnLQ45izhHFGBbzG1riwSDXF5HxR7P6MYnAHHiOX2/bE53XIUnaRqRJMDFAm P8zAFSBs7KWapWa9nTnuKg/KNnO3bZ2mOUawCw+CDy+9UnJXlCv1wJXqDWlnNolPaB rXl1Ck3kKrE+EXgUNuoH0szMYFn4EqkJTs0hQNEXiHpEp16L82OBAnWkCq19clUSEG 6/9GTOU9oqC5kGb9R5dOO/Mh4wDbKHUsiboA1eolxLil/INGfzViLXj4lvJnbxaRGw 0qe92o3jgy8cw== From: Michael Ellerman To: Daniel Axtens , Xianting Tian , gregkh@linuxfoundation.org, jirislaby@kernel.org, amit@kernel.org, arnd@arndb.de, osandov@fb.com Cc: Xianting Tian , shile.zhang@linux.alibaba.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars() In-Reply-To: <87pmu8ehkk.fsf@linkitivity.dja.id.au> References: <20210818082122.166881-1-xianting.tian@linux.alibaba.com> <20210818082122.166881-3-xianting.tian@linux.alibaba.com> <87pmu8ehkk.fsf@linkitivity.dja.id.au> Date: Fri, 20 Aug 2021 22:34:02 +1000 Message-ID: <87pmu8cn2d.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Daniel Axtens writes: > Xianting Tian writes: > >> As well known, hvc backend driver(eg, virtio-console) can register its >> operations to hvc framework. The operations can contain put_chars(), >> get_chars() and so on. >> >> Some hvc backend may do dma in its operations. eg, put_chars() of >> virtio-console. But in the code of hvc framework, it may pass DMA >> incapable memory to put_chars() under a specific configuration, which >> is explained in commit c4baad5029(virtio-console: avoid DMA from stack): > > We could also run into issues on powerpc where Andrew is working on > adding vmap-stack but the opal hvc driver assumes that it is passed a > buffer which is not in vmalloc space but in the linear mapping. The right fix for that is our code that calls opal has to be careful that it's not passing vmalloc addresses. We have many cases where we pass stack variables to opal, they'll all have to be fixed to pass the underlying phyiscal/linear map address. The opal hvc code will just be one more case of that. cheers