All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Petre Ovidiu PIRCALABU" <ppircalabu@bitdefender.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Tamas K Lengyel" <tamas@tklengyel.com>,
	"Jun Nakajima" <jun.nakajima@intel.com>, "Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Razvan COJOCARU" <rcojocaru@bitdefender.com>,
	"Suravee Suthikulpanit" <suravee.suthikulpanit@amd.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH] SVM: correct CPUID event processing
Date: Fri, 20 Sep 2019 08:39:42 +0000	[thread overview]
Message-ID: <57f40bec-d2ad-192f-aeb1-008a0a701fcc@bitdefender.com> (raw)
In-Reply-To: <845737d3-e16e-61d7-7733-0f8b9eddfb45@suse.com>



On 19.09.2019 13:37, Jan Beulich wrote:
> hvm_monitor_cpuid() expects the input registers, not two of the outputs.
> 
> However, once having made the necessary adjustment, the SVM and VMX
> functions are so similar that they should be folded (thus avoiding
> further similar asymmetries to get introduced). Use the best of both
> worlds by e.g. using "curr" consistently. This then being the only
> caller of hvm_check_cpuid_faulting(), fold in that function as well.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Alexandru Isaila <aisaila@bitdefender.com>

> 
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3349,14 +3349,28 @@ unsigned long copy_from_user_hvm(void *t
>       return rc ? len : 0; /* fake a copy_from_user() return code */
>   }
>

Useful fold. Maybe a small comment with the reason to have one function 
would help. Something like both SVM and VMX do the same thing, but it's 
up to you if it is necessary.

> -bool hvm_check_cpuid_faulting(struct vcpu *v)
> +int hvm_vmexit_cpuid(struct cpu_user_regs *regs, unsigned int inst_len)

Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-09-20  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 10:37 [Xen-devel] [PATCH] SVM: correct CPUID event processing Jan Beulich
2019-09-19 20:07 ` Boris Ostrovsky
2019-09-19 20:36   ` Razvan COJOCARU
2019-09-20  8:39 ` Alexandru Stefan ISAILA [this message]
2019-09-20  8:44   ` Jan Beulich
2019-09-20  8:50 ` Andrew Cooper
2019-09-20  8:55   ` Jan Beulich
2019-09-25  9:18 ` Jürgen Groß
2019-09-25  9:19 ` Tian, Kevin

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=57f40bec-d2ad-192f-aeb1-008a0a701fcc@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tamas@tklengyel.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.