[PATCH v3] KVM: SEV: Disable SEV-SNP support on initialization failure

2025-05-12 Thread Ashish Kalra
From: Ashish Kalra During platform init, SNP initialization may fail for several reasons, such as firmware command failures and incompatible versions. However, the KVM capability may continue to advertise support for it. The platform may have SNP enabled but if SNP_INIT fails then SNP is not

[PATCH v2] KVM: SEV: Disable SEV-SNP support on initialization failure

2025-05-12 Thread Ashish Kalra
From: Ashish Kalra During platform init, SNP initialization may fail for several reasons, such as firmware command failures and incompatible versions. However, the KVM capability may continue to advertise support for it. The platform may have SNP enabled but if SNP_INIT fails then SNP is not

[PATCH] KVM: SEV: Disable SEV-SNP support on initialization failure

2025-05-08 Thread Ashish Kalra
From: Ashish Kalra During platform init, SNP initialization may fail for several reasons, such as firmware command failures and incompatible versions. However, the KVM capability may continue to advertise support for it. The platform may have SNP enabled but if SNP_INIT fails then SNP is not

Re: [PATCH 0/3] KVM: x86: guest interface for SEV live migration

2021-04-20 Thread Ashish Kalra
On Tue, Apr 20, 2021 at 05:31:07PM +, Sean Christopherson wrote: > On Tue, Apr 20, 2021, Paolo Bonzini wrote: > > From ef78673f78e3f2eedc498c1fbf9271146caa83cb Mon Sep 17 00:00:00 2001 > > From: Ashish Kalra > > Date: Thu, 15 Apr 2021 15:57:02 + > > Su

[PATCH] staging: wlan-ng: silence incorrect type in argument 1 (different address spaces) warning

2021-04-20 Thread Ashish Kalra
Upon running sparse, "warning: incorrect type in argument 1 (different address spaces) is brought to notice for this file.let's add correct typecast to make it cleaner and silence the Sparse warning. Signed-off-by: Ashish Kalra --- drivers/staging/wlan-ng/p80211netdev.c | 2 +- 1 fi

Re: [PATCH] staging: wfx: silence symbol 'wfx_get_ps_timeout' was not declared warning

2021-04-19 Thread Ashish Kalra
On Mon, Apr 19, 2021 at 05:55:34PM +0200, Jérôme Pouiller wrote: > On Monday 19 April 2021 17:33:48 CEST Ashish Kalra wrote: > > > > Upon running sparse, "warning: symbol 'wfx_get_ps_timeout' was not declared. > > Should it be static?" and "wa

[PATCH] staging: wfx: silence symbol 'wfx_get_ps_timeout' was not declared warning

2021-04-19 Thread Ashish Kalra
nt this warning. let's add it to make it cleaner and silence the Sparse warning. Signed-off-by: Ashish Kalra --- drivers/staging/wfx/sta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 12e8a5b638f1..d855d87c2102

Re: [PATCH v13 00/12] Add AMD SEV guest live migration support

2021-04-19 Thread Ashish Kalra
On Fri, Apr 16, 2021 at 02:43:48PM -0700, Steve Rutherford wrote: > On Thu, Apr 15, 2021 at 8:52 AM Ashish Kalra wrote: > > > > From: Ashish Kalra > > > > The series add support for AMD SEV guest live migration commands. To > > protect the > > confident

Re: [PATCH] media: atomisp: silence "dubious: !x | !y" warning

2021-04-17 Thread Ashish Kalra
On Sat, Apr 17, 2021 at 08:56:13PM +0200, Mauro Carvalho Chehab wrote: > Em Sat, 17 Apr 2021 21:06:27 +0530 > Ashish Kalra escreveu: > > > Upon running sparse, "warning: dubious: !x | !y" is brought to notice > > for this file. Logical and bitwise OR are basical

Re: [PATCH] media: atomisp: silence "dubious: !x | !y" warning

2021-04-17 Thread Ashish Kalra
On Sat, Apr 17, 2021 at 09:31:32PM +, David Laight wrote: > From: Mauro Carvalho Chehab > > Sent: 17 April 2021 19:56 > > > > Em Sat, 17 Apr 2021 21:06:27 +0530 > > Ashish Kalra escreveu: > > > > > Upon running sparse, "warning: dubious: !x

[PATCH] media: atomisp: silence "dubious: !x | !y" warning

2021-04-17 Thread Ashish Kalra
Upon running sparse, "warning: dubious: !x | !y" is brought to notice for this file. Logical and bitwise OR are basically the same in this context so it doesn't cause a runtime bug. But let's change it to logical OR to make it cleaner and silence the Sparse warning. Signed-

[PATCH v13 12/12] x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.

2021-04-15 Thread Ashish Kalra
From: Ashish Kalra The guest support for detecting and enabling SEV Live migration feature uses the following logic : - kvm_init_plaform() invokes check_kvm_sev_migration() which checks if its booted under the EFI - If not EFI, i) check for the KVM_FEATURE_CPUID ii) if CPUID

[PATCH v13 11/12] EFI: Introduce the new AMD Memory Encryption GUID.

2021-04-15 Thread Ashish Kalra
From: Ashish Kalra Introduce a new AMD Memory Encryption GUID which is currently used for defining a new UEFI environment variable which indicates UEFI/OVMF support for the SEV live migration feature. This variable is setup when UEFI/OVMF detects host/hypervisor support for SEV live migration

[PATCH v13 10/12] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-04-15 Thread Ashish Kalra
From: Ashish Kalra Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check for host-side support for SEV live migration. Also add a new custom MSR_KVM_SEV_LIVE_MIGRATION for guest to enable the SEV live migration feature. MSR is handled by userspace using MSR filters. Signed-off-by

[PATCH v13 09/12] mm: x86: Invoke hypercall when page encryption status is changed

2021-04-15 Thread Ashish Kalra
rg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/paravirt.h | 10 ++

[PATCH v13 08/12] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-15 Thread Ashish Kalra
From: Ashish Kalra This hypercall is used by the SEV guest to notify a change in the page encryption status to the hypervisor. The hypercall should be invoked only when the encryption attribute is changed from encrypted -> decrypted and vice versa. By default all guest pages are conside

[PATCH v13 07/12] KVM: x86: Add AMD SEV specific Hypercall3

2021-04-15 Thread Ashish Kalra
ord Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/kvm_para.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 338119852512..bc1b11d057fc 1006

[PATCH v13 06/12] KVM: SVM: Add KVM_SEV_RECEIVE_FINISH command

2021-04-15 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31

[PATCH v13 05/12] KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command

2021-04-15 Thread Ashish Kalra
Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 ++ arch/x86/kvm/svm/sev.c| 79 +++ include/uapi/linux/kvm.h

[PATCH v13 04/12] KVM: SVM: Add support for KVM_SEV_RECEIVE_START command

2021-04-15 Thread Ashish Kalra
Cc: Paolo Bonzini Cc: Joerg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 29 +++

[PATCH v13 03/12] KVM: SVM: Add KVM_SEV_SEND_FINISH command

2021-04-15 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31

[PATCH v13 02/12] KVM: SVM: Add KVM_SEND_UPDATE_DATA command

2021-04-15 Thread Ashish Kalra
cky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by : Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 arch/x86/kvm/svm/sev.c| 122 ++ in

[PATCH v13 01/12] KVM: SVM: Add KVM_SEV SEND_START command

2021-04-15 Thread Ashish Kalra
nux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 27 arch/x86/kvm/svm/sev.c| 125 ++ include/linux

[PATCH v13 00/12] Add AMD SEV guest live migration support

2021-04-15 Thread Ashish Kalra
From: Ashish Kalra The series add support for AMD SEV guest live migration commands. To protect the confidentiality of an SEV protected guest memory while in transit we need to use the SEV commands defined in SEV API spec [1]. SEV guest VMs have the concept of private and shared memory. Private

Re: [PATCH v12 13/13] x86/kvm: Add kexec support for SEV Live Migration.

2021-04-13 Thread Ashish Kalra
On Mon, Apr 12, 2021 at 07:25:03PM -0700, Steve Rutherford wrote: > On Mon, Apr 12, 2021 at 6:48 PM Ashish Kalra wrote: > > > > On Mon, Apr 12, 2021 at 06:23:32PM -0700, Steve Rutherford wrote: > > > On Mon, Apr 12, 2021 at 5:22 PM Steve Rutherford > > > wrot

Re: [PATCH v12 13/13] x86/kvm: Add kexec support for SEV Live Migration.

2021-04-12 Thread Ashish Kalra
On Mon, Apr 12, 2021 at 06:23:32PM -0700, Steve Rutherford wrote: > On Mon, Apr 12, 2021 at 5:22 PM Steve Rutherford > wrote: > > > > On Mon, Apr 12, 2021 at 12:48 PM Ashish Kalra wrote: > > > > > > From: Ashish Kalra > > > > > >

Re: [PATCH v12 12/13] x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.

2021-04-12 Thread Ashish Kalra
On Mon, Apr 12, 2021 at 05:25:15PM -0700, Steve Rutherford wrote: > On Mon, Apr 12, 2021 at 12:46 PM Ashish Kalra wrote: > > > > From: Ashish Kalra > > > > The guest support for detecting and enabling SEV Live migration > > feature uses the following logic : >

[PATCH v12 13/13] x86/kvm: Add kexec support for SEV Live Migration.

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra Reset the host's shared pages list related to kernel specific page encryption status settings before we load a new kernel by kexec. We cannot reset the complete shared pages list here as we need to retain the UEFI/OVMF firmware specific settings. The host's shared

[PATCH v12 11/13] EFI: Introduce the new AMD Memory Encryption GUID.

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra Introduce a new AMD Memory Encryption GUID which is currently used for defining a new UEFI environment variable which indicates UEFI/OVMF support for the SEV live migration feature. This variable is setup when UEFI/OVMF detects host/hypervisor support for SEV live migration

[PATCH v12 09/13] mm: x86: Invoke hypercall when page encryption status is changed

2021-04-12 Thread Ashish Kalra
rg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/paravirt.h | 10 + arch/x86/include/asm/paravirt

[PATCH v12 10/13] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check for host-side support for SEV live migration. Also add a new custom MSR_KVM_SEV_LIVE_MIGRATION for guest to enable the SEV live migration feature. MSR is handled by userspace using MSR filters. Signed-off-by

[PATCH v12 06/13] KVM: SVM: Add KVM_SEV_RECEIVE_FINISH command

2021-04-12 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31

[PATCH v12 04/13] KVM: SVM: Add support for KVM_SEV_RECEIVE_START command

2021-04-12 Thread Ashish Kalra
Cc: Paolo Bonzini Cc: Joerg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 29 +++ arch/x86/kvm

[PATCH v12 12/13] x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra The guest support for detecting and enabling SEV Live migration feature uses the following logic : - kvm_init_plaform() invokes check_kvm_sev_migration() which checks if its booted under the EFI - If not EFI, i) check for the KVM_FEATURE_CPUID ii) if CPUID

[PATCH v12 02/13] KVM: SVM: Add KVM_SEND_UPDATE_DATA command

2021-04-12 Thread Ashish Kalra
cky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by : Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 arch/x86/kvm/svm/sev.c| 122 ++ in

[PATCH v12 07/13] KVM: x86: Add AMD SEV specific Hypercall3

2021-04-12 Thread Ashish Kalra
ord Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/kvm_para.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 338119852512..bc1b11d057fc 1006

[PATCH v12 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra This hypercall is used by the SEV guest to notify a change in the page encryption status to the hypervisor. The hypercall should be invoked only when the encryption attribute is changed from encrypted -> decrypted and vice versa. By default all guest pages are conside

[PATCH v12 05/13] KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command

2021-04-12 Thread Ashish Kalra
Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 ++ arch/x86/kvm/svm/sev.c| 79 +++ include/uapi/linux/kvm.h | 9 +++ 3 files ch

[PATCH v12 03/13] KVM: SVM: Add KVM_SEV_SEND_FINISH command

2021-04-12 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31 insertions(+) diff --git a/Document

[PATCH v12 01/13] KVM: SVM: Add KVM_SEV SEND_START command

2021-04-12 Thread Ashish Kalra
nux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 27 arch/x86/kvm/svm/sev.c| 125 ++ include/linux

[PATCH v12 00/13] Add AMD SEV guest live migration support

2021-04-12 Thread Ashish Kalra
From: Ashish Kalra The series add support for AMD SEV guest live migration commands. To protect the confidentiality of an SEV protected guest memory while in transit we need to use the SEV commands defined in SEV API spec [1]. SEV guest VMs have the concept of private and shared memory. Private

Re: [PATCH v11 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-07 Thread Ashish Kalra
On Tue, Apr 06, 2021 at 03:48:20PM +, Sean Christopherson wrote: > On Mon, Apr 05, 2021, Ashish Kalra wrote: > > From: Ashish Kalra > > ... > > > diff --git a/arch/x86/include/asm/kvm_host.h > > b/arch/x86/include/asm/kvm_host.h > > index 3768819693e5

Re: [PATCH v11 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-06 Thread Ashish Kalra
On Tue, Apr 06, 2021 at 06:22:48AM +, Ashish Kalra wrote: > On Mon, Apr 05, 2021 at 01:42:42PM -0700, Steve Rutherford wrote: > > On Mon, Apr 5, 2021 at 7:28 AM Ashish Kalra wrote: > > > > > > From: Ashish Kalra > > > > > > This hypercall is us

Re: [PATCH v11 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-06 Thread Ashish Kalra
On Tue, Apr 06, 2021 at 03:48:20PM +, Sean Christopherson wrote: > On Mon, Apr 05, 2021, Ashish Kalra wrote: > > From: Ashish Kalra > > ... > > > diff --git a/arch/x86/include/asm/kvm_host.h > > b/arch/x86/include/asm/kvm_host.h > > index 3768819693e5

Re: [PATCH v11 10/13] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-04-06 Thread Ashish Kalra
Hello Paolo, On Tue, Apr 06, 2021 at 03:47:59PM +0200, Paolo Bonzini wrote: > On 06/04/21 15:26, Ashish Kalra wrote: > > > It's a little unintuitive to see KVM_MSR_RET_FILTERED here, since > > > userspace can make this happen on its own without having an entry in >

Re: [PATCH v11 10/13] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-04-06 Thread Ashish Kalra
Hello Steve, On Mon, Apr 05, 2021 at 06:39:03PM -0700, Steve Rutherford wrote: > On Mon, Apr 5, 2021 at 7:30 AM Ashish Kalra wrote: > > > > From: Ashish Kalra > > > > Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check > > for host-side support f

Re: [PATCH v11 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-05 Thread Ashish Kalra
On Mon, Apr 05, 2021 at 01:42:42PM -0700, Steve Rutherford wrote: > On Mon, Apr 5, 2021 at 7:28 AM Ashish Kalra wrote: > > > > From: Ashish Kalra > > > > This hypercall is used by the SEV guest to notify a change in the page > > encryption status to the hy

[PATCH v11 13/13] x86/kvm: Add kexec support for SEV Live Migration.

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra Reset the host's shared pages list related to kernel specific page encryption status settings before we load a new kernel by kexec. We cannot reset the complete shared pages list here as we need to retain the UEFI/OVMF firmware specific settings. The host's shared

[PATCH v11 11/13] EFI: Introduce the new AMD Memory Encryption GUID.

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra Introduce a new AMD Memory Encryption GUID which is currently used for defining a new UEFI environment variable which indicates UEFI/OVMF support for the SEV live migration feature. This variable is setup when UEFI/OVMF detects host/hypervisor support for SEV live migration

[PATCH v11 12/13] x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature.

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra The guest support for detecting and enabling SEV Live migration feature uses the following logic : - kvm_init_plaform() invokes check_kvm_sev_migration() which checks if its booted under the EFI - If not EFI, i) check for the KVM_FEATURE_CPUID ii) if CPUID

[PATCH v11 10/13] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check for host-side support for SEV live migration. Also add a new custom MSR_KVM_SEV_LIVE_MIGRATION for guest to enable the SEV live migration feature. MSR is handled by userspace using MSR filters. Signed-off-by

[PATCH v11 09/13] mm: x86: Invoke hypercall when page encryption status is changed

2021-04-05 Thread Ashish Kalra
rg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/paravirt.h | 10 + arch/x86/include/asm/paravirt

[PATCH v11 08/13] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra This hypercall is used by the SEV guest to notify a change in the page encryption status to the hypervisor. The hypercall should be invoked only when the encryption attribute is changed from encrypted -> decrypted and vice versa. By default all guest pages are conside

[PATCH v11 07/13] KVM: x86: Add AMD SEV specific Hypercall3

2021-04-05 Thread Ashish Kalra
ord Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/kvm_para.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 338119852512..bc1b11d057fc 1006

[PATCH v11 06/13] KVM: SVM: Add KVM_SEV_RECEIVE_FINISH command

2021-04-05 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31

[PATCH v11 05/13] KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command

2021-04-05 Thread Ashish Kalra
Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 ++ arch/x86/kvm/svm/sev.c| 79 +++ include/uapi/linux/kvm.h | 9 +++ 3 files ch

[PATCH v11 04/13] KVM: SVM: Add support for KVM_SEV_RECEIVE_START command

2021-04-05 Thread Ashish Kalra
Cc: Paolo Bonzini Cc: Joerg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 29 +++ arch/x86/kvm

[PATCH v11 03/13] KVM: SVM: Add KVM_SEV_SEND_FINISH command

2021-04-05 Thread Ashish Kalra
.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23 +++ 2 files changed, 31 insertions(+) diff --git a/Document

[PATCH v11 02/13] KVM: SVM: Add KVM_SEND_UPDATE_DATA command

2021-04-05 Thread Ashish Kalra
cky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by : Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 arch/x86/kvm/svm/sev.c| 122 ++ in

[PATCH v11 01/13] KVM: SVM: Add KVM_SEV SEND_START command

2021-04-05 Thread Ashish Kalra
nux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 27 arch/x86/kvm/svm/sev.c| 125 ++ include/linux

[PATCH v11 00/13] Add AMD SEV guest live migration support

2021-04-05 Thread Ashish Kalra
From: Ashish Kalra The series add support for AMD SEV guest live migration commands. To protect the confidentiality of an SEV protected guest memory while in transit we need to use the SEV commands defined in SEV API spec [1]. SEV guest VMs have the concept of private and shared memory. Private

Re: [RFC v2] KVM: x86: Support KVM VMs sharing SEV context

2021-04-02 Thread Ashish Kalra
Hi Nathan, Will you be posting a corresponding Qemu patch for this ? Thanks, Ashish On Tue, Mar 16, 2021 at 01:40:27AM +, Nathan Tempelman wrote: > Add a capability for userspace to mirror SEV encryption context from > one vm to another. On our side, this is intended to support a > Migration

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-04-02 Thread Ashish Kalra
Hello Steve, On Thu, Apr 01, 2021 at 06:40:06PM -0700, Steve Rutherford wrote: > On Fri, Mar 19, 2021 at 11:00 AM Ashish Kalra wrote: > > > > On Thu, Mar 11, 2021 at 12:48:07PM -0800, Steve Rutherford wrote: > > > On Thu, Mar 11, 2021 at 10:15 AM Ashish Kalra > &g

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-19 Thread Ashish Kalra
On Thu, Mar 11, 2021 at 12:48:07PM -0800, Steve Rutherford wrote: > On Thu, Mar 11, 2021 at 10:15 AM Ashish Kalra wrote: > > > > On Wed, Mar 03, 2021 at 06:54:41PM +, Will Deacon wrote: > > > [+Marc] > > > > > > On Tue, Mar 02, 2021 at 02:55:43PM +000

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-11 Thread Ashish Kalra
On Wed, Mar 03, 2021 at 06:54:41PM +, Will Deacon wrote: > [+Marc] > > On Tue, Mar 02, 2021 at 02:55:43PM +0000, Ashish Kalra wrote: > > On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > > > On Fri, Feb 26, 2021, Ashish Kalra wrote: > > >

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-09 Thread Ashish Kalra
On Wed, Mar 03, 2021 at 06:54:41PM +, Will Deacon wrote: > [+Marc] > > On Tue, Mar 02, 2021 at 02:55:43PM +0000, Ashish Kalra wrote: > > On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > > > On Fri, Feb 26, 2021, Ashish Kalra wrote: > > >

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-08 Thread Ashish Kalra
On Mon, Mar 08, 2021 at 03:11:41PM -0600, Brijesh Singh wrote: > > On 3/8/21 1:51 PM, Sean Christopherson wrote: > > On Mon, Mar 08, 2021, Ashish Kalra wrote: > >> On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > >>> +Will and Quentin (arm6

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-08 Thread Ashish Kalra
On Mon, Mar 08, 2021 at 11:51:57AM -0800, Sean Christopherson wrote: > On Mon, Mar 08, 2021, Ashish Kalra wrote: > > On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > > > +Will and Quentin (arm64) > > > > > > Moving the non-KVM x86 folks

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-08 Thread Ashish Kalra
On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > +Will and Quentin (arm64) > > Moving the non-KVM x86 folks to bcc, I don't they care about KVM details at > this > point. > > On Fri, Feb 26, 2021, Ashish Kalra wrote: > > On Thu, Feb 25,

Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context

2021-03-05 Thread Ashish Kalra
On Thu, Feb 25, 2021 at 10:49:00AM -0800, Steve Rutherford wrote: > On Thu, Feb 25, 2021 at 6:57 AM Tom Lendacky wrote: > > >> +int svm_vm_copy_asid_to(struct kvm *kvm, unsigned int mirror_kvm_fd) > > >> +{ > > >> + struct file *mirror_kvm_file; > > >> + struct kvm *mirror_kvm; > > >>

Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context

2021-03-05 Thread Ashish Kalra
On Wed, Feb 24, 2021 at 08:59:15AM +, Nathan Tempelman wrote: > Add a capability for userspace to mirror SEV encryption context from > one vm to another. On our side, this is intended to support a > Migration Helper vCPU, but it can also be used generically to support > other in-guest workloads

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-03 Thread Ashish Kalra
On Wed, Mar 03, 2021 at 06:54:41PM +, Will Deacon wrote: > [+Marc] > > On Tue, Mar 02, 2021 at 02:55:43PM +0000, Ashish Kalra wrote: > > On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > > > On Fri, Feb 26, 2021, Ashish Kalra wrote: > > >

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-02 Thread Ashish Kalra
On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > +Will and Quentin (arm64) > > Moving the non-KVM x86 folks to bcc, I don't they care about KVM details at > this > point. > > On Fri, Feb 26, 2021, Ashish Kalra wrote: > > On Thu, Feb 25,

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-03-02 Thread Ashish Kalra
On Tue, Mar 02, 2021 at 02:55:43PM +, Ashish Kalra wrote: > On Fri, Feb 26, 2021 at 09:44:41AM -0800, Sean Christopherson wrote: > > +Will and Quentin (arm64) > > > > Moving the non-KVM x86 folks to bcc, I don't they care about KVM details at > > this > >

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-02-26 Thread Ashish Kalra
Hello Steve, On Thu, Feb 25, 2021 at 02:59:27PM -0800, Steve Rutherford wrote: > On Thu, Feb 25, 2021 at 12:20 PM Ashish Kalra wrote: > > > > On Wed, Feb 24, 2021 at 10:22:33AM -0800, Sean Christopherson wrote: > > > On Wed, Feb 24, 2021, Ashish Kalra wrote: > &g

Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context

2021-02-26 Thread Ashish Kalra
On Thu, Feb 25, 2021 at 09:33:09PM +0100, Paolo Bonzini wrote: > On 25/02/21 19:18, Ashish Kalra wrote: > > I do believe that some of these alternative SEV live migration support > > or Migration helper (MH) solutions will still use SEV PSP migration for > > migrating the MH

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-02-25 Thread Ashish Kalra
On Wed, Feb 24, 2021 at 10:22:33AM -0800, Sean Christopherson wrote: > On Wed, Feb 24, 2021, Ashish Kalra wrote: > > # Samples: 19K of event 'kvm:kvm_hypercall' > > # Event count (approx.): 19573 > > # > > # Overhead Comm

Re: [RFC] KVM: x86: Support KVM VMs sharing SEV context

2021-02-25 Thread Ashish Kalra
>> > For additional context, we need a Migration Helper because SEV PSP >> > migration is far too slow for our live migration on its own. Using an >> > in-guest migrator lets us speed this up significantly. >> >> We have the same problem here at IBM, hence the RFC referred to above. >> I do beli

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-02-24 Thread Ashish Kalra
duce KVM_GET_SHARED_PAGES_LIST > ioctl > > On Thu, Feb 04, 2021, Ashish Kalra wrote: > > From: Brijesh Singh > > > > The ioctl is used to retrieve a guest's shared pages list. > > >What's the performance hit to boot time if KVM_HC_PAGE_ENC_STATUS i

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-10 Thread Ashish Kalra
Hello Steve, On Mon, Feb 08, 2021 at 02:50:14PM -0800, Steve Rutherford wrote: > Hi Ashish, > > On Sun, Feb 7, 2021 at 4:29 PM Ashish Kalra wrote: > > > > Hello Steve, > > > > On Sat, Feb 06, 2021 at 01:56:46PM +, Ashish Kalra wrote: > > > Hello Ste

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-07 Thread Ashish Kalra
Hello Steve, On Sat, Feb 06, 2021 at 01:56:46PM +, Ashish Kalra wrote: > Hello Steve, > > On Sat, Feb 06, 2021 at 05:46:17AM +0000, Ashish Kalra wrote: > > Hello Steve, > > > > Continued response to your queries, especially related to userspace > > cont

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-06 Thread Ashish Kalra
Hello Steve, On Sat, Feb 06, 2021 at 05:46:17AM +, Ashish Kalra wrote: > Hello Steve, > > Continued response to your queries, especially related to userspace > control of SEV live migration feature : > > On Fri, Feb 05, 2021 at 06:54:21PM -0800, Steve Rutherford wrote:

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-05 Thread Ashish Kalra
Hello Steve, Continued response to your queries, especially related to userspace control of SEV live migration feature : On Fri, Feb 05, 2021 at 06:54:21PM -0800, Steve Rutherford wrote: > On Thu, Feb 4, 2021 at 7:08 PM Ashish Kalra wrote: > > > > Hello Steve, > > > &

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-05 Thread Ashish Kalra
Hello Steve, Let me first answer those queries which i can do immediately ... On Fri, Feb 05, 2021 at 06:54:21PM -0800, Steve Rutherford wrote: > On Thu, Feb 4, 2021 at 7:08 PM Ashish Kalra wrote: > > > > Hello Steve, > > > > On Thu, Feb 04, 2021 at 04:56:35PM -0

Re: [PATCH v10 08/16] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-02-04 Thread Ashish Kalra
Hello Steve, On Thu, Feb 04, 2021 at 05:44:27PM -0800, Steve Rutherford wrote: > On Wed, Feb 3, 2021 at 4:38 PM Ashish Kalra wrote: > > > > From: Brijesh Singh > > > > This hypercall is used by the SEV guest to notify a change in the page > > encryption status

Re: [PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-04 Thread Ashish Kalra
Hello Steve, On Thu, Feb 04, 2021 at 04:56:35PM -0800, Steve Rutherford wrote: > On Wed, Feb 3, 2021 at 4:39 PM Ashish Kalra wrote: > > > > From: Ashish Kalra > > > > Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check > > for host-side support f

Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-02-04 Thread Ashish Kalra
Hello Tom, On Thu, Feb 04, 2021 at 10:14:37AM -0600, Tom Lendacky wrote: > On 2/3/21 6:39 PM, Ashish Kalra wrote: > > From: Brijesh Singh > > > > The ioctl is used to retrieve a guest's shared pages list. > > > > ... > > >

[PATCH v10 12/16] KVM: x86: Introduce new KVM_FEATURE_SEV_LIVE_MIGRATION feature & Custom MSR.

2021-02-03 Thread Ashish Kalra
From: Ashish Kalra Add new KVM_FEATURE_SEV_LIVE_MIGRATION feature for guest to check for host-side support for SEV live migration. Also add a new custom MSR_KVM_SEV_LIVE_MIGRATION for guest to enable the SEV live migration feature. Signed-off-by: Ashish Kalra --- Documentation/virt/kvm

[PATCH v10 09/16] mm: x86: Invoke hypercall when page encryption status is changed

2021-02-03 Thread Ashish Kalra
"Radim Krčmář" Cc: Joerg Roedel Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/paravirt.h | 10

[PATCH v10 16/16] KVM: SVM: Bypass DBG_DECRYPT API calls for unencrypted guest memory.

2021-02-03 Thread Ashish Kalra
From: Ashish Kalra For all unencrypted guest memory regions such as S/W IOTLB bounce buffers and for guest regions marked as "__bss_decrypted", ensure that DBG_DECRYPT API calls are bypassed. The guest memory regions encryption status is referenced using the shared pages list. Sig

[PATCH v10 15/16] KVM: x86: Add kexec support for SEV Live Migration.

2021-02-03 Thread Ashish Kalra
From: Ashish Kalra Reset the host's shared pages list related to kernel specific page encryption status settings before we load a new kernel by kexec. We cannot reset the complete shared pages list here as we need to retain the UEFI/OVMF firmware specific settings. The host's shared

[PATCH v10 14/16] KVM: x86: Add guest support for detecting and enabling SEV Live Migration feature.

2021-02-03 Thread Ashish Kalra
From: Ashish Kalra The guest support for detecting and enabling SEV Live migration feature uses the following logic : - kvm_init_plaform() invokes check_kvm_sev_migration() which checks if its booted under the EFI - If not EFI, i) check for the KVM_FEATURE_CPUID ii) if CPUID

[PATCH v10 13/16] EFI: Introduce the new AMD Memory Encryption GUID.

2021-02-03 Thread Ashish Kalra
From: Ashish Kalra Introduce a new AMD Memory Encryption GUID which is currently used for defining a new UEFI environment variable which indicates UEFI/OVMF support for the SEV live migration feature. This variable is setup when UEFI/OVMF detects host/hypervisor support for SEV live migration

[PATCH v10 11/16] KVM: x86: Introduce KVM_SET_SHARED_PAGES_LIST ioctl

2021-02-03 Thread Ashish Kalra
.@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Co-developed-by: Ashish Kalra Signed-off-by: Ashish Kalra --- Documentation/virt/kvm/api.rst | 20 +- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/svm/sev.c | 70 +++

[PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

2021-02-03 Thread Ashish Kalra
vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Co-developed-by: Ashish Kalra Signed-off-by: Ashish Kalra --- Documentation/virt/kvm/api.rst | 24 arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/svm/sev.c | 49 ++

[PATCH v10 08/16] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall

2021-02-03 Thread Ashish Kalra
el Cc: Borislav Petkov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Co-developed-by: Ashish Kalra Signed-off-by: Ashish Kalra --- Documentation/virt/kvm/hypercalls.rst | 15 +++ arch/x86/include/asm/kvm_host.h

[PATCH v10 06/16] KVM: SVM: Add KVM_SEV_RECEIVE_FINISH command

2021-02-03 Thread Ashish Kalra
: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 8 +++ arch/x86/kvm/svm/sev.c| 23

[PATCH v10 07/16] KVM: x86: Add AMD SEV specific Hypercall3

2021-02-03 Thread Ashish Kalra
.org Reviewed-by: Steve Rutherford Reviewed-by: Venu Busireddy Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- arch/x86/include/asm/kvm_para.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_pa

[PATCH v10 05/16] KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command

2021-02-03 Thread Ashish Kalra
...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 ++ arch/x86/kvm/svm/sev.c| 79 +++ include/uapi/linux/kvm.h

[PATCH v10 02/16] KVM: SVM: Add KVM_SEND_UPDATE_DATA command

2021-02-03 Thread Ashish Kalra
ov Cc: Tom Lendacky Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by : Steve Rutherford Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- .../virt/kvm/amd-memory-encryption.rst| 24 arch/x86/kvm/svm/sev.c

  1   2   3   >