From patchwork Thu Sep 7 12:59:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 720613 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp226727wrp; Thu, 7 Sep 2023 06:12:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0s8s8p5Bm1oxTzLE1TUbXcDIgVQ9ND3SuUSdZfrj5vTcdGQSYmBhj3EJjled+RO6fk5uD X-Received: by 2002:a05:6000:11c8:b0:31f:651f:f84d with SMTP id i8-20020a05600011c800b0031f651ff84dmr2115239wrx.12.1694092379458; Thu, 07 Sep 2023 06:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694092379; cv=none; d=google.com; s=arc-20160816; b=Y5ZYp7G0/VYVi4AsIGo2H+W1n1cgAYmOkbAN3WTn5AL4xvvZvtl+8yYczok9uKlniQ 0QrONhORvWx82rW/oMjHNcN1aKf/n254h1fZmgWTsZMLZp+VwDMezyh/6Kc8U2IM9zQb GZGX3iwIDnHzMJP7A+vA/U6u65N3NcAVQX+PJ3uRAHnfdRj7Lf1DUyKKLbtdhsiag0HR qYGJelc0wV4rhW4YkNRjxL8Li/MzRYGeyuKySI4r7vAke/nFbtNKrKfOkxgx2ILmG682 Pv3KoDLaTavl8FmIG1UfY0Z3TVxDXsAAtnn+rQieBEC7IrjpXQfBgiI+UrNkp/C7CJFm cYFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SpvS7kXL3QPxpjC9VxkOF+3EPpNlxl8dKSrXGx/rLrM=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gGet6V6TEOxU1GJqgpqCfq8Fjy+ZfDKfDSRzdnreaRDaHazO3VQ+vo2qtEmCuKvEYC vaqRGzm9a0iARGXgTPKtzNYjr9K3lt5TGwbH+eM0aOLheoCusxGPz393U6Gst+cEFMe9 ssvbZ202FyQCRXJ3HeI5MZ4aMilv+nBHnhpj4OuHRp6byGzHodx89Vg+W4hTI7SUKJ6i hY1gpuF6oyvRuepQHmQUvEdVSMBQ4dcFPOx9/N5ZVeFs8DgAFkFE7lbmx5BjRag8+Wd+ otW5UZcXe0BIZG4dosh6QjZddSfA9Kd88Ygm5nHyUmJ/a/u0gBtgfn4xdXNk09P2S6ID JwYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gEmbZPkI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id iv19-20020a05600c549300b00401fbd5c687si1105206wmb.206.2023.09.07.06.12.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2023 06:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gEmbZPkI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeEej-0007G5-0I; Thu, 07 Sep 2023 09:02:45 -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 1qeEdy-0004X7-EP for qemu-devel@nongnu.org; Thu, 07 Sep 2023 09:02:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeEdv-0007W6-Bh for qemu-devel@nongnu.org; Thu, 07 Sep 2023 09:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694091714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SpvS7kXL3QPxpjC9VxkOF+3EPpNlxl8dKSrXGx/rLrM=; b=gEmbZPkIxcWWUEe0TlbkPC6B9jRl9kGD+sT5fgRSe2RpIyewi0qyFcjEO67sKtz/WqDUcu BR6rnH6++DS4FfsEiKLQmQmuPzlCKm657W+w8T2TXlcCzvfDkwrPc85rq92mOS64I70XfW +/cH8BrP/67Q+Key7T3LU44rNCS345c= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-W3AORoUBNraZhigSKtqqXw-1; Thu, 07 Sep 2023 09:01:52 -0400 X-MC-Unique: W3AORoUBNraZhigSKtqqXw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4011f56165eso8835735e9.0 for ; Thu, 07 Sep 2023 06:01:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694091710; x=1694696510; 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=SpvS7kXL3QPxpjC9VxkOF+3EPpNlxl8dKSrXGx/rLrM=; b=cs+usAVTvyDLcX8XSUaM992Loc7M9aS5UGGfzEItfB3YNLeMbSKIW7SdsDCix2+YKG LISNMAPUfwQ76cxtFL06iS7wqgRNVRVFPgCUm/I4gTqjgvBaII4vAW6akoHKbIpsMudT 8xYWJSf4HCOb7LDRm9h7Xo+duI80F+gsVTHDL9wUpTCXXaxWJY0MuPmRrryp0dajgjlt HYZgJLluDk7Qbz0dNZ9iuDhiaa3txgBMQCuxUReYaERfJg7i/UEDFoltCeoxqIt52Ntb Y7djwiGLv1Of+l/oitLfTnmPpb63idPVfzqY5QEyeLHnwHuKI8LnJPE6hiASJa3Hw4b+ r3cg== X-Gm-Message-State: AOJu0YxcgjFLNLff6RvKwOhK/7gsyKB4jJqjt0r70Bpj45Nj0SUMg/0J uFk5ZehbqzpPLRfzo2DFayFekzQFEpcRh8BWBc/56OzOnOSGYOfs1dn5j0R4//0vfGsn/CIAkHR TfRdbYPf/najtr0ip5Vlmp6AGO/UJhri9IQT4C0oEqgBdE+vMww8oLNBqy0DJnnoKXCjqmSW3Ln M= X-Received: by 2002:a05:600c:1d1c:b0:401:bd94:f45b with SMTP id l28-20020a05600c1d1c00b00401bd94f45bmr2127646wms.4.1694091710487; Thu, 07 Sep 2023 06:01:50 -0700 (PDT) X-Received: by 2002:a05:600c:1d1c:b0:401:bd94:f45b with SMTP id l28-20020a05600c1d1c00b00401bd94f45bmr2127578wms.4.1694091709283; Thu, 07 Sep 2023 06:01:49 -0700 (PDT) Received: from [192.168.1.174] ([151.48.237.81]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c025100b00402c0a8a084sm2501217wmj.17.2023.09.07.06.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:01:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 45/51] target/i386: Restrict declarations specific to CONFIG_KVM Date: Thu, 7 Sep 2023 14:59:54 +0200 Message-ID: <20230907130004.500601-46-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230907130004.500601-1-pbonzini@redhat.com> References: <20230907130004.500601-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Message-ID: <20230904124325.79040-10-philmd@linaro.org> Signed-off-by: Paolo Bonzini --- 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 470627b7504..ff309bad25f 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -31,30 +31,35 @@ #endif /* CONFIG_KVM */ 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); +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); -bool kvm_enable_x2apic(void); bool kvm_has_x2apic_api(void); bool kvm_has_waitpkg(void); -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); -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); -void kvm_set_max_apic_id(uint32_t max_apic_id); +#endif /* CONFIG_KVM */ #endif