From patchwork Thu Mar 7 07:21:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA32D14DE for ; Thu, 7 Mar 2019 07:25:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90CBF2E84F for ; Thu, 7 Mar 2019 07:25:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 844472E8C8; Thu, 7 Mar 2019 07:25:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC7EE2E84F for ; Thu, 7 Mar 2019 07:25:36 +0000 (UTC) Received: from localhost ([127.0.0.1]:46620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nPL-0005KQ-UP for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:25:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nLB-0001eX-Qc for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nLA-0004bM-HC for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:17 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:49650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nLA-0004Zi-7P for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:16 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277Jp5k034503; Thu, 7 Mar 2019 07:21:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=GikO3jjq3sr5rCmlW2yXy8j687o4J0v3XTUnLlnZmfk=; b=jfJIfqa6SrUV3M8xEHvFNpfbSkdTQrtdjfXjN6zZsY6n5EtEqGw78AVN5ngePqsh966B ETfVlCRXyU/t6fCrn4EtnooJiE9hTw9Xh1yyHH2td2AhPt4ITy+3jRofgUcuHT+FNJOF Oai5QtuBGegPDv8rqjOlxosIv8QQpkvevV5XVx/LIKEtJtVxzBZcf1ji8mwHnswBpktt kAtmMwrC171PquEzrcqdRJ2Q4g3n1ustI63A3wJX+BWLXXNLpSrz22ttj2Z1NKL05bbb 4qTH5ciZa3h6G/GPGfb/JHEXe2SgHl7hW9Itv5KBOS0PTcl6NDpWNS2gC2pTq/y44qC9 Vg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2qyfbegge2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:21:08 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x277L7Dh027931 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:21:07 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x277L6al003512; Thu, 7 Mar 2019 07:21:06 GMT Received: from heatpipe.hsd1.ca.comcast.net (/73.170.27.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 23:21:06 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:21:03 -0800 Message-Id: <20190307072103.8243-1-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903070053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [multiprocess RFC PATCH 04/37] multi-process: Add stub functions to facilate build of multi-process X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, sstabellini@kernel.org, jag.raman@oracle.com, pavel.dovgaluk@ispras.ru, kvm@vger.kernel.org, konrad.wilk@oracle.com, ross.lagerwall@citrix.com, paul.durrant@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, pbonzini@redhat.com, anthony.perard@citrix.com, kanth.ghatraju@oracle.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jagannathan Raman Add stub functions that are needed during compile time but not in runtime. Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva --- accel/stubs/kvm-stub.c | 5 +++ accel/stubs/tcg-stub.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++ stubs/machine-init-done.c | 4 +++ stubs/monitor.c | 25 ++++++++++++++ stubs/net-stub.c | 31 +++++++++++++++++ stubs/replay.c | 14 ++++++++ stubs/vl-stub.c | 75 +++++++++++++++++++++++++++++++++++++++++ stubs/vmstate.c | 20 +++++++++++ stubs/xen-mapcache.c | 22 ++++++++++++ 9 files changed, 281 insertions(+) create mode 100644 stubs/net-stub.c create mode 100644 stubs/vl-stub.c create mode 100644 stubs/xen-mapcache.c diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 02d5170..573b4da 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -32,6 +32,7 @@ bool kvm_allowed; bool kvm_readonly_mem_allowed; bool kvm_ioeventfd_any_length_allowed; bool kvm_msi_use_devid; +bool kvm_halt_in_kernel_allowed; int kvm_destroy_vcpu(CPUState *cpu) { @@ -59,6 +60,10 @@ void kvm_cpu_synchronize_post_init(CPUState *cpu) { } +void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu) +{ +} + int kvm_cpu_exec(CPUState *cpu) { abort(); diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 76ae461..52722c7 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -16,11 +16,96 @@ #include "tcg/tcg.h" #include "exec/cpu-common.h" #include "exec/exec-all.h" +#include "translate-all.h" +#include "exec/ram_addr.h" + +bool parallel_cpus; void tb_flush(CPUState *cpu) { } +void tb_check_watchpoint(CPUState *cpu) +{ +} + +void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end) +{ +} + +void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, + int is_cpu_write_access) +{ +} + +void tb_invalidate_phys_page_fast(struct page_collection *pages, + tb_page_addr_t start, int len) +{ +} + +void tlb_init(CPUState *cpu) +{ +} + void tlb_set_dirty(CPUState *cpu, target_ulong vaddr) { } + +void tlb_flush(CPUState *cpu) +{ +} + +void tlb_flush_page(CPUState *cpu, target_ulong addr) +{ +} + +void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) +{ +} + +void tcg_region_init(void) +{ +} + +void tcg_register_thread(void) +{ +} + +void tcg_flush_softmmu_tlb(CPUState *cs) +{ +} + +void cpu_loop_exit_noexc(CPUState *cpu) +{ + cpu->exception_index = -1; + cpu_loop_exit(cpu); +} + +void cpu_loop_exit(CPUState *cpu) +{ + cpu->can_do_io = 1; + siglongjmp(cpu->jmp_env, 1); +} + +void cpu_reloading_memory_map(void) +{ +} + +int cpu_exec(CPUState *cpu) +{ + return 0; +} + +void cpu_exec_step_atomic(CPUState *cpu) +{ +} + +struct page_collection * +page_collection_lock(tb_page_addr_t start, tb_page_addr_t end) +{ + return NULL; +} + +void page_collection_unlock(struct page_collection *set) +{ +} diff --git a/stubs/machine-init-done.c b/stubs/machine-init-done.c index 4121f17..5bff245 100644 --- a/stubs/machine-init-done.c +++ b/stubs/machine-init-done.c @@ -7,3 +7,7 @@ bool machine_init_done = true; void qemu_add_machine_init_done_notifier(Notifier *notify) { } + +void qemu_remove_machine_init_done_notifier(Notifier *notify) +{ +} diff --git a/stubs/monitor.c b/stubs/monitor.c index b57fe6c..1973a3b 100644 --- a/stubs/monitor.c +++ b/stubs/monitor.c @@ -3,6 +3,8 @@ #include "qapi/qapi-emit-events.h" #include "qemu-common.h" #include "monitor/monitor.h" +#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-commands-misc.h" __thread Monitor *cur_mon; @@ -19,3 +21,26 @@ void monitor_init(Chardev *chr, int flags) void qapi_event_emit(QAPIEvent event, QDict *qdict) { } + +int monitor_get_cpu_index(void) +{ + return -ENOSYS; +} +void monitor_printf(Monitor *mon, const char *fmt, ...) +{ +} + +bool monitor_cur_is_qmp(void) +{ + return false; +} + +ObjectPropertyInfoList *qmp_device_list_properties(const char *typename, + Error **errp) +{ + return NULL; +} + +void monitor_vfprintf(FILE *stream, const char *fmt, va_list ap) +{ +} diff --git a/stubs/net-stub.c b/stubs/net-stub.c new file mode 100644 index 0000000..cb2274b --- /dev/null +++ b/stubs/net-stub.c @@ -0,0 +1,31 @@ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "net/net.h" + +int qemu_find_net_clients_except(const char *id, NetClientState **ncs, + NetClientDriver type, int max) +{ + return -ENOSYS; +} + +NetClientState *net_hub_port_find(int hub_id) +{ + return NULL; +} + +int net_hub_id_for_client(NetClientState *nc, int *id) +{ + return -ENOSYS; +} + +int qemu_show_nic_models(const char *arg, const char *const *models) +{ + return -ENOSYS; +} + +int qemu_find_nic_model(NICInfo *nd, const char * const *models, + const char *default_model) +{ + return -ENOSYS; +} + diff --git a/stubs/replay.c b/stubs/replay.c index 4ac6078..38fd1d3 100644 --- a/stubs/replay.c +++ b/stubs/replay.c @@ -80,3 +80,17 @@ void replay_mutex_lock(void) void replay_mutex_unlock(void) { } + +bool replay_has_checkpoint(void) +{ + return false; +} + +int replay_get_instructions(void) +{ + return 0; +} + +void replay_account_executed_instructions(void) +{ +} diff --git a/stubs/vl-stub.c b/stubs/vl-stub.c new file mode 100644 index 0000000..bff6a94 --- /dev/null +++ b/stubs/vl-stub.c @@ -0,0 +1,75 @@ +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "qemu/uuid.h" +#include "sysemu/sysemu.h" +#include "exec/cpu-common.h" +#include "exec/gdbstub.h" +#include "sysemu/replay.h" +#include "disas/disas.h" + +bool tcg_allowed; +bool xen_allowed; +bool boot_strict; + +int mem_prealloc; +int smp_cpus; +int vga_interface_type = VGA_NONE; +int smp_cores = 1; +int smp_threads = 1; +int icount_align_option; +int boot_menu; + +unsigned int max_cpus; +const uint32_t arch_type; +const char *mem_path; +uint8_t qemu_extra_params_fw[2]; +uint8_t *boot_splash_filedata; +size_t boot_splash_filedata_size; +struct syminfo *syminfos; + +ram_addr_t ram_size; +MachineState *current_machine; +QemuUUID qemu_uuid; + +int runstate_is_running(void) +{ + return 0; +} + +void runstate_set(RunState new_state) +{ +} + +void vm_state_notify(int running, RunState state) +{ +} + +bool qemu_vmstop_requested(RunState *r) +{ + return false; +} + +void qemu_system_debug_request(void) +{ +} + +char *qemu_find_file(int type, const char *name) +{ + return NULL; +} + +void gdb_set_stop_cpu(CPUState *cpu) +{ +} + +void replay_enable_events(void) +{ +} + +void replay_disable_events(void) +{ +} + +void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf) +{ +} diff --git a/stubs/vmstate.c b/stubs/vmstate.c index 6399474..a9a2bc2 100644 --- a/stubs/vmstate.c +++ b/stubs/vmstate.c @@ -1,9 +1,12 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "migration/misc.h" const VMStateDescription vmstate_dummy = {}; +const VMStateInfo vmstate_info_timer; + int vmstate_register_with_alias_id(DeviceState *dev, int instance_id, const VMStateDescription *vmsd, @@ -24,3 +27,20 @@ bool vmstate_check_only_migratable(const VMStateDescription *vmsd) { return true; } + +void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev) +{ +} + +void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev) +{ +} + +void vmstate_register_ram_global(MemoryRegion *mr) +{ +} + +bool migration_is_idle(void) +{ + return true; +} diff --git a/stubs/xen-mapcache.c b/stubs/xen-mapcache.c new file mode 100644 index 0000000..af5c031 --- /dev/null +++ b/stubs/xen-mapcache.c @@ -0,0 +1,22 @@ +#include "qemu/osdep.h" +#include "exec/hwaddr.h" +#include "exec/cpu-common.h" +#include "sysemu/xen-mapcache.h" + +#ifdef CONFIG_XEN + +void xen_invalidate_map_cache_entry(uint8_t *buffer) +{ +} + +uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, uint8_t lock, bool dma) +{ + return NULL; +} + +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) +{ + return 0; +} + +#endif