[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: target/ppc: sPAPR invalid function calls when compiling without TCG
From: |
David Gibson |
Subject: |
Re: target/ppc: sPAPR invalid function calls when compiling without TCG |
Date: |
Tue, 20 Apr 2021 10:09:18 +1000 |
On Mon, Apr 19, 2021 at 07:04:34PM +0000, Lucas Mateus Martins Araujo e Castro
wrote:
>
>
> >> spapr_hcall.c:
> >> function h_enter call ppc_hash64_hpte_page_shift_noslb,
> >> ppc_hash64_map_hptes and ppc_hash64_unmap_hptes
> >> function remove_hpte call ppc_hash64_map_hptes, ppc_hash64_unmap_hptes
> >> and ppc_hash64_tlb_flush_hpte
> >> function h_protect call ppc_hash64_map_hptes, ppc_hash64_unmap_hptes
> >> and ppc_hash64_tlb_flush_hpte
> >> function h_read call ppc_hash64_map_hptes and ppc_hash64_unmap_hptes
> >> function rehash_hpte call ppc_hash64_hpte_page_shift_noslb
> >> function rehash_hpt call ppc_hash64_map_hptes and
> >> ppc_hash64_unmap_hptes
>
> >h_enter, remove_hpte, h_protect, h_read and rehash_hpte should never
> >be called for a KVM guest (KVM will intercept the relevant hcalls
> >before they reach qemu). I think it would make sense to split of a
> >TCG only portion of spapr_hcall.c into a new file. You'll then
> >probably need !TCG stubs for those hypercalls, which should trip a
> >fatal error (if KVM hasn't handled the calls, there's nothing we can
> >do that will salvage the situation).
>
> These functions are static, so I thought about turning them into non-static
> functions and creating the prototype in
> internal.h and changing hw/ppc/meson.build to add the correct .c file but
> hw/ppc/ doesn't have an internal.h
>
> What is the best way to handle this static functions?
They're static because their only direct use is passing to
spapr_register_hypercall() in hypercall_register_types(). You can put
your own register types function in the new KVM-only file, with those
calls, so everything will stay static.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature