From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/APIC: reduce self-IPI related code
Date: Tue, 9 Sep 2014 16:58:51 +0100 [thread overview]
Message-ID: <540F23BB.3010003@citrix.com> (raw)
In-Reply-To: <540F3DA50200007800032CE3@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 3583 bytes --]
On 09/09/14 16:49, Jan Beulich wrote:
> send_IPI_self_{phys,flat}() were identical and send_IPI_self_x2apic()
> was misplaced and pointlessly (implictly) had a non-x2APIC code path.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/genapic/x2apic.c
> +++ b/xen/arch/x86/genapic/x2apic.c
> @@ -92,6 +92,11 @@ static unsigned int cpu_mask_to_apicid_x
> return dest;
> }
>
> +static void send_IPI_self_x2apic(uint8_t vector)
> +{
> + apic_wrmsr(APIC_SELF_IPI, vector);
> +}
> +
> static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
> {
> unsigned int cpu;
> --- a/xen/arch/x86/smp.c
> +++ b/xen/arch/x86/smp.c
> @@ -124,21 +124,11 @@ static void __default_send_IPI_shortcut(
> apic_write_around(APIC_ICR, cfg);
> }
>
> -void send_IPI_self_flat(int vector)
> +void send_IPI_self_legacy(uint8_t vector)
> {
> __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
> }
>
> -void send_IPI_self_phys(int vector)
> -{
> - __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
> -}
> -
> -void send_IPI_self_x2apic(int vector)
> -{
> - apic_write(APIC_SELF_IPI, vector);
> -}
> -
> void send_IPI_mask_flat(const cpumask_t *cpumask, int vector)
> {
> unsigned long mask = cpumask_bits(cpumask)[0];
> --- a/xen/include/asm-x86/genapic.h
> +++ b/xen/include/asm-x86/genapic.h
> @@ -37,7 +37,7 @@ struct genapic {
> const cpumask_t *(*vector_allocation_cpumask)(int cpu);
> unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask);
> void (*send_IPI_mask)(const cpumask_t *mask, int vector);
> - void (*send_IPI_self)(int vector);
> + void (*send_IPI_self)(uint8_t vector);
> };
>
> #define APICFUNC(x) .x = x
> @@ -52,12 +52,12 @@ extern const struct genapic *genapic;
> extern const struct genapic apic_default;
>
> const cpumask_t *target_cpus_all(void);
> +void send_IPI_self_legacy(uint8_t vector);
>
> void init_apic_ldr_flat(void);
> void clustered_apic_check_flat(void);
> unsigned int cpu_mask_to_apicid_flat(const cpumask_t *cpumask);
> void send_IPI_mask_flat(const cpumask_t *mask, int vector);
> -void send_IPI_self_flat(int vector);
> const cpumask_t *vector_allocation_cpumask_flat(int cpu);
> #define GENAPIC_FLAT \
> .int_delivery_mode = dest_LowestPrio, \
> @@ -68,13 +68,12 @@ const cpumask_t *vector_allocation_cpuma
> .vector_allocation_cpumask = vector_allocation_cpumask_flat, \
> .cpu_mask_to_apicid = cpu_mask_to_apicid_flat, \
> .send_IPI_mask = send_IPI_mask_flat, \
> - .send_IPI_self = send_IPI_self_flat
> + .send_IPI_self = send_IPI_self_legacy
>
> void init_apic_ldr_phys(void);
> void clustered_apic_check_phys(void);
> unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask);
> void send_IPI_mask_phys(const cpumask_t *mask, int vector);
> -void send_IPI_self_phys(int vector);
> const cpumask_t *vector_allocation_cpumask_phys(int cpu);
> #define GENAPIC_PHYS \
> .int_delivery_mode = dest_Fixed, \
> @@ -85,8 +84,6 @@ const cpumask_t *vector_allocation_cpuma
> .vector_allocation_cpumask = vector_allocation_cpumask_phys, \
> .cpu_mask_to_apicid = cpu_mask_to_apicid_phys, \
> .send_IPI_mask = send_IPI_mask_phys, \
> - .send_IPI_self = send_IPI_self_phys
> -
> -void send_IPI_self_x2apic(int vector);
> + .send_IPI_self = send_IPI_self_legacy
>
> #endif
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 4319 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2014-09-09 16:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 15:49 [PATCH] x86/APIC: reduce self-IPI related code Jan Beulich
2014-09-09 15:58 ` Andrew Cooper [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=540F23BB.3010003@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@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.