From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC954C433B4 for ; Tue, 20 Apr 2021 00:12:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CC086109E for ; Tue, 20 Apr 2021 00:12:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CC086109E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYe0J-0001no-4f for qemu-devel@archiver.kernel.org; Mon, 19 Apr 2021 20:12:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYdz6-0001FV-T1; Mon, 19 Apr 2021 20:11:21 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:55705 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYdz4-0004XD-Bv; Mon, 19 Apr 2021 20:11:20 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FPPH31gNgz9vDc; Tue, 20 Apr 2021 10:11:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1618877471; bh=oAA0sgrm7jSx1Cxr/nlWM5dP+TKPCCIi8oIy2rAUf2Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nWwUjvTtJwQpJCKBxARtQRaessfCIkt8GXdjVqVs7CZa0oeo5skCW1AScGM4Rtl7a wIdO0EekayjcoFYVcyZM35ib55v4pXAVTjjnyUhfavDcbEa72thd/HsCf8d8DOXAOk CvFiDGuJj/+NlzjGjPSNZy2ooPHAITi/rjQJsDQ0= Date: Tue, 20 Apr 2021 10:09:18 +1000 From: David Gibson To: Lucas Mateus Martins Araujo e Castro Subject: Re: target/ppc: sPAPR invalid function calls when compiling without TCG Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="00llom3lU7/rY16i" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bruno Piazera Larsen , "qemu-ppc@nongnu.org" , "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00llom3lU7/rY16i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 19, 2021 at 07:04:34PM +0000, Lucas Mateus Martins Araujo e Cas= tro wrote: >=20 >=20 > >> 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_h= ptes and ppc_hash64_tlb_flush_hpte > >> function h_protect call ppc_hash64_map_hptes, ppc_hash64_unmap_hpt= es and ppc_hash64_tlb_flush_hpte > >> function h_read call ppc_hash64_map_hptes and ppc_hash64_unmap_hpt= es > >> function rehash_hpte call ppc_hash64_hpte_page_shift_noslb > >> function rehash_hpt call ppc_hash64_map_hptes and ppc_hash64_unmap= _hptes >=20 > >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). >=20 > These functions are static, so I thought about turning them into non-stat= ic 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 >=20 > 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. --=20 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 --00llom3lU7/rY16i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmB+G6wACgkQbDjKyiDZ s5LbmA//SLYTqFdGvWL+pNrowX+nZQQgOGbR08p+tXQNGaCXaFreUD3ZnvE+8gv+ F5Vrd2rNV2hgKDah2ng/4v0+1V9kr/cBoV6tzTm9FTuyY8KNXiKQEac6ZtoNs/mA 9E0y18KGDSp163//od7HIyusB0pq2D2+H0t4DyfRNqgbRpxF8LGLUAiiQJVSA3/m davMyEcRsD13PzHw0Vudu9I+C83ytt+5SLdP4gzTDxiGHxXlJj9UpHD4SIr0tTaK 7w17WlxQQM98kAL+oH7ZB0wYWJ1Q3qZHoeghQ4xI8qDdl8qtmBhoH3qN+J1/91yW gL9L2JeRMF4BqLTbriAYYcxqUcbiTSoL4KTE3KJS3pN/usogv8eS4t+C00mnUL7h 5TUSHVTQy180bpFlHZ6UBH+j+CMUEvEPXvBYE2LaKPyZ7moiG4QGZS5Clb1gwcQp FwS1U2DFzudXiGB/+HEC0pYUQQuOc+l1patJWyP23FgQHGj1m+BOoubyx+YFowPL 5v6/sZzFxAtjCRxrftYbxtXboyFXsBCT90njqjxNX1LV7e76sxXrTWsH9j7uh6Ej hAgElmt1IypmsEwl99IdB+DHZpfhEcorJ5S77rpD+d9A9Z3hxri4XlI/E9pVpivj QLjnDxWDCgAtemKGENfhJnutKCDrQEQ5owNNGbhk3y5vbp4Knvc= =D8sR -----END PGP SIGNATURE----- --00llom3lU7/rY16i--