[PATCH v3 1/2] KVM: x86: always stop emulation on page fault

2019-08-29 Thread Jan Dakinevich
: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") Cc: Denis Lunev Cc: Roman Kagan Cc: Denis Plotnikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/x86.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c ind

[PATCH v3 0/2] fix emulation error on Windows bootup

2019-08-29 Thread Jan Dakinevich
- do sanity check in caller code - drop patch, that moved emulation_type() function Jan Dakinevich (2): KVM: x86: always stop emulation on page fault KVM: x86: set ctxt->have_exception in x86_decode_insn() arch/x86/kvm/emulate.c | 2 ++ arch/x86/kvm/x86.c | 7 ++- 2 files chang

[PATCH v3 2/2] KVM: x86: set ctxt->have_exception in x86_decode_insn()

2019-08-29 Thread Jan Dakinevich
nikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/emulate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index bef3c3c..698efb8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -5416,6 +5416,8 @@ int x86_decod

[PATCH v2 0/3] fix emulation error on Windows bootup

2019-08-28 Thread Jan Dakinevich
queue - add sanity check for exception value of exception vector Jan Dakinevich (3): KVM: x86: always stop emulation on page fault KVM: x86: make exception_class() and exception_type() globally visible KVM: x86: set ctxt->have_exception in x86_decode_insn() arch/x86/kvm/emulate.c | 5 +++

[PATCH v2 1/3] KVM: x86: always stop emulation on page fault

2019-08-28 Thread Jan Dakinevich
: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") Cc: Denis Lunev Cc: Roman Kagan Cc: Denis Plotnikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/x86.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c ind

[PATCH v2 2/3] KVM: x86: make exception_class() and exception_type() globally visible

2019-08-28 Thread Jan Dakinevich
exception_type() function was moved for upcoming sanity check in emulation code. exceptions_class() function is not supposed to be used right now, but it was moved as well to keep things together. Cc: Denis Lunev Cc: Roman Kagan Cc: Denis Plotnikov Signed-off-by: Jan Dakinevich --- arch/x86

[PATCH v2 3/3] KVM: x86: set ctxt->have_exception in x86_decode_insn()

2019-08-28 Thread Jan Dakinevich
nikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/emulate.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index bef3c3c..74b4d79 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -5416,6 +5416,11 @@ int x86_decod

Re: [PATCH 3/3] KVM: x86: always stop emulation on page fault

2019-08-28 Thread Jan Dakinevich
On Tue, 27 Aug 2019 07:50:30 -0700 Sean Christopherson wrote: > +Cc Peng Hao and Yi Wang > > On Tue, Aug 27, 2019 at 01:07:09PM +0000, Jan Dakinevich wrote: > > inject_emulated_exception() returns true if and only if nested page > > fault happens. However, page fault can

Re: [PATCH 2/3] KVM: x86: set ctxt->have_exception in x86_decode_insn()

2019-08-28 Thread Jan Dakinevich
On Tue, 27 Aug 2019 07:53:58 -0700 Sean Christopherson wrote: > On Tue, Aug 27, 2019 at 01:07:08PM +0000, Jan Dakinevich wrote: > > x86_emulate_instruction() takes into account ctxt->have_exception flag > > during instruction decoding, but in practice this

[PATCH 0/3] fix emulation error on Windows bootup

2019-08-27 Thread Jan Dakinevich
me an advise if it is the correct handling of guest page fault? Jan Dakinevich (3): KVM: x86: fix wrong return code KVM: x86: set ctxt->have_exception in x86_decode_insn() KVM: x86: always stop emulation on page fault arch/x86/kvm/emulate.c | 4 +++- arch/x86/kvm/x86.c | 4 +++- 2

[PATCH 2/3] KVM: x86: set ctxt->have_exception in x86_decode_insn()

2019-08-27 Thread Jan Dakinevich
nikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/emulate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 6170ddf..f93880f 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -5395,6 +5395,8 @@ int x86_decod

[PATCH 3/3] KVM: x86: always stop emulation on page fault

2019-08-27 Thread Jan Dakinevich
: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") Cc: Denis Lunev Cc: Roman Kagan Cc: Denis Plotnikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/x86.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c ind

[PATCH 1/3] KVM: x86: fix wrong return code

2019-08-27 Thread Jan Dakinevich
are equal to 0) this change makes code more consistent and it is required for further fixes. Cc: Denis Lunev Cc: Roman Kagan Cc: Denis Plotnikov Signed-off-by: Jan Dakinevich --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b

[PATCH 2/3] netlink: always use vmapped memory for skb data

2019-08-22 Thread Jan Dakinevich
one() become equal to generic skb_clone() and can be dropped. Signed-off-by: Jan Dakinevich --- include/linux/netlink.h | 16 net/ipv4/fib_frontend.c | 2 +- net/netfilter/nfnetlink.c | 2 +- net/netlink/af_netlink.c | 16 +++- 4 files changed, 5 insertions(+),

[PATCH 0/3] rework netlink skb allocation

2019-08-22 Thread Jan Dakinevich
broadcast messages to be allocated with vmalloc() as well as unicast. Jan Dakinevich (3): skbuff: use kvfree() to deallocate head netlink: always use vmapped memory for skb data netlink: use generic skb_set_owner_r() include/linux/netlink.h | 16 net/core/skbuff.c

[PATCH 1/3] skbuff: use kvfree() to deallocate head

2019-08-22 Thread Jan Dakinevich
If skb buffer was allocated using vmalloc() it will make simple its further deallocation. Signed-off-by: Jan Dakinevich --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 0338820..55eac01 100644 --- a/net/core

[PATCH 3/3] netlink: use generic skb_set_owner_r()

2019-08-22 Thread Jan Dakinevich
Since skb destructor is not used for data deallocating, netlink_skb_set_owner_r() almost completely repeates generic skb_set_owner_r(). Thus, both netlink_skb_set_owner_r() and netlink_skb_destructor() are not required anymore. Signed-off-by: Jan Dakinevich --- net/netlink/af_netlink.c | 23

[PATCH] af_unix: utilize skb's fragment list for sending large datagrams

2019-08-22 Thread Jan Dakinevich
ist of skb (->frag_list) in addition to paged part for huge datagrams. Signed-off-by: Jan Dakinevich --- net/unix/af_unix.c | 38 +++--- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 67e87db..0

[PATCH 1/3] skbuff: use kvfree() to deallocate head

2019-08-22 Thread Jan Dakinevich
If skb buffer was allocated using vmalloc() it will make simple its further deallocation. Signed-off-by: Jan Dakinevich --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 0338820..55eac01 100644 --- a/net/core

[PATCH 3/3] netlink: use generic skb_set_owner_r()

2019-08-22 Thread Jan Dakinevich
Since skb destructor is not used for data deallocating, netlink_skb_set_owner_r() almost completely repeates generic skb_set_owner_r(). Thus, both netlink_skb_set_owner_r() and netlink_skb_destructor() are not required anymore. Signed-off-by: Jan Dakinevich --- net/netlink/af_netlink.c | 23

[PATCH 2/3] netlink: always use vmapped memory for skb data

2019-08-22 Thread Jan Dakinevich
one() become equal to generic skb_clone() and can be dropped. Signed-off-by: Jan Dakinevich --- include/linux/netlink.h | 16 net/ipv4/fib_frontend.c | 2 +- net/netfilter/nfnetlink.c | 2 +- net/netlink/af_netlink.c | 16 +++- 4 files changed, 5 insertions(+),

[PATCH 0/3] rework netlink skb allocation

2019-08-22 Thread Jan Dakinevich
broadcast messages to be allocated with vmalloc() as well as unicast. Jan Dakinevich (3): skbuff: use kvfree() to deallocate head netlink: always use vmapped memory for skb data netlink: use generic skb_set_owner_r() include/linux/netlink.h | 16 net/core/skbuff.c

Re: [PATCH 0/4] IB: decrease large contigous allocation

2018-09-26 Thread Jan Dakinevich
On Tue, 18 Sep 2018 08:46:23 -0600 Jason Gunthorpe wrote: > On Tue, Sep 18, 2018 at 04:03:42PM +0300, Jan Dakinevich wrote: > > The size of mlx4_ib_device became too large to be allocated as > > whole contigous block of memory. Currently it takes about 55K. On > > arch

Re: [PATCH 0/4] IB: decrease large contigous allocation

2018-09-26 Thread Jan Dakinevich
On Tue, 18 Sep 2018 08:46:23 -0600 Jason Gunthorpe wrote: > On Tue, Sep 18, 2018 at 04:03:42PM +0300, Jan Dakinevich wrote: > > The size of mlx4_ib_device became too large to be allocated as > > whole contigous block of memory. Currently it takes about 55K. On > > arch

Re: [PATCH 0/4] IB: decrease large contigous allocation

2018-09-26 Thread Jan Dakinevich
On Wed, 19 Sep 2018 00:23:51 +0300 Leon Romanovsky wrote: > On Tue, Sep 18, 2018 at 08:46:23AM -0600, Jason Gunthorpe wrote: > > On Tue, Sep 18, 2018 at 04:03:42PM +0300, Jan Dakinevich wrote: > > > The size of mlx4_ib_device became too large to be allocated as > >

Re: [PATCH 0/4] IB: decrease large contigous allocation

2018-09-26 Thread Jan Dakinevich
On Wed, 19 Sep 2018 00:23:51 +0300 Leon Romanovsky wrote: > On Tue, Sep 18, 2018 at 08:46:23AM -0600, Jason Gunthorpe wrote: > > On Tue, Sep 18, 2018 at 04:03:42PM +0300, Jan Dakinevich wrote: > > > The size of mlx4_ib_device became too large to be allocated as > >

[PATCH 2/4] IB/mlx4: move iboe field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 1st patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 8K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/main.c| 65 ++-- drivers/infiniband/hw/mlx4

[PATCH 2/4] IB/mlx4: move iboe field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 1st patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 8K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/main.c| 65 ++-- drivers/infiniband/hw/mlx4

[PATCH 4/4] IB/mlx4: move sriov field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 3rd patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 6K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/alias_GUID.c | 192 drivers/infiniband/hw/mlx4/cm.c

[PATCH 4/4] IB/mlx4: move sriov field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 3rd patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 6K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/alias_GUID.c | 192 drivers/infiniband/hw/mlx4/cm.c

[PATCH 3/4] IB/mlx4: move pkeys field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 2nd patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 36K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/mad.c | 18 +- drivers/infiniband/hw/mlx4/main.c| 11

[PATCH 3/4] IB/mlx4: move pkeys field aside from mlx4_ib_dev

2018-09-18 Thread Jan Dakinevich
This is the 2nd patch of 3 of the work for decreasing size of mlx4_ib_dev. The field takes about 36K and could be safely allocated with kvzalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/hw/mlx4/mad.c | 18 +- drivers/infiniband/hw/mlx4/main.c| 11

[PATCH 1/4] IB/core: introduce ->release() callback

2018-09-18 Thread Jan Dakinevich
foo->part = kvmalloc(65536, GFP_KERNEL); Signed-off-by: Jan Dakinevich --- drivers/infiniband/core/device.c | 2 ++ include/rdma/ib_verbs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index db3b627..a8

[PATCH 1/4] IB/core: introduce ->release() callback

2018-09-18 Thread Jan Dakinevich
foo->part = kvmalloc(65536, GFP_KERNEL); Signed-off-by: Jan Dakinevich --- drivers/infiniband/core/device.c | 2 ++ include/rdma/ib_verbs.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index db3b627..a8

[PATCH 0/4] IB: decrease large contigous allocation

2018-09-18 Thread Jan Dakinevich
kvzalloc Jan Dakinevich (4): IB/core: introduce ->release() callback IB/mlx4: move iboe field aside from mlx4_ib_dev IB/mlx4: move pkeys field aside from mlx4_ib_dev IB/mlx4: move sriov field aside from mlx4_ib_dev drivers/infiniband/core/device.c| 2 + drivers/infiniband/hw/m

[PATCH 0/4] IB: decrease large contigous allocation

2018-09-18 Thread Jan Dakinevich
kvzalloc Jan Dakinevich (4): IB/core: introduce ->release() callback IB/mlx4: move iboe field aside from mlx4_ib_dev IB/mlx4: move pkeys field aside from mlx4_ib_dev IB/mlx4: move sriov field aside from mlx4_ib_dev drivers/infiniband/core/device.c| 2 + drivers/infiniband/hw/m

Re: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers

2018-07-16 Thread Jan Dakinevich
On Mon, 9 Jul 2018 16:51:03 +0300 Jan Dakinevich wrote: > This table by default takes 32KiB which is 3rd memory order. > Meanwhile, this memory is not aimed for DMA operation and could be > safely allocated by vmalloc. > > Signed-off-by: Jan Dakinevich > --- > drivers

Re: [PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers

2018-07-16 Thread Jan Dakinevich
On Mon, 9 Jul 2018 16:51:03 +0300 Jan Dakinevich wrote: > This table by default takes 32KiB which is 3rd memory order. > Meanwhile, this memory is not aimed for DMA operation and could be > safely allocated by vmalloc. > > Signed-off-by: Jan Dakinevich > --- > drivers

[PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers

2018-07-09 Thread Jan Dakinevich
This table by default takes 32KiB which is 3rd memory order. Meanwhile, this memory is not aimed for DMA operation and could be safely allocated by vmalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] IPoIB: use kvzalloc to allocate an array of bucket pointers

2018-07-09 Thread Jan Dakinevich
This table by default takes 32KiB which is 3rd memory order. Meanwhile, this memory is not aimed for DMA operation and could be safely allocated by vmalloc. Signed-off-by: Jan Dakinevich --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] ib_srpt: use kvmalloc to allocate ring pointers

2018-07-09 Thread Jan Dakinevich
An array of pointers to SRPT contexts in ib_device is over 30KiB even in default case, in which an amount of contexts is 4095. The patch is intended to weed out large contigous allocation for non-DMA memory. Signed-off-by: Jan Dakinevich --- drivers/infiniband/ulp/srpt/ib_srpt.c | 6 +++--- 1

[PATCH] ib_srpt: use kvmalloc to allocate ring pointers

2018-07-09 Thread Jan Dakinevich
An array of pointers to SRPT contexts in ib_device is over 30KiB even in default case, in which an amount of contexts is 4095. The patch is intended to weed out large contigous allocation for non-DMA memory. Signed-off-by: Jan Dakinevich --- drivers/infiniband/ulp/srpt/ib_srpt.c | 6 +++--- 1

Re: [PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-20 Thread Jan Dakinevich
On Wed, 6 Dec 2017 14:43:01 +0300 Jan Dakinevich <jan.dakinev...@virtuozzo.com> wrote: > w2k16 essentials fails to boot if underlying hypervisor lacks of > support for LBR MSRs. To workaround the issue, it suggessted to > ignore these MSRs (but not all). > > The in

Re: [PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-20 Thread Jan Dakinevich
On Wed, 6 Dec 2017 14:43:01 +0300 Jan Dakinevich wrote: > w2k16 essentials fails to boot if underlying hypervisor lacks of > support for LBR MSRs. To workaround the issue, it suggessted to > ignore these MSRs (but not all). > > The information, which MSRs are supported for sp

Re: [PATCH RFC 2/2] KVM: x86/vPMU: ignore access to LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
to be written, expose PERF_CAPABILITIES too, > and start/stop them on entry/exit, and enable context switching > through perf in the host. > > That would be far better than creating a frankenstate where LBR is > there but mostly broken on some KVM versions. > > -Andi -- Best regards Jan Dakinevich

Re: [PATCH RFC 2/2] KVM: x86/vPMU: ignore access to LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
APABILITIES too, > and start/stop them on entry/exit, and enable context switching > through perf in the host. > > That would be far better than creating a frankenstate where LBR is > there but mostly broken on some KVM versions. > > -Andi -- Best regards Jan Dakinevich

Re: [PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
On Wed, 6 Dec 2017 10:06:48 -0500 Konrad Rzeszutek Wilk <konrad.w...@oracle.com> wrote: > On Wed, Dec 06, 2017 at 02:43:01PM +0300, Jan Dakinevich wrote: > > w2k16 essentials fails to boot if underlying hypervisor lacks of > > support for LBR MSRs. To workaround the

Re: [PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
On Wed, 6 Dec 2017 10:06:48 -0500 Konrad Rzeszutek Wilk wrote: > On Wed, Dec 06, 2017 at 02:43:01PM +0300, Jan Dakinevich wrote: > > w2k16 essentials fails to boot if underlying hypervisor lacks of > > support for LBR MSRs. To workaround the issue, it suggessted to > &

[PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
patch adds ignoring for these MSRs to pmu_intel code of KVM. TODO: use MSR load/store areas to make full support of LBR debug. Jan Dakinevich (2): perf/x86/intel: make reusable LBR initialization code KVM: x86/vPMU: ignore access to LBR-related MSRs arch/x86/events/core.c| 8

[PATCH RFC 0/2] ignore LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
patch adds ignoring for these MSRs to pmu_intel code of KVM. TODO: use MSR load/store areas to make full support of LBR debug. Jan Dakinevich (2): perf/x86/intel: make reusable LBR initialization code KVM: x86/vPMU: ignore access to LBR-related MSRs arch/x86/events/core.c| 8

[PATCH RFC 1/2] perf/x86/intel: make reusable LBR initialization code

2017-12-06 Thread Jan Dakinevich
effect which could affect host system. * LBR information moved to separate structure `struct x86_pmu_lbr'; * All family-specific tweaks on gathered information are applied only for global x86_pmu.lbr to keep current perf initialization behavior. Signed-off-by: Jan Dakinevich <jan.daki

[PATCH RFC 1/2] perf/x86/intel: make reusable LBR initialization code

2017-12-06 Thread Jan Dakinevich
effect which could affect host system. * LBR information moved to separate structure `struct x86_pmu_lbr'; * All family-specific tweaks on gathered information are applied only for global x86_pmu.lbr to keep current perf initialization behavior. Signed-off-by: Jan Dakinevich --- arch/x86

[PATCH RFC 2/2] KVM: x86/vPMU: ignore access to LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
, and dummy handle them (ignore writes and return zero on reads). Signed-off-by: Jan Dakinevich <jan.dakinev...@virtuozzo.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/pmu_intel.c| 33 + 2 files changed, 35 insertions(+) diff --git a/ar

[PATCH RFC 2/2] KVM: x86/vPMU: ignore access to LBR-related MSRs

2017-12-06 Thread Jan Dakinevich
, and dummy handle them (ignore writes and return zero on reads). Signed-off-by: Jan Dakinevich --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/pmu_intel.c| 33 + 2 files changed, 35 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

Re: [PATCH] tty: hvc: don't allocate a buffer for console print on stack

2017-03-20 Thread Jan Dakinevich
was more welcomed and happened earlier: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c4baad50297d84bde1a7ad45e50c73adae4a2192 On 03/17/2017 08:09 AM, Greg Kroah-Hartman wrote: > On Fri, Feb 17, 2017 at 11:42:45PM +0300, Jan Dakinevich wrote: >> The buffer

Re: [PATCH] tty: hvc: don't allocate a buffer for console print on stack

2017-03-20 Thread Jan Dakinevich
was more welcomed and happened earlier: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c4baad50297d84bde1a7ad45e50c73adae4a2192 On 03/17/2017 08:09 AM, Greg Kroah-Hartman wrote: > On Fri, Feb 17, 2017 at 11:42:45PM +0300, Jan Dakinevich wrote: >> The buffer

Re: [PATCH] virtio-console: avoid DMA from stack

2017-03-02 Thread Jan Dakinevich
- return __send_to_port(port, sg, 1, count, (void *)buf, false); > + data = kmemdup(buf, count, GFP_ATOMIC); > + if (!data) > + return -ENOMEM; > + > + sg_init_one(sg, data, count); > + ret = __send_to_port(port, sg, 1, count, data, false); > + kfree(data); > + return ret; > } > > /* > -- Best regards, Jan Dakinevich

Re: [PATCH] virtio-console: avoid DMA from stack

2017-03-02 Thread Jan Dakinevich
, sg, 1, count, (void *)buf, false); > + data = kmemdup(buf, count, GFP_ATOMIC); > + if (!data) > + return -ENOMEM; > + > + sg_init_one(sg, data, count); > + ret = __send_to_port(port, sg, 1, count, data, false); > + kfree(data); > + return ret; > } > > /* > -- Best regards, Jan Dakinevich

[PATCH] tty: hvc: don't allocate a buffer for console print on stack

2017-02-17 Thread Jan Dakinevich
The buffer is used by virtio console driver as DMA buffer. Since v4.9 (if VMAP_STACK is enabled) we shouldn't use the stack for DMA. Signed-off-by: Jan Dakinevich <jan.dakinev...@gmail.com> --- drivers/tty/hvc/hvc_console.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH] tty: hvc: don't allocate a buffer for console print on stack

2017-02-17 Thread Jan Dakinevich
The buffer is used by virtio console driver as DMA buffer. Since v4.9 (if VMAP_STACK is enabled) we shouldn't use the stack for DMA. Signed-off-by: Jan Dakinevich --- drivers/tty/hvc/hvc_console.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/hvc

[PATCH v2] KVM: nVMX: expose INS/OUTS information support

2016-09-05 Thread Jan Dakinevich
is already copied to VMCS12 for L1 hypervisor (see prepare_vmcs12 routine) independently of feature presence. Signed-off-by: Jan Dakinevich <jan.dakinev...@gmail.com> --- v1: * don't copy to basic_cap bits, which are already copied to size field * fix commit message arch/x86/kvm/vmx

[PATCH v2] KVM: nVMX: expose INS/OUTS information support

2016-09-05 Thread Jan Dakinevich
is already copied to VMCS12 for L1 hypervisor (see prepare_vmcs12 routine) independently of feature presence. Signed-off-by: Jan Dakinevich --- v1: * don't copy to basic_cap bits, which are already copied to size field * fix commit message arch/x86/kvm/vmx.c | 9 + 1 file changed, 9

Re: [PATCH] KVM: nVMX: pass valid guest linear-address to the L1

2016-09-05 Thread Jan Dakinevich
On 09/05/2016 03:49 AM, Wanpeng Li wrote: > 2016-09-05 2:22 GMT+08:00 Jan Dakinevich <jan.dakinev...@gmail.com>: >> If EPT support is exposed to L1 hypervisor, guest linear-address field >> of VMCS should contain GVA of L2, the access to which caused EPT violation. >

Re: [PATCH] KVM: nVMX: pass valid guest linear-address to the L1

2016-09-05 Thread Jan Dakinevich
On 09/05/2016 03:49 AM, Wanpeng Li wrote: > 2016-09-05 2:22 GMT+08:00 Jan Dakinevich : >> If EPT support is exposed to L1 hypervisor, guest linear-address field >> of VMCS should contain GVA of L2, the access to which caused EPT violation. >> >> Signed-off-by: Jan Daki

[PATCH] KVM: nVMX: pass valid guest linear-address to the L1

2016-09-04 Thread Jan Dakinevich
If EPT support is exposed to L1 hypervisor, guest linear-address field of VMCS should contain GVA of L2, the access to which caused EPT violation. Signed-off-by: Jan Dakinevich <jan.dakinev...@gmail.com> --- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x

[PATCH] KVM: nVMX: pass valid guest linear-address to the L1

2016-09-04 Thread Jan Dakinevich
If EPT support is exposed to L1 hypervisor, guest linear-address field of VMCS should contain GVA of L2, the access to which caused EPT violation. Signed-off-by: Jan Dakinevich --- arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c

[PATCH] KVM: nVMX: expose INS/OUTS information support

2016-09-04 Thread Jan Dakinevich
is already copied to VMCS12 for L1 hypervisor (see prepare_vmcs12 routine) independently feature presence. Signed-off-by: Jan Dakinevich <jan.dakinev...@gmail.com> --- arch/x86/kvm/vmx.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a

[PATCH] KVM: nVMX: expose INS/OUTS information support

2016-09-04 Thread Jan Dakinevich
is already copied to VMCS12 for L1 hypervisor (see prepare_vmcs12 routine) independently feature presence. Signed-off-by: Jan Dakinevich --- arch/x86/kvm/vmx.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a4bb2bd..4fd22a6 100644 --- a/arch