Skip to content

Commit

Permalink
x86: Remove cpu_data parameter from apic_clear
Browse files Browse the repository at this point in the history
The function only works against the current CPU, thus should avoid to
take the misleading parameter. The necessary reference can be obtained
inline.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Apr 10, 2015
1 parent 3633188 commit 28f936a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hypervisor/arch/x86/apic.c
Expand Up @@ -289,7 +289,7 @@ static void apic_mask_lvt(unsigned int reg)
apic_ops.write(reg, val | APIC_LVT_MASKED);
}

void apic_clear(struct per_cpu *cpu_data)
void apic_clear(void)
{
unsigned int maxlvt = (apic_ops.read(APIC_REG_LVR) >> 16) & 0xff;
unsigned int xlc = (apic_ext_features() >> 16) & 0xff;
Expand Down Expand Up @@ -318,7 +318,7 @@ void apic_clear(struct per_cpu *cpu_data)
/* Consume pending interrupts to clear IRR.
* Need to reset TPR to ensure interrupt delivery. */
apic_ops.write(APIC_REG_TPR, 0);
cpu_data->num_clear_apic_irqs = 0;
this_cpu_data()->num_clear_apic_irqs = 0;
enable_irq();
cpu_relax();
disable_irq();
Expand Down
4 changes: 2 additions & 2 deletions hypervisor/arch/x86/control.c
Expand Up @@ -237,7 +237,7 @@ int x86_handle_events(struct per_cpu *cpu_data)
cpu_relax();

if (cpu_data->shutdown_cpu) {
apic_clear(cpu_data);
apic_clear();
vcpu_exit(cpu_data);
asm volatile("1: hlt; jmp 1b");
}
Expand Down Expand Up @@ -267,7 +267,7 @@ int x86_handle_events(struct per_cpu *cpu_data)
if (cpu_data->wait_for_sipi)
vcpu_park(cpu_data);
else if (sipi_vector >= 0)
apic_clear(cpu_data);
apic_clear();

return sipi_vector;
}
Expand Down
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/include/asm/apic.h
Expand Up @@ -153,7 +153,7 @@ extern u8 apic_to_cpu_id[];
int apic_init(void);
int apic_cpu_init(struct per_cpu *cpu_data);

void apic_clear(struct per_cpu *cpu_data);
void apic_clear(void);

void apic_send_nmi_ipi(struct per_cpu *target_data);
bool apic_filter_irq_dest(struct cell *cell, struct apic_irq_message *irq_msg);
Expand Down

0 comments on commit 28f936a

Please sign in to comment.