[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flu
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback |
Date: |
Wed, 30 May 2012 18:57:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 |
Am 30.05.2012 09:53, schrieb Alexander Graf:
> Mind to elaborate (in the patch description maybe) why we need a CPU specific
> TLB flush callback that merely calls the globally visible tlb_flush? :)
Ouch! That's one patch description I forgot to fill in. :-/
The issue is that env is defined in X86CPU, PowerPCCPU, etc. and its
parent, CPUState, does not know about it. Thus, a function passed
CPUState *cpu cannot call functions expecting CPUArchState *env, here
tlb_flush(), unless it is target-specific (e.g., cpu_has_work()).
I've previously structured my series in such a way that all references
to env were removed first before the argument type was changed, cf. (iv)
in [1]. VMState restricts my artistic freedom there by needing matching
types of which the offsets are calculated and which is passed as opaque
to its callbacks. So the alternative to finding some indirect way to
call tlb_flush() from there would be to postpone patch 59 until the TLB
is QOM'ified. But since Anthony had suggested to make "halted" a QOM
property for controlling the vCPU, I did not want to wait forever. ;)
To make it clear, this patch (or an alternative thereof) is only needed
as band-aid for patch 59. It does not provide any value on its own.
Long-term I was thinking of keeping cpu_tlb_flush() as wrapper that
forwards to a TLBClass::flush() or so, so the function in qom/cpu.c
wouldn't have been a complete waste.
Andreas
[1] https://lists.gnu.org/archive/html/qemu-devel/2012-05/msg01286.html
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH qom-next 35/59] cpu: Move queued_work_{first, last} to CPUState, (continued)
- [Qemu-devel] [PATCH qom-next 35/59] cpu: Move queued_work_{first, last} to CPUState, Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 50/59] target-i386: Pass X86CPU to kvm_get_mp_state(), Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 58/59] xen_machine_pv: Use cpu_x86_init() to obtain X86CPU, Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 43/59] cpus: Pass CPUState to [qemu_]cpu_has_work(), Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 54/59] target-mips: Pass MIPSCPU to mips_tc_sleep(), Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 44/59] target-i386: Pass X86CPU to kvm_mce_inject(), Andreas Färber, 2012/05/22
- [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback, Andreas Färber, 2012/05/22
- Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback, Peter Maydell, 2012/05/30
[Qemu-devel] [PATCH qom-next 55/59] target-mips: Pass MIPSCPU to mips_vpe_sleep(), Andreas Färber, 2012/05/22
[Qemu-devel] [PATCH qom-next 45/59] target-i386: Pass X86CPU to cpu_x86_inject_mce(), Andreas Färber, 2012/05/23
[Qemu-devel] [PATCH qom-next 40/59] spapr: Pass PowerPCCPU to spapr_hypercall(), Andreas Färber, 2012/05/23
[Qemu-devel] [PATCH qom-next 41/59] spapr: Pass PowerPCCPU to hypercalls, Andreas Färber, 2012/05/23
[Qemu-devel] [PATCH qom-next 49/59] target-i386: Drop version 5 CPU VMState support, Andreas Färber, 2012/05/23
[Qemu-devel] [PATCH qom-next 47/59] cpu: Move thread_id to CPUState, Andreas Färber, 2012/05/23