Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Borislav Petkov
On Wed, Sep 13, 2017 at 11:23:26AM -0500, Brijesh Singh wrote: > I am okay with moving it on the stack but just to give context why > I went in this way. The physical address of data is given to the > device (in this case SEV FW). I was not sure if its okay to pass the > stack address to the

Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Borislav Petkov
On Wed, Sep 13, 2017 at 11:23:26AM -0500, Brijesh Singh wrote: > I am okay with moving it on the stack but just to give context why > I went in this way. The physical address of data is given to the > device (in this case SEV FW). I was not sure if its okay to pass the > stack address to the

Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Brijesh Singh
Hi Boris, thanks for the detail review. On 09/13/2017 10:06 AM, Borislav Petkov wrote: ... +static int sev_platform_get_state(int *state, int *error) +{ + int ret; + struct sev_data_status *data; + + data = kzalloc(sizeof(*data), GFP_KERNEL); It's a bit silly to do the

Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Brijesh Singh
Hi Boris, thanks for the detail review. On 09/13/2017 10:06 AM, Borislav Petkov wrote: ... +static int sev_platform_get_state(int *state, int *error) +{ + int ret; + struct sev_data_status *data; + + data = kzalloc(sizeof(*data), GFP_KERNEL); It's a bit silly to do the

Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 03:02:50PM -0500, Brijesh Singh wrote: > The command initializes the SEV firmware and allocate a new ASID for allocates > this guest from SEV ASID pool. The firmware must be initialized before from the > we

Re: [RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-09-13 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 03:02:50PM -0500, Brijesh Singh wrote: > The command initializes the SEV firmware and allocate a new ASID for allocates > this guest from SEV ASID pool. The firmware must be initialized before from the > we

[RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-07-24 Thread Brijesh Singh
The command initializes the SEV firmware and allocate a new ASID for this guest from SEV ASID pool. The firmware must be initialized before we issue guest launch command to create a new encryption context. Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 188

[RFC Part2 PATCH v3 13/26] KVM: SVM: Add KVM_SEV_INIT command

2017-07-24 Thread Brijesh Singh
The command initializes the SEV firmware and allocate a new ASID for this guest from SEV ASID pool. The firmware must be initialized before we issue guest launch command to create a new encryption context. Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 188