2007-10-25 21:35:50 +00:00
|
|
|
/*
|
|
|
|
* PowerPC emulation special registers manipulation helpers for qemu.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003-2007 Jocelyn Mayer
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2020-10-19 06:11:26 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2007-10-25 21:35:50 +00:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-07-16 20:47:01 +00:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2007-10-25 21:35:50 +00:00
|
|
|
*/
|
|
|
|
|
2016-06-29 11:47:03 +00:00
|
|
|
#ifndef HELPER_REGS_H
|
|
|
|
#define HELPER_REGS_H
|
2007-10-25 21:35:50 +00:00
|
|
|
|
2021-03-15 18:45:59 +00:00
|
|
|
void hreg_swap_gpr_tgpr(CPUPPCState *env);
|
|
|
|
void hreg_compute_hflags(CPUPPCState *env);
|
|
|
|
void cpu_interrupt_exittb(CPUState *cs);
|
|
|
|
int hreg_store_msr(CPUPPCState *env, target_ulong value, int alter_hv);
|
2017-12-04 22:25:43 +00:00
|
|
|
|
2021-03-15 18:45:59 +00:00
|
|
|
#ifdef CONFIG_USER_ONLY
|
2016-09-20 16:35:00 +00:00
|
|
|
static inline void check_tlb_flush(CPUPPCState *env, bool global) { }
|
2021-03-15 18:45:59 +00:00
|
|
|
#else
|
|
|
|
void check_tlb_flush(CPUPPCState *env, bool global);
|
ppc: Do some batching of TCG tlb flushes
On ppc64 especially, we flush the tlb on any slbie or tlbie instruction.
However, those instructions often come in bursts of 3 or more (context
switch will favor a series of slbie's for example to an slbia if the
SLB has less than a certain number of entries in it, and tlbie's can
happen in a series, with PAPR, H_BULK_REMOVE can remove up to 4 entries
at a time.
Doing a tlb_flush() each time is a waste of time. We end up doing a memset
of the whole TLB, reloading it for the next instruction, memset'ing again,
etc...
Those instructions don't have to take effect immediately. For slbie, they
can wait for the next context synchronizing event. For tlbie, the next
tlbsync.
This implements batching by keeping a flag that indicates that we have a
TLB in need of flushing. We check it on interrupts, rfi's, isync's and
tlbsync and flush the TLB if needed.
This reduces the number of tlb_flush() on a boot to a ubuntu installer
first dialog screen from roughly 360K down to 36K.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[clg: added a 'CPUPPCState *' variable in h_remove() and
h_bulk_remove() ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
[dwg: removed spurious whitespace change, use 0/1 not true/false
consistently, since tlb_need_flush has int type]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-05-03 16:03:25 +00:00
|
|
|
#endif
|
|
|
|
|
2016-06-29 11:47:03 +00:00
|
|
|
#endif /* HELPER_REGS_H */
|