public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	konrad.wilk@oracle.com, david.vrabel@citrix.com,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/xen: Disable APIC PM for Xen PV guests
Date: Mon, 17 Mar 2014 13:10:57 -0400	[thread overview]
Message-ID: <53272CA1.3000609@oracle.com> (raw)
In-Reply-To: <1393900821-6182-1-git-send-email-boris.ostrovsky@oracle.com>

On 03/03/2014 09:40 PM, Boris Ostrovsky wrote:
> Xen PV guests support only few APIC registers and writes to
> unsupported registers result in WARN_ONs. Most APIC accesses in these
> guests  have been eliminated; however, lapic_suspend/resume are still
> called (on 32-bit kernels).
>
> We can disable APIC power management in xen_smp_prepare_boot_cpu()
> (which is called after APIC has been initialized).


This touches generic APIC code so x86 maintainers' review would
be appreciated.

Thanks.
-boris


> Signed-off-by: Boris Ostrovsky<boris.ostrovsky@oracle.com>
> ---
>   arch/x86/include/asm/apic.h |    2 ++
>   arch/x86/kernel/apic/apic.c |    6 ++++++
>   arch/x86/xen/smp.c          |    4 ++++
>   3 files changed, 12 insertions(+)
>
>
> An alternative could be to add another op to stuct apic. The advantage would be
> the fact that we never have a window of time when APIC PM is enabled. The downside
> is having yet another op (of which there are already plenty).
>
> We could also avoid loading lapic_syscore_ops but I couldn't think of a good way
> to figure out when not to do it.
>
>
>
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 1d2091a..1f100f2 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -687,6 +687,8 @@ extern int default_cpu_present_to_apicid(int mps_cpu);
>   extern int default_check_phys_apicid_present(int phys_apicid);
>   #endif
>   
> +extern void apic_pm_deactivate(void);
> +
>   #endif /* CONFIG_X86_LOCAL_APIC */
>   extern void irq_enter(void);
>   extern void irq_exit(void);
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 7f26c9a..60607b3 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -2424,6 +2424,11 @@ static void apic_pm_activate(void)
>   	apic_pm_state.active = 1;
>   }
>   
> +void apic_pm_deactivate(void)
> +{
> +	apic_pm_state.active = 0;
> +}
> +
>   static int __init init_lapic_sysfs(void)
>   {
>   	/* XXX: remove suspend/resume procs if !apic_pm_state.active? */
> @@ -2439,6 +2444,7 @@ core_initcall(init_lapic_sysfs);
>   #else	/* CONFIG_PM */
>   
>   static void apic_pm_activate(void) { }
> +void apic_pm_deactivate(void) { }
>   
>   #endif	/* CONFIG_PM */
>   
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index a18eadd..33115d8 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -298,6 +298,10 @@ static void __init xen_smp_prepare_boot_cpu(void)
>   
>   		xen_filter_cpu_maps();
>   		xen_setup_vcpu_info_placement();
> +
> +#ifdef CONFIG_X86_LOCAL_APIC
> +		apic_pm_deactivate();
> +#endif
>   	}
>   	/*
>   	 * The alternative logic (which patches the unlock/lock) runs before


      parent reply	other threads:[~2014-03-17 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04  2:40 [PATCH] x86/xen: Disable APIC PM for Xen PV guests Boris Ostrovsky
2014-03-04 10:25 ` David Vrabel
2014-03-04 21:17   ` Boris Ostrovsky
2014-03-17 17:10 ` Boris Ostrovsky [this message]

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=53272CA1.3000609@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox