All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kevin.tian@intel.com, suravee.suthikulpanit@amd.com,
	andrew.cooper3@citrix.com, tim@xen.org,
	dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org,
	Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com,
	dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v19 11/14] x86/VPMU: Handle PMU interrupts for PV guests
Date: Tue, 24 Mar 2015 14:28:35 +0000	[thread overview]
Message-ID: <551182A3020000780006D030@mail.emea.novell.com> (raw)
In-Reply-To: <1426604051-2980-12-git-send-email-boris.ostrovsky@oracle.com>

>>> On 17.03.15 at 15:54, <boris.ostrovsky@oracle.com> wrote:
> Changes in v19:
> * Adjusted for new ops interfaces (passing vcpu vs. vpmu)
> * Test for domain->max_cpu in choose_hwdom_vcpu() instead of 
> 'domain->vcpu!=NULL'

I suppose that's something that then should also be done in patch 7?

> --- a/xen/arch/x86/hvm/vpmu.c
> +++ b/xen/arch/x86/hvm/vpmu.c
> @@ -87,31 +87,57 @@ static void __init parse_vpmu_param(char *s)
>  void vpmu_lvtpc_update(uint32_t val)
>  {
>      struct vpmu_struct *vpmu;
> +    struct vcpu *curr;
>  
>      if ( vpmu_mode == XENPMU_MODE_OFF )
>          return;
>  
> -    vpmu = vcpu_vpmu(current);
> +    curr = current;

Please make this the initializer of the variable, to be consistent with
other code (including yours a few lines down).

> +    vpmu = vcpu_vpmu(curr);
>  
>      vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | (val & APIC_LVT_MASKED);
> -    apic_write(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
> +
> +    /* Postpone APIC updates for PV(H) guests if PMU interrupt is pending */
> +    if ( is_hvm_vcpu(curr) || !vpmu->xenpmu_data ||

Here and below you use is_hvm_vcpu() - is the title wrongly saying
just PV when PV/PVH is meant?

> @@ -548,6 +719,24 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
>          pvpmu_finish(current->domain, &pmu_params);
>          break;
>  
> +    case XENPMU_lvtpc_set:
> +        curr = current;
> +        xenpmu_data = curr->arch.vpmu.xenpmu_data;
> +        if ( xenpmu_data == NULL )
> +            return -EINVAL;
> +        vpmu_lvtpc_update(xenpmu_data->pmu.l.lapic_lvtpc);
> +        break;

You don't use curr more than once here, hence I don't see the point
of latching current into a local variable.

These aside,
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan

  reply	other threads:[~2015-03-24 14:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 14:53 [PATCH v19 00/14] x86/PMU: Xen PMU PV(H) support Boris Ostrovsky
2015-03-17 14:53 ` [PATCH v19 01/14] x86/VPMU: VPMU should not exist when vpmu_initialise() is called Boris Ostrovsky
2015-03-19  8:43   ` Dietmar Hahn
2015-03-17 14:53 ` [PATCH v19 02/14] common/symbols: Export hypervisor symbols to privileged guest Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 03/14] x86/VPMU: Add public xenpmu.h Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 04/14] x86/VPMU: Make vpmu not HVM-specific Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 05/14] x86/VPMU: Interface for setting PMU mode and flags Boris Ostrovsky
2015-03-19 13:12   ` Dietmar Hahn
2015-03-19 13:28     ` Jan Beulich
2015-03-19 13:49       ` Dietmar Hahn
2015-03-24 13:56   ` Jan Beulich
2015-03-17 14:54 ` [PATCH v19 06/14] x86/VPMU: Initialize VPMUs with __initcall Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 07/14] x86/VPMU: Initialize PMU for PV(H) guests Boris Ostrovsky
2015-03-24 14:08   ` Jan Beulich
2015-03-24 15:06     ` Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 08/14] x86/VPMU: Save VPMU state for PV guests during context switch Boris Ostrovsky
2015-03-24 14:15   ` Jan Beulich
2015-03-17 14:54 ` [PATCH v19 09/14] x86/VPMU: When handling MSR accesses, leave fault injection to callers Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 10/14] x86/VPMU: Add support for PMU register handling on PV guests Boris Ostrovsky
2015-03-17 14:54 ` [PATCH v19 11/14] x86/VPMU: Handle PMU interrupts for " Boris Ostrovsky
2015-03-24 14:28   ` Jan Beulich [this message]
2015-03-24 15:13     ` Boris Ostrovsky
2015-03-24 15:36       ` Jan Beulich
2015-03-24 15:47         ` Boris Ostrovsky
2015-03-24 16:03           ` Jan Beulich
2015-03-17 14:54 ` [PATCH v19 12/14] x86/VPMU: Merge vpmu_rdmsr and vpmu_wrmsr Boris Ostrovsky
2015-03-25  8:29   ` Dietmar Hahn
2015-03-25 12:23     ` Dietmar Hahn
2015-03-25 16:52   ` Jan Beulich
2015-03-17 14:54 ` [PATCH v19 13/14] x86/VPMU: Add privileged PMU mode Boris Ostrovsky
2015-03-25 12:25   ` Dietmar Hahn
2015-03-25 16:57   ` Jan Beulich
2015-03-17 14:54 ` [PATCH v19 14/14] x86/VPMU: Move VPMU files up from hvm/ directory Boris Ostrovsky
2015-03-19 14:32 ` [PATCH v19 00/14] x86/PMU: Xen PMU PV(H) support Dietmar Hahn
2015-03-19 16:03   ` Boris Ostrovsky

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=551182A3020000780006D030@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dietmar.hahn@ts.fujitsu.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --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 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.