在 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
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
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
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 +
在 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
在 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__
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_
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
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
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
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
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
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
在 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
在 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
在 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
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
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
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
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
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
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
在 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
在 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
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
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
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
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
在 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
在 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
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 ++
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 +
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
在 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);
^~
在 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
在 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);
^~
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 ++
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
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
在 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
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 ++
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
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
在 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,
在 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,
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 ++
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
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
在 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(
在 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
在 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
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
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
在 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
在 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/
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
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
在 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
58 matches
Mail list logo