Re: [PATCH v12 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-11-04 Thread Xianting Tian
在 2021/11/2 下午2:33, Jiri Slaby 写道: On 28. 10. 21, 17:09, Xianting Tian wrote: As well known, hvc backend can register its opertions to hvc backend. the operations contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its operations. eg, put_chars() of virtio-console. But

[PATCH v12 0/2] make hvc pass dma capable memory to its backend

2021-10-28 Thread Xianting Tian
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 Be

[PATCH v12 2/2] virtio-console: remove unnecessary kmemdup()

2021-10-28 Thread Xianting Tian
This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/char/virtio

[PATCH v12 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-10-28 Thread Xianting Tian
find hvc's cons_outbuf and its lock. Introduce array cons_early_outbuf[] to ensure the mechanism of early console still work normally. With the patch, we can revert the fix c4baad5029. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 55 +

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-25 Thread Xianting Tian
在 2021/10/26 下午2:10, Greg KH 写道: On Tue, Oct 26, 2021 at 02:02:21PM +0800, Xianting Tian wrote: 在 2021/10/26 下午1:10, Jiri Slaby 写道: On 15. 10. 21, 4:46, Xianting Tian wrote: @@ -151,9 +142,11 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =   static void hvc_console_print(struct console

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-25 Thread Xianting Tian
在 2021/10/26 下午1:10, Jiri Slaby 写道: On 15. 10. 21, 4:46, Xianting Tian wrote: @@ -151,9 +142,11 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =   static void hvc_console_print(struct console *co, const char *b,     unsigned count)   { -    char c[N_OUTBUF] __ALIGNED__

Re: [PATCH v11 0/3] make hvc pass dma capable memory to its backend

2021-10-21 Thread Xianting Tian
I am very glad to get this reply:) Thank you and other experts' kindly help and guide, which improved me a lot. 在 2021/10/21 下午4:35, Greg KH 写道: On Fri, Oct 15, 2021 at 10:46:55AM +0800, Xianting Tian wrote: Dear all, This patch series make hvc framework pass DMA capable memory to put_

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-20 Thread Xianting Tian
hi Greg, Could I get  your comments of this new version patches? thanks 在 2021/10/15 上午10:46, Xianting Tian 写道: As well known, hvc backend can register its opertions to hvc backend. the operations contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its operations. eg

Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-15 Thread Xianting Tian
Hi Greg and experts Is this version ok for you?  thanks 在 2021/10/15 上午10:46, Xianting Tian 写道: As well known, hvc backend can register its opertions to hvc backend. the operations contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its operations. eg, put_chars() of

[PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-14 Thread Xianting Tian
asily find hvc's cons_outbuf and its lock. With the patch, we can revert the fix c4baad5029. Signed-off-by: Xianting Tian Signed-off-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 36 --- drivers/tty/hvc/hvc_console.h | 21 +++- 2 files c

[PATCH v11 3/3] virtio-console: remove unnecessary kmemdup()

2021-10-14 Thread Xianting Tian
This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/char/virtio

[PATCH v11 0/3] make hvc pass dma capable memory to its backend

2021-10-14 Thread Xianting Tian
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 Be

[PATCH v11 1/3] tty: hvc: use correct dma alignment size

2021-10-14 Thread Xianting Tian
Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)' as dma alignment is wrong. Signed-off-by: Xianting Tian Signed-off-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_console.c b/d

Re: [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-14 Thread Xianting Tian
在 2021/10/14 下午4:41, Greg KH 写道: On Thu, Oct 14, 2021 at 04:34:59PM +0800, Xianting Tian wrote: 在 2021/10/10 下午1:33, Greg KH 写道: On Sat, Oct 09, 2021 at 11:45:23PM +0800, Xianting Tian wrote: 在 2021/10/9 下午7:58, Greg KH 写道: Did you look at the placement using pahole as to how this

Re: [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-14 Thread Xianting Tian
在 2021/10/10 下午1:33, Greg KH 写道: On Sat, Oct 09, 2021 at 11:45:23PM +0800, Xianting Tian wrote: 在 2021/10/9 下午7:58, Greg KH 写道: Did you look at the placement using pahole as to how this structure now looks? thanks for all your commnts. for this one, do you mean I need to remove the blank

Re: [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-09 Thread Xianting Tian
在 2021/10/9 下午7:58, Greg KH 写道: Did you look at the placement using pahole as to how this structure now looks? thanks for all your commnts. for this one, do you mean I need to remove the blank line?  thanks

[PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-10-09 Thread Xianting Tian
uce another array(cons_hvcs[]) for hvc pointers next to the cons_ops[] and vtermnos[] arrays. With the array, we can easily find hvc's cons_outbuf and its lock. With the patch, we can revert the fix c4baad5029. Signed-off-by: Xianting Tian Signed-off-by: Shile Zhang --- drivers/tty/hv

[PATCH v10 3/3] virtio-console: remove unnecessary kmemdup()

2021-10-09 Thread Xianting Tian
This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/char/virtio

[PATCH v10 0/3] make hvc pass dma capable memory to its backend

2021-10-09 Thread Xianting Tian
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 Be

[PATCH v10 1/3] tty: hvc: use correct dma alignment size

2021-10-09 Thread Xianting Tian
Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)' is wrong. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc

Re: [PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-09-18 Thread Xianting Tian
thanks Greg, I will submit v9 patch for reviewing. Before, I was waiting for a new reply:( 在 2021/9/18 下午8:40, Greg KH 写道: On Sat, Sep 18, 2021 at 08:32:01PM +0800, Xianting Tian wrote: hi Will you consider to continue the disscussion of this patch? thanks I do not see a newer version of

Re: [PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-09-18 Thread Xianting Tian
hi Will you consider to continue the disscussion of this patch? thanks 在 2021/8/20 下午4:43, Xianting TIan 写道: 在 2021/8/20 下午2:49, Daniel Axtens 写道: Xianting Tian writes: As well known, hvc backend driver(eg, virtio-console) can register its operations to hvc framework. The operations can

Re: [PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-08-20 Thread Xianting TIan
在 2021/8/20 下午2:49, Daniel Axtens 写道: 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

Re: [PATCH v7 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-18 Thread Xianting TIan
在 2021/8/18 上午11:17, Jiri Slaby 写道: Hi, On 17. 08. 21, 15:22, Xianting Tian wrote: As well known, hvc backend can register its opertions to hvc backend. the opertions contain put_chars(), get_chars() and so on. "operations". And there too: Some hvc backend may do dma in its ope

[PATCH v8 3/3] virtio-console: remove unnecessary kmemdup()

2021-08-18 Thread Xianting Tian
This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/char/virtio

[PATCH v8 2/3] tty: hvc: pass DMA capable memory to put_chars()

2021-08-18 Thread Xianting Tian
y find the buffer, instead of traversing hp list. With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 27 --- drivers/tty/hvc/hvc_console.h | 16 ++-- 2 files changed, 26 i

[PATCH v8 0/3] make hvc pass dma capable memory to its backend

2021-08-18 Thread Xianting Tian
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 Be

[PATCH v8 1/3] tty: hvc: use correct dma alignment size

2021-08-18 Thread Xianting Tian
Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)' is wrong. Signed-off-by: Xianting Tian Reviewed-by: Shile Zhang --- drivers/tty/hvc/hvc_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc

Re: [PATCH v7 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-17 Thread Xianting TIan
在 2021/8/18 上午11:17, Jiri Slaby 写道: Hi, On 17. 08. 21, 15:22, Xianting Tian wrote: As well known, hvc backend can register its opertions to hvc backend. the opertions contain put_chars(), get_chars() and so on. "operations". And there too: Some hvc backend may do dma in its ope

Re: [PATCH v7 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-17 Thread Xianting TIan
在 2021/8/17 下午11:48, Greg KH 写道: On Tue, Aug 17, 2021 at 09:22:59PM +0800, Xianting Tian wrote: We tested the patch, it worked normally. Who is "we"? Signed-off-by: Xianting Tian Like I said before, I need another developer from your company to review and sign-off on this patc

[PATCH v7 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-17 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++

[PATCH v7 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-17 Thread Xianting Tian
e cons_ops[] and vtermnos[] arrays. With the array, we can easily find the hp, instead of traversing hp list. With the patch, we can remove the fix c4baad5029. We tested the patch, it worked normally. Signed-off-by: Xianting Tian --- drivers/tty/hvc/hvc_console.c | 39 +

[PATCH v7 0/2] make hvc pass dma capable memory to its backend

2021-08-17 Thread Xianting Tian
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 Be

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-13 Thread Xianting TIan
在 2021/8/13 下午1:53, Jiri Slaby 写道: Hi, On 12. 08. 21, 14:26, kernel test robot wrote: drivers/tty/hvc/hvc_console.c:190:26: warning: variable 'hp' is uninitialized when used here [-Wuninitialized]     spin_unlock_irqrestore(&hp->c_lock, flags);     ^~

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-13 Thread Xianting TIan
在 2021/8/13 下午3:27, Greg KH 写道: On Thu, Aug 12, 2021 at 05:45:31PM +0800, Xianting Tian wrote: As well known, hvc backend can register its opertions to hvc backend. the opertions contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its opertions. eg, put_chars() of

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/13 下午1:53, Jiri Slaby 写道: Hi, On 12. 08. 21, 14:26, kernel test robot wrote: drivers/tty/hvc/hvc_console.c:190:26: warning: variable 'hp' is uninitialized when used here [-Wuninitialized]     spin_unlock_irqrestore(&hp->c_lock, flags);     ^~

[PATCH v6 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-12 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++

[PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting Tian
the cons_ops[] and vtermnos[] arrays. With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian Tested-by: Xianting Tian --- drivers/tty/hvc/hvc_console.c | 40 +-- drivers/tty/hvc/hvc_console.h | 16 -- 2 files changed, 38

[PATCH v6 0/2] make hvc pass dma capable memory to its backend

2021-08-12 Thread Xianting Tian
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 Be

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/12 下午4:54, Arnd Bergmann 写道: On Thu, Aug 12, 2021 at 10:08 AM Xianting TIan wrote: 在 2021/8/6 下午10:51, Arnd Bergmann 写道: On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long I think you need a higher alignment for DMA

[PATCH v5 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-12 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++

[PATCH v5 0/2] make hvc pass dma capable memory to its backend

2021-08-12 Thread Xianting Tian
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 Be

[PATCH v5 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting Tian
is no longer the stack memory. we can use it in above two cases. Other cleanup is use ARCH_DMA_MINALIGN for align, and make 'hp->outbuf' aligned and use struct_size() for the size parameter of kzalloc(). With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/6 下午10:51, Arnd Bergmann 写道: On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian wrote: @@ -163,6 +155,13 @@ static void hvc_console_print(struct console *co, const char *b, if (vtermnos[index] == -1) return; + list_for_each_entry(hp, &hvc_structs,

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-07 Thread Xianting Tian
在 2021/8/6 下午10:51, Arnd Bergmann 写道: On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian wrote: @@ -163,6 +155,13 @@ static void hvc_console_print(struct console *co, const char *b, if (vtermnos[index] == -1) return; + list_for_each_entry(hp, &hvc_structs,

[PATCH v4 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-05 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++

[PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-05 Thread Xianting Tian
is no longer the stack memory. we can use it in above two cases. Other cleanup is to make 'hp->outbuf' aligned and use struct_size() to calculate the size of hvc_struct. With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian Test

[PATCH v4 0/2] make hvc pass dma capable memory to its backend

2021-08-05 Thread Xianting Tian
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 Be

Re: [PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-05 Thread Xianting Tian
在 2021/8/5 下午4:09, Jiri Slaby 写道: On 05. 08. 21, 9:58, Jiri Slaby wrote: Hi, On 04. 08. 21, 4:54, Xianting Tian wrote: @@ -933,6 +949,16 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,   hp->outbuf_size = outbuf_size;   hp->outbuf = &((char *)hp)[ALIGN(

Re: [PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-05 Thread Xianting Tian
在 2021/8/5 下午4:18, Greg KH 写道: On Thu, Aug 05, 2021 at 04:08:46PM +0800, Xianting Tian wrote: 在 2021/8/5 下午3:58, Jiri Slaby 写道: Hi, On 04. 08. 21, 4:54, Xianting Tian wrote: @@ -933,6 +949,16 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,   hp->outbuf_size = outbuf_s

Re: [PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-05 Thread Xianting Tian
在 2021/8/5 下午3:58, Jiri Slaby 写道: Hi, On 04. 08. 21, 4:54, Xianting Tian wrote: @@ -933,6 +949,16 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,   hp->outbuf_size = outbuf_size;   hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp), s

[PATCH v3 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-03 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++-- 1 fi

[PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-03 Thread Xianting Tian
f, which is aligned at least to N_OUTBUF, and use it in above two cases. With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian Tested-by: Xianting Tian --- drivers/tty/hvc/hvc_console.c | 30 -- drivers/tty/hvc/hvc_console.h | 2 ++ 2 fil

Re: [PATCH 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-02 Thread Xianting Tian
在 2021/8/2 下午3:25, Jiri Slaby 写道: Hi, why is this 2/2? I seem (Lore neither) to find 1/2. You didn't receive 1/2? [PATCH 1/2] tty: hvc: pass DMA capable memory to put_chars() https://lkml.org/lkml/2021/8/1/8 <https://lkml.org/lkml/2021/8/1/8> On 01. 08. 21, 7:16, Xianting Tian

Re: [PATCH 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-02 Thread Xianting Tian
在 2021/8/2 下午4:40, Jiri Slaby 写道: On 02. 08. 21, 10:32, Xianting Tian wrote: 在 2021/8/2 下午3:25, Jiri Slaby 写道: Hi, why is this 2/2? I seem (Lore neither) to find 1/2. You didn't receive 1/2? [PATCH 1/2] tty: hvc: pass DMA capable memory to put_chars() https://lkml.org/lkml/2021/

[PATCH 2/2] virtio-console: remove unnecessary kmemdup()

2021-07-31 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, remove it. Fixes: c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++-- 1 file

[PATCH 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-07-31 Thread Xianting Tian
t(), I didn’t use hp->outbuf, just allocate additional memory(length N_OUTBUF) and append it to hp->outbuf. For the issue in hvc_poll_put_char(), I use a static char to replace the char in stack. With the patch, we can remove the fix c4baad5029. Signed-off-by: Xianting Tian Tested-by: X

Re: [PATCH] virtio-console: avoid DMA from vmalloc area

2021-07-28 Thread Xianting Tian
在 2021/7/28 下午5:01, Arnd Bergmann 写道: On Wed, Jul 28, 2021 at 10:28 AM Xianting Tian wrote: 在 2021/7/28 下午3:25, Arnd Bergmann 写道: I checked several hvc backends, like drivers/tty/hvc/hvc_riscv_sbi.c, drivers/tty/hvc/hvc_iucv.c, drivers/tty/hvc/hvc_rtas.c, they don't use dma. I not fin