From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
suravee.suthikulpanit@amd.com, Eddie Dong <eddie.dong@intel.com>,
Jun Nakajima <jun.nakajima@intel.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/HVM: replace open-coded non-local cache flushing
Date: Fri, 25 Apr 2014 10:19:55 -0400 [thread overview]
Message-ID: <535A6F0B.2040109@oracle.com> (raw)
In-Reply-To: <535A5A5C020000780000C400@nat28.tlf.novell.com>
On 04/25/2014 06:51 AM, Jan Beulich wrote:
> We accumulated quite a number of these, despite having a pre-canned
> interface for it.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Somewhat related: I also noticed that in on_selected_cpus() (that this
patch is replacing for flushing) we take a global lock. I wonder whether
this may cause scaling issues on big systems. (The same would be true
for flush_all/mask but to a lesser extent since at least that's a lock
dedicated to a particular operation)
-boris
>
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1823,11 +1823,6 @@ static bool_t domain_exit_uc_mode(struct
> return 1;
> }
>
> -static void local_flush_cache(void *info)
> -{
> - wbinvd();
> -}
> -
> static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
> {
> v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
> @@ -1927,7 +1922,7 @@ void hvm_shadow_handle_cd(struct vcpu *v
> domain_pause_nosync(v->domain);
>
> /* Flush physical caches. */
> - on_each_cpu(local_flush_cache, NULL, 1);
> + flush_all(FLUSH_CACHE);
> hvm_set_uc_mode(v, 1);
>
> domain_unpause(v->domain);
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2106,15 +2106,10 @@ static void svm_vmexit_mce_intercept(
> }
> }
>
> -static void wbinvd_ipi(void *info)
> -{
> - wbinvd();
> -}
> -
> static void svm_wbinvd_intercept(void)
> {
> if ( cache_flush_permitted(current->domain) )
> - on_each_cpu(wbinvd_ipi, NULL, 1);
> + flush_all(FLUSH_CACHE);
> }
>
> static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1301,11 +1301,6 @@ void vm_resume_fail(void)
> domain_crash_synchronous();
> }
>
> -static void wbinvd_ipi(void *info)
> -{
> - wbinvd();
> -}
> -
> void vmx_do_resume(struct vcpu *v)
> {
> bool_t debug_state;
> @@ -1332,7 +1327,7 @@ void vmx_do_resume(struct vcpu *v)
> {
> int cpu = v->arch.hvm_vmx.active_cpu;
> if ( cpu != -1 )
> - on_selected_cpus(cpumask_of(cpu), wbinvd_ipi, NULL, 1);
> + flush_mask(cpumask_of(cpu), FLUSH_CACHE);
> }
>
> vmx_clear_vmcs(v);
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2307,18 +2307,13 @@ static void vmx_do_extint(struct cpu_use
> do_IRQ(regs);
> }
>
> -static void wbinvd_ipi(void *info)
> -{
> - wbinvd();
> -}
> -
> static void vmx_wbinvd_intercept(void)
> {
> if ( !cache_flush_permitted(current->domain) || iommu_snoop )
> return;
>
> if ( cpu_has_wbinvd_exiting )
> - on_each_cpu(wbinvd_ipi, NULL, 1);
> + flush_all(FLUSH_CACHE);
> else
> wbinvd();
> }
>
>
>
next prev parent reply other threads:[~2014-04-25 14:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-25 10:51 [PATCH] x86/HVM: replace open-coded non-local cache flushing Jan Beulich
2014-04-25 10:55 ` Andrew Cooper
2014-04-28 7:54 ` Tian, Kevin
2014-04-30 6:29 ` Suravee Suthikulpanit
2014-04-25 14:19 ` Boris Ostrovsky [this message]
2014-04-25 15:55 ` Jan Beulich
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=535A6F0B.2040109@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=jun.nakajima@intel.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=suravee.suthikulpanit@amd.com \
--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.