From patchwork Fri Dec 16 22:07:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13075516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0202EC4332F for ; Fri, 16 Dec 2022 22:07:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiLPWHz (ORCPT ); Fri, 16 Dec 2022 17:07:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiLPWHv (ORCPT ); Fri, 16 Dec 2022 17:07:51 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDA5175A6 for ; Fri, 16 Dec 2022 14:07:48 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id gh17so9290934ejb.6 for ; Fri, 16 Dec 2022 14:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=dnjBpu8YAsQiqTIBqdAxGgUmmCKdMDBQ66ZGoKps2Ew=; b=V3iElN+pWdNXlbuPkzYch26WWW47kZLvkp4pklr7MqLTRunNn+TowQUCROmuGTluTf FsYrRMIjbaKMvwPHXlfASr9BDsiFaNk5utWdmxOagO2T38fiu9GKn2LnXis0PoxQ+y4M jQbhdKk5M8mKJ4olp/u/KIfYKN+m7g/B7yk272XBW3r9g7vjxf8hIvdcnnyTrWybBjhD QZEnwyq0y5KBYC6dw/g5x1zKU+Ygl2Khg01/qm6G75KuQIWVNQw+qzd370FBZ9tYzVS/ FXrTuzGh4dxHBWogjOU7q51i3Ndq71mTCiVkLUl/lNwRyIaEDc5r/1JqjfsuvhJLEHat jo5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dnjBpu8YAsQiqTIBqdAxGgUmmCKdMDBQ66ZGoKps2Ew=; b=SoL33mW5Pz14Zv6N26irlMP/ZCDp4EbFBAsuZ3U1WdHZRzVouPPWYFVdTm7y/kXdXv M0jqE2tmQGPGDUUcIb/7E2hxyU7TES0WgEX9E0U/1oC8pCRe0gFaQRydz4YzYVOnbt/A RJGUQeV+KrffJHe35akNYmFgPirbdYKW/qZewLiJHRhAYkE/ti6ezgHzIHJyhfig+pW7 OO+k6DDWTwCwlcTGxZoSHvgZG2pYWdRbMHBX0LT3G4QaRMdBwXTEvZNTLKNWTCFOhyWw 07oS8OHOiMgfFb/fVfpOHQ6Tv9Y41PTfKv9mDfhuhgu3p5BWB6nZI31cuyRcmM7XLiRq lccA== X-Gm-Message-State: ANoB5pnVSxn9Xamgkn2+1AClJBzQR2M8pKvWPvUBFd0qwFlQpALYDOqb mGV9ZcVD/+nbGLsSYlQJgZUZQA== X-Google-Smtp-Source: AA0mqf5FXdnuw+SCM5bPyadVl6lKNY8k4Ioju8XS7pTqY32yMybMBXqVv08QWaAB2Z4v9CR/OLRXLw== X-Received: by 2002:a17:906:698f:b0:7ad:d250:b903 with SMTP id i15-20020a170906698f00b007add250b903mr38530813ejr.56.1671228466702; Fri, 16 Dec 2022 14:07:46 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id p23-20020a17090653d700b007bed316a6d9sm1308360ejo.18.2022.12.16.14.07.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Dec 2022 14:07:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] sysemu/kvm: Remove CONFIG_USER_ONLY guard Date: Fri, 16 Dec 2022 23:07:37 +0100 Message-Id: <20221216220738.7355-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221216220738.7355-1-philmd@linaro.org> References: <20221216220738.7355-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org User emulation shouldn't really include this header; if included these declarations are guarded by CONFIG_KVM_IS_POSSIBLE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/sysemu/kvm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index e9a97eda8c..c8281c07a7 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -471,10 +471,8 @@ uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index); void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len); -#if !defined(CONFIG_USER_ONLY) int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, hwaddr *phys_addr); -#endif #endif /* NEED_CPU_H */ From patchwork Fri Dec 16 22:07:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13075517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4443C4332F for ; Fri, 16 Dec 2022 22:08:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiLPWH7 (ORCPT ); Fri, 16 Dec 2022 17:07:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiLPWHy (ORCPT ); Fri, 16 Dec 2022 17:07:54 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BF2418B27 for ; Fri, 16 Dec 2022 14:07:53 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id bj12so9182615ejb.13 for ; Fri, 16 Dec 2022 14:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=BuvOmgloso2e5NXgsHUei7ptWD2NT1t6KV+3QRSZobI=; b=zYWAixXwjDLNsWkPsxwYHCwaJXcbQ/fM/AV4tyCO8jMgSiMySrs25voDToqac55f+X eY8QmqBEs837n22ZpNqfdVJkIIOJFxGhqg7oO74Zw3FkXPGDFAzVUgSkLpIw/n9XTZkd FKrJRELYL1jYUpS+AXb9iglMUzGmaKlt8bu3wkIngl3sdTHIrjIEh3i8BN0Jzi5nudZR /NzUBroaPW4+1SXEOFxPlluDvyZS32fiMOZ2sKWIFT469I6iNSRNlqNJ2Fhrno3HpAMG cZzDQasTuyJ3YLqheuj2txiYkShpEWmbHpKCK6rQZko6ywz58IBwXGeOnkLxr721wptF hfKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=BuvOmgloso2e5NXgsHUei7ptWD2NT1t6KV+3QRSZobI=; b=mLLwwbr4Hh9DYq2frNxrHpghYFtBSayKIE9aoHULrJNnyWTohcKVb//L9+I7LBkZDx SqaMfB5AJH5XhKu1tOeUDpMqyZTMjTwfpj8SWrUJ8M5uLH/CWnl6BDYN5Fz8AhuQ2MQF 1Xy/hNYN60jX8D7YJsl9OURmFpHKij5sq50RrjOWLqTbZNtg5jo0rJLnu+fBEWyHEmo9 C+0+p32KAhGu5vFMvhLD0uVngb0U1n9UsZDNXqRP6IZ/Og1bP0jP0StBbAjAoU/egwe0 HEq4ZXb6/UHqRbjkQjI10izMFY1GR7JV83CtxpO+YpyJEG3mGG2QEbnNJx+zg0qVwiBi 5juA== X-Gm-Message-State: ANoB5pnJu+TDjqYskWOWKLhCilJMlm552Lun+KwvuIJkgUSHCXOpONTM r9KXiDT5S+nU2vM5ugh8YQBscg== X-Google-Smtp-Source: AA0mqf43lrvqoVp9kw/H2TDq+nbYIW8SaiNj0yMyvD09B1QPt4yyMI9jDe29obq2nfKAPcYMH8R43w== X-Received: by 2002:a17:906:4ec3:b0:7c1:5169:3ed6 with SMTP id i3-20020a1709064ec300b007c151693ed6mr22045996ejv.48.1671228471882; Fri, 16 Dec 2022 14:07:51 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id va15-20020a17090711cf00b007c0dacbe00bsm1289082ejb.115.2022.12.16.14.07.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Dec 2022 14:07:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , kvm@vger.kernel.org, =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] sysemu/kvm: Reduce target-specific declarations Date: Fri, 16 Dec 2022 23:07:38 +0100 Message-Id: <20221216220738.7355-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221216220738.7355-1-philmd@linaro.org> References: <20221216220738.7355-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Only the declarations using the target_ulong type are target specific. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index c8281c07a7..a53d6dab49 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -242,9 +242,6 @@ bool kvm_arm_supports_user_irq(void); int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr); int kvm_on_sigbus(int code, void *addr); -#ifdef NEED_CPU_H -#include "cpu.h" - void kvm_flush_coalesced_mmio_buffer(void); /** @@ -410,6 +407,9 @@ void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic); struct kvm_guest_debug; struct kvm_debug_exit_arch; +#ifdef NEED_CPU_H +#include "cpu.h" + struct kvm_sw_breakpoint { target_ulong pc; target_ulong saved_insn; @@ -436,6 +436,15 @@ void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg); bool kvm_arch_stop_on_emulation_error(CPUState *cpu); +uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, + uint32_t index, int reg); +uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index); + +int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, + hwaddr *phys_addr); + +#endif /* NEED_CPU_H */ + int kvm_check_extension(KVMState *s, unsigned int extension); int kvm_vm_check_extension(KVMState *s, unsigned int extension); @@ -464,18 +473,8 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension); kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap); \ }) -uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, - uint32_t index, int reg); -uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index); - - void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len); -int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr, - hwaddr *phys_addr); - -#endif /* NEED_CPU_H */ - void kvm_cpu_synchronize_state(CPUState *cpu); void kvm_init_cpu_signals(CPUState *cpu);