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 v3 3/3] x86/vlapic: a few type adjustments
Date: Mon, 15 Sep 2014 16:15:24 +0100 [thread overview]
Message-ID: <5417028C.5030400@citrix.com> (raw)
In-Reply-To: <54130909020000780003480A@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 3158 bytes --]
On 12/09/2014 13:54, Jan Beulich wrote:
> Constify a couple of pointer parameters, convert a boolean function
> return type to bool_t, and clean up a printk() being touched anyway.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/hvm/vlapic.c
> +++ b/xen/arch/x86/hvm/vlapic.c
> @@ -173,9 +173,9 @@ uint32_t vlapic_set_ppr(struct vlapic *v
> return ppr;
> }
>
> -static int vlapic_match_logical_addr(struct vlapic *vlapic, uint32_t mda)
> +static bool_t vlapic_match_logical_addr(const struct vlapic *vlapic, uint32_t mda)
> {
> - int result = 0;
> + bool_t result = 0;
> uint32_t logical_id = vlapic_get_reg(vlapic, APIC_LDR);
>
> if ( vlapic_x2apic_mode(vlapic) )
> @@ -196,9 +196,9 @@ static int vlapic_match_logical_addr(str
> result = 1;
> break;
> default:
> - gdprintk(XENLOG_WARNING, "Bad DFR value for lapic of vcpu %d: %08x\n",
> - vlapic_vcpu(vlapic)->vcpu_id,
> - vlapic_get_reg(vlapic, APIC_DFR));
> + printk(XENLOG_G_WARNING "%pv: bad LAPIC DFR value %08x\n",
> + const_vlapic_vcpu(vlapic),
> + vlapic_get_reg(vlapic, APIC_DFR));
> break;
> }
>
> @@ -206,7 +206,7 @@ static int vlapic_match_logical_addr(str
> }
>
> bool_t vlapic_match_dest(
> - struct vlapic *target, const struct vlapic *source,
> + const struct vlapic *target, const struct vlapic *source,
> int short_hand, uint32_t dest, bool_t dest_mode)
> {
> HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest %#x, "
> --- a/xen/include/asm-x86/hvm/vlapic.h
> +++ b/xen/include/asm-x86/hvm/vlapic.h
> @@ -28,6 +28,8 @@
>
> #define vcpu_vlapic(x) (&(x)->arch.hvm_vcpu.vlapic)
> #define vlapic_vcpu(x) (container_of((x), struct vcpu, arch.hvm_vcpu.vlapic))
> +#define const_vlapic_vcpu(x) (container_of((x), const struct vcpu, \
> + arch.hvm_vcpu.vlapic))
> #define vlapic_domain(x) (vlapic_vcpu(x)->domain)
>
> #define _VLAPIC_ID(vlapic, id) (vlapic_x2apic_mode(vlapic) \
> @@ -85,7 +87,8 @@ struct vlapic {
> /* vlapic's frequence is 100 MHz */
> #define APIC_BUS_CYCLE_NS 10
>
> -static inline uint32_t vlapic_get_reg(struct vlapic *vlapic, uint32_t reg)
> +static inline uint32_t vlapic_get_reg(const struct vlapic *vlapic,
> + uint32_t reg)
> {
> return *((uint32_t *)(&vlapic->regs->data[reg]));
> }
> @@ -129,7 +132,7 @@ struct vlapic *vlapic_lowest_prio(
> int short_hand, uint32_t dest, bool_t dest_mode);
>
> bool_t vlapic_match_dest(
> - struct vlapic *target, const struct vlapic *source,
> + const struct vlapic *target, const struct vlapic *source,
> int short_hand, uint32_t dest, bool_t dest_mode);
>
> void vlapic_domain_unpause(const struct domain *);
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3967 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-15 15:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 12:47 [PATCH v3 0/3] x86/HVM: fix various aspects of x2APIC emulation Jan Beulich
2014-09-12 12:52 ` [PATCH v3 1/3] x86/HVM: fix miscellaneous " Jan Beulich
2014-09-12 12:53 ` [PATCH v3 2/3] x86/HVM: fix ID handling " Jan Beulich
2014-09-12 14:49 ` Jan Beulich
2014-09-12 12:54 ` [PATCH v3 3/3] x86/vlapic: a few type adjustments Jan Beulich
2014-09-15 15:15 ` 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=5417028C.5030400@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.