lkml.org 
[lkml]   [2021]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] KVM: SVM: Get rid of *ghcb_msr_bits() functions
On Wed, Sep 01, 2021 at 09:12:10PM +0000, Sean Christopherson wrote:
> On Thu, Jul 22, 2021, Joerg Roedel wrote:
> > case GHCB_MSR_TERM_REQ: {
> > u64 reason_set, reason_code;
> >
> > - reason_set = get_ghcb_msr_bits(svm,
> > - GHCB_MSR_TERM_REASON_SET_MASK,
> > - GHCB_MSR_TERM_REASON_SET_POS);
> > - reason_code = get_ghcb_msr_bits(svm,
> > - GHCB_MSR_TERM_REASON_MASK,
> > - GHCB_MSR_TERM_REASON_POS);
> > + reason_set = GHCB_MSR_TERM_REASON_SET(control->ghcb_gpa);
> > + reason_code = GHCB_MSR_TERM_REASON(control->ghcb_gpa);
> > +
> > pr_info("SEV-ES guest requested termination: %#llx:%#llx\n",
> > reason_set, reason_code);
> > +
> > fallthrough;
>
> Not related to this patch, but why use fallthrough and more importantly, why is
> this an -EINVAL return? Why wouldn't KVM forward the request to userspace instead
> of returning an opaque -EINVAL?

I guess it is to signal an error condition up the call-chain to get the
guest terminated, like requested.

Regards,

Joerg

\
 
 \ /
  Last update: 2021-09-09 15:40    [W:0.068 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site