diff mbox

[v2,02/10] x86/vLAPIC: Declare vlapic_read_aligned() and vlapic_reg_write() as non-static

Message ID 1483163161-2402-3-git-send-email-suravee.suthikulpanit@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Suravee Suthikulpanit Dec. 31, 2016, 5:45 a.m. UTC
Expose vlapic_read_aligned and vlapic_reg_write() to be used by AVIC.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/vlapic.c        | 5 ++---
 xen/include/asm-x86/hvm/vlapic.h | 4 ++++
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Jan Beulich Jan. 5, 2017, 3:53 p.m. UTC | #1
>>> On 31.12.16 at 06:45, <suravee.suthikulpanit@amd.com> wrote:
> Expose vlapic_read_aligned and vlapic_reg_write() to be used by AVIC.
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Generally I dislike functions being non-static when all their callers
live in the same file. Therefore it would be better (and hardly
harder to review) if they got made non-static at the point of their
first external use. That'll also help understanding whether that's
an appropriate move.

Jan
Suravee Suthikulpanit Jan. 10, 2017, 6:57 a.m. UTC | #2
On 01/05/2017 10:53 PM, Jan Beulich wrote:
>>>> On 31.12.16 at 06:45, <suravee.suthikulpanit@amd.com> wrote:
>> Expose vlapic_read_aligned and vlapic_reg_write() to be used by AVIC.
>>
>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> Generally I dislike functions being non-static when all their callers
> live in the same file. Therefore it would be better (and hardly
> harder to review) if they got made non-static at the point of their
> first external use. That'll also help understanding whether that's
> an appropriate move.
>
> Jan
>

IIUC, you want these changes to be in the same patch of the one making 
use of them externally. I can certainly combine this patch with patch 6/10.

Thanks,
S
Jan Beulich Jan. 10, 2017, 8:25 a.m. UTC | #3
>>> On 10.01.17 at 07:57, <Suravee.Suthikulpanit@amd.com> wrote:
> On 01/05/2017 10:53 PM, Jan Beulich wrote:
>>>>> On 31.12.16 at 06:45, <suravee.suthikulpanit@amd.com> wrote:
>>> Expose vlapic_read_aligned and vlapic_reg_write() to be used by AVIC.
>>>
>>> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>>> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>> Generally I dislike functions being non-static when all their callers
>> live in the same file. Therefore it would be better (and hardly
>> harder to review) if they got made non-static at the point of their
>> first external use. That'll also help understanding whether that's
>> an appropriate move.
> 
> IIUC, you want these changes to be in the same patch of the one making 
> use of them externally.

Yes.

> I can certainly combine this patch with patch 6/10.

Thanks.

Jan
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 1d5d287..0f52067 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -562,7 +562,7 @@  static void vlapic_set_tdcr(struct vlapic *vlapic, unsigned int val)
                 "timer_divisor: %d", vlapic->hw.timer_divisor);
 }
 
-static uint32_t vlapic_read_aligned(struct vlapic *vlapic, unsigned int offset)
+uint32_t vlapic_read_aligned(struct vlapic *vlapic, unsigned int offset)
 {
     switch ( offset )
     {
@@ -680,8 +680,7 @@  static void vlapic_tdt_pt_cb(struct vcpu *v, void *data)
     vcpu_vlapic(v)->hw.tdt_msr = 0;
 }
 
-static void vlapic_reg_write(struct vcpu *v,
-                             unsigned int offset, uint32_t val)
+void vlapic_reg_write(struct vcpu *v, unsigned int offset, uint32_t val)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
 
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 4656293..48ab3a6 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -132,6 +132,10 @@  void vlapic_ipi(struct vlapic *vlapic, uint32_t icr_low, uint32_t icr_high);
 
 int vlapic_apicv_write(struct vcpu *v, unsigned int offset);
 
+void vlapic_reg_write(struct vcpu *v, unsigned int offset, uint32_t val);
+
+uint32_t vlapic_read_aligned(struct vlapic *vlapic, unsigned int offset);
+
 struct vlapic *vlapic_lowest_prio(
     struct domain *d, const struct vlapic *source,
     int short_hand, uint32_t dest, bool_t dest_mode);