From nobody Thu Nov 28 10:46:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693831561; cv=none; d=zohomail.com; s=zohoarc; b=RAF9REUaCWp53ClVFxTNqO+kHjqRLuG/GmoJT/Xcz+Vc/OU+brlZwiHD3+N0yr5pVqcSpWX4w2WrlK6Ub1ymaS6QGMCPOO/dzvdmTW68Ip/nD5f5o1BLOE8u+FOTdT7qSxhRDWNx72/jv3PimjJwJRj3B2Z0g25XYviu6ARdEoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693831561; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=FNz+kgh+bVFsWoexXepF7dhMG4twHB+8dvC4Re5NxokFjoftwlRRBK0RdaV+wyg8ahv9Sz7O/zVFGd9RPaTy9NkT4Zc90Bbu/oBQd2iFdyjzSdHxOdwmLhTv/zjgmY1MpI0oIh8ewKopfOH7TTLxegxk2E0/qDN3M0/ts5bsAu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693831561788171.91586655453136; Mon, 4 Sep 2023 05:46:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qd8wn-0003IW-Tn; Mon, 04 Sep 2023 08:44:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qd8wM-0002Ui-NC for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:34 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qd8wJ-0004kN-GI for qemu-devel@nongnu.org; Mon, 04 Sep 2023 08:44:25 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bbbda48904so22935531fa.2 for ; Mon, 04 Sep 2023 05:44:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.227]) by smtp.gmail.com with ESMTPSA id gu18-20020a170906f29200b0098f99048053sm6215400ejb.148.2023.09.04.05.44.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Sep 2023 05:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693831461; x=1694436261; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=OFetcV02ajE+PqlKu5fqrE509BbUwXTdtoYOnacoN56eVwIUD8S9s/eAzrY+iwiYkE j/MLAyUjbv9KoKG9HAyA5Cnh6EimPxQJVuHvp/g69foed4PfuRYzfBTNHrr0DEkiUy/I 6VaJH1sL747WCUNBjzHcJU9iqApHFI3PHqRxCRN65+11KR/WAmgdEMyaO7q/fNoZvNLi sNAAZjNfA10HzA0hpUgTT/pQnkdYWo/rtZN2nbupMG4DRQB5pgEtyRPCxH5gdJLA7VvS UcJaMlTLSZyzBX/7R9lSAQ9El5fS1Ntu0kXH0BuCd5lMNSIxZ+Gc38PYyAKiONduYAIk zN5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693831461; x=1694436261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EfDnH2zi19spDXT1YZEdk2e2zvrpSHkYzKDFanumPPE=; b=J4pYeDN9hgR3ct6tpmEBMG0Hj7KusIWtsP4ASm+gcnOHuK5y3j9e5e1hV06Rw7PSaN Ah8Hdu3fJTjDS+CF6X+efWQlvhtZ12ZG5m9Ug8nqmBiTkk3KdO0Yr2hDR9YwDC0/j5Gt EuGEL5lErkPNshR5D/B+PnOCmMQhIMzq0Moh2h3V8rI8a9panOluymp7CCDnQb2I6M4G WcLepNDkyT5xFpWi4BajUfBvfzXSw8WM0lNEQ3Kcn/HW73FUfY0wTjmMy5c/loo5x/q0 nKNbadkp+HpcugrA3m06JOPNen7tuNxvjRqpn9vyqtbmbJApC/uWRC/hF2hxmUXVvuET wuww== X-Gm-Message-State: AOJu0YzMOZhQYYfdLXniYUNE0go+RRqYiMGWwQxpQwmh7pmF1eL8zfQ8 oQCiAO6S2v2w9pUcUYWDT++epzEwRq+pMZe/06U= X-Google-Smtp-Source: AGHT+IE976/wb9043fTOX1jLNvYiAsS+SMGWMVP8cKCaRkt7WlpkXdAiG5q4d7+oUS7QvOusWuayLw== X-Received: by 2002:a2e:a176:0:b0:2bc:c466:60e9 with SMTP id u22-20020a2ea176000000b002bcc46660e9mr6704259ljl.49.1693831461543; Mon, 04 Sep 2023 05:44:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Marcelo Tosatti , "Michael S. Tsirkin" , kvm@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 09/13] target/i386: Restrict declarations specific to CONFIG_KVM Date: Mon, 4 Sep 2023 14:43:20 +0200 Message-ID: <20230904124325.79040-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230904124325.79040-1-philmd@linaro.org> References: <20230904124325.79040-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693831562525100001 Keep the function accessed by target/i386/ and hw/i386/ exposed, restrict the ones accessed by target/i386/kvm/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/kvm/kvm_i386.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index 470627b750..ff309bad25 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -31,30 +31,35 @@ #endif /* CONFIG_KVM */ =20 bool kvm_has_smm(void); -bool kvm_has_adjust_clock(void); -bool kvm_has_adjust_clock_stable(void); -bool kvm_has_exception_payload(void); -void kvm_synchronize_all_tsc(void); +bool kvm_enable_x2apic(void); +bool kvm_hv_vpindex_settable(void); + +bool kvm_enable_sgx_provisioning(KVMState *s); +bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); + void kvm_arch_reset_vcpu(X86CPU *cs); void kvm_arch_after_reset_vcpu(X86CPU *cpu); void kvm_arch_do_init_vcpu(X86CPU *cs); =20 +void kvm_set_max_apic_id(uint32_t max_apic_id); +void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); + +#ifdef CONFIG_KVM + +bool kvm_has_adjust_clock(void); +bool kvm_has_adjust_clock_stable(void); +bool kvm_has_exception_payload(void); +void kvm_synchronize_all_tsc(void); + void kvm_put_apicbase(X86CPU *cpu, uint64_t value); =20 -bool kvm_enable_x2apic(void); bool kvm_has_x2apic_api(void); bool kvm_has_waitpkg(void); =20 -bool kvm_hv_vpindex_settable(void); -bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp); - uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address); void kvm_update_msi_routes_all(void *private, bool global, uint32_t index, uint32_t mask); =20 -bool kvm_enable_sgx_provisioning(KVMState *s); -void kvm_request_xsave_components(X86CPU *cpu, uint64_t mask); - typedef bool QEMURDMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t *val); typedef bool QEMUWRMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t val); typedef struct kvm_msr_handlers { @@ -66,6 +71,6 @@ typedef struct kvm_msr_handlers { bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr, QEMUWRMSRHandler *wrmsr); =20 -void kvm_set_max_apic_id(uint32_t max_apic_id); +#endif /* CONFIG_KVM */ =20 #endif --=20 2.41.0