From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: "tamas@tklengyel.com" <tamas@tklengyel.com>
Cc: "suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
"rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>,
"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v1 2/2] hvm/svm: Implement CPUID events
Date: Tue, 20 Feb 2018 10:37:15 +0000 [thread overview]
Message-ID: <1519123035.4963.32.camel@bitdefender.com> (raw)
In-Reply-To: <CABfawhmBBfzfeR3RySFEKZzn-LAC71c9qNDOCoXV5XOrBcpXog@mail.gmail.com>
On Lu, 2018-02-19 at 08:25 -0700, Tamas K Lengyel wrote:
> On Mon, Feb 19, 2018 at 6:07 AM, Alexandru Isaila
> <aisaila@bitdefender.com> wrote:
> >
> > At this moment the CPUID events for the AMD architecture are not
> > forwarded to the monitor layer.
> >
> > This patch adds the CPUID event to the common capabilities and then
> > forwards the event to the monitor layer.
> >
> > Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> > ---
> > xen/arch/x86/hvm/svm/svm.c | 8 +++++++-
> > xen/include/asm-x86/monitor.h | 2 +-
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/svm/svm.c
> > b/xen/arch/x86/hvm/svm/svm.c
> > index e36ad05..0f1c57d 100644
> > --- a/xen/arch/x86/hvm/svm/svm.c
> > +++ b/xen/arch/x86/hvm/svm/svm.c
> > @@ -1804,6 +1804,7 @@ static void svm_vmexit_do_cpuid(struct
> > cpu_user_regs *regs)
> > struct vcpu *curr = current;
> > unsigned int inst_len;
> > struct cpuid_leaf res;
> > + int rc = 0;
> >
> > if ( (inst_len = __get_instruction_length(curr, INSTR_CPUID))
> > == 0 )
> > return;
> > @@ -1822,7 +1823,12 @@ static void svm_vmexit_do_cpuid(struct
> > cpu_user_regs *regs)
> > regs->rcx = res.c;
> > regs->rdx = res.d;
> >
> > - __update_guest_eip(regs, inst_len);
> > + rc = hvm_monitor_cpuid(inst_len, regs->eax, regs->ecx);
> > +
> > + if ( !rc )
> Missing the rc < 0 case handling.
Hi Tamas,
I think we can resolve this in 2 ways:
1. I do it like on the vmx side and take the __update_guest_eip out of
the function, return the result from hvm_monitor_cpuid and handle the
result in the case statement.
2. I can handle the !rc in the function and the rc < 0 in the case
statement.
What do you prefer so we can skip version 3 of the patch?
~Alex
________________________
This email was scanned by Bitdefender
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-20 10:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 13:07 [PATCH v1 0/2] hvm/svm: Enable vm events for SVM Alexandru Isaila
2018-02-19 13:07 ` [PATCH v1 1/2] asm-x86/monitor: Add MONITOR_EVENT_INTERRUPT to common capabilities Alexandru Isaila
2018-02-19 13:11 ` Razvan Cojocaru
2018-02-19 13:07 ` [PATCH v1 2/2] hvm/svm: Implement CPUID events Alexandru Isaila
2018-02-19 15:25 ` Tamas K Lengyel
2018-02-19 15:29 ` Razvan Cojocaru
2018-02-19 15:38 ` Jan Beulich
2018-02-20 10:37 ` Alexandru Stefan ISAILA [this message]
2018-02-20 18:59 ` Tamas K Lengyel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1519123035.4963.32.camel@bitdefender.com \
--to=aisaila@bitdefender.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jbeulich@suse.com \
--cc=rcojocaru@bitdefender.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tamas@tklengyel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).