powerpc/powernv: Remove separate entry for OPAL real mode calls
Subsystems (2)
RFC PATCH v2 1/2 powerpc/powernv: Remove separate entry for OPAL real mode calls
Quoted 1 line
From
5f32fd8fef0cb762ddb0939265455a0b3db2911bMon Sep 17 00:00:00 2001
From: Benjamin Herrenschmidt <[email protected]>
Date: Tue, 7 Feb 2017 15:01:55 +1100
Subject:
All entry points already read the MSR so they can easily do the right thing.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
---
v2. Test both IR and DR and fix accidentally removing an
instruction in the tracepoint path.
arch/powerpc/include/asm/opal.h | 7 --- arch/powerpc/kernel/idle_book3s.S | 6 +-- arch/powerpc/kvm/book3s_hv_builtin.c | 13 +++-- arch/powerpc/kvm/book3s_hv_rm_xics.c | 14 +++--- arch/powerpc/platforms/powernv/opal-wrappers.S | 70 +++++++++++--------------- arch/powerpc/platforms/powernv/pci-ioda.c | 5 -- 6 files changed, 45 insertions(+), 70 deletions(-)
arch/powerpc/include/asm/opal.h +0 -7
@@ -67,7 +67,6 @@ int64_t opal_pci_config_write_half_word(uint64_t phb_id, uint64_t bus_dev_func,int64_t opal_pci_config_write_word (uint64_t phb_id,uint64_t bus_dev_func,uint64_t offset,uint32_t data);int64_t opal_set_xive (uint32_t isn,uint16_t server,uint8_t priority); -int64_t opal_rm_set_xive (uint32_t isn,uint16_t server,uint8_t priority);int64_t opal_get_xive (uint32_t isn,__be16 *server,uint8_t *priority); int64_t opal_register_exception_handler(uint64_t opal_exception, uint64_t handler_address,
@@ -220,18 +219,12 @@ int64_t opal_pci_set_power_state(uint64_t async_token, uint64_t id,int64_t opal_pci_poll2 (uint64_t id,uint64_t data);int64_t opal_int_get_xirr (uint32_t *out_xirr,bool just_poll); -int64_t opal_rm_int_get_xirr (__be32 *out_xirr,bool just_poll);int64_t opal_int_set_cppr (uint8_t cppr);int64_t opal_int_eoi (uint32_t xirr); -int64_t opal_rm_int_eoi (uint32_t xirr);int64_t opal_int_set_mfrr (uint32_t cpu,uint8_t mfrr); -int64_t opal_rm_int_set_mfrr (uint32_t cpu,uint8_t mfrr);int64_t opal_pci_tce_kill (uint64_t phb_id,uint32_t kill_type,uint32_t pe_num,uint32_t tce_size,uint64_t dma_addr,uint32_t npages); -int64_t opal_rm_pci_tce_kill (uint64_t phb_id,uint32_t kill_type, -uint32_t pe_num,uint32_t tce_size, -uint64_t dma_addr,uint32_t npages);/* Internal functions */ extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
arch/powerpc/kernel/idle_book3s.S +3 -3
@@ -250,7 +250,7 @@ fastsleep_workaround_at_entry: /* Fast sleep workaround */ li r3,1 li r4,1 - bl opal_rm_config_cpu_idle_state + bl opal_config_cpu_idle_state /* Clear Lock bit */ li r0,0
@@ -544,7 +544,7 @@ timebase_resync: */ ble cr3,clear_lock /* Time base re-sync */ - bl opal_rm_resync_timebase; + bl opal_resync_timebase; /* * If waking up from sleep, per core state is not lost, skip to * clear_lock.
@@ -633,7 +633,7 @@ hypervisor_state_restored: fastsleep_workaround_at_exit: li r3,1 li r4,0 - bl opal_rm_config_cpu_idle_state + bl opal_config_cpu_idle_state b timebase_resync /*
arch/powerpc/kvm/book3s_hv_builtin.c +6 -7
@@ -229,8 +229,7 @@ void kvmhv_rm_send_ipi(int cpu)if (xics_phys)rm_writeb (xics_phys +XICS_MFRR ,IPI_PRIORITY );else -opal_rm_int_set_mfrr (get_hard_smp_processor_id (cpu), -IPI_PRIORITY ); +opal_int_set_mfrr (get_hard_smp_processor_id (cpu),IPI_PRIORITY ); }/*
@@ -414,7 +413,7 @@ static long kvmppc_read_one_intr(bool *again) xics_phys = local_paca->kvm_hstate.xics_phys;if (!xics_phys) {/* Use OPAL to read the XIRR */ - rc =opal_rm_int_get_xirr (&xirr, false); + rc =opal_int_get_xirr (&xirr, false);if (rc <0 )return 1 ; }else {
@@ -449,8 +448,8 @@ static long kvmppc_read_one_intr(bool *again)_stbcix (xics_phys +XICS_MFRR ,0xff );_stwcix (xics_phys +XICS_XIRR , xirr); }else { -opal_rm_int_set_mfrr (hard_smp_processor_id (),0xff ); - rc =opal_rm_int_eoi (h_xirr); +opal_int_set_mfrr (hard_smp_processor_id (),0xff ); + rc =opal_int_eoi (h_xirr);/* If rc > 0, there is another interrupt pending */ *again = rc >0 ; }
@@ -474,8 +473,8 @@ static long kvmppc_read_one_intr(bool *again)if (xics_phys)_stbcix (xics_phys +XICS_MFRR ,IPI_PRIORITY );else -opal_rm_int_set_mfrr (hard_smp_processor_id (), -IPI_PRIORITY ); +opal_int_set_mfrr (hard_smp_processor_id (), +IPI_PRIORITY );/* Let side effects complete */ smp_mb ();return 1 ;
arch/powerpc/kvm/book3s_hv_rm_xics.c +7 -7
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(kvm_irq_bypass);static void icp_rm_deliver_irq (struct kvmppc_xics *xics,struct kvmppc_icp *icp,u32 new_irq); -static int xics_opal_rm_set_server (unsigned int hw_irq,int server_cpu); +static int xics_opal_set_server (unsigned int hw_irq,int server_cpu);/* -- ICS routines -- */ static void ics_rm_check_resend(struct kvmppc_xics *xics,
@@ -73,8 +73,8 @@ static inline void icp_send_hcore_msg(int hcore, struct kvm_vcpu *vcpu)if (paca[hcpu].kvm_hstate.xics_phys)icp_native_cause_ipi_rm (hcpu);else -opal_rm_int_set_mfrr (get_hard_smp_processor_id (hcpu), - IPI_PRIORITY); +opal_int_set_mfrr (get_hard_smp_processor_id (hcpu), + IPI_PRIORITY); }#else static inline void icp_send_hcore_msg (int hcore,struct kvm_vcpu *vcpu) { }
@@ -730,7 +730,7 @@ int kvmppc_rm_h_eoi(struct kvm_vcpu *vcpu, unsigned long xirr) ++vcpu->stat.pthru_host;if (state->intr_cpu != pcpu) { ++vcpu->stat.pthru_bad_aff; -xics_opal_rm_set_server (state->host_irq, pcpu); +xics_opal_set_server (state->host_irq, pcpu); } state->intr_cpu =-1 ; }
@@ -758,16 +758,16 @@ static void icp_eoi(struct irq_chip *c, u32 hwirq, __be32 xirr, bool *again)if (xics_phys) {_stwcix (xics_phys +XICS_XIRR , xirr); }else { - rc =opal_rm_int_eoi (be32_to_cpu (xirr)); + rc =opal_int_eoi (be32_to_cpu (xirr)); *again = rc >0 ; } } -static int xics_opal_rm_set_server (unsigned int hw_irq,int server_cpu) +static int xics_opal_set_server (unsigned int hw_irq,int server_cpu) {unsigned int mangle_cpu =get_hard_smp_processor_id (server_cpu) <<2 ; -return opal_rm_set_xive (hw_irq, mangle_cpu,DEFAULT_PRIORITY ); +return opal_set_xive (hw_irq, mangle_cpu,DEFAULT_PRIORITY ); }/*
arch/powerpc/platforms/powernv/opal-wrappers.S +29 -41
119 lines not on this page · raw message
arch/powerpc/platforms/powernv/pci-ioda.c +0 -5
@@ -1962,11 +1962,6 @@ static void pnv_pci_ioda2_tce_invalidate(struct iommu_table *tbl,if (phb->model ==PNV_PHB_MODEL_PHB3 && phb->regs)pnv_pci_phb3_tce_invalidate (pe, rm, shift, index, npages); -else if (rm) -opal_rm_pci_tce_kill (phb->opal_id, -OPAL_PCI_TCE_KILL_PAGES , - pe->pe_number,1u << shift, - index << shift, npages);else opal_pci_tce_kill(phb->opal_id, OPAL_PCI_TCE_KILL_PAGES,