[PATCH v3 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-13 Thread Siddharth Chandrasekaran
Now that kvm_hv_flush_tlb() has been patched to support XMM hypercall inputs, we can start advertising this feature to guests. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/include/asm/hyperv-tlfs.h | 7 ++- arch/x86/kvm/hyperv.c

[PATCH v3 2/4] KVM: hyper-v: Collect hypercall params into struct

2021-04-13 Thread Siddharth Chandrasekaran
into a single structure. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/hyperv.c | 147 +++--- 1 file changed, 79 insertions(+), 68 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index

[PATCH v3 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-13 Thread Siddharth Chandrasekaran
-developed-by: Evgeny Iakovlev Signed-off-by: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/include/asm/hyperv-tlfs.h | 2 + arch/x86/kvm/hyperv.c | 90 +++--- 2 files changed, 73 insertions(+), 19 deletions(-) diff --git a/arch/x86

[PATCH v3 1/4] KVM: x86: Move FPU register accessors into fpu.h

2021-04-13 Thread Siddharth Chandrasekaran
more readable. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/emulate.c | 137 +--- arch/x86/kvm/fpu.h | 140 + arch/x86/kvm/kvm_emulate.h | 3 +- 3 files changed

[PATCH v3 0/4] Add support for XMM fast hypercalls

2021-04-13 Thread Siddharth Chandrasekaran
for kvm_hv_hypercall_{read,write}_xmm() - Fix typo: s/ouput/output/ - Remove sse128_t from kvm_emulate.h - Reword comment to match TLFS wording - Move num XMM registers macro to hyperv-tlfs.h - Stop advertising HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE Siddharth Chandrasekaran (4): KVM: x86: Move FPU

Re: [PATCH v2 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-13 Thread Siddharth Chandrasekaran
On Tue, Apr 13, 2021 at 04:09:48PM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > Hyper-V supports the use of XMM registers to perform fast hypercalls. > > This allows guests to take advantage of the improved performance of the > > fast hypercall

Re: [PATCH v2 2/4] KVM: hyper-v: Collect hypercall params into struct

2021-04-13 Thread Siddharth Chandrasekaran
On Tue, Apr 13, 2021 at 03:53:01PM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > As of now there are 7 parameters (and flags) that are used in various > > hyper-v hypercall handlers. There are 6 more input/output parameters > > passed fro

Re: [PATCH v2 1/4] KVM: x86: Move FPU register accessors into fpu.h

2021-04-13 Thread Siddharth Chandrasekaran
On Tue, Apr 13, 2021 at 03:40:56PM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > @@ -0,0 +1,140 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > + > > +#ifndef __KVM_FPU_H_ > > +#define __KVM_FPU_H_ > > + > > +#include

Re: [PATCH v2 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-13 Thread Siddharth Chandrasekaran
On Mon, Apr 12, 2021 at 08:14:23PM +, Wei Liu wrote: > On Mon, Apr 12, 2021 at 07:00:17PM +0200, Siddharth Chandrasekaran wrote: > > Now that all extant hypercalls that can use XMM registers (based on > > spec) for input/outputs are patched to support them, we can start

Re: [PATCH v2 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-13 Thread Siddharth Chandrasekaran
On Mon, Apr 12, 2021 at 08:13:19PM +, Wei Liu wrote: > On Mon, Apr 12, 2021 at 07:00:16PM +0200, Siddharth Chandrasekaran wrote: > > + > > +static inline void kvm_hv_hypercall_read_xmm(struct kvm_hv_hcall *hc) > > Do you really need inline here? The compiler should be sma

[PATCH v2 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-12 Thread Siddharth Chandrasekaran
in kvm_hv_hypercall() and use the additional hypercall inputs from XMM registers in kvm_hv_flush_tlb() when possible. Cc: Alexander Graf Co-developed-by: Evgeny Iakovlev Signed-off-by: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/hyperv.c | 109

[PATCH v2 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-12 Thread Siddharth Chandrasekaran
Now that all extant hypercalls that can use XMM registers (based on spec) for input/outputs are patched to support them, we can start advertising this feature to guests. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/include/asm/hyperv-tlfs.h | 7

[PATCH v2 0/4] Add support for XMM fast hypercalls

2021-04-12 Thread Siddharth Chandrasekaran
. v2: - Add hc.fast to is_xmm_fast_hypercall() check - Split CPUID feature bits for input and output Siddharth Chandrasekaran (4): KVM: x86: Move FPU register accessors into fpu.h KVM: hyper-v: Collect hypercall params into struct KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

[PATCH v2 2/4] KVM: hyper-v: Collect hypercall params into struct

2021-04-12 Thread Siddharth Chandrasekaran
into a single structure. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/hyperv.c | 147 +++--- 1 file changed, 79 insertions(+), 68 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index

[PATCH v2 1/4] KVM: x86: Move FPU register accessors into fpu.h

2021-04-12 Thread Siddharth Chandrasekaran
more readable. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/emulate.c | 138 ++-- arch/x86/kvm/fpu.h | 140 + 2 files changed, 158 insertions(+), 120 deletions

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-12 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 04:44:23PM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote: > >> Siddharth Chandrasekaran writes: > >> > Now that all extant hypercalls that can use XMM r

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-09 Thread Siddharth Chandrasekaran
On Fri, Apr 09, 2021 at 09:42:41AM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > On Thu, Apr 08, 2021 at 04:30:18PM +, Wei Liu wrote: > >> On Thu, Apr 08, 2021 at 05:54:43PM +0200, Siddharth Chandrasekaran wrote: > >> > On Thu, Apr 08, 2

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-09 Thread Siddharth Chandrasekaran
On Fri, Apr 09, 2021 at 09:38:03AM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > On Thu, Apr 08, 2021 at 04:44:23PM +0200, Vitaly Kuznetsov wrote: > >> Siddharth Chandrasekaran writes: > >> > On Thu, Apr 08, 2021 at 02:05:53PM

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 04:30:18PM +, Wei Liu wrote: > On Thu, Apr 08, 2021 at 05:54:43PM +0200, Siddharth Chandrasekaran wrote: > > On Thu, Apr 08, 2021 at 05:48:19PM +0200, Paolo Bonzini wrote: > > > On 08/04/21 17:40, Siddharth Chandrasekaran wrote: > > > > &

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 03:38:13PM +, Wei Liu wrote: > On Thu, Apr 08, 2021 at 05:30:26PM +0200, Paolo Bonzini wrote: > > On 08/04/21 17:28, Wei Liu wrote: > > > > Although the Hyper-v TLFS mentions that a guest cannot use this feature > > > > unless the hypervisor advertises support for it,

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
54PM +0200, Siddharth Chandrasekaran wrote: > > On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote: > > > Siddharth Chandrasekaran writes: > > > > > > > Now that all extant hypercalls that can use XMM registers (based on > > > &

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 05:48:19PM +0200, Paolo Bonzini wrote: > On 08/04/21 17:40, Siddharth Chandrasekaran wrote: > > > > > Although the Hyper-v TLFS mentions that a guest cannot use this > > > > > feature > > > > > unless the hypervisor

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 04:44:23PM +0200, Vitaly Kuznetsov wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you can confirm the sender and know the > content is safe. > > > > Siddharth Chandrasekaran

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 05:30:26PM +0200, Paolo Bonzini wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you can confirm the sender and know the > content is safe. > > > > On 08/04/21 17:28, Wei Liu wrote: > > > Although

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Siddharth Chandrasekaran
On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote: > Siddharth Chandrasekaran writes: > > > Now that all extant hypercalls that can use XMM registers (based on > > spec) for input/outputs are patched to support them, we can start > > advertising this featu

[PATCH 0/4] Add support for XMM fast hypercalls

2021-04-07 Thread Siddharth Chandrasekaran
. Siddharth Chandrasekaran (4): KVM: x86: Move FPU register accessors into fpu.h KVM: hyper-v: Collect hypercall params into struct KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers KVM: hyper-v: Advertise support for fast XMM hypercalls arch/x86/include/asm/hyperv-tlfs.h | 4

[PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-07 Thread Siddharth Chandrasekaran
Now that all extant hypercalls that can use XMM registers (based on spec) for input/outputs are patched to support them, we can start advertising this feature to guests. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/include/asm/hyperv-tlfs.h | 4

[PATCH 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-07 Thread Siddharth Chandrasekaran
in kvm_hv_hypercall() and use the additional hypercall inputs from XMM registers in kvm_hv_flush_tlb() when possible. Cc: Alexander Graf Co-developed-by: Evgeny Iakovlev Signed-off-by: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/hyperv.c | 109

[PATCH 2/4] KVM: hyper-v: Collect hypercall params into struct

2021-04-07 Thread Siddharth Chandrasekaran
into a single structure. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/hyperv.c | 147 +++--- 1 file changed, 79 insertions(+), 68 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index

[PATCH 1/4] KVM: x86: Move FPU register accessors into fpu.h

2021-04-07 Thread Siddharth Chandrasekaran
more readable. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/kvm/emulate.c | 138 ++-- arch/x86/kvm/fpu.h | 140 + 2 files changed, 158 insertions(+), 120 deletions

[PATCH] KVM: make: Fix out-of-source module builds

2021-03-24 Thread Siddharth Chandrasekaran
Building kvm module out-of-source with, make -C $SRC O=$BIN M=arch/x86/kvm fails to find "irq.h" as the include dir passed to cflags-y does not prefix the source dir. Fix this by prefixing $(srctree) to the include dir path. Signed-off-by: Siddharth Chandrasekaran --- ar

Re: [PATCH] Backport security fixe to 4.9 and 4.4 stable trees

2020-05-15 Thread Siddharth Chandrasekaran
On Fri, May 15, 2020 at 02:57:01PM +0200, Greg KH wrote: > On Fri, May 15, 2020 at 06:19:45PM +0530, Siddharth Chandrasekaran wrote: > > Please ignore this patch set, I accidentally added another patch I was > > working on. Will send v2 with the right patches. > > What patc

[PATCH v2] Backport xfs security fix to 4.9 and 4.4 stable trees

2020-05-15 Thread Siddharth Chandrasekaran
Hello, Lack of proper validation that cached inodes are free during allocation can, cause a crash in fs/xfs/xfs_icache.c (refer: CVE-2018-13093). To address this issue, I'm backporting upstream commit [1] to 4.4 and 4.9 stable trees (a backport of [1] to 4.14 already exists). Also, commit [1]

[PATCH 4.9 v2] xfs: validate cached inodes are free when allocated

2020-05-15 Thread Siddharth Chandrasekaran
ino Reviewed-by: Darrick J. Wong [darrick: fix typos in comment] Signed-off-by: Darrick J. Wong Signed-off-by: Siddharth Chandrasekaran --- fs/xfs/xfs_icache.c | 57 ++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_icac

[PATCH 4.4 v2] xfs: validate cached inodes are free when allocated

2020-05-15 Thread Siddharth Chandrasekaran
ino Reviewed-by: Darrick J. Wong [darrick: fix typos in comment] Signed-off-by: Darrick J. Wong Signed-off-by: Siddharth Chandrasekaran --- fs/xfs/xfs_icache.c | 57 ++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_icac

Re: [PATCH] Backport security fixe to 4.9 and 4.4 stable trees

2020-05-15 Thread Siddharth Chandrasekaran
Please ignore this patch set, I accidentally added another patch I was working on. Will send v2 with the right patches. Thanks! -- Sid.

[PATCH v4.4] xfs: validate cached inodes are free when allocated

2020-05-14 Thread Siddharth Chandrasekaran
ino Reviewed-by: Darrick J. Wong [darrick: fix typos in comment] Signed-off-by: Darrick J. Wong Signed-off-by: Siddharth Chandrasekaran --- fs/xfs/xfs_icache.c | 57 ++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_icac

[PATCH v4.9] xfs: More robust inode extent count validation

2020-05-14 Thread Siddharth Chandrasekaran
up compiler warnings] Signed-off-by: Darrick J. Wong Signed-off-by: Siddharth Chandrasekaran --- fs/xfs/libxfs/xfs_format.h| 3 ++ fs/xfs/libxfs/xfs_inode_buf.c | 112 -- 2 files changed, 112 insertions(+), 3 deletions(-) diff --git a/fs/xfs/libxfs

[PATCH] Backport security fixe to 4.9 and 4.4 stable trees

2020-05-14 Thread Siddharth Chandrasekaran
Due to lack of proper validation that cached inodes are free during allocation, causes a crash (refer to CVE-2018-13093 for more details). To address this issue, I'm backporting upstream commit [1] to 4.4 and 4.9 stable trees (a backport of [1] to 4.14 already exists). Also, commit [1] references