From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239322511166.89326142062566; Wed, 5 Jul 2017 00:22:02 -0700 (PDT) Received: from localhost ([::1]:44512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSedM-00029h-2g for importer@patchew.org; Wed, 05 Jul 2017 03:22:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWY-0004N2-6X for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWT-0007PI-Mw for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:58 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWT-0007Nj-Df for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:53 -0400 Received: by mail-wm0-x241.google.com with SMTP id y5so30406731wmh.3 for ; Wed, 05 Jul 2017 00:14:51 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mruUxzQ3ocRvCkMkatEuVT9PdNDinEPNDUoz/umHcRg=; b=dTRkWBCoy1n8n8lFMOVrHZOEbx0GJwL/kVhF+vL484IzbUE4n+aFY7qyvHUKsJ7HtW ZejCeE2i6rCPPd8e+Yfh/0uuSpKgKqZvyQf9mFWtJbsAHdfJmk4AKII/CK0kseGRVFen x2y3Jb3NHbskRbIrPqOgs7EdhdpiW6UWpqlY9EBzMR6K1xL9i7KUP68891dpIYz/gJ45 8YuqviE5gyisJYnMKVhJW1+E+EpgxpxC5sqsjMzK7kO/DvD2mhH+5j1b+6JkOzuX/VFX r37FUceztjJJ9sqn4L2Pjn93jlcHszebKRaC95iC9A5Svl1kHw2Q4qOLRINhGc94cVlF ZDlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mruUxzQ3ocRvCkMkatEuVT9PdNDinEPNDUoz/umHcRg=; b=VhwiRPxVUXsiw9bPFo42ImHh1NzyqniPHW1lsEJGS9wznzm7DgHrQhqLLiS04z6Z6j EGSeVh/FLsDq+52cPxReiIcVSci+6OCmgvFeZ8jerCwjaRRCAYgGJ7vEromIhDUcewXQ F4ZIeCHM81RD1Y5TCbCWQfNO4gTsW3TXP6ioWq+g5/X0hWv09bXejE39Y6lW4+0TBLCW oVJZ3h9Gkc9+EGz+66w+lsylP8OUZ2J+H0sXUuGLsQc01ZX9r9zczxd5pcWiVTvAKDDz olx/IpYYlV1yvRnNonBjUsKUKkaDmmJLQFUwjw1cfyRVDeS4n+alntq6RLXZiyUbnnyV bhqQ== X-Gm-Message-State: AKS2vOzfMbJafg+JJzLXzFoQMpmuhxNyA8XdPgXdwQXbV46DSNfn8Zy4 7RCL5qesP1DqQJKzp7k= X-Received: by 10.28.168.145 with SMTP id r139mr20648845wme.102.1499238890572; Wed, 05 Jul 2017 00:14:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:04 +0200 Message-Id: <1499238885-26161-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 01/42] vcpu_dirty: share the same field in CPUState for all accelerators 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: Sergio Andres Gomez Del Real Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sergio Andres Gomez Del Real This patch simply replaces the separate boolean field in CPUState that kvm, hax (and upcoming hvf) have for keeping track of vcpu dirtiness with a single shared field. Signed-off-by: Sergio Andres Gomez Del Real Message-Id: <20170618191101.3457-1-Sergio.G.DelReal@gmail.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 18 +++++++++--------- include/qom/cpu.h | 5 +++-- target/i386/hax-all.c | 12 ++++++------ target/mips/kvm.c | 4 ++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 75feffa..cd71e28 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -318,7 +318,7 @@ int kvm_init_vcpu(CPUState *cpu) =20 cpu->kvm_fd =3D ret; cpu->kvm_state =3D s; - cpu->kvm_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; =20 mmap_size =3D kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) { @@ -1864,15 +1864,15 @@ void kvm_flush_coalesced_mmio_buffer(void) =20 static void do_kvm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data ar= g) { - if (!cpu->kvm_vcpu_dirty) { + if (!cpu->vcpu_dirty) { kvm_arch_get_registers(cpu); - cpu->kvm_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; } } =20 void kvm_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->kvm_vcpu_dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_kvm_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -1880,7 +1880,7 @@ void kvm_cpu_synchronize_state(CPUState *cpu) static void do_kvm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_da= ta arg) { kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE); - cpu->kvm_vcpu_dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 void kvm_cpu_synchronize_post_reset(CPUState *cpu) @@ -1891,7 +1891,7 @@ void kvm_cpu_synchronize_post_reset(CPUState *cpu) static void do_kvm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_dat= a arg) { kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE); - cpu->kvm_vcpu_dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 void kvm_cpu_synchronize_post_init(CPUState *cpu) @@ -1901,7 +1901,7 @@ void kvm_cpu_synchronize_post_init(CPUState *cpu) =20 static void do_kvm_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_da= ta arg) { - cpu->kvm_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu) @@ -1982,9 +1982,9 @@ int kvm_cpu_exec(CPUState *cpu) do { MemTxAttrs attrs; =20 - if (cpu->kvm_vcpu_dirty) { + if (cpu->vcpu_dirty) { kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE); - cpu->kvm_vcpu_dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 kvm_arch_pre_run(cpu, run); diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 2fe7cff..b9440b6 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -369,7 +369,6 @@ struct CPUState { vaddr mem_io_vaddr; =20 int kvm_fd; - bool kvm_vcpu_dirty; struct KVMState *kvm_state; struct kvm_run *kvm_run; =20 @@ -386,6 +385,9 @@ struct CPUState { uint32_t can_do_io; int32_t exception_index; /* used by m68k TCG */ =20 + /* shared by kvm, hax and hvf */ + bool vcpu_dirty; + /* Used to keep track of an outstanding cpu throttle thread for migrat= ion * autoconverge */ @@ -400,7 +402,6 @@ struct CPUState { icount_decr_u16 u16; } icount_decr; =20 - bool hax_vcpu_dirty; struct hax_vcpu_state *hax_vcpu; =20 /* The pending_tlb_flush flag is set and cleared atomically to diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index ba6117d..3ce6950 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -232,7 +232,7 @@ int hax_init_vcpu(CPUState *cpu) } =20 cpu->hax_vcpu =3D hax_global.vm->vcpus[cpu->cpu_index]; - cpu->hax_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; qemu_register_reset(hax_reset_vcpu_state, (CPUArchState *) (cpu->env_p= tr)); =20 return ret; @@ -599,12 +599,12 @@ static void do_hax_cpu_synchronize_state(CPUState *cp= u, run_on_cpu_data arg) CPUArchState *env =3D cpu->env_ptr; =20 hax_arch_get_registers(env); - cpu->hax_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 void hax_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->hax_vcpu_dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_hax_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -615,7 +615,7 @@ static void do_hax_cpu_synchronize_post_reset(CPUState = *cpu, CPUArchState *env =3D cpu->env_ptr; =20 hax_vcpu_sync_state(env, 1); - cpu->hax_vcpu_dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 void hax_cpu_synchronize_post_reset(CPUState *cpu) @@ -628,7 +628,7 @@ static void do_hax_cpu_synchronize_post_init(CPUState *= cpu, run_on_cpu_data arg) CPUArchState *env =3D cpu->env_ptr; =20 hax_vcpu_sync_state(env, 1); - cpu->hax_vcpu_dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 void hax_cpu_synchronize_post_init(CPUState *cpu) @@ -638,7 +638,7 @@ void hax_cpu_synchronize_post_init(CPUState *cpu) =20 static void do_hax_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_da= ta arg) { - cpu->hax_vcpu_dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 void hax_cpu_synchronize_pre_loadvm(CPUState *cpu) diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 0982e87..3317905 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -523,7 +523,7 @@ static void kvm_mips_update_state(void *opaque, int run= ning, RunState state) * already saved and can be restored when it is synced back to KVM. */ if (!running) { - if (!cs->kvm_vcpu_dirty) { + if (!cs->vcpu_dirty) { ret =3D kvm_mips_save_count(cs); if (ret < 0) { fprintf(stderr, "Failed saving count\n"); @@ -539,7 +539,7 @@ static void kvm_mips_update_state(void *opaque, int run= ning, RunState state) return; } =20 - if (!cs->kvm_vcpu_dirty) { + if (!cs->vcpu_dirty) { ret =3D kvm_mips_restore_count(cs); if (ret < 0) { fprintf(stderr, "Failed restoring count\n"); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239007173304.4301360285233; Wed, 5 Jul 2017 00:16:47 -0700 (PDT) Received: from localhost ([::1]:44487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeYH-0005kC-Sj for importer@patchew.org; Wed, 05 Jul 2017 03:16:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWX-0004Mi-Kq for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWT-0007Oy-0Z for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWS-0007OO-Qv for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:52 -0400 Received: by mail-wm0-x241.google.com with SMTP id u23so30501897wma.2 for ; Wed, 05 Jul 2017 00:14:52 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=++p2hJ4V4zfEVJGVu+hcp1HTgD9jXFuuqhCSvkR+Ej8=; b=fq+OKm621diJaFKg/4V4Pg9oSPll8l01turYThGxqEkfSDFY52V69fQ34sZ5aFlTQC cbZ6RQkM7QKDuckf5oRGURdsCy7K3l6muMt7bmMGDeyI6+6UoGKKKYWHV8caWwCLE2xA bm34rx8w4ECV/pgbrGGVHzrCDzd3SDPj4ntY/c2tzB1wsfIBt3UjV51j1d9aVTiJXHHR gqlmG7mF1Ql3td50H02heT3Ssngd/BhNDEaT3cBMAxEmyF0zTucu6iECD0rZPJiQFTlo cEhB7Cx5rEm2gnbUXyxFKJlsGLMRoaAJkdbpJ6qYkBwIY4kxMo3vD37r4H1uI4UyLlZ7 erRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=++p2hJ4V4zfEVJGVu+hcp1HTgD9jXFuuqhCSvkR+Ej8=; b=qc/0ZgP/BWrY27/Aww5yHen5wm+V4t0AcykCNH+AcDaEMry6DnjD+32R45LYXJrmKn c8Lv0BHWylQ+ZUglNDqaySDsjCbApnG/2b/f7KxVHe4K3D7VYWZZZReNg0ZbEZgx8Dc9 IHlIiAQnd3YtZva95aXPqBCxLiKZIUXLMCBjSuDED84pnwb+p2OIuT26QznwH+ThDGxY HoGaQ0XBK3dRr1DqYixOLBrNl+J/1jzsgczSnCBEcpmkO02sptoSAig8uU1aNsZArmBh KO1wsmDdhdZcYnuZ+7pE3NsAT3gdcg0dSLOyhzRcGFXlgLGHpv2VAm0cr7PtvujkBwPU Kw/w== X-Gm-Message-State: AKS2vOzjWebqrONEwLWwUAIVoEoTMtClOA7HQpWSEXi5H1VE2t0hlIHK CfSJ4M3ywRccuuoCJTc= X-Received: by 10.28.109.210 with SMTP id b79mr29501601wmi.34.1499238891721; Wed, 05 Jul 2017 00:14:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:05 +0200 Message-Id: <1499238885-26161-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 02/42] qemu-doc: Add missing "@c man end" statements 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Since commit 3f2ce724f1f1 ("Move the qemu-ga description into a separate chapter"), the qemu.1 man page looks pretty much screwed up, e.g. the title was "qemu-ga - QEMU Guest Agent" instead of "qemu-doc - QEMU Emulator User Documentation". However, that movement of the gemu-ga chapter is not the real problem, it just triggered another bug in the qemu-doc.texi: There are some parts in the file which introduce a "@c man begin OPTIONS" section, but never close it again with "@c man end". After adding the proper end tags here, the title of the man page is right again and the previously wrongly tagged sections now also show up correctly in the man page, too. Reported-by: Kevin Wolf Signed-off-by: Thomas Huth Message-Id: <1497863771-24929-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-doc.texi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu-doc.texi b/qemu-doc.texi index 21079fd..45f67f6 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2566,6 +2566,8 @@ so should only be used with trusted guest OS. =20 @end table =20 +@c man end + @node ColdFire System emulator @section ColdFire System emulator @cindex system emulation (ColdFire) @@ -2610,6 +2612,8 @@ so should only be used with trusted guest OS. =20 @end table =20 +@c man end + @node Cris System emulator @section Cris System emulator @cindex system emulation (Cris) @@ -2682,6 +2686,8 @@ so should only be used with trusted guest OS. =20 @end table =20 +@c man end + @node QEMU Guest Agent @chapter QEMU Guest Agent invocation =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239167477827.0951623381058; Wed, 5 Jul 2017 00:19:27 -0700 (PDT) Received: from localhost ([::1]:44496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeas-0008Rc-5Z for importer@patchew.org; Wed, 05 Jul 2017 03:19:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWX-0004Mj-Ks for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWU-0007PY-Bs for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWU-0007P8-5f; Wed, 05 Jul 2017 03:14:54 -0400 Received: by mail-wm0-x244.google.com with SMTP id p204so30533448wmg.1; Wed, 05 Jul 2017 00:14:54 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gflYPpeJSs2azKKiKscSbInK8sDrp1zU2ymU9ukQ4Rw=; b=XzDGG3fwudOoTU5MGQuFM1Y9yN62uvicVAN6bgrPTxgv+ZnYlGxuT5iyyhqw/B4P6y V85BSMSbqOocUEL3/G98LKOGQhbXsO68SYp7vFDO0RY8NnbjAC8Tnb7ckImvGVB5L9EO zZ09qOii0F0pk98dWpoLDbMuw+dT07YXGCKZKrqUXK/hPl78LHm7b9ygCI08iHRbPzbx PVLrvm4iNnlMbBCSaOvCysUURW8u7W2pd7tKwnAJbCeQm80iiX0ms8rQkLPHQ35Z2nBu CtNKF+k56jnvaXGAhmVuhCvubu+KpH88vq0fiIl/L+3Fj8XdRB/yubFTJ5AoGnDKfqSK ySUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=gflYPpeJSs2azKKiKscSbInK8sDrp1zU2ymU9ukQ4Rw=; b=RCuJbWTfyVD3z/GUEeFbS66If6OhuH21v1hB4z0J3FacP6LbzQ671Xl+0kJJbeWWVk KtSqnrP4XmUxsuiKPDdhWvey6SAxSY4RWzMqZBqvxUoOq5cT68LeZtI6079gA2147VEO Xx1xZ4LGN0VFlYYQeqOLQfcdzyx4PAyWV53UnbgrnxJvPxrNNY4Ypejqmj/AKPPlx1dk oFafm1KVmFuJiH37xGOj7UVnThYuUPWSNEs+HgZhGu9AOm/xB5ADxNXTAKWeuP02mVBF OZSYCxRmgA3W7/LcIGK8D3q4aikVOvkPC0bJZ919U+d1DX7zOCardTJS+DsC2a7hb8g+ dScQ== X-Gm-Message-State: AKS2vOwN1UjGiLOsY5RSD/uy7LJ3qL+L9fJ9cDldAfRXA1jtZeLnMj43 HufqV9EpeV/G4qFJApM= X-Received: by 10.28.234.193 with SMTP id g62mr32817002wmi.24.1499238892927; Wed, 05 Jul 2017 00:14:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:06 +0200 Message-Id: <1499238885-26161-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 03/42] nbd: fix NBD over TLS 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: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When attaching the NBD QIOChannel to an AioContext, the TLS channel should be used, not the underlying socket channel. This is because, trivially, the TLS channel will be the one that we read/write to and thus the one that will get the qio_channel_yield() call. Fixes: ff82911cd3f69f028f2537825c9720ff78bc3f19 Cc: qemu-stable@nongnu.org Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrange Tested-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- block/nbd-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 02e9281..208f907 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -345,14 +345,14 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int6= 4_t offset, int bytes) void nbd_client_detach_aio_context(BlockDriverState *bs) { NBDClientSession *client =3D nbd_get_client_session(bs); - qio_channel_detach_aio_context(QIO_CHANNEL(client->sioc)); + qio_channel_detach_aio_context(QIO_CHANNEL(client->ioc)); } =20 void nbd_client_attach_aio_context(BlockDriverState *bs, AioContext *new_context) { NBDClientSession *client =3D nbd_get_client_session(bs); - qio_channel_attach_aio_context(QIO_CHANNEL(client->sioc), new_context); + qio_channel_attach_aio_context(QIO_CHANNEL(client->ioc), new_context); aio_co_schedule(new_context, client->read_reply_co); } =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149923927246627.992508526894085; Wed, 5 Jul 2017 00:21:12 -0700 (PDT) Received: from localhost ([::1]:44510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSecW-0001Qy-4c for importer@patchew.org; Wed, 05 Jul 2017 03:21:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWX-0004Mk-L6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWV-0007Qa-LJ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:33878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWV-0007Pv-En for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:55 -0400 Received: by mail-wr0-x233.google.com with SMTP id 77so258101644wrb.1 for ; Wed, 05 Jul 2017 00:14:55 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ztrq0G2bfbzcVlMNply0R8fzpCLd2vtQaGt9aaYcHlg=; b=CDc7V6vHE8X9v1gqdEIfCbZjGLAMZ87ZFYeUYC3VPLHSspADqs70Um6RApXq3VO8s6 dLrMS+f+E9tvz2hgzuK1VluzJtbRi+MM4+Gch9+Bo/FTfcERG/LX6epf2XKu0HqYdVZm aDizhFwzbtUXUgUGTWtV8nr1um68/Sn5EA4zfScgi9BO6zeydfr4IDCzhr9CZkJZ7kuH VAH4jgP/oaSyF0VG6ZRDZu7okoZtL/4UDF903EZ4a+VLIPysJokNTAgOKBRc1diZTxUr mvjtG3hRl3eZ6LmG+LHWs+utIPqjqczTa4iUzOZxLotnAs730XZCwQ775cB3hzyyXqP9 GJcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Ztrq0G2bfbzcVlMNply0R8fzpCLd2vtQaGt9aaYcHlg=; b=hpPLRXAV81n4Fg4vA5LclQNTIDYjfaMAVPEkqMcj0rpvaFwWiMZB/e9+0TfVTncjtU xn9LQCnN9evDk7HE+OMdKGs5zcKbiMFtb6S6lro5oWTynRAWPNnVCvsGZZo2j8mOvfKi j9UWEFaUhqWLRRA+Qa01t9MK2ELKwmuoT4kVpcm6wQhhZWhYBM+0eCSafJc+20kWpXSS VhIykRbv1toFmoxujLq0tIBKQI5wS4MmKc9XtpGNlZRFp/7y/ToLC2bgs5VRoqlM3R07 iVGNZcROsZTMYXGqhrCUr3yf78P1fHgj5KpBJUTBA4OGEi43CfW45FbysdaU+sN8gjQf 5SHw== X-Gm-Message-State: AKS2vOyL2FxNawcs1mG4dsz5v+1o41M4HTj+fPdftAv1F+BaHwnHcE9G EapoAz7yUWoSpPD39J0= X-Received: by 10.223.172.211 with SMTP id o77mr31221817wrc.201.1499238894117; Wed, 05 Jul 2017 00:14:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:07 +0200 Message-Id: <1499238885-26161-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::233 Subject: [Qemu-devel] [PULL 04/42] target/i386: fix interrupt CPL error when using ist in x86-64 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: Wu Xiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Wu Xiang In do_interrupt64(), when interrupt stack table(ist) is enabled and the the target code segment is conforming(e2 & DESC_C_MASK), the old implementation always set new CPL to 0, and SS.RPL to 0. This is incorrect for when CPL3 code access a CPL0 conforming code segment, the CPL should remain unchanged. Otherwise higher privileged code can be compromised. The patch fix this for always set dpl =3D cpl when the target code segment is conforming, and modify the last parameter `flags`, which contains correct new CPL, in cpu_x86_load_seg_cache(). Signed-off-by: Wu Xiang Message-Id: <20170621142152.GA18094@wxdeubuntu.ipads-lab.se.sjtu.edu.cn> Signed-off-by: Paolo Bonzini --- target/i386/seg_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 0374031..9af69c2 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -931,12 +931,14 @@ static void do_interrupt64(CPUX86State *env, int intn= o, int is_int, } new_stack =3D 0; esp =3D env->regs[R_ESP]; - dpl =3D cpl; } else { raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); new_stack =3D 0; /* avoid warning */ esp =3D 0; /* avoid warning */ } + if (e2 & DESC_C_MASK) { + dpl =3D cpl; + } esp &=3D ~0xfLL; /* align stack */ =20 PUSHQ(esp, env->segs[R_SS].selector); @@ -956,7 +958,7 @@ static void do_interrupt64(CPUX86State *env, int intno,= int is_int, =20 if (new_stack) { ss =3D 0 | dpl; - cpu_x86_load_seg_cache(env, R_SS, ss, 0, 0, 0); + cpu_x86_load_seg_cache(env, R_SS, ss, 0, 0, dpl << DESC_DPL_SHIFT); } env->regs[R_ESP] =3D esp; =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239170889527.5124823366131; Wed, 5 Jul 2017 00:19:30 -0700 (PDT) Received: from localhost ([::1]:44498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeav-0008TX-Ly for importer@patchew.org; Wed, 05 Jul 2017 03:19:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWX-0004Ml-OE for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWW-0007RR-Cw for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWW-0007QX-6Y for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:56 -0400 Received: by mail-wm0-x241.google.com with SMTP id j85so30446722wmj.0 for ; Wed, 05 Jul 2017 00:14:56 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=Eoy/EXzwqs3RGDHCzp3a9szKxyzU9GQyzUXXK/5BdyI=; b=b6/JHXpTqDbp/hss1nf8hl68tC4uKhAkbGmR+RCekMJNNVSYFf9T0AhSlG9ajcm9ri zKpRHIJOuBbFDN+71QUm6CdTidH4GhegSE6xdpkqB750/VaKAPsw4WGM3/l10RstuzPe 8O7+hk3oXz6ecL02aQRN5nKzOTImhv8A328ZMcklx6Fp144AEA0W56Iq+kRRbETnqqim mC/+75hxA4EotkfWERetZSeMPr5VlITbpjlakMi0MrXzLn62FBMMt5PYTpFs3Ksu+xk4 qZl2lI7vMNHNUF9b6CpW2TWkxhyovW19vBO5ZxCfv3ZrwPB95la/XIiYkEuVlaBe5NR7 ZiUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=Eoy/EXzwqs3RGDHCzp3a9szKxyzU9GQyzUXXK/5BdyI=; b=efoAoL4FdzfkxIFxwjfDOtA+B7tBl1m56qXnIjnHYcLku7XBWDyuaguQWpLs1OwqSx ZyFMQ36tinlvJG66ZtqKCNuWu33m0RDYaObrXP0h0berUIWdunkLGIzbA9UjNThmy3rM B+uPzKVxk6X5XBVLb0OupccbX9r4WYudAN3L2UVKCEp3fZMPTKcILT7/iVVFbMCITtMC xRQo6vqhmGuQ2UyNxhFBOmdOayVcGBJu70ZDa6NKaAGQm64FohPqJ3VfjlHTLIvV49C2 aiPcy90/JgiRJ9iy62MDoamR1sJ3dQrJGFMKUqlfaFeY849wvW6ihi4IksHm1+GiY4FP SqCg== X-Gm-Message-State: AKS2vOxwxeHwc1FxRNv/GW3SiwOwZvD9s0idP4U2XcsNYgYDbsmSw3pI OoHuF/GstJ3pj1Fdrac= X-Received: by 10.28.154.19 with SMTP id c19mr20528899wme.87.1499238895097; Wed, 05 Jul 2017 00:14:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:08 +0200 Message-Id: <1499238885-26161-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 05/42] target/i386: simplify handling of conforming code segments on interrupt 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move the handling of conforming code segments before the handling of stack switch. Because dpl =3D=3D cpl after the new "if", it's now unnecessary to check the C bit when testing dpl < cpl. Furthermore, dpl > cpl is checked slightly above the modified code, so the final "else" is unreachable and we can remove it. Signed-off-by: Paolo Bonzini --- target/i386/seg_helper.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 9af69c2..600a4d7 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -692,7 +692,10 @@ static void do_interrupt_protected(CPUX86State *env, i= nt intno, int is_int, if (!(e2 & DESC_P_MASK)) { raise_exception_err(env, EXCP0B_NOSEG, selector & 0xfffc); } - if (!(e2 & DESC_C_MASK) && dpl < cpl) { + if (e2 & DESC_C_MASK) { + dpl =3D cpl; + } + if (dpl < cpl) { /* to inner privilege */ get_ss_esp_from_tss(env, &ss, &esp, dpl, 0); if ((ss & 0xfffc) =3D=3D 0) { @@ -719,7 +722,7 @@ static void do_interrupt_protected(CPUX86State *env, in= t intno, int is_int, new_stack =3D 1; sp_mask =3D get_sp_mask(ss_e2); ssp =3D get_seg_base(ss_e1, ss_e2); - } else if ((e2 & DESC_C_MASK) || dpl =3D=3D cpl) { + } else { /* to same privilege */ if (vm86) { raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); @@ -728,13 +731,6 @@ static void do_interrupt_protected(CPUX86State *env, i= nt intno, int is_int, sp_mask =3D get_sp_mask(env->segs[R_SS].flags); ssp =3D env->segs[R_SS].base; esp =3D env->regs[R_ESP]; - dpl =3D cpl; - } else { - raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); - new_stack =3D 0; /* avoid warning */ - sp_mask =3D 0; /* avoid warning */ - ssp =3D 0; /* avoid warning */ - esp =3D 0; /* avoid warning */ } =20 shift =3D type >> 3; @@ -919,25 +915,21 @@ static void do_interrupt64(CPUX86State *env, int intn= o, int is_int, if (!(e2 & DESC_L_MASK) || (e2 & DESC_B_MASK)) { raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); } - if ((!(e2 & DESC_C_MASK) && dpl < cpl) || ist !=3D 0) { + if (e2 & DESC_C_MASK) { + dpl =3D cpl; + } + if (dpl < cpl || ist !=3D 0) { /* to inner privilege */ new_stack =3D 1; esp =3D get_rsp_from_tss(env, ist !=3D 0 ? ist + 3 : dpl); ss =3D 0; - } else if ((e2 & DESC_C_MASK) || dpl =3D=3D cpl) { + } else { /* to same privilege */ if (env->eflags & VM_MASK) { raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); } new_stack =3D 0; esp =3D env->regs[R_ESP]; - } else { - raise_exception_err(env, EXCP0D_GPF, selector & 0xfffc); - new_stack =3D 0; /* avoid warning */ - esp =3D 0; /* avoid warning */ - } - if (e2 & DESC_C_MASK) { - dpl =3D cpl; } esp &=3D ~0xfLL; /* align stack */ =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239010019915.7639923086083; Wed, 5 Jul 2017 00:16:50 -0700 (PDT) Received: from localhost ([::1]:44489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeYK-0005lb-Gh for importer@patchew.org; Wed, 05 Jul 2017 03:16:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWZ-0004NS-0D for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWX-0007TN-FF for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:58 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWX-0007S0-9z for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:57 -0400 Received: by mail-wm0-x243.google.com with SMTP id p204so30533639wmg.1 for ; Wed, 05 Jul 2017 00:14:57 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4nNtEcgG5d1+zrxQ8hIeC8AJI6qbjWM3HBaGBX0+I0I=; b=EYgKiQDif4v+ayj4PTwCyLNs771K1R07oaFVgD+AvMuKUhgifAmcby+cFhUMO9dhNb +fyYrt1JnY2oNaQQGKv+nml0+zDrNerMTOEJ5nHGSQDoJVpUC1i3iX64kFIHOckV6Coe hgcuSK2qV9vOkLz64VMK8dG03d27aSA28vyZmGpTeSGfQOmmlBqZFJsDLHySo5IzkEZE UCySjTOz881R0fBX6lajd0wmQL8nBQCjqNGFKUzWxWpC1ucaZ/VLmx7WymP2buO7gPuM dFWg6KplBQcVNvvOqTuhry6+XYInZMt3kAdidxo3B3dT+QhrQ+gjXBVr2NEomyFlb+fO Ookw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=4nNtEcgG5d1+zrxQ8hIeC8AJI6qbjWM3HBaGBX0+I0I=; b=eSUwIiI6A3ZKQB/UVtJhpKJqrTezF/JRtbmNOh4/dILQj+JK7pFteTjNFPtgG/Os5o SEQMkaWrFNe4gqSOKIlVI/9oVfZhdKVsr9Vekzn7wX5HNklPIfhRk+ibzatLJfpvIixw bZTdLeFXDp5S0UOMuAtCySnE/qcBXXrmVECwUmSQIjzUNBFNCwoe6YEHn4kDJnhS5ECQ mi5sUTTdxHs6GKSvl4mTkRmT7fBN4hU4WP63Y0zxrQ6aLna0cUlsd7fGrh3syfk9E5z3 ucS/doK+Hy943Q+qVyv8tCqJlIoVDEy8ddeb/XBLHh/zNNItGutdA7jxz2tJ6/9tlGwm mzpg== X-Gm-Message-State: AKS2vOzsiC6fQ4k4Eg+VpQCaqwPVgSh0jsXgyTsKRiqIZYc2BTj+RYNg z1tdejqlFyb5t1IxfTE= X-Received: by 10.28.22.6 with SMTP id 6mr32025156wmw.124.1499238896106; Wed, 05 Jul 2017 00:14:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:09 +0200 Message-Id: <1499238885-26161-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 06/42] include/exec/poison: Add some more missing TARGET and CONFIG defines 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The defines of some *-linux-user targets were still missing. Suggested-by: Richard Henderson Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-2-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/poison.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 5ffed4d..7a025b2 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -7,13 +7,16 @@ =20 #pragma GCC poison TARGET_I386 #pragma GCC poison TARGET_X86_64 +#pragma GCC poison TARGET_AARCH64 #pragma GCC poison TARGET_ALPHA #pragma GCC poison TARGET_ARM #pragma GCC poison TARGET_CRIS +#pragma GCC poison TARGET_HPPA #pragma GCC poison TARGET_LM32 #pragma GCC poison TARGET_M68K #pragma GCC poison TARGET_MICROBLAZE #pragma GCC poison TARGET_MIPS +#pragma GCC poison TARGET_ABI_MIPSN32 #pragma GCC poison TARGET_ABI_MIPSO32 #pragma GCC poison TARGET_MIPS64 #pragma GCC poison TARGET_ABI_MIPSN64 @@ -28,10 +31,12 @@ #pragma GCC poison TARGET_SH4 #pragma GCC poison TARGET_SPARC #pragma GCC poison TARGET_SPARC64 +#pragma GCC poison TARGET_TILEGX #pragma GCC poison TARGET_TRICORE #pragma GCC poison TARGET_UNICORE32 #pragma GCC poison TARGET_XTENSA =20 +#pragma GCC poison TARGET_HAS_BFLT #pragma GCC poison TARGET_NAME #pragma GCC poison TARGET_SUPPORTS_MTTCG #pragma GCC poison TARGET_WORDS_BIGENDIAN @@ -65,6 +70,7 @@ #pragma GCC poison CONFIG_ARM_A64_DIS #pragma GCC poison CONFIG_ARM_DIS #pragma GCC poison CONFIG_CRIS_DIS +#pragma GCC poison CONFIG_HPPA_DIS #pragma GCC poison CONFIG_I386_DIS #pragma GCC poison CONFIG_LM32_DIS #pragma GCC poison CONFIG_M68K_DIS --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239419956467.32130864661406; Wed, 5 Jul 2017 00:23:39 -0700 (PDT) Received: from localhost ([::1]:44521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeew-0003Y0-NA for importer@patchew.org; Wed, 05 Jul 2017 03:23:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWZ-0004OE-U6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWY-0007US-Fj for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWY-0007Ti-7x for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:58 -0400 Received: by mail-wm0-x243.google.com with SMTP id p204so30533812wmg.1 for ; Wed, 05 Jul 2017 00:14:58 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZXrOjnyj09B6R9L4/7BvrpuNYi8UPSKMH5JN7Z3j57Q=; b=cbzUAexmMJvrfTfTzWRd9zYNeoF/SLewtsUEuXpZOxiymqNlKKzetIEhxAnEpXVa0e YlJaeflWSVQt9t9RiAwtItgUo+zhaNHI/4fWpOjiDm7psSU+60xQ7IbF3CVnhcWO7aAB HnDSdaCWCyY5gDxWBPveny/sXVopkXNGiBp6HUS/yySfVI9lttKbVW+ThsdtHHG8Vvjy IzPd3K7sv4FOdwn2mRHAp0FCWnZK2Of2r76HFAPYf6pvQMF+NUKqTQGuZKmsydbhk4W6 rpAN6YqI4Xf1adAQRtQSU/PPhVeWS7IaDQ8daLmGKV93R5ShVI6Sf0c33KKTvoevjj23 pLeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZXrOjnyj09B6R9L4/7BvrpuNYi8UPSKMH5JN7Z3j57Q=; b=P9hzEdh3+8yaL64eJMdbORkby07zLe1uUPSzszNzgWSmQHOzjO0+zAzLDdIPL2OyY9 v2WyLeDn0ReZqFbJZ+eBLN3rdGp/xgiFqKkIZBTLekn4Zn1UISkBsAUp1CS+n4iDqXaw brnhRrUa+pYZ7+ADgb3SlcvJjXvbQGPIIUH3F2RM+KwBkJYHgaaxGiWFuXRgju5/pJ3z AK5Z6IekuPTjZCCFXWvqmPCiz2nNj6Ki1kmLNytq10dJx6Z9s918PQfMMwnu7xVnQ0AH E4/RH1WlHQcB7ANMH249by4JVnytB01LKCxO+uHd0rJNrAGZn0bbwm2ukLUjTOsj4WPW GrQA== X-Gm-Message-State: AIVw113GFtLZDH2AB3mYqK6uyHHI9h/4Wzyod7Kl5qWHMORTSV//X2t0 hz2LThbaCU22fdiVNm8= X-Received: by 10.28.101.6 with SMTP id z6mr8641247wmb.99.1499238897101; Wed, 05 Jul 2017 00:14:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:10 +0200 Message-Id: <1499238885-26161-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 07/42] Move CONFIG_KVM related definitions to kvm_i386.h 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth pc.h and sysemu/kvm.h are also included from common code (where CONFIG_KVM is not available), so the #defines that depend on CONFIG_KVM should not be declared here to avoid that anybody is using them in a wrong way. Since we're also going to poison CONFIG_KVM for common code, let's move them to kvm_i386.h instead. Most of the dummy definitions from sysemu/kvm.h are also unused since the code that uses them is only compiled for CONFIG_KVM (e.g. target/i386/kvm.c), so the unused defines are also simply dropped here instead of being moved. Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-3-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 1 + include/hw/i386/pc.h | 13 ------------- include/sysemu/kvm.h | 15 --------------- target/i386/kvm_i386.h | 23 +++++++++++++++++++++++ 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 1523ef3..8f696b7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -36,6 +36,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/xen/xen.h" #include "sysemu/kvm.h" +#include "kvm_i386.h" #include "hw/kvm/clock.h" #include "hw/pci-host/q35.h" #include "exec/address-spaces.h" diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 233216a..f48d167 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -20,19 +20,6 @@ =20 #define HPET_INTCAP "hpet-intcap" =20 -#ifdef CONFIG_KVM -#define kvm_pit_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#define kvm_pic_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#define kvm_ioapic_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#else -#define kvm_pit_in_kernel() 0 -#define kvm_pic_in_kernel() 0 -#define kvm_ioapic_in_kernel() 0 -#endif - /** * PCMachineState: * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 1e91613..ca40b6e 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -22,21 +22,6 @@ #ifdef CONFIG_KVM #include #include -#else -/* These constants must never be used at runtime if kvm_enabled() is false. - * They exist so we don't need #ifdefs around KVM-specific code that alrea= dy - * checks kvm_enabled() properly. - */ -#define KVM_CPUID_SIGNATURE 0 -#define KVM_CPUID_FEATURES 0 -#define KVM_FEATURE_CLOCKSOURCE 0 -#define KVM_FEATURE_NOP_IO_DELAY 0 -#define KVM_FEATURE_MMU_OP 0 -#define KVM_FEATURE_CLOCKSOURCE2 0 -#define KVM_FEATURE_ASYNC_PF 0 -#define KVM_FEATURE_STEAL_TIME 0 -#define KVM_FEATURE_PV_EOI 0 -#define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 0 #endif =20 extern bool kvm_allowed; diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index bfce427..1de9876 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -15,6 +15,29 @@ =20 #define kvm_apic_in_kernel() (kvm_irqchip_in_kernel()) =20 +#ifdef CONFIG_KVM + +#define kvm_pit_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) +#define kvm_pic_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) +#define kvm_ioapic_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) + +#else + +#define kvm_pit_in_kernel() 0 +#define kvm_pic_in_kernel() 0 +#define kvm_ioapic_in_kernel() 0 + +/* These constants must never be used at runtime if kvm_enabled() is false. + * They exist so we don't need #ifdefs around KVM-specific code that alrea= dy + * checks kvm_enabled() properly. + */ +#define KVM_CPUID_FEATURES 0 + +#endif /* CONFIG_KVM */ + bool kvm_allows_irq0_override(void); bool kvm_has_smm(void); bool kvm_has_adjust_clock_stable(void); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239325463219.90310230820558; Wed, 5 Jul 2017 00:22:05 -0700 (PDT) Received: from localhost ([::1]:44513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSedO-0002BE-WA for importer@patchew.org; Wed, 05 Jul 2017 03:22:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWb-0004Ps-AR for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWZ-0007Vb-Vx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:01 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:34261) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWZ-0007Ul-LR for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:14:59 -0400 Received: by mail-wr0-x242.google.com with SMTP id k67so48979909wrc.1 for ; Wed, 05 Jul 2017 00:14:59 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fR8tiqDhNP1m1fXH5rY7e94A0hQsK7ZcdvxT0TrvvXc=; b=sePT6X2/Z8+cZI66hDrB/IJBL0WG2yMpPmZjK3ibrAKD0oOd+VLnzKM3lW/v5G6iG6 4QnM0/L6Mn2IiQi/PwPpF8gZuhfmzq8Urj2RDy9ALiprcErH/xiQKkRyTr3riyZ0XOKH ypm+7O5hcwFZYZcN8+Ti9VPhDDRQtjqgwOfdA8QN9rwc038TR3HBoAMhhhZjLZ/RS6jc VBgwdWqCyZ6Ak/Pb8dAdcwX5vmOrODFtPBFq6Pg+jZkLL1KO+NlVe/ndMstZM35HjBND CVvxiexrJI0DwHMI5mhe10W2QE7o1Z/YHXYpqZaHS1pHFQ2b/aBEuAMOzUQtabU83cB1 4JOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fR8tiqDhNP1m1fXH5rY7e94A0hQsK7ZcdvxT0TrvvXc=; b=RuO5p92SeMTGZ9Jl3XRIAJ3AKyM2Fbtvx6n0v703SJwlKp6HiyNmvCwca2+MsgZFcU f9ElQmEn7pMoKw944HbebE6LW73QT1sfNQ7Tbp7Qgl9xFzKiRtCzk7cWfVfGnIiZ8FvW +vCb6ucyWusSaMvqDJG8fMQ3DwT55dFVdDDoFTL/mRX3IlI+GAvbAH3+rtDykBsUhG2Y xihGxaQm6akQNHCbzI5g0Cx0vYRgPtBlwLMvi4G1hcaAPTIe3PA9uvfWMBktRVpyVPh9 ml8yEjO5XBFlKsOyvnct8ol9ltEmOpdJ9QQuZRfT4EnfCAA4wGm0jTm/5t3tH9bZJIfm zQ+A== X-Gm-Message-State: AKS2vOy8InfDvelqwvdo7IjkTGc8tbInU8Xh66LUzSUnxt4+D06bo98z Zmg2FXLq1aSaEUUOT3s= X-Received: by 10.223.133.211 with SMTP id 19mr43536793wru.27.1499238898109; Wed, 05 Jul 2017 00:14:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:11 +0200 Message-Id: <1499238885-26161-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 08/42] include/exec/poison: Mark CONFIG_KVM as poisoned, too 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth CONFIG_KVM is only defined for target-specific code, so nobody should use it by accident in common code. To avoid such subtle bugs, CONFIG_KVM is now marked as poisoned in common code. The header include/sysemu/kvm.h is somewhat special since it is included all over the place from common code, too, so we need some extra logic via "#ifdef NEED_CPU_H" here to make sure that we can compile all files without problems. Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-4-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/acpi/ich9.c | 1 - include/exec/poison.h | 1 + include/sysemu/kvm.h | 18 +++++++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 5c279bb..c5d8646 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -33,7 +33,6 @@ #include "sysemu/sysemu.h" #include "hw/acpi/acpi.h" #include "hw/acpi/tco.h" -#include "sysemu/kvm.h" #include "exec/address-spaces.h" =20 #include "hw/i386/ich9.h" diff --git a/include/exec/poison.h b/include/exec/poison.h index 7a025b2..32707cd 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -86,6 +86,7 @@ =20 #pragma GCC poison CONFIG_LINUX_USER #pragma GCC poison CONFIG_VHOST_NET +#pragma GCC poison CONFIG_KVM =20 #endif #endif diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index ca40b6e..052e11f 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -19,11 +19,18 @@ #include "exec/memattrs.h" #include "hw/irq.h" =20 -#ifdef CONFIG_KVM -#include -#include +#ifdef NEED_CPU_H +# ifdef CONFIG_KVM +# include +# include +# define CONFIG_KVM_IS_POSSIBLE +# endif +#else +# define CONFIG_KVM_IS_POSSIBLE #endif =20 +#ifdef CONFIG_KVM_IS_POSSIBLE + extern bool kvm_allowed; extern bool kvm_kernel_irqchip; extern bool kvm_split_irqchip; @@ -40,7 +47,6 @@ extern bool kvm_direct_msi_allowed; extern bool kvm_ioeventfd_any_length_allowed; extern bool kvm_msi_use_devid; =20 -#if defined CONFIG_KVM || !defined NEED_CPU_H #define kvm_enabled() (kvm_allowed) /** * kvm_irqchip_in_kernel: @@ -163,6 +169,7 @@ extern bool kvm_msi_use_devid; #define kvm_msi_devid_required() (kvm_msi_use_devid) =20 #else + #define kvm_enabled() (0) #define kvm_irqchip_in_kernel() (false) #define kvm_irqchip_is_split() (false) @@ -178,7 +185,8 @@ extern bool kvm_msi_use_devid; #define kvm_direct_msi_enabled() (false) #define kvm_ioeventfd_any_length_enabled() (false) #define kvm_msi_devid_required() (false) -#endif + +#endif /* CONFIG_KVM_IS_POSSIBLE */ =20 struct kvm_run; struct kvm_lapic_state; --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149923919222484.2197752737028; Wed, 5 Jul 2017 00:19:52 -0700 (PDT) Received: from localhost ([::1]:44501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSebH-0000Ky-1K for importer@patchew.org; Wed, 05 Jul 2017 03:19:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWc-0004RH-Mx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWb-0007Wq-MI for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:02 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWb-0007WI-Fc for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:01 -0400 Received: by mail-wm0-x242.google.com with SMTP id u23so30502493wma.2 for ; Wed, 05 Jul 2017 00:15:01 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.14.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=02rsNOp32b79/khq4qAj2tLsPqnszu5eUNL2AFh4OIQ=; b=eRP5rw8gBOXjrAdKnbC2LJ/bQyoiFsVV+yrxKkjPhId7tVpzxYUM0riovCX62IvVjX bXxXQXotDXvIeIortb3F3pnQDkAyN+wX0hY5t7eZVoeNYkDfHNB/imFGh5ugDaxeWmJg bsiM+DRf0YN093kFI5ZDv7TGn0oI1l/y5G04VufaMReltHPFFYmT9OrADTMFYn9ngsxC AgaWVTJ3j1bNNYlpq4AmsXuRqoWXaLvwnHplGAFDK0sSrf525dndsnQGWyDKM8LsgS1N aJr8OsgPo/3G+sXw64SyNCwWxczeyEhdvzdyZSKYH0UPjnKjmuHxUeS91xLKkXBI5tbD 5yiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=02rsNOp32b79/khq4qAj2tLsPqnszu5eUNL2AFh4OIQ=; b=uHirqmG9Ki1YW7xtJFTlzpnIiTMTPaKAEVAbBbumKBx2yr7W341TRtWvBJ7kBluAn6 mkP4mgkqyPl3RbvMj7clbybOMA4Qk1f++sfGRetlhPaUCVVeYSwgcQENpO4mTCMXqYIH jUewMgNAuweSMZRY9J7Pzf9lWLHf07VPT4aYI01JPQXQb3qOSNp7N15l186B1sEgawpF lmCoGr1X1JGqHDm7PbjZIrXzscCfzZunJDMqwAxvyrGQVWDxScfKoYBE5BeZvvayr4pd YNSh/0koAUfTLLMpw8/2slq6+BzhByfBo/N0cEMixKfc4CqQZ+1XpSZj5d/7r8qjPj79 E6kA== X-Gm-Message-State: AIVw111LB7Kp5aJ7fTmkdIkw7tX6v7V7velZ2/Bpr+8xxY99c4CbWzm8 a2t/tR0s09kKfe9AVhU= X-Received: by 10.28.149.209 with SMTP id x200mr21534116wmd.91.1499238900279; Wed, 05 Jul 2017 00:15:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:12 +0200 Message-Id: <1499238885-26161-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 09/42] cpu: Introduce a wrapper for tlb_flush() that can be used in common code 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Commit 1f5c00cfdb8114c ("qom/cpu: move tlb_flush to cpu_common_reset") moved the call to tlb_flush() from the target-specific reset handlers into the common code qom/cpu.c file, and protected the call with "#ifdef CONFIG_SOFTMMU" to avoid that it is called for linux-user only targets. But since qom/cpu.c is common code, CONFIG_SOFTMMU is *never* defined here, so the tlb_flush() was simply never executed anymore. Fix it by introducing a wrapper for tlb_flush() in a file that is re-compiled for each target, i.e. in translate-all.c. Fixes: 1f5c00cfdb8114c1e3a13426588ceb64f82c9ddb Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-5-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- accel/tcg/translate-all.c | 8 ++++++++ include/exec/cpu-common.h | 2 ++ qom/cpu.c | 5 ++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 93fb923..dc7e816 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2223,3 +2223,11 @@ int page_unprotect(target_ulong address, uintptr_t p= c) return 0; } #endif /* CONFIG_USER_ONLY */ + +/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */ +void tcg_flush_softmmu_tlb(CPUState *cs) +{ +#ifdef CONFIG_SOFTMMU + tlb_flush(cs); +#endif +} diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 4d45a72..74341b1 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -28,6 +28,8 @@ void qemu_init_cpu_list(void); void cpu_list_lock(void); void cpu_list_unlock(void); =20 +void tcg_flush_softmmu_tlb(CPUState *cs); + #if !defined(CONFIG_USER_ONLY) =20 enum device_endian { diff --git a/qom/cpu.c b/qom/cpu.c index 585419b..7b20f84 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -26,6 +26,7 @@ #include "qemu/notify.h" #include "qemu/log.h" #include "exec/log.h" +#include "exec/cpu-common.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" #include "hw/qdev-properties.h" @@ -293,9 +294,7 @@ static void cpu_common_reset(CPUState *cpu) if (tcg_enabled()) { cpu_tb_jmp_cache_clear(cpu); =20 -#ifdef CONFIG_SOFTMMU - tlb_flush(cpu, 0); -#endif + tcg_flush_softmmu_tlb(cpu); } } =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239784102879.7486730770892; Wed, 5 Jul 2017 00:29:44 -0700 (PDT) Received: from localhost ([::1]:44549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeko-0001fn-Rb for importer@patchew.org; Wed, 05 Jul 2017 03:29:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWi-0004YV-JX for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWc-0007Xq-Tl for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWc-0007XD-Nu for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:02 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so30447249wmj.0 for ; Wed, 05 Jul 2017 00:15:02 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=APn7rLN+TQ+c3aX7Qot5Ks/dXhqvt7eaRQ8R4koD2kM=; b=Uni7KkeiCDgcLoKUvdUGnwrwhh9I39ooELGjVk5fIhJ745T1iJDxCLHhCU3kQSvTwH qymiJNoreelRfFimhyixJoBgmFL5ITHI3N7wRJ3nynxenAY8Cn8RMKHUnj/YKZ/qBUBb Ao+QuEjzXEqjTbU5IoFi+IoxVIGlInq4q8ls13sxiEFeRBHzQz6XYXtBZTwCso3g69nI KjW3L0cXWOugm6nrDdl5NiOhVVHQdRLr/XdEuipsQiGeT4vzEqDYrupKQT5Y77HG43yj cgfqaD/inVBIihj1cgD8F3azIZ+MT0YpYWuvHiO9xpAJpC2xkDHaz3dX28BmzerJZXiK PUow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=APn7rLN+TQ+c3aX7Qot5Ks/dXhqvt7eaRQ8R4koD2kM=; b=k9M3IRtdSSaD3qU6vKtCbzMGLX3JRo2yEVGO2Ndb5lQ03OZ3sWupOEmUU2OGZfXP8+ SdZk+qxjegQhawZ0vT1kjLarqyWCIjZQFzM2KwqcNqYwakuMry1I+420UXXqUX8YF4I1 pRGyFMskQpeZQsoKY2ZdSRlTleBEwFnWTnkj2fZA3KAKBwv4nFfW3R0VM97VvkFupuzW Hg41mgla7/H+yCs0hjkIuU2TQ4vF9bH4BEGgLng5N/C9lQjvQNCiryBZKYFEhvyYt6rk Nk5RTsb0bdjwYt7kfyaovFpQVe541h9XVagL01ysJqGmMif4ntkrEmayY0kcA+LF6nUQ BPRQ== X-Gm-Message-State: AIVw110ecQFF8UicimTXmoa9/xJW01GOKlgbMRMWEnLhWjeOFxXswiww 61XUJM/xwjsJNc6F80s= X-Received: by 10.28.66.67 with SMTP id p64mr14551409wma.93.1499238901622; Wed, 05 Jul 2017 00:15:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:13 +0200 Message-Id: <1499238885-26161-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 10/42] include/exec/poison: Mark CONFIG_SOFTMMU as poisoned 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth CONFIG_SOFTMMU should never be used in common code, so mark it as poisoned, too. Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-6-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/poison.h | 1 + include/qom/cpu.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 32707cd..41cd2eb 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -87,6 +87,7 @@ #pragma GCC poison CONFIG_LINUX_USER #pragma GCC poison CONFIG_VHOST_NET #pragma GCC poison CONFIG_KVM +#pragma GCC poison CONFIG_SOFTMMU =20 #endif #endif diff --git a/include/qom/cpu.h b/include/qom/cpu.h index b9440b6..7bfd50c 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -817,6 +817,8 @@ void cpu_interrupt(CPUState *cpu, int mask); =20 #endif /* USER_ONLY */ =20 +#ifdef NEED_CPU_H + #ifdef CONFIG_SOFTMMU static inline void cpu_unassigned_access(CPUState *cpu, hwaddr addr, bool is_write, bool is_exec, @@ -839,6 +841,8 @@ static inline void cpu_unaligned_access(CPUState *cpu, = vaddr addr, } #endif =20 +#endif /* NEED_CPU_H */ + /** * cpu_set_pc: * @cpu: The CPU to set the program counter for. @@ -1015,6 +1019,8 @@ void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); =20 +#ifdef NEED_CPU_H + #ifdef CONFIG_SOFTMMU extern const struct VMStateDescription vmstate_cpu_common; #else @@ -1029,6 +1035,8 @@ extern const struct VMStateDescription vmstate_cpu_co= mmon; .offset =3D 0, = \ } =20 +#endif /* NEED_CPU_H */ + #define UNASSIGNED_CPU_INDEX -1 =20 #endif --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239346054653.1502331043562; Wed, 5 Jul 2017 00:22:26 -0700 (PDT) Received: from localhost ([::1]:44515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSedk-0002Uw-SN for importer@patchew.org; Wed, 05 Jul 2017 03:22:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWi-0004Z7-W4 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWe-0007YJ-0h for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:34834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWd-0007Xx-QI for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:03 -0400 Received: by mail-wm0-x22d.google.com with SMTP id w126so212850804wme.0 for ; Wed, 05 Jul 2017 00:15:03 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=H2xDN/2PDE1+HuGyD9NwqxKTliPgQsnKbZXOOE45SDA=; b=GtBH9S7JhtBuPIjx1X8yAgBS3/fFffI59kNNBw5c2MtpfygEVGJZV7i1DpW5Q8xOFP MYUoeWhlqAZzxi+uhs/DRO44HuSzOPfQhGdsXUZgur59I4Zx5SdgwSw8+hvgamtzvAgA tMIkDP8W6qJ0ZQmZln9yB3r12hib2VAfYkVqjWUHFleO+3cXbrtSFPiOb5cJo8MnoUQT L6JkT5xlBGDyNh0lMy8FvI/4JoNCATJOIq5g0kRnLnfmsmumLBzKzl8JmqN0xQqXeXT+ /UODa3IjIy5fxrV6vPqF+CneaduJ34Oms734OLU61REnG4LqNlLrcP2OKBKDCUoSKAeK gI9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=H2xDN/2PDE1+HuGyD9NwqxKTliPgQsnKbZXOOE45SDA=; b=Ab78/BsC9xlHKrNalnBHPApOEpv2jUI9909bHOaKYYu9IMMmX7xjSQp+n44ED2LokX PlDmZR3mzFNwjcri9dnFeMTrOqrTZVtuTFtldjfnJ0SZqQG+sBv6KMTn4xMLDYwcCCqF 95W2OMf7CTAnbN1Fnl/9oirOYpjZ7YiyLdBH1mrBV9iAbKHIYNPGnpm9kuVZM491nM4Y YjIUBexePD9vVmnvfJ3ufylgUGOQLlgktVAo3bQbw1VQopHrrVTEq1pADYWosa6F4S0+ 7RTxTVbrV1rZcYj3hzRxTS0f8k2M3ueSHfvvgCSq+noOhtsYe1JXuVF13KKhn7X66wHo 6Tcg== X-Gm-Message-State: AIVw110b+vrOjSy0T1t7uQysTmOv0JMQO1DJI0FAkwlwnSD34sN/JWQD uWvvO2PrBI2oY3pp9lg= X-Received: by 10.28.175.135 with SMTP id y129mr1424968wme.87.1499238902623; Wed, 05 Jul 2017 00:15:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:14 +0200 Message-Id: <1499238885-26161-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d Subject: [Qemu-devel] [PULL 11/42] Makefile: Move bootdevice.o to common-obj-y 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth There does not seem to be any target specific code in this file, so we can put it into "common-obj" instead of "obj" to compile it only once for all targets. Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-7-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile.objs | 2 +- Makefile.target | 2 +- bootdevice.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index b2e6322..756644c 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -40,7 +40,7 @@ io-obj-y =3D io/ =20 ifeq ($(CONFIG_SOFTMMU),y) common-obj-y =3D blockdev.o blockdev-nbd.o block/ -common-obj-y +=3D iothread.o +common-obj-y +=3D bootdevice.o iothread.o common-obj-y +=3D net/ common-obj-y +=3D qdev-monitor.o device-hotplug.o common-obj-$(CONFIG_WIN32) +=3D os-win32.o diff --git a/Makefile.target b/Makefile.target index 0066579..ffa7a8f 100644 --- a/Makefile.target +++ b/Makefile.target @@ -137,7 +137,7 @@ endif #CONFIG_BSD_USER # System emulator target ifdef CONFIG_SOFTMMU obj-y +=3D arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o -obj-y +=3D qtest.o bootdevice.o +obj-y +=3D qtest.o obj-y +=3D hw/ obj-y +=3D memory.o obj-y +=3D memory_mapping.o diff --git a/bootdevice.c b/bootdevice.c index 33e3029..1141009 100644 --- a/bootdevice.c +++ b/bootdevice.c @@ -27,7 +27,7 @@ #include "sysemu/sysemu.h" #include "qapi/visitor.h" #include "qemu/error-report.h" -#include "hw/hw.h" +#include "sysemu/reset.h" #include "hw/qdev-core.h" =20 typedef struct FWBootEntry FWBootEntry; --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239468639385.1869100445076; Wed, 5 Jul 2017 00:24:28 -0700 (PDT) Received: from localhost ([::1]:44522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSefi-0004qq-Ai for importer@patchew.org; Wed, 05 Jul 2017 03:24:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWj-0004ZA-06 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWf-0007Yx-3t for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWe-0007YU-Ui for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:05 -0400 Received: by mail-wm0-x241.google.com with SMTP id u23so30502720wma.2 for ; Wed, 05 Jul 2017 00:15:04 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xwr0g92Y+xqOzrmbmjXLVTcsvBYkd5Wic5okaHQZpP4=; b=TN7VmPxwyMi111Nar+2sDEv5fORfjRGzpNpACnv5ln0taXZ0X5U9vT5vlDNu+TMjDP P3GddMhXB5bFUQiOj5ZpeHxnkR+NvW8soBnYU297NpkYI6cHVjVma4IxAH2xNNCOjDYn BnFO+cVD6/3pTIWvb22Hv37SIvcKWmSWRmgwm9Ro1tzU71uq3RTqzsbHOzS5YAMxhNyk YpU4Wdyqv5M55EdDfm6fYe25MJyc7T1JG7jdXdZr21U2y5ndclPtBxua4y14/D1splxk QVqcAiVgXg/rYhQqMEEO88qQj15U4DQGmrx44B+HTPwKhigNGfHC1mybpEj6McFf3SoX JKEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xwr0g92Y+xqOzrmbmjXLVTcsvBYkd5Wic5okaHQZpP4=; b=itC91xvyutUIOgMRLL8/0spqTRfSHV8uM4TNCpLvj2R1f7RYWEuXO5a55ZsRyNd6GD kO49ygYkzs16e+qiBaClFkBpt3nQ9RnDBiQ8qHYVBvkdMgeaNit+/6Yvpb80Ippij+bp Hek2IQJUwiM5bQGSYVE1EnkiPBhPUpk3mzJrGLrt39QHin7834cV/KR64uUArZD5ombH qnb0lXUNN5h3q4Cfu/gA5A6zLxmLrTkmgonFExUSnlCUCN1Hzq/aN4dOB84n5gx0NBai 4dXJU0L2MCkdTbJEFdDoc/LtMLd6gwpX/NvgEKWDZYfDC7sGhNNcuY0xFFqX2t1P09SZ 6d+g== X-Gm-Message-State: AIVw113CIxisYTtcnM7rDJLqYwaIieJdXdqrmo+Mrd8NaFAWkv7c+hDv onJloEwHr//KUOuCGYc= X-Received: by 10.28.54.13 with SMTP id d13mr22327450wma.124.1499238903865; Wed, 05 Jul 2017 00:15:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:15 +0200 Message-Id: <1499238885-26161-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 12/42] hw/misc/edu: Compile the edu device as common object 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: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth edu.c does not contain any target-specific code, so we can put it into common-obj-y to compile it only once for all targets. Signed-off-by: Thomas Huth Message-Id: <1498454578-18709-8-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/misc/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs index 08a79c3..44e0e79 100644 --- a/hw/misc/Makefile.objs +++ b/hw/misc/Makefile.objs @@ -6,6 +6,7 @@ common-obj-$(CONFIG_ISA_DEBUG) +=3D debugexit.o common-obj-$(CONFIG_SGA) +=3D sga.o common-obj-$(CONFIG_ISA_TESTDEV) +=3D pc-testdev.o common-obj-$(CONFIG_PCI_TESTDEV) +=3D pci-testdev.o +common-obj-$(CONFIG_EDU) +=3D edu.o =20 common-obj-y +=3D unimp.o =20 @@ -53,7 +54,6 @@ obj-$(CONFIG_MIPS_CPS) +=3D mips_cpc.o obj-$(CONFIG_MIPS_ITU) +=3D mips_itu.o =20 obj-$(CONFIG_PVPANIC) +=3D pvpanic.o -obj-$(CONFIG_EDU) +=3D edu.o obj-$(CONFIG_HYPERV_TESTDEV) +=3D hyperv_testdev.o obj-$(CONFIG_AUX) +=3D auxbus.o obj-$(CONFIG_ASPEED_SOC) +=3D aspeed_scu.o aspeed_sdmc.o --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239470439280.32407093148595; Wed, 5 Jul 2017 00:24:30 -0700 (PDT) Received: from localhost ([::1]:44523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSefl-0004sv-6D for importer@patchew.org; Wed, 05 Jul 2017 03:24:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWi-0004Z6-Vg for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWg-0007aK-L8 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:33515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWg-0007ZW-Fu for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:06 -0400 Received: by mail-wm0-x236.google.com with SMTP id t70so1597780wmt.0 for ; Wed, 05 Jul 2017 00:15:06 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=NYgoR01FMd8An2aBRV8J0Y4sUy6n/lTis4Pk5WzFeAs=; b=P1i3TDI00nyvruCjQY85JbNTmFi5tlGSATKTolAwDSRs/4+KBXv3K2ctr1IIsbEOZf 51Fuv6Zx5x1JQJaIveL19JKo8ClWiDIEnutIEm2Pj9spvKTWW4RkBkx46zlVopfJip58 khYNUfuW7F+XMNXJIiX3pOydn+KfvkTxa8BG8su6I1hl/jjVPa50cgl+rG+V8PbQIGBB WRRUTpmgE7oyMGrm/WXdChKuvlTFyRYpje5CKbvn2JlwP3oOkETuqR8DAHxJbaUTuDu0 X66wIoa2G2p2fKINTwIIP+Lsf7AKkBGOYTE6tBNO4XUlkrdW3SF5FijN0TVApyJFPMuo f/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NYgoR01FMd8An2aBRV8J0Y4sUy6n/lTis4Pk5WzFeAs=; b=J91qwBqNrWA/ijprVjuLnZCYUYPUcEy3sLd+9ljiXGuK4y0CKYDTAvWsd5g6sxorh9 7ezW6yoIo/aAOhkP4JpCCNCohlE+MJc9NsRDcgsvXoal4enSBrSztjiLD9TSUEcLLj4P hISoeU8bNPDXtxOCasDp9zJfNHlODvW1CQcO7P6BDWqPB37bD2d2KeNwx5tVtdbFUGeF x9bu/c6AG+PjQSMlz3Rk4yUmbXpN6/9VzLjlt4gLjxR53/HgenQjopwu4oItgcXnU0rF t5VtopUzuBmAJekfT34RbZV6aZLf8DSsAwTXUqc+I1qZwsSiR+g3iO0Np3VGZgOPNdzr sDUw== X-Gm-Message-State: AIVw112PNw/9qfhwivcND0o12qoDGNbdN9xsixdeIcja3D5+fCFRTfYr JSIsHz5Dv7+2bZ4XLE0= X-Received: by 10.28.184.195 with SMTP id i186mr10223152wmf.98.1499238905203; Wed, 05 Jul 2017 00:15:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:16 +0200 Message-Id: <1499238885-26161-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::236 Subject: [Qemu-devel] [PULL 13/42] sockets: avoid formatting buffer that may not be NUL terminated 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The 'sun_path' field in the sockaddr_un struct is not required to be NUL termianted, so when reporting an error, we must use the separate 'path' variable which is guaranteed terminated. Fixes a bug spotted by coverity that was introduced in commit ad9579aaa16d5b385922d49edac2c96c79bcfb62 Author: Daniel P. Berrange Date: Thu May 25 16:53:00 2017 +0100 sockets: improve error reporting if UNIX socket path is too long Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrange Message-Id: <20170626103756.22974-1-berrange@redhat.com> Signed-off-by: Paolo Bonzini --- util/qemu-sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 82290cb..d3e5108 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -897,7 +897,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, strncpy(un.sun_path, path, sizeof(un.sun_path)); =20 if (bind(sock, (struct sockaddr*) &un, sizeof(un)) < 0) { - error_setg_errno(errp, errno, "Failed to bind socket to %s", un.su= n_path); + error_setg_errno(errp, errno, "Failed to bind socket to %s", path); goto err; } if (listen(sock, 1) < 0) { --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239496324653.7888270880399; Wed, 5 Jul 2017 00:24:56 -0700 (PDT) Received: from localhost ([::1]:44525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeg9-0005D1-Uu for importer@patchew.org; Wed, 05 Jul 2017 03:24:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWk-0004aq-2U for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWi-0007dK-3O for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:10 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36825) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWh-0007bk-Ql for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: by mail-wm0-x242.google.com with SMTP id y5so30407863wmh.3 for ; Wed, 05 Jul 2017 00:15:07 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=TyN3+E+wZ/wfy9DxL3mTLzvywPHf6D3IvlINCx+7whY=; b=JxJiN4RNMI9YDzsPPC16KKd0Vgx5ALNkkfAgE6Pf+dyEveGAaQ+9lQEyJej0qtxODW 4OsqxCr2R2oGuatgH5wE1nzwdUkc3GNLJB2TF0JUv7OXtwAfsoHMP0YJ2PAwSbCJgA4A 6JYyB4Vh5TaxRMv5AwfuzGv9inWs1NaaRV+xI2opXDNHwSg7pDE5Awc+r43vyBzCubNM wTPcx7ic4v5nHtW+K0cNEcMhVfnFyIFjAAqq8D6jCq1S23Bg65EyoR+VYKu+ckFf0eFI 2tPpqWKRNgJEZ8jq3FXBSv8Y1HYKUjBfRCdUBAu8EnQ8pKcYEReXvpdt6QApn1Ckv2iJ N64w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=TyN3+E+wZ/wfy9DxL3mTLzvywPHf6D3IvlINCx+7whY=; b=foXARnFMvRy/zADMqc9mxNddXV8pBhQwTY+Pyzi1T1w/cdTUZM0nLS0E50KlVxV9ql momLmb7TAEvEWObtdyhxYb3vxHgXV6GqEXlSUt5X4N0qVSizPiKEDEK0viabraE/s2Cv wRZl1MwooZ7Ee8qGR0HQgLqcmOgBD84oYPHBHx+9LpwXE6wMcEnzljE6bUVYUASKxtEy ey3mCiE1zjGXa2KVaa/3QWTHjSghznQ4wK5YrKfiD3uVe3CdM5e98MGQqzmJL/eA8Vyb 4OgTW8PiQNCcHRXpHSyLQ1z6IT46ytmgUJM/byvQ3070LqVKtcsk1d54B6btdHeg1CZl Jglw== X-Gm-Message-State: AIVw1106gFf6KYHriaEUOmbocBCWy6rJJH86Y3zPINleVuj0IgXLg8cR btjR8nbmTUylmDwaXNQ= X-Received: by 10.28.65.135 with SMTP id o129mr18454907wma.20.1499238906554; Wed, 05 Jul 2017 00:15:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:17 +0200 Message-Id: <1499238885-26161-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 14/42] xsave_helper: pull xsave and xrstor out of kvm.c into helper function 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: Sergio Andres Gomez Del Real Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sergio Andres Gomez Del Real This patch pulls out of kvm.c and into the new files the implementation for the xsave and xrstor instructions. This so they can be shared by kvm and hvf. Signed-off-by: Sergio Andres Gomez Del Real Message-Id: <20170626200832.11058-1-Sergio.G.DelReal@gmail.com> Signed-off-by: Paolo Bonzini Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + target/i386/cpu.h | 2 + target/i386/kvm.c | 91 ++---------------------------------- target/i386/xsave_helper.c | 114 +++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 120 insertions(+), 88 deletions(-) create mode 100644 target/i386/xsave_helper.c diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 4fcb7f3..ca3bd21 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -1,6 +1,7 @@ obj-y +=3D translate.o helper.o cpu.o bpt_helper.o obj-y +=3D excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o obj-y +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.o mpx_helper= .o +obj-y +=3D xsave_helper.o obj-y +=3D gdbstub.o obj-$(CONFIG_SOFTMMU) +=3D machine.o arch_memory_mapping.o arch_dump.o mon= itor.o obj-$(CONFIG_KVM) +=3D kvm.o hyperv.o diff --git a/target/i386/cpu.h b/target/i386/cpu.h index de0551f..c5e143e 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1697,4 +1697,6 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, FILE= *f, /* cpu.c */ bool cpu_is_bsp(X86CPU *cpu); =20 +void x86_cpu_xrstor_all_areas(X86CPU *cpu, const X86XSaveArea *buf); +void x86_cpu_xsave_all_areas(X86CPU *cpu, X86XSaveArea *buf); #endif /* I386_CPU_H */ diff --git a/target/i386/kvm.c b/target/i386/kvm.c index ee36502..f84a49d 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1433,56 +1433,12 @@ static int kvm_put_xsave(X86CPU *cpu) { CPUX86State *env =3D &cpu->env; X86XSaveArea *xsave =3D env->kvm_xsave_buf; - uint16_t cwd, swd, twd; - int i; =20 if (!has_xsave) { return kvm_put_fpu(cpu); } + x86_cpu_xsave_all_areas(cpu, xsave); =20 - memset(xsave, 0, sizeof(struct kvm_xsave)); - twd =3D 0; - swd =3D env->fpus & ~(7 << 11); - swd |=3D (env->fpstt & 7) << 11; - cwd =3D env->fpuc; - for (i =3D 0; i < 8; ++i) { - twd |=3D (!env->fptags[i]) << i; - } - xsave->legacy.fcw =3D cwd; - xsave->legacy.fsw =3D swd; - xsave->legacy.ftw =3D twd; - xsave->legacy.fpop =3D env->fpop; - xsave->legacy.fpip =3D env->fpip; - xsave->legacy.fpdp =3D env->fpdp; - memcpy(&xsave->legacy.fpregs, env->fpregs, - sizeof env->fpregs); - xsave->legacy.mxcsr =3D env->mxcsr; - xsave->header.xstate_bv =3D env->xstate_bv; - memcpy(&xsave->bndreg_state.bnd_regs, env->bnd_regs, - sizeof env->bnd_regs); - xsave->bndcsr_state.bndcsr =3D env->bndcs_regs; - memcpy(&xsave->opmask_state.opmask_regs, env->opmask_regs, - sizeof env->opmask_regs); - - for (i =3D 0; i < CPU_NB_REGS; i++) { - uint8_t *xmm =3D xsave->legacy.xmm_regs[i]; - uint8_t *ymmh =3D xsave->avx_state.ymmh[i]; - uint8_t *zmmh =3D xsave->zmm_hi256_state.zmm_hi256[i]; - stq_p(xmm, env->xmm_regs[i].ZMM_Q(0)); - stq_p(xmm+8, env->xmm_regs[i].ZMM_Q(1)); - stq_p(ymmh, env->xmm_regs[i].ZMM_Q(2)); - stq_p(ymmh+8, env->xmm_regs[i].ZMM_Q(3)); - stq_p(zmmh, env->xmm_regs[i].ZMM_Q(4)); - stq_p(zmmh+8, env->xmm_regs[i].ZMM_Q(5)); - stq_p(zmmh+16, env->xmm_regs[i].ZMM_Q(6)); - stq_p(zmmh+24, env->xmm_regs[i].ZMM_Q(7)); - } - -#ifdef TARGET_X86_64 - memcpy(&xsave->hi16_zmm_state.hi16_zmm, &env->xmm_regs[16], - 16 * sizeof env->xmm_regs[16]); - memcpy(&xsave->pkru_state, &env->pkru, sizeof env->pkru); -#endif return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_XSAVE, xsave); } =20 @@ -1868,8 +1824,7 @@ static int kvm_get_xsave(X86CPU *cpu) { CPUX86State *env =3D &cpu->env; X86XSaveArea *xsave =3D env->kvm_xsave_buf; - int ret, i; - uint16_t cwd, swd, twd; + int ret; =20 if (!has_xsave) { return kvm_get_fpu(cpu); @@ -1879,48 +1834,8 @@ static int kvm_get_xsave(X86CPU *cpu) if (ret < 0) { return ret; } + x86_cpu_xrstor_all_areas(cpu, xsave); =20 - cwd =3D xsave->legacy.fcw; - swd =3D xsave->legacy.fsw; - twd =3D xsave->legacy.ftw; - env->fpop =3D xsave->legacy.fpop; - env->fpstt =3D (swd >> 11) & 7; - env->fpus =3D swd; - env->fpuc =3D cwd; - for (i =3D 0; i < 8; ++i) { - env->fptags[i] =3D !((twd >> i) & 1); - } - env->fpip =3D xsave->legacy.fpip; - env->fpdp =3D xsave->legacy.fpdp; - env->mxcsr =3D xsave->legacy.mxcsr; - memcpy(env->fpregs, &xsave->legacy.fpregs, - sizeof env->fpregs); - env->xstate_bv =3D xsave->header.xstate_bv; - memcpy(env->bnd_regs, &xsave->bndreg_state.bnd_regs, - sizeof env->bnd_regs); - env->bndcs_regs =3D xsave->bndcsr_state.bndcsr; - memcpy(env->opmask_regs, &xsave->opmask_state.opmask_regs, - sizeof env->opmask_regs); - - for (i =3D 0; i < CPU_NB_REGS; i++) { - uint8_t *xmm =3D xsave->legacy.xmm_regs[i]; - uint8_t *ymmh =3D xsave->avx_state.ymmh[i]; - uint8_t *zmmh =3D xsave->zmm_hi256_state.zmm_hi256[i]; - env->xmm_regs[i].ZMM_Q(0) =3D ldq_p(xmm); - env->xmm_regs[i].ZMM_Q(1) =3D ldq_p(xmm+8); - env->xmm_regs[i].ZMM_Q(2) =3D ldq_p(ymmh); - env->xmm_regs[i].ZMM_Q(3) =3D ldq_p(ymmh+8); - env->xmm_regs[i].ZMM_Q(4) =3D ldq_p(zmmh); - env->xmm_regs[i].ZMM_Q(5) =3D ldq_p(zmmh+8); - env->xmm_regs[i].ZMM_Q(6) =3D ldq_p(zmmh+16); - env->xmm_regs[i].ZMM_Q(7) =3D ldq_p(zmmh+24); - } - -#ifdef TARGET_X86_64 - memcpy(&env->xmm_regs[16], &xsave->hi16_zmm_state.hi16_zmm, - 16 * sizeof env->xmm_regs[16]); - memcpy(&env->pkru, &xsave->pkru_state, sizeof env->pkru); -#endif return 0; } =20 diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c new file mode 100644 index 0000000..ca735ee --- /dev/null +++ b/target/i386/xsave_helper.c @@ -0,0 +1,114 @@ +/* + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qapi/error.h" + +#include "qemu-common.h" +#include "cpu.h" + +void x86_cpu_xsave_all_areas(X86CPU *cpu, X86XSaveArea *buf) +{ + CPUX86State *env =3D &cpu->env; + X86XSaveArea *xsave =3D buf; + + uint16_t cwd, swd, twd; + int i; + memset(xsave, 0, sizeof(X86XSaveArea)); + twd =3D 0; + swd =3D env->fpus & ~(7 << 11); + swd |=3D (env->fpstt & 7) << 11; + cwd =3D env->fpuc; + for (i =3D 0; i < 8; ++i) { + twd |=3D (!env->fptags[i]) << i; + } + xsave->legacy.fcw =3D cwd; + xsave->legacy.fsw =3D swd; + xsave->legacy.ftw =3D twd; + xsave->legacy.fpop =3D env->fpop; + xsave->legacy.fpip =3D env->fpip; + xsave->legacy.fpdp =3D env->fpdp; + memcpy(&xsave->legacy.fpregs, env->fpregs, + sizeof env->fpregs); + xsave->legacy.mxcsr =3D env->mxcsr; + xsave->header.xstate_bv =3D env->xstate_bv; + memcpy(&xsave->bndreg_state.bnd_regs, env->bnd_regs, + sizeof env->bnd_regs); + xsave->bndcsr_state.bndcsr =3D env->bndcs_regs; + memcpy(&xsave->opmask_state.opmask_regs, env->opmask_regs, + sizeof env->opmask_regs); + + for (i =3D 0; i < CPU_NB_REGS; i++) { + uint8_t *xmm =3D xsave->legacy.xmm_regs[i]; + uint8_t *ymmh =3D xsave->avx_state.ymmh[i]; + uint8_t *zmmh =3D xsave->zmm_hi256_state.zmm_hi256[i]; + stq_p(xmm, env->xmm_regs[i].ZMM_Q(0)); + stq_p(xmm+8, env->xmm_regs[i].ZMM_Q(1)); + stq_p(ymmh, env->xmm_regs[i].ZMM_Q(2)); + stq_p(ymmh+8, env->xmm_regs[i].ZMM_Q(3)); + stq_p(zmmh, env->xmm_regs[i].ZMM_Q(4)); + stq_p(zmmh+8, env->xmm_regs[i].ZMM_Q(5)); + stq_p(zmmh+16, env->xmm_regs[i].ZMM_Q(6)); + stq_p(zmmh+24, env->xmm_regs[i].ZMM_Q(7)); + } + +#ifdef TARGET_X86_64 + memcpy(&xsave->hi16_zmm_state.hi16_zmm, &env->xmm_regs[16], + 16 * sizeof env->xmm_regs[16]); + memcpy(&xsave->pkru_state, &env->pkru, sizeof env->pkru); +#endif + +} + +void x86_cpu_xrstor_all_areas(X86CPU *cpu, const X86XSaveArea *buf) +{ + + CPUX86State *env =3D &cpu->env; + const X86XSaveArea *xsave =3D buf; + + int i; + uint16_t cwd, swd, twd; + cwd =3D xsave->legacy.fcw; + swd =3D xsave->legacy.fsw; + twd =3D xsave->legacy.ftw; + env->fpop =3D xsave->legacy.fpop; + env->fpstt =3D (swd >> 11) & 7; + env->fpus =3D swd; + env->fpuc =3D cwd; + for (i =3D 0; i < 8; ++i) { + env->fptags[i] =3D !((twd >> i) & 1); + } + env->fpip =3D xsave->legacy.fpip; + env->fpdp =3D xsave->legacy.fpdp; + env->mxcsr =3D xsave->legacy.mxcsr; + memcpy(env->fpregs, &xsave->legacy.fpregs, + sizeof env->fpregs); + env->xstate_bv =3D xsave->header.xstate_bv; + memcpy(env->bnd_regs, &xsave->bndreg_state.bnd_regs, + sizeof env->bnd_regs); + env->bndcs_regs =3D xsave->bndcsr_state.bndcsr; + memcpy(env->opmask_regs, &xsave->opmask_state.opmask_regs, + sizeof env->opmask_regs); + + for (i =3D 0; i < CPU_NB_REGS; i++) { + const uint8_t *xmm =3D xsave->legacy.xmm_regs[i]; + const uint8_t *ymmh =3D xsave->avx_state.ymmh[i]; + const uint8_t *zmmh =3D xsave->zmm_hi256_state.zmm_hi256[i]; + env->xmm_regs[i].ZMM_Q(0) =3D ldq_p(xmm); + env->xmm_regs[i].ZMM_Q(1) =3D ldq_p(xmm+8); + env->xmm_regs[i].ZMM_Q(2) =3D ldq_p(ymmh); + env->xmm_regs[i].ZMM_Q(3) =3D ldq_p(ymmh+8); + env->xmm_regs[i].ZMM_Q(4) =3D ldq_p(zmmh); + env->xmm_regs[i].ZMM_Q(5) =3D ldq_p(zmmh+8); + env->xmm_regs[i].ZMM_Q(6) =3D ldq_p(zmmh+16); + env->xmm_regs[i].ZMM_Q(7) =3D ldq_p(zmmh+24); + } + +#ifdef TARGET_X86_64 + memcpy(&env->xmm_regs[16], &xsave->hi16_zmm_state.hi16_zmm, + 16 * sizeof env->xmm_regs[16]); + memcpy(&env->pkru, &xsave->pkru_state, sizeof env->pkru); +#endif + +} --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149923956460435.061166197519924; Wed, 5 Jul 2017 00:26:04 -0700 (PDT) Received: from localhost ([::1]:44535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSehH-0006I7-48 for importer@patchew.org; Wed, 05 Jul 2017 03:26:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWk-0004as-3u for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWj-0007ep-3f for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:10 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWi-0007ds-Rl for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:08 -0400 Received: by mail-wm0-x241.google.com with SMTP id u23so30502950wma.2 for ; Wed, 05 Jul 2017 00:15:08 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FYYf0X6WLnpX+RrapBsIqCbcCwfDsoSPrtI7sxpkSbQ=; b=Ht7GYNCHA8KjqoJCPdDua/5N5FFuY6zvD96EmO8zB64z89E01Pus0TZFccWKQzWRSJ Kmu6D7abSA+vPVNoZIQbbIaHkNRbIPJvmvlwoqQ/+wQDUSmcCqw9PAsXy6n+u83pFtzz Oa1wW8mR0hCV6fn9ax9sffK9wFrqQvvADVJOQEsUtBfblQ/pmwetqZkjGdJv9bAQJSzv /JiGxJXxtIVdPHsN5YTQGTuoOXfASryv3gtDI2R5BZSfEd9/XKyD4ifMJ/PK3Q2IE64Z DOyMx2afHpD7r9oq8DUI7pt5H9xqxnBORynkaNup/RxEh1yefd/oOAjV4OC0pREhUhRh KdcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=FYYf0X6WLnpX+RrapBsIqCbcCwfDsoSPrtI7sxpkSbQ=; b=YBZkzCjULY80XFM4GQxvMVOY0v5pfYSHL+pAvleI2nRtmCGihSItVQbcWme8H8BfpL Rcu7Z4GdM/Q0Hci+vgVviTMMbQGJ/gDnmSmneRJwtmHciT1RN14Aln5oW2YY2bZL4/xL 65zW80A//27uFrcK4yCFX5nljS74GbwfPeEqKPT/pipxJWKs44Fx0BI/kUBw9xSSDps8 cQnQSnkW8W2OQlWdxhVYsq8xlz8FZXPr2B48cp/+3ns4IfiFM1UeOpD2jG343thBvM9y Z3BA7SDVjyX5JKiHS1glw6/w5MkR5yoXdDTciItfqE5UXFMqQo7hZtrLIGrQXpE493jM DW6Q== X-Gm-Message-State: AIVw111fq0nwa6W/isUix01YQDckerFGZAA1s89HKhLtAOy/LerIthH9 YIYiv7lTaIs530OlhD8= X-Received: by 10.28.87.205 with SMTP id l196mr23369447wmb.121.1499238907746; Wed, 05 Jul 2017 00:15:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:18 +0200 Message-Id: <1499238885-26161-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 15/42] util/oslib-win32: Remove if conditional 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: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis The original ready < nhandles - 1 can be re-written as ready + 1 < nhandles. The check was actually incorrect because WAIT_OBJECT_0 was not subtracted from ready; it worked because WAIT_OBJECT_0 is zero. After subtracting WAIT_OBJECT_0, the result is the same condition that we are checking on the first itteration of the for loop. This means we can remove the if statement and let the for loop check the code. Signed-off-by: Alistair Francis Message-Id: Signed-off-by: Paolo Bonzini --- util/oslib-win32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 80e4668..3de9e77 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -438,10 +438,8 @@ static int poll_rest(gboolean poll_msgs, HANDLE *handl= es, gint nhandles, if (timeout =3D=3D 0 && nhandles > 1) { /* Remove the handle that fired */ int i; - if (ready < nhandles - 1) { - for (i =3D ready - WAIT_OBJECT_0 + 1; i < nhandles; i++) { - handles[i-1] =3D handles[i]; - } + for (i =3D ready - WAIT_OBJECT_0 + 1; i < nhandles; i++) { + handles[i-1] =3D handles[i]; } nhandles--; recursed_result =3D poll_rest(FALSE, handles, nhandles, fds, n= fds, 0); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239639754591.9642812576216; Wed, 5 Jul 2017 00:27:19 -0700 (PDT) Received: from localhost ([::1]:44539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeiU-0007Nb-Dj for importer@patchew.org; Wed, 05 Jul 2017 03:27:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWl-0004c4-4g for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWk-0007fk-2Z for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:11 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWj-0007fC-TR for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:10 -0400 Received: by mail-wm0-x241.google.com with SMTP id p204so30534602wmg.1 for ; Wed, 05 Jul 2017 00:15:09 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EyH2PLpaOvyCaCwHKZyOrYewcYZ1BkMGBAOvaGnzP+c=; b=R4kFF3NHPPqCIRPHPS+hQ48hvprFJNj3zNhMd/mpgRVRtIV2+caUwux96bCsPf8aKf gQBoQS3ysD7MLuZnnbIGrvupTT5GQEjCa7lGSBWS9BgH3437VOUy01EvQiVbthwcjjP0 niUdeaqe29kjD4QS5Eka109hm3OJcBsUsK3X4X0tPt+j235N0KzW+2hCLkR5suBb0TCq hAKnF9zgcCsPRz/kWxBwhdQJPUaHHnC9hZ7lACBwPKotZ4e7LFGQMjlKNOiFvYSsMmon uZ47J7Gekm9cMaJGdwdKZwbLUeG4z7VrfeHYDjZnt+xDcT17nfM9PSragPeV3s7RWdQp yOsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EyH2PLpaOvyCaCwHKZyOrYewcYZ1BkMGBAOvaGnzP+c=; b=sEoSyHSJG2jrElC09FGaiusRTyvVkElhIduZjxVglIkhsxAiUij98MiNaCHbivxPle qYTHaqlT67bGVVFPR2q7b85n/DfjU+b+0i2QeWkmUKxHCM7ubzT6zoG8ZEWhXZiWfNP7 dNKDBXGep1kO0LWGfH8N2ygCUnPiewG2BZ9BL0apeBwj2u9+xAuhC7WyNro5/qLmBGbs DFJx8+jMd0gWDwEyX2ABUhmPrSyvxEMX4sa6l1tooEeoOSQO6+GfuKtQtcu5JlWCOc3W 5FdZRCVmZMcBQqShXfigaGxVdJ9KoscukL/7TCljbqHoFLHZraFvJUu1rNyJGDkusIel VkKA== X-Gm-Message-State: AKS2vOysuBTx7TBtkKY5i8MMECvPSZQR/1Geslgr/L0hG08WpMGmFVly CevuVtlqJXImOmdgWNE= X-Received: by 10.28.68.66 with SMTP id r63mr20823192wma.120.1499238908758; Wed, 05 Jul 2017 00:15:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:19 +0200 Message-Id: <1499238885-26161-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 16/42] tests/test-char.c: Don't use main_loop_wait()'s return value 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: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Peter Maydell In QEMU's main_loop() we used to check whether we should do a nonblocking call to main_loop(); this was deleted in commit e330c118f2a5, because now that vCPUs always drop the I/O thread lock it is an unnecessary optimization. The loop in test-char.c copied the old QEMU main_loop() code, but here the nonblocking check has never been necessary because this standalone test case doesn't hold the I/O lock anyway. Remove it, so we can drop the main_loop_wait() return value. Signed-off-by: Peter Maydell Message-Id: <1498584769-12439-2-git-send-email-peter.maydell@linaro.org> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- tests/test-char.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 87c724c..b962063 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -20,13 +20,9 @@ typedef struct FeHandler { =20 static void main_loop(void) { - bool nonblocking; - int last_io =3D 0; - quit =3D false; do { - nonblocking =3D last_io > 0; - last_io =3D main_loop_wait(nonblocking); + main_loop_wait(false); } while (!quit); } =20 --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239708137666.3145458125695; Wed, 5 Jul 2017 00:28:28 -0700 (PDT) Received: from localhost ([::1]:44543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeja-0008Oe-Q8 for importer@patchew.org; Wed, 05 Jul 2017 03:28:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWm-0004f9-Rg for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWl-0007gw-KF for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:12 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWl-0007gT-DZ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:11 -0400 Received: by mail-wm0-x22b.google.com with SMTP id f67so102817981wmh.1 for ; Wed, 05 Jul 2017 00:15:11 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4YI+PgScIwqwdQm6AB4Spg2wLRGv+iKLWY3ItrXKaeQ=; b=tsh5FclsWIGqLvfJ3BmV/m4AtfXSxdc5jaMlwj4iosxLePkYMqXZPrZydJhJzKVYE6 2gQ2F/j4u+qCsvJtoM9sWxaIV2FkABwFO478XqfNYLfszV4kOZRjdV9yBXIfyNIBrh55 kMNwl+SJE9gwNvhZA2PZxLNOT2AGxwx/OIfxDaNkfB2Vw9+7FEndux1V8mOJl3xN0dES f6aXI6aOmeD5TlfGc0Ukmoo/Juo+Q0oT5A7XdACAzCuOLBgMEUiKByT/YJf+HPMiBx36 dN07lSc4vDJvFhJN5KdXAORY7qn5Z6ozzW9alx3St9XbXDi2qv7FzpXfTCIG3VtvPZ1/ ON7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4YI+PgScIwqwdQm6AB4Spg2wLRGv+iKLWY3ItrXKaeQ=; b=Gb9AY+JYizGIW5+zM8EtZhRkWYihF4yNEVHMYt2W4M+KrMkSOqQEX41JlHhcl4q9HV S1KvH2a+JEvyTddXaK5SLhJrHPTYnEWfCWBs54SapmGXuvbCzVTWfgfnSmY2f5BuJaau aGu/3BPx2jttbKEdy1TowZov8OCgBNzvoAzbdm3MEB9mxEF34nIJc3CQf0G4PTzcYGAT Ymu6oKTVlqxBeq5puKcpV406ctx6OXABHhNiHgWJlVa8YlO2s//llVlJoa7HzeJ8LO9s lyzcZWy1z5FxbZA2jsqOviHvfd2QzSmLnDTgaHFEE9ZCGPjz9EENQqNyJRZVbJXmNYDq qM0Q== X-Gm-Message-State: AKS2vOxaUsSAkgOghgBLs1aMBcGfHjzNL1DaXO3bYPZuHs10yIQF6JD4 gsFygIRgvFtuRMATPAc= X-Received: by 10.28.157.205 with SMTP id g196mr30099492wme.84.1499238909829; Wed, 05 Jul 2017 00:15:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:20 +0200 Message-Id: <1499238885-26161-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22b Subject: [Qemu-devel] [PULL 17/42] main_loop: Make main_loop_wait() return void 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: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Peter Maydell The last users of main_loop_wait() that cared about the return value have now been changed to no longer use it. Drop the now-useless return value and make the function return void. We avoid the awkwardness of ifdeffery to handle the 'ret' variable in main_loop_wait() only being wanted if CONFIG_SLIRP by simply dropping all the ifdefs. There are stub implementations of slirp_pollfds_poll() and slirp_pollfds_fill() already in stubs/slirp.c which do nothing, as required. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=83=C2=A9 Reviewed-by: Stefan Hajnoczi Message-Id: <1498584769-12439-3-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- include/qemu/main-loop.h | 2 +- util/main-loop.c | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index d7e24af..6b4b60b 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -79,7 +79,7 @@ int qemu_init_main_loop(Error **errp); * * @nonblocking: Whether the caller should block until an event occurs. */ -int main_loop_wait(int nonblocking); +void main_loop_wait(int nonblocking); =20 /** * qemu_get_aio_context: Return the main loop's AioContext diff --git a/util/main-loop.c b/util/main-loop.c index 19cad6b..2f48f41 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -487,7 +487,7 @@ static int os_host_main_loop_wait(int64_t timeout) } #endif =20 -int main_loop_wait(int nonblocking) +void main_loop_wait(int nonblocking) { int ret; uint32_t timeout =3D UINT32_MAX; @@ -500,9 +500,7 @@ int main_loop_wait(int nonblocking) /* poll any events */ g_array_set_size(gpollfds, 0); /* reset for new iteration */ /* XXX: separate device handlers from system ones */ -#ifdef CONFIG_SLIRP slirp_pollfds_fill(gpollfds, &timeout); -#endif =20 if (timeout =3D=3D UINT32_MAX) { timeout_ns =3D -1; @@ -515,16 +513,12 @@ int main_loop_wait(int nonblocking) &main_loop_tlg)); =20 ret =3D os_host_main_loop_wait(timeout_ns); -#ifdef CONFIG_SLIRP slirp_pollfds_poll(gpollfds, (ret < 0)); -#endif =20 /* CPU thread can infinitely wait for event after missing the warp */ qemu_start_warp_timer(); qemu_clock_run_all_timers(); - - return ret; } =20 /* Functions to operate on the main QEMU AioContext. */ --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239617695313.8402404925854; Wed, 5 Jul 2017 00:26:57 -0700 (PDT) Received: from localhost ([::1]:44537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSei8-00072W-Ff for importer@patchew.org; Wed, 05 Jul 2017 03:26:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWn-0004fT-3p for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWm-0007hA-5j for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:13 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWl-0007gm-Vr for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:12 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so30447822wmj.0 for ; Wed, 05 Jul 2017 00:15:11 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=NapBNUi1OCUh++T38QtPHggf1b94CbEJWgaOGy6ykYo=; b=OF8E0y8V1F9ygKzRQzuF1nGY+Cywmtef1eASh5D49dPZg7hB4+0ngUPY11PkrdQYWv 0p/grMBZg1TlxL3tQyrOigeqoDNAqw35sI7DiiIlBv3NFRVwnUNI8QijtM0a/FIN27kg lXixOIr1/V9Cel5voWni7+Z0h/Ou7JocaKGUPdowcQnbHgP//jAP3JXsyjL5znceatNr J4paR8TfLR7ZFMKfHwtjKEbOOKAzu0Kdaoy8x2r6VVH9RXOwvZBd7OPA5et8VklZFxsn /CKAf4S4YMcXe2XyidtV3gcf9p28CDpV36XlwnsH2LBAmd/T6yUkYDj8mDXWeE1kXV73 ifuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=NapBNUi1OCUh++T38QtPHggf1b94CbEJWgaOGy6ykYo=; b=g5globwsyo2FT9W0LpFXac0VsT+kwSsSVtx36qOV6BmKjxCeAIX438sV3iVaccDSH4 /wlqHe9990dU2YHYNBgWTErmNTd3gB7yL0phYaGcb3+07FyBkN4dJMroKDAkl/wH1Tah c2OSUG+fHuFozDKrq9SK6442rxR31H2av3dVRzYefWdGZ/Hi5y9TFrmFMl7CPz3hAAXZ 5AxcsLUXBfes9llBJkniHx0ArF81jA+dEY9BQwhYow9gjRgAWr13SNyOoeyHREWHNexG qMDYM+iFLKn/EIdK9wboJBXuzIm/6Cd+yHKeYlw/8tGwMgzCAWNG/diP1//+4VEd+KRJ lMoA== X-Gm-Message-State: AKS2vOyLDaLWghr3z8LCXhsDdS89Ch6tmoNjbSQoJYpCylJDqkfy5fcz 2263F8mvRA15n1v5TCg= X-Received: by 10.28.5.19 with SMTP id 19mr30016130wmf.120.1499238910867; Wed, 05 Jul 2017 00:15:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:21 +0200 Message-Id: <1499238885-26161-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 18/42] checkpatch: should not use signal except for SIG_DFL or SIG_IGN 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Using signal to establish a signal handler is not portable; on SysV systems, the signal handler would be reset to SIG_DFL after delivery, while BSD preserves the signal handler. Daniel Berrange reported that (to complicate matters further) the signal system call has SysV behavior, but glibc signal() actually calls the sigaction system call to provide BSD behavior. However, using signal() to set a signal's disposition to SIG_DFL or SIG_IGN is portable and is a relatively common occurrence in QEMU source code, so allow that. Reviewed-by: Daniel P. Berrange Reviewed-by: Richard W.M. Jones Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 45027b9..73efc92 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2473,6 +2473,10 @@ sub process { if ($line =3D~ /\b(strto[^kd].*?)\s*\(/) { ERROR("consider using qemu_$1 in preference to $1\n" . $herecurr); } +# recommend sigaction over signal for portability, when establishing a han= dler + if ($line =3D~ /\bsignal\s*\(/ && !($line =3D~ /SIG_(?:IGN|DFL)/)) { + ERROR("use sigaction to establish signal handlers; signal is not portab= le\n" . $herecurr); + } # check for module_init(), use category-specific init macros explicitly pl= ease if ($line =3D~ /^module_init\s*\(/) { ERROR("please use block_init(), type_init() etc. instead of module_init= ()\n" . $herecurr); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239760740384.3525987101161; Wed, 5 Jul 2017 00:29:20 -0700 (PDT) Received: from localhost ([::1]:44544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSekR-00016X-8x for importer@patchew.org; Wed, 05 Jul 2017 03:29:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWo-0004h8-Iq for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWn-0007hy-M6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:14 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWn-0007hV-CD; Wed, 05 Jul 2017 03:15:13 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so30447933wmj.0; Wed, 05 Jul 2017 00:15:13 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6L4XugqVIefozncL+7/SBmA/ORq/e08syfRoJGil+Zo=; b=mu3jQxO6g/R/RQfo3a9Dhw0ff1bpljOeX42QU3NdZl1wVCnU8TmOTbZsvkxFRqDvE4 bisFv18PZ4LwzTqu+OJ3dwsdIxXi8bDRKp35hvc/ffKjZMBQEm4jU7h7yPYwdtjwaVFk 943Ayjr7P3C+qHA3bCIt1sAvfgAF8/KTGlL4fsP7W2JzJAQhiIZVB485AMSY0uVD1GDm XFXQMvGxYAwe2PDoFgxSQeXkiJWyce9eP6X1mgnSPmiCXvfy9X/CUJFTXqLEh4uFoyce kAWitbkk1TuMeFJSTYsaQAEs2vOkgRVC7oFWEkwkSq1Fykr1sZs+MwWjyR5tgSkDJ8Vj treA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6L4XugqVIefozncL+7/SBmA/ORq/e08syfRoJGil+Zo=; b=Ee4/1wf+Nxt5QxR1E179GTfIRLcdbG5I8HDBn/UAAxpBP1Pm3MPrc026fgjuT6FD1s z4ZMUE3s5pha+oSQYkgeZGmnFidqepapPOU2lYs5FJT+sH71kJmujTFXB8IXBKiOuMsr wZudjofn5GyiQjOHnfZCMHHwQ2tpabEixQ81n9IHtltVMstdmbnWxZD0P0xsaqk2ICyy 15EAxKD6wE4AKBnXBklqu0E8x5HRp2U6uOFRsLC3gti2O9Hq1Efc2wKpxyH6ehK2BeMi P0XPkUuwEtyhzBKVSof+EM9vldcv0stW1RT4RLeQOAAEPaCPRDoVoV1RM8hlsr3MhExO rJsA== X-Gm-Message-State: AIVw110oJGnwJRpB1Y8aA1hL2IFpPSTSP9lF8MhrIKsoYM3Y6cWR8T+A rY4PRJCBbfpttuqiYyU= X-Received: by 10.28.150.142 with SMTP id y136mr9419171wmd.51.1499238912189; Wed, 05 Jul 2017 00:15:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:22 +0200 Message-Id: <1499238885-26161-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 19/42] virtio-scsi: finalize IOMMU support 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: Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jason Wang After converting to use DMA api for virtio devices, we should use dma_as instead of address_space_memory. Otherwise it won't work if IOMMU is enabled. Fixes: commit 8607f5c3072c ("virtio: convert to use DMA api") Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang Message-Id: <1499170866-9068-1-git-send-email-jasowang@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index f46f06d..d076fe7 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -43,12 +43,13 @@ static inline SCSIDevice *virtio_scsi_device_find(VirtI= OSCSI *s, uint8_t *lun) =20 void virtio_scsi_init_req(VirtIOSCSI *s, VirtQueue *vq, VirtIOSCSIReq *req) { + VirtIODevice *vdev =3D VIRTIO_DEVICE(s); const size_t zero_skip =3D offsetof(VirtIOSCSIReq, resp_iov) + sizeof(req->resp_iov); =20 req->vq =3D vq; req->dev =3D s; - qemu_sglist_init(&req->qsgl, DEVICE(s), 8, &address_space_memory); + qemu_sglist_init(&req->qsgl, DEVICE(s), 8, vdev->dma_as); qemu_iovec_init(&req->resp_iov, 1); memset((uint8_t *)req + zero_skip, 0, sizeof(*req) - zero_skip); } --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240230649835.704226191536; Wed, 5 Jul 2017 00:37:10 -0700 (PDT) Received: from localhost ([::1]:44586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSerz-0008PF-Ks for importer@patchew.org; Wed, 05 Jul 2017 03:37:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWt-0004mR-Il for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWp-0007im-3J for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:34906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWo-0007iG-PC for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:15 -0400 Received: by mail-wm0-x232.google.com with SMTP id w126so212855156wme.0 for ; Wed, 05 Jul 2017 00:15:14 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+JzI6HLR1rfvQw7ixfxpkD+Go/4Hv7tDNfgBBWmb4ik=; b=CSnvLii/+NdaFHem+7YybvpU5EcJZSt/U+RuK1QhKn4H7tPZ6Yt1l/KUFMDNSxNaXk oOr+3kEImN/NgmoXkAdzLckC60i4xr0nQYanZZsqMdaoMAlSVavfB+c/F671euBU3M5o +sXHP7Nnq93pejZbhQuBzS6yU+lWSM6a/sHqsw6m/y9AV4FJ9vScCCUUDxoBMVpxNkIy pZaRIl/NQTkFoZNv6l7oM/CA/+JtuN9r78jZobPjXMvhzJP0vDmzrZp9+30neyx0r/g8 Uyf7Sa5KsCjWScGXYRbiVMp382UFcmoNZf7mHEU1GMip6+WrC+gmZORCsSyrqyMBKCda 9jlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+JzI6HLR1rfvQw7ixfxpkD+Go/4Hv7tDNfgBBWmb4ik=; b=rI1CJZCk6JOvM3ZLwkm9xHlHRlIQy/DNU06hPeDcR9wW9SZRtSapGsfv5GxI0XBtMh iFcF5eL/RFLUO+l4k+i0NlmSsJmIeKWBx9gLQWfvv5PG3wYRIXph5cEpWB70IUbsLwZn ZrEpVfk/oXJbXrJDOa93z+ceWwECV0dW7tx+NhPYOrbn+1Dz9X9GLUm+784OxYC/GeyT csdzYYtRB0ZP80FZ8XWXmuLrrm1vWNqwbM9uBanVkCwxr+yIm8ov72dCru4/jxFcnsNe L+gyt65pFx/+ZX8VgK91pI7YTo7nBhLRmBYdLCSSle+MzpQ/XHGLgsWBCC4OSpSTHvYP 024g== X-Gm-Message-State: AKS2vOx4qULwBYy0cnSYUYub/AiKx4fU2Z5cuHqyB5Y0DwcgX2WWXEQ0 pqHL6B4Fj1anLjXPiR8= X-Received: by 10.28.229.209 with SMTP id c200mr26559206wmh.43.1499238913380; Wed, 05 Jul 2017 00:15:13 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:23 +0200 Message-Id: <1499238885-26161-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::232 Subject: [Qemu-devel] [PULL 20/42] qemu-thread: Assert locks are initialized before using 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: Fam Zheng Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng Not all platforms check whether a lock is initialized before used. In particular Linux seems to be more permissive than OSX. Check initialization state explicitly in our code to catch such bugs earlier. Signed-off-by: Fam Zheng Message-Id: <20170704122325.25634-1-famz@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/thread-posix.h | 4 ++++ include/qemu/thread-win32.h | 5 +++++ util/qemu-thread-posix.c | 27 +++++++++++++++++++++++++++ util/qemu-thread-win32.c | 34 +++++++++++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index 09d1e15..e5e3a0f 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -12,10 +12,12 @@ typedef QemuMutex QemuRecMutex; =20 struct QemuMutex { pthread_mutex_t lock; + bool initialized; }; =20 struct QemuCond { pthread_cond_t cond; + bool initialized; }; =20 struct QemuSemaphore { @@ -26,6 +28,7 @@ struct QemuSemaphore { #else sem_t sem; #endif + bool initialized; }; =20 struct QemuEvent { @@ -34,6 +37,7 @@ struct QemuEvent { pthread_cond_t cond; #endif unsigned value; + bool initialized; }; =20 struct QemuThread { diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h index 4c4a261..3a05e3b 100644 --- a/include/qemu/thread-win32.h +++ b/include/qemu/thread-win32.h @@ -5,11 +5,13 @@ =20 struct QemuMutex { SRWLOCK lock; + bool initialized; }; =20 typedef struct QemuRecMutex QemuRecMutex; struct QemuRecMutex { CRITICAL_SECTION lock; + bool initialized; }; =20 void qemu_rec_mutex_destroy(QemuRecMutex *mutex); @@ -19,15 +21,18 @@ void qemu_rec_mutex_unlock(QemuRecMutex *mutex); =20 struct QemuCond { CONDITION_VARIABLE var; + bool initialized; }; =20 struct QemuSemaphore { HANDLE sema; + bool initialized; }; =20 struct QemuEvent { int value; HANDLE event; + bool initialized; }; =20 typedef struct QemuThreadData QemuThreadData; diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index eacd99e..4e95d27 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -43,12 +43,15 @@ void qemu_mutex_init(QemuMutex *mutex) err =3D pthread_mutex_init(&mutex->lock, NULL); if (err) error_exit(err, __func__); + mutex->initialized =3D true; } =20 void qemu_mutex_destroy(QemuMutex *mutex) { int err; =20 + assert(mutex->initialized); + mutex->initialized =3D false; err =3D pthread_mutex_destroy(&mutex->lock); if (err) error_exit(err, __func__); @@ -58,6 +61,7 @@ void qemu_mutex_lock(QemuMutex *mutex) { int err; =20 + assert(mutex->initialized); err =3D pthread_mutex_lock(&mutex->lock); if (err) error_exit(err, __func__); @@ -69,6 +73,7 @@ int qemu_mutex_trylock(QemuMutex *mutex) { int err; =20 + assert(mutex->initialized); err =3D pthread_mutex_trylock(&mutex->lock); if (err =3D=3D 0) { trace_qemu_mutex_locked(mutex); @@ -84,6 +89,7 @@ void qemu_mutex_unlock(QemuMutex *mutex) { int err; =20 + assert(mutex->initialized); trace_qemu_mutex_unlocked(mutex); err =3D pthread_mutex_unlock(&mutex->lock); if (err) @@ -102,6 +108,7 @@ void qemu_rec_mutex_init(QemuRecMutex *mutex) if (err) { error_exit(err, __func__); } + mutex->initialized =3D true; } =20 void qemu_cond_init(QemuCond *cond) @@ -111,12 +118,15 @@ void qemu_cond_init(QemuCond *cond) err =3D pthread_cond_init(&cond->cond, NULL); if (err) error_exit(err, __func__); + cond->initialized =3D true; } =20 void qemu_cond_destroy(QemuCond *cond) { int err; =20 + assert(cond->initialized); + cond->initialized =3D false; err =3D pthread_cond_destroy(&cond->cond); if (err) error_exit(err, __func__); @@ -126,6 +136,7 @@ void qemu_cond_signal(QemuCond *cond) { int err; =20 + assert(cond->initialized); err =3D pthread_cond_signal(&cond->cond); if (err) error_exit(err, __func__); @@ -135,6 +146,7 @@ void qemu_cond_broadcast(QemuCond *cond) { int err; =20 + assert(cond->initialized); err =3D pthread_cond_broadcast(&cond->cond); if (err) error_exit(err, __func__); @@ -144,6 +156,7 @@ void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) { int err; =20 + assert(cond->initialized); trace_qemu_mutex_unlocked(mutex); err =3D pthread_cond_wait(&cond->cond, &mutex->lock); trace_qemu_mutex_locked(mutex); @@ -174,12 +187,15 @@ void qemu_sem_init(QemuSemaphore *sem, int init) error_exit(errno, __func__); } #endif + sem->initialized =3D true; } =20 void qemu_sem_destroy(QemuSemaphore *sem) { int rc; =20 + assert(sem->initialized); + sem->initialized =3D false; #if defined(__APPLE__) || defined(__NetBSD__) rc =3D pthread_cond_destroy(&sem->cond); if (rc < 0) { @@ -201,6 +217,7 @@ void qemu_sem_post(QemuSemaphore *sem) { int rc; =20 + assert(sem->initialized); #if defined(__APPLE__) || defined(__NetBSD__) pthread_mutex_lock(&sem->lock); if (sem->count =3D=3D UINT_MAX) { @@ -238,6 +255,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) int rc; struct timespec ts; =20 + assert(sem->initialized); #if defined(__APPLE__) || defined(__NetBSD__) rc =3D 0; compute_abs_deadline(&ts, ms); @@ -285,6 +303,7 @@ void qemu_sem_wait(QemuSemaphore *sem) { int rc; =20 + assert(sem->initialized); #if defined(__APPLE__) || defined(__NetBSD__) pthread_mutex_lock(&sem->lock); while (sem->count =3D=3D 0) { @@ -310,6 +329,7 @@ void qemu_sem_wait(QemuSemaphore *sem) #else static inline void qemu_futex_wake(QemuEvent *ev, int n) { + assert(ev->initialized); pthread_mutex_lock(&ev->lock); if (n =3D=3D 1) { pthread_cond_signal(&ev->cond); @@ -321,6 +341,7 @@ static inline void qemu_futex_wake(QemuEvent *ev, int n) =20 static inline void qemu_futex_wait(QemuEvent *ev, unsigned val) { + assert(ev->initialized); pthread_mutex_lock(&ev->lock); if (ev->value =3D=3D val) { pthread_cond_wait(&ev->cond, &ev->lock); @@ -355,10 +376,13 @@ void qemu_event_init(QemuEvent *ev, bool init) #endif =20 ev->value =3D (init ? EV_SET : EV_FREE); + ev->initialized =3D true; } =20 void qemu_event_destroy(QemuEvent *ev) { + assert(ev->initialized); + ev->initialized =3D false; #ifndef __linux__ pthread_mutex_destroy(&ev->lock); pthread_cond_destroy(&ev->cond); @@ -370,6 +394,7 @@ void qemu_event_set(QemuEvent *ev) /* qemu_event_set has release semantics, but because it *loads* * ev->value we need a full memory barrier here. */ + assert(ev->initialized); smp_mb(); if (atomic_read(&ev->value) !=3D EV_SET) { if (atomic_xchg(&ev->value, EV_SET) =3D=3D EV_BUSY) { @@ -383,6 +408,7 @@ void qemu_event_reset(QemuEvent *ev) { unsigned value; =20 + assert(ev->initialized); value =3D atomic_read(&ev->value); smp_mb_acquire(); if (value =3D=3D EV_SET) { @@ -398,6 +424,7 @@ void qemu_event_wait(QemuEvent *ev) { unsigned value; =20 + assert(ev->initialized); value =3D atomic_read(&ev->value); smp_mb_acquire(); if (value !=3D EV_SET) { diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 653f29f..94f3491 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -46,15 +46,19 @@ static void error_exit(int err, const char *msg) void qemu_mutex_init(QemuMutex *mutex) { InitializeSRWLock(&mutex->lock); + mutex->initialized =3D true; } =20 void qemu_mutex_destroy(QemuMutex *mutex) { + assert(mutex->initialized); + mutex->initialized =3D false; InitializeSRWLock(&mutex->lock); } =20 void qemu_mutex_lock(QemuMutex *mutex) { + assert(mutex->initialized); AcquireSRWLockExclusive(&mutex->lock); trace_qemu_mutex_locked(mutex); } @@ -63,6 +67,7 @@ int qemu_mutex_trylock(QemuMutex *mutex) { int owned; =20 + assert(mutex->initialized); owned =3D TryAcquireSRWLockExclusive(&mutex->lock); if (owned) { trace_qemu_mutex_locked(mutex); @@ -73,6 +78,7 @@ int qemu_mutex_trylock(QemuMutex *mutex) =20 void qemu_mutex_unlock(QemuMutex *mutex) { + assert(mutex->initialized); trace_qemu_mutex_unlocked(mutex); ReleaseSRWLockExclusive(&mutex->lock); } @@ -80,25 +86,31 @@ void qemu_mutex_unlock(QemuMutex *mutex) void qemu_rec_mutex_init(QemuRecMutex *mutex) { InitializeCriticalSection(&mutex->lock); + mutex->initialized =3D true; } =20 void qemu_rec_mutex_destroy(QemuRecMutex *mutex) { + assert(mutex->initialized); + mutex->initialized =3D false; DeleteCriticalSection(&mutex->lock); } =20 void qemu_rec_mutex_lock(QemuRecMutex *mutex) { + assert(mutex->initialized); EnterCriticalSection(&mutex->lock); } =20 int qemu_rec_mutex_trylock(QemuRecMutex *mutex) { + assert(mutex->initialized); return !TryEnterCriticalSection(&mutex->lock); } =20 void qemu_rec_mutex_unlock(QemuRecMutex *mutex) { + assert(mutex->initialized); LeaveCriticalSection(&mutex->lock); } =20 @@ -106,25 +118,31 @@ void qemu_cond_init(QemuCond *cond) { memset(cond, 0, sizeof(*cond)); InitializeConditionVariable(&cond->var); + cond->initialized =3D true; } =20 void qemu_cond_destroy(QemuCond *cond) { + assert(cond->initialized); + cond->initialized =3D false; InitializeConditionVariable(&cond->var); } =20 void qemu_cond_signal(QemuCond *cond) { + assert(cond->initialized); WakeConditionVariable(&cond->var); } =20 void qemu_cond_broadcast(QemuCond *cond) { + assert(cond->initialized); WakeAllConditionVariable(&cond->var); } =20 void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) { + assert(cond->initialized); trace_qemu_mutex_unlocked(mutex); SleepConditionVariableSRW(&cond->var, &mutex->lock, INFINITE, 0); trace_qemu_mutex_locked(mutex); @@ -134,21 +152,28 @@ void qemu_sem_init(QemuSemaphore *sem, int init) { /* Manual reset. */ sem->sema =3D CreateSemaphore(NULL, init, LONG_MAX, NULL); + sem->initialized =3D true; } =20 void qemu_sem_destroy(QemuSemaphore *sem) { + assert(sem->initialized); + sem->initialized =3D false; CloseHandle(sem->sema); } =20 void qemu_sem_post(QemuSemaphore *sem) { + assert(sem->initialized); ReleaseSemaphore(sem->sema, 1, NULL); } =20 int qemu_sem_timedwait(QemuSemaphore *sem, int ms) { - int rc =3D WaitForSingleObject(sem->sema, ms); + int rc; + + assert(sem->initialized); + rc =3D WaitForSingleObject(sem->sema, ms); if (rc =3D=3D WAIT_OBJECT_0) { return 0; } @@ -160,6 +185,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) =20 void qemu_sem_wait(QemuSemaphore *sem) { + assert(sem->initialized); if (WaitForSingleObject(sem->sema, INFINITE) !=3D WAIT_OBJECT_0) { error_exit(GetLastError(), __func__); } @@ -193,15 +219,19 @@ void qemu_event_init(QemuEvent *ev, bool init) /* Manual reset. */ ev->event =3D CreateEvent(NULL, TRUE, TRUE, NULL); ev->value =3D (init ? EV_SET : EV_FREE); + ev->initialized =3D true; } =20 void qemu_event_destroy(QemuEvent *ev) { + assert(ev->initialized); + ev->initialized =3D false; CloseHandle(ev->event); } =20 void qemu_event_set(QemuEvent *ev) { + assert(ev->initialized); /* qemu_event_set has release semantics, but because it *loads* * ev->value we need a full memory barrier here. */ @@ -218,6 +248,7 @@ void qemu_event_reset(QemuEvent *ev) { unsigned value; =20 + assert(ev->initialized); value =3D atomic_read(&ev->value); smp_mb_acquire(); if (value =3D=3D EV_SET) { @@ -232,6 +263,7 @@ void qemu_event_wait(QemuEvent *ev) { unsigned value; =20 + assert(ev->initialized); value =3D atomic_read(&ev->value); smp_mb_acquire(); if (value !=3D EV_SET) { --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149923991158866.90977304261594; Wed, 5 Jul 2017 00:31:51 -0700 (PDT) Received: from localhost ([::1]:44561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSemr-0003TP-BT for importer@patchew.org; Wed, 05 Jul 2017 03:31:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWt-0004mQ-I6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWp-0007j6-Ls for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33159) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWp-0007id-El for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:15 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so30448035wmj.0 for ; Wed, 05 Jul 2017 00:15:15 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=r03XHBeuMmwpNQQFJULvU5Fuy09SxgequN+ta29ImQA=; b=iVfQ4w8MZeNQAbAjiilvhMTZ2Slnh4dnVnFYJbEaZQEwsO7CiPuADuNiu3tLeYBjl8 duywMRjuOVTFGIUI5DzggfOMX5+cJKZ0DFJ1Part5pRQeEB9UnjLDdW3Y9xYmy1e9P/H EEz2fFMAHabZgve8VQ5xLTEEVAFY0N0/fSYKMlBUN5CCv3H+BWPscFViMeeSfiOdfasp Udtb0uRMtQLVffekFc+1enOqbd5njm5iTM/Aak5X2S4e2QpqnQMgz5ZSYOdR47vdyPG3 EUmzjdwxQ4/N9wU7fZW3CQ3CLxMSdcFCEaLmbjg2wCq+cncuagek35+xUsZ805YDQ3jv ifbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=r03XHBeuMmwpNQQFJULvU5Fuy09SxgequN+ta29ImQA=; b=Y3UQreBG/jHgEU+n3mfn6lW4r/mLBYyGcT4pS6zUQp3tciCuYuMTs4unWIPoyVHh52 K0qnLhvYygOViKXOs7tBBFbRkFodrzD3jLiM6R6GM+s1mz20iL65RUR7hxYL/FBT/8Jb kakQnO+25lsr+yx9eRz+EnP6gBBTP5VBJArqJOHzpeGe+6/f49+qJls3riGRkFCMFqp3 VY7rKwQNN9ZgGvj9VAIFd9841A1ycLc64oO8YmHFI0yjTrNF4OpAVE5EPWPG9Y/aHa6j jTZNX2mbkLR6PSVEAIFzD0fYLCFIKwZbUdWrgM9ShBqxs7I+Hz60Ngwd0KK+3MAlS7lb kguA== X-Gm-Message-State: AIVw113RGZhx93diXkcd3F4doye2AB9BSRSjYbVWoriDk+ZuxaSqo6Sk XhqK8qTVGDMKwYsU4IM= X-Received: by 10.28.23.137 with SMTP id 131mr453389wmx.7.1499238914314; Wed, 05 Jul 2017 00:15:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:24 +0200 Message-Id: <1499238885-26161-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 21/42] qemu-doc: do not refer to years-old version numbers 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- qemu-doc.texi | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 45f67f6..d2986cb 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -386,11 +386,9 @@ CPU registers by prefixing them with @emph{$}. @node disk_images @section Disk Images =20 -Since version 0.6.1, QEMU supports many disk image formats, including -growable disk images (their size increase as non empty sectors are -written), compressed and encrypted disk images. Version 0.8.3 added -the new qcow2 disk image format which is essential to support VM -snapshots. +QEMU supports many disk image formats, including growable disk images +(their size increase as non empty sectors are written), compressed and +encrypted disk images. =20 @menu * disk_images_quickstart:: Quick start for disk image creation --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239918404585.6966579265617; Wed, 5 Jul 2017 00:31:58 -0700 (PDT) Received: from localhost ([::1]:44562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSemy-0003ZJ-NG for importer@patchew.org; Wed, 05 Jul 2017 03:31:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWt-0004mO-Hr for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWr-0007jy-Dk for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35255) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWr-0007ji-6L for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:17 -0400 Received: by mail-wm0-x244.google.com with SMTP id u23so30503515wma.2 for ; Wed, 05 Jul 2017 00:15:17 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=VEBtt4nhdeZpfaa1FMPNqG4AIBecXZHV7xgzSIC+kIEi1eYJTjUnOJRMO1ElWseUjP rK+DLIya6B0HH9qt5TOuUtIjnYRJ/JVx1Ne19V3lwA9OJIQB4vnQuNrTonRS5kVAH9Sr 2SsFBYH9ZatGcveVwrxig2eqIbwM2AEb2Fbjfb32kDoh+u6DAQE95qin2jWu5WfNqTz8 iJqpeqkmVMomUae3MhNEem27FEJJW7GrMm7vPT0CiV1H9oULhN94Qhe7BYDwlqxAKa/1 YYef6TXx7YF/si+i6UW/fCCBWY3ZodG/Incjra3mPeirbNCLcCTwoJaPDsxcuOTwiQYc lNhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=LPrUCnNu6EJlI/T57ffb8ZSgIsfg+xNV0NhMwqAE0ukBoYabYTjABR6AaUqrkz9QAS zTWp17GBMa2UmkvUmp4PHnHvlsMCAC1vjOuvzMmquG8PzrfWXQiXjGNI7sKG+6xrTGXq PvcfJZ3M6SQKiXWswiM4FdhMpQN4Tff/Bn6kPbfmVucoJedPrzV9vMhamITNBGpq8CC1 01uVP7OEesf72qDz8oYQFCpnSozqNy+hpzj+5/JVVdVWoua3yRcazLXFRZxruQrW2Rna DwMguMO9y1WC85rDa+Fe0ca3BoBOyDQfXt0JQcpW255G3jlv1ri8V/J7QB1u1KISirLQ pxyQ== X-Gm-Message-State: AIVw111eeFICqVfmftszap71bZ8SY/X0aOK0iD0IfW9Tsla4I2HsNXNI E8wVCHOYdYOmNBFcD/U= X-Received: by 10.28.87.205 with SMTP id l196mr23370006wmb.121.1499238915997; Wed, 05 Jul 2017 00:15:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:25 +0200 Message-Id: <1499238885-26161-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 22/42] configure: factor out list of supported Xen/KVM/HAX targets 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This will be useful when the functions are called, early in the configure process, to filter out targets that do not support hardware acceleration. Signed-off-by: Paolo Bonzini --- configure | 90 ++++++++++++++++++++++++++++++++++++++---------------------= ---- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/configure b/configure index c571ad1..0f14e79 100755 --- a/configure +++ b/configure @@ -163,6 +163,50 @@ have_backend () { echo "$trace_backends" | grep "$1" >/dev/null } =20 +glob() { + eval test -z '"${1#'"$2"'}"' +} + +supported_hax_target() { + test "$hax" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}" in + i386|x86_64) + return 0 + ;; + esac + return 1 +} + +supported_kvm_target() { + test "$kvm" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | i386:x32 | \ + x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ + mips:mips | mipsel:mips | \ + ppc:ppc | ppcemb:ppc | ppc64:ppc | \ + ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ + s390x:s390x) + return 0 + ;; + esac + return 1 +} + +supported_xen_target() { + test "$xen" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64) + return 0 + ;; + esac + return 1 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -6178,46 +6222,22 @@ echo "TARGET_ABI_DIR=3D$TARGET_ABI_DIR" >> $config_= target_mak if [ "$HOST_VARIANT_DIR" !=3D "" ]; then echo "HOST_VARIANT_DIR=3D$HOST_VARIANT_DIR" >> $config_target_mak fi -case "$target_name" in - i386|x86_64) - if test "$xen" =3D "yes" -a "$target_softmmu" =3D "yes" ; then - echo "CONFIG_XEN=3Dy" >> $config_target_mak - if test "$xen_pci_passthrough" =3D yes; then + +if supported_xen_target $target; then + echo "CONFIG_XEN=3Dy" >> $config_target_mak + if test "$xen_pci_passthrough" =3D yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=3Dy" >> "$config_target_mak" - fi fi - ;; - *) -esac -case "$target_name" in - aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x|mipsel|mips) - # Make sure the target and host cpus are compatible - if test "$kvm" =3D "yes" -a "$target_softmmu" =3D "yes" -a \ - \( "$target_name" =3D "$cpu" -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc64" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "mipsel" -a "$cpu" =3D "mips" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "i386" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x86_64" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "x32" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x32" \) \) ; then - echo "CONFIG_KVM=3Dy" >> $config_target_mak - if test "$vhost_net" =3D "yes" ; then +fi +if supported_kvm_target $target; then + echo "CONFIG_KVM=3Dy" >> $config_target_mak + if test "$vhost_net" =3D "yes" ; then echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak echo "CONFIG_VHOST_NET_TEST_$target_name=3Dy" >> $config_host_mak - fi fi -esac -if test "$hax" =3D "yes" ; then - if test "$target_softmmu" =3D "yes" ; then - case "$target_name" in - i386|x86_64) - echo "CONFIG_HAX=3Dy" >> $config_target_mak - ;; - esac - fi +fi +if supported_hax_target $target; then + echo "CONFIG_HAX=3Dy" >> $config_target_mak fi if test "$target_bigendian" =3D "yes" ; then echo "TARGET_WORDS_BIGENDIAN=3Dy" >> $config_target_mak --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240073475700.9480630575065; Wed, 5 Jul 2017 00:34:33 -0700 (PDT) Received: from localhost ([::1]:44571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSepU-0006EJ-5L for importer@patchew.org; Wed, 05 Jul 2017 03:34:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWu-0004mx-02 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWs-0007kf-SR for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:36572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWs-0007kL-Lk for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:18 -0400 Received: by mail-wr0-x230.google.com with SMTP id c11so258194771wrc.3 for ; Wed, 05 Jul 2017 00:15:18 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=rsbIEiZQB6IxyWP8KkSQb5fvfrcZtiBcfIFyzTmo3fU=; b=MAVmzhVhAMA7x8wiBx5CVADJkT6aOOdAUDmUfdW5TQGaAfSEHDGgJMN3Tl+eiJi6D5 Vpif6EBFMYd7VI4tr9J2BSnITHZuoBSM9u3FsJSOefO6EzaGXvLSqvjE0DPJx4g64mqe 50UYXlzY+XGnwxp61lusap6apA4oxI4nq9JnzrGLeNAI4YApo4KrSXm/vgSaddfmmRzF qQySKVCaI07sl2BNO36jYQi9ReZmkV5ffo+8tRFXJH8ogZTqePSGLa6KlEjThYZfAHyZ H1sK92kRIx5pRoD+0C2w9gk/C3mL/RqHLHuS4AcmDwx/gIBJADxfS/JEKNCbW6PXq5rr W3NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=rsbIEiZQB6IxyWP8KkSQb5fvfrcZtiBcfIFyzTmo3fU=; b=gwGZYfZx2hW2UbOch1RNrVfmHQS3vNVVNwPzkukcazoG+7xTC2P5jeBzY1WNuZn/rf z+c4DAUCbNSlN0zemFffQSgmHrz3iZc4aymDCXglJNXi+kL31pzBbdxYO8/Bja8Gb8py RJJy54bAuk0cZQaAPkvEl8tD6VRJadvHbQwrYyEjy4DmpvmVhn87VXXoQ1OzqbqhhR8y GapTImuhjmW0HfrUA+iP0/KEmLNzyWVmputCrDwhPZhi10gvh6JJvawshfxhAEk0JEjn XCMPu47Z8mYrUuVoOZfc3AciVN8SbvohxKPhK1PXIDt+T2r+aeL6aYwNRlh5DK3X+LLb Hreg== X-Gm-Message-State: AKS2vOxpu7BvcCTBZ9gYb1XntdDx73iM8dM/ZqQJIhPdQu48w3JP8M7M ZIYGPFrTQ8QPMRJexu8= X-Received: by 10.223.165.10 with SMTP id i10mr41929993wrb.59.1499238917303; Wed, 05 Jul 2017 00:15:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:26 +0200 Message-Id: <1499238885-26161-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::230 Subject: [Qemu-devel] [PULL 23/42] configure: early test for supported targets 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Check for unsupported targets in target_list, and print an error early in the configuration process. Signed-off-by: Paolo Bonzini --- configure | 70 +++++++++++++++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 0f14e79..ae69e96 100755 --- a/configure +++ b/configure @@ -40,14 +40,18 @@ printf " '%s'" "$0" "$@" >> config.log echo >> config.log echo "#" >> config.log =20 -error_exit() { - echo +print_error() { + (echo echo "ERROR: $1" while test -n "$2"; do echo " $2" shift done - echo + echo) >&2 +} + +error_exit() { + print_error "$@" exit 1 } =20 @@ -207,6 +211,30 @@ supported_xen_target() { return 1 } =20 +supported_target() { + case "$1" in + *-softmmu) + ;; + *-linux-user) + if test "$linux" !=3D "yes"; then + print_error "Target '$target' is only available on a Linux= host" + return 1 + fi + ;; + *-bsd-user) + if test "$bsd" !=3D "yes"; then + print_error "Target '$target' is only available on a BSD h= ost" + return 1 + fi + ;; + *) + print_error "Invalid target name '$target'" + return 1 + ;; + esac + return 0 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -1734,23 +1762,27 @@ if test "$solaris" =3D "yes" ; then fi =20 if test -z "${target_list+xxx}" ; then - target_list=3D"$default_target_list" + for target in $default_target_list; do + supported_target $target 2>/dev/null && \ + target_list=3D"$target_list $target" + done + target_list=3D"${target_list# }" else target_list=3D$(echo "$target_list" | sed -e 's/,/ /g') + for target in $target_list; do + # Check that we recognised the target name; this allows a more + # friendly error message than if we let it fall through. + case " $default_target_list " in + *" $target "*) + ;; + *) + error_exit "Unknown target name '$target'" + ;; + esac + supported_target $target || exit 1 + done fi =20 -# Check that we recognised the target name; this allows a more -# friendly error message than if we let it fall through. -for target in $target_list; do - case " $default_target_list " in - *" $target "*) - ;; - *) - error_exit "Unknown target name '$target'" - ;; - esac -done - # see if system emulation was really requested case " $target_list " in *"-softmmu "*) softmmu=3Dyes @@ -6050,16 +6082,10 @@ case "$target" in target_softmmu=3D"yes" ;; ${target_name}-linux-user) - if test "$linux" !=3D "yes" ; then - error_exit "Target '$target' is only available on a Linux host" - fi target_user_only=3D"yes" target_linux_user=3D"yes" ;; ${target_name}-bsd-user) - if test "$bsd" !=3D "yes" ; then - error_exit "Target '$target' is only available on a BSD host" - fi target_user_only=3D"yes" target_bsd_user=3D"yes" ;; --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240377585688.5455610963961; Wed, 5 Jul 2017 00:39:37 -0700 (PDT) Received: from localhost ([::1]:44596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeuO-0002IH-93 for importer@patchew.org; Wed, 05 Jul 2017 03:39:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWu-0004o1-VJ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWt-0007lM-Vi for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:20 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWt-0007kr-P3 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:19 -0400 Received: by mail-wr0-x243.google.com with SMTP id 77so49087926wrb.3 for ; Wed, 05 Jul 2017 00:15:19 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4vNFOuJcbQKXLb5Xbxf/cSScD86oqS+EW6/qIVDA6yM=; b=KQ8u/DyMwtcKU9GRUEypZ3qDUzCRvLaLusFwctrSRkOU/LKZg9PGiWOBuSp2DKbgtJ httWhbaz9u3OG1uvvD1sB3h1WctHQ7UQSzNjZxEICfjpmoJqu1VtuaL3wz8HC33sr37C XWZzNDXnmIIiHtVfbctJ3vbqpa0PktSQSlg7/THMmSbDpH2gtegEhzYqS4dRMo/MFhEQ WtyF2D0tXL0Eajt6dhTh/9eN8ktDZYLpX2n7udnHFX9tSMvXqV/bAP1G7ozouiF8GSym Bk5lrsQgksA/nw2ReSbgzm2At5v66fXQA1TpZrOYffvWlcZuiAo3utZyve5Y5No4BrbO YC9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=4vNFOuJcbQKXLb5Xbxf/cSScD86oqS+EW6/qIVDA6yM=; b=kBg3xdsEgEyVTdt0i0tCkUX31sjiVDRgjAb2897WtHrCDa8cfzKHXppRStUcx4yt9k AXVxsh+8uiNSbe4wGFkylE1/97uwGq8TrmN7DVeKHnky19uSrxiJlzhLd8Qjt//snKKx ufChHUBQwUgVoMOivZ1/7JcPT+vwd9EEaak95sRquDJ9/J7nHN9De/7o5kt1LUlbjYDh FR5vz4bzRcixWQetbejOz90mx0+SMMIp1hKtl2LMv/zpo2+ySwZj661E69QO79TWpASB 9DnrFIwX34yFnG9oAJYaXeiIslyjGq29vaHKX7MYN5gQjz0QQjWxwRhSx3OlBWcceOuU s3Zg== X-Gm-Message-State: AKS2vOzgiJg26jtS9gFVvU6l2gDUmTc1WeW0j80tHvArJLiJT4zAcdLL Lq6pHmNu3TWUn6thlrs= X-Received: by 10.223.146.161 with SMTP id 30mr43333928wrn.164.1499238918449; Wed, 05 Jul 2017 00:15:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:27 +0200 Message-Id: <1499238885-26161-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 24/42] configure: add --disable-tcg configure option 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: Anthony Liguori Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This lets you build without TCG (hardware accelerationor qtest only). When this flag is passed to configure, it will automatically filter out the targ= et list to only those that support KVM or Xen or HAX. Signed-off-by: Anthony Liguori Signed-off-by: Paolo Bonzini --- configure | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/configure b/configure index ae69e96..806658c 100755 --- a/configure +++ b/configure @@ -232,7 +232,12 @@ supported_target() { return 1 ;; esac - return 0 + test "$tcg" =3D "yes" && return 0 + supported_kvm_target "$1" && return 0 + supported_xen_target "$1" && return 0 + supported_hax_target "$1" && return 0 + print_error "TCG disabled, but hardware accelerator not available for = '$target'" + return 1 } =20 # default parameters @@ -296,6 +301,7 @@ cap_ng=3D"" attr=3D"" libattr=3D"" xfs=3D"" +tcg=3D"yes" =20 vhost_net=3D"no" vhost_scsi=3D"no" @@ -1033,6 +1039,10 @@ for opt do ;; --enable-cap-ng) cap_ng=3D"yes" ;; + --disable-tcg) tcg=3D"no" + ;; + --enable-tcg) tcg=3D"yes" + ;; --disable-spice) spice=3D"no" ;; --enable-spice) spice=3D"yes" @@ -5195,7 +5205,6 @@ echo "module support $modules" echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" -echo "tcg debug enabled $debug_tcg" echo "gprof enabled $gprof" echo "sparse enabled $sparse" echo "strip binaries $strip_opt" @@ -5250,8 +5259,12 @@ echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" echo "HAX support $hax" +echo "TCG support $tcg" +if test "$tcg" =3D "yes" ; then + echo "TCG debug enabled $debug_tcg" + echo "TCG interpreter $tcg_interpreter" +fi echo "RDMA support $rdma" -echo "TCG interpreter $tcg_interpreter" echo "fdt support $fdt" echo "preadv support $preadv" echo "fdatasync $fdatasync" @@ -5694,8 +5707,11 @@ fi if test "$signalfd" =3D "yes" ; then echo "CONFIG_SIGNALFD=3Dy" >> $config_host_mak fi -if test "$tcg_interpreter" =3D "yes" ; then - echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak +if test "$tcg" =3D "yes"; then + echo "CONFIG_TCG=3Dy" >> $config_host_mak + if test "$tcg_interpreter" =3D "yes" ; then + echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak + fi fi if test "$fdatasync" =3D "yes" ; then echo "CONFIG_FDATASYNC=3Dy" >> $config_host_mak --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149924008192975.08345945039264; Wed, 5 Jul 2017 00:34:41 -0700 (PDT) Received: from localhost ([::1]:44572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSepb-0006Js-K5 for importer@patchew.org; Wed, 05 Jul 2017 03:34:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWv-0004pA-Vt for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWv-0007lo-1R for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:21 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWu-0007lY-Rv for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:20 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so30408742wmh.3 for ; Wed, 05 Jul 2017 00:15:20 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=i79s2tDP9JmuChrYWLWu4OTocCOgPuLJykLEO3XPa6Q=; b=tMRF9HIiN0CqEBwQADRqpnsBl+TXbJIodS9T8ZuGo4jhUJII1HXJmBnk70ZuuRPXca zfazmI2Zdg0QAH3XWQEJ4vfFentSaHZbn7ud9C7EzDSDBibL0V6zG/gcDJ6q0klgh9xH lrGJphgwb9MyokC9Fuaf8s4lJ2JomSQogHNSMT2ZdziEx96CwXLYq3yyjsIsjE5RH/Nr 5PRnnkivMWKESpBr6q52uS92crGi1t1O8PE3YnDJ12ViyiTxbZCsO5jgGhF3zMHvapc6 CZK0mo4+7vkOtW0hPWpUV2+ip4N87lBMMOUjPg/qvZQiJVNCHE484XVO1MUbrYwD4G5a 3Y+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=i79s2tDP9JmuChrYWLWu4OTocCOgPuLJykLEO3XPa6Q=; b=YaioanGMhqJZsyOKQg7iEtNRUmW3E0MHXu//nEWDa76lzrcNbUMIBMFiQWR5S/VWE4 p3NShDtHvaY1vp98qTyqcAJIee5+wSyJjluflEoYKn9EGua73wmCo+nEeqNtHuaYe5LC DYUApdfWRjSOrsqJ0g20hhyhYYJgXMPpUUER5sjK57K0c6hmG7J3k9VeYcNh22VK8FQm LS379tmVOrnh3de2InjqW4InsaWH/2uaufkCJy9XZrrrzYZZRQnY24ldaXAC6WeeJSPO H6mYrLcMxaC/Zk86ITp6sUyYyW965iiA0i1A7x4UHCb89McHF+6qP0UIvsslMeu/UfIX 7QXg== X-Gm-Message-State: AIVw112ionpwaS8fza4iwTrRnTiPRTnkR6ebFC3mTtx9PFpSmpW05WV9 oL68z7DPbz0HRKtJnuM= X-Received: by 10.28.7.18 with SMTP id 18mr11005123wmh.20.1499238919733; Wed, 05 Jul 2017 00:15:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:28 +0200 Message-Id: <1499238885-26161-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 25/42] vl: convert -tb-size to qemu_strtoul 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- accel/tcg/tcg-all.c | 2 +- include/sysemu/accel.h | 2 +- vl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index dba9931..e327d90 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -28,7 +28,7 @@ #include "sysemu/sysemu.h" #include "qom/object.h" =20 -int tcg_tb_size; +unsigned long tcg_tb_size; static bool tcg_allowed =3D true; =20 static int tcg_init(MachineState *ms) diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index ecc5c84..5a632ce 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -63,7 +63,7 @@ typedef struct AccelClass { #define ACCEL_GET_CLASS(obj) \ OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) =20 -extern int tcg_tb_size; +extern unsigned long tcg_tb_size; =20 void configure_accelerator(MachineState *ms); /* Register accelerator specific global properties */ diff --git a/vl.c b/vl.c index 36ff3f4..ea8ef5f 100644 --- a/vl.c +++ b/vl.c @@ -3933,9 +3933,9 @@ int main(int argc, char **argv, char **envp) configure_rtc(opts); break; case QEMU_OPTION_tb_size: - tcg_tb_size =3D strtol(optarg, NULL, 0); - if (tcg_tb_size < 0) { - tcg_tb_size =3D 0; + if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) { + error_report("Invalid argument to -tb-size"); + exit(1); } break; case QEMU_OPTION_icount: --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239615191478.18779886708944; Wed, 5 Jul 2017 00:26:55 -0700 (PDT) Received: from localhost ([::1]:44536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSei5-00071F-RS for importer@patchew.org; Wed, 05 Jul 2017 03:26:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWx-0004qc-8R for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWw-0007mH-Eq for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:23 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWw-0007m1-88 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:22 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so30503881wma.2 for ; Wed, 05 Jul 2017 00:15:22 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mbWvsAlRffY2rx+vTS+tp8TDJnM6+iUsO1V3HJzv0Js=; b=KeIFG/DeVqzOSuQoUvXAfoLGpr71EK7Fxqad2kSovB4OB8ouEJe/pll8VbzHFXVEHf UHnO1by5uZsMYgIDMuIVGe3IErguN2vNiipy5BKn+xR7tEyoN3wOOPDwGSWOoZJR+9aw xKLe+ghYGcmwjc4FixKid3b1Msld5KfBecFE17nuMsg9HPQXcBLSIUYDP1vuvc215qjt Ez82TYcD9XwHq0v6EFRL+wcshaO3J8Yt2GCV82rhEzSAFSnRYVZAzBUXaufosLnHjkaz IKmk/EzUDcw1vYIMMak5O6j8bPtHqI+JK4ZWkGi0HbUGj7rB0C5FXoiVnQISLVgKSRyE tViQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mbWvsAlRffY2rx+vTS+tp8TDJnM6+iUsO1V3HJzv0Js=; b=qpF0sxunW0nuJPtW//+OrXie3+JvdFAs04awj/QJ+JCVWbfw9tbukgFnrzz+BEdOfu gQjqqf/81MAiwdrEJ7kx8Hb/VoPMwipxItpAAWG5OgH5PlXFmcJv6pZOAbmHV5JdMcHk ppSboTiicYBLRCz7qYsCm2wnA9KhFImMOxF0f3PVwRAq1R40+WCqkqqZRT0Rcy63SOXn FV2ac2wRzH5fJ5KH7Oh9J6TojYxi6jj9WOeEJ3zpYKvQkAZkdvyqrQIviNKcZkaul7TG phJTfaapl1jk8FI7lyXS1H9sZVXya266Bx+B0gSQv7p+19bNXsxFclGDaYA5S0JiEdBl JM6g== X-Gm-Message-State: AKS2vOx568IMazWCfZigE2UifsOBDX/RQpQyJZ+SNjD2uS4D8tWtdGqY ifWEQVMp8eCYtTQaV5Q= X-Received: by 10.28.180.70 with SMTP id d67mr22339216wmf.121.1499238921029; Wed, 05 Jul 2017 00:15:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:29 +0200 Message-Id: <1499238885-26161-27-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 26/42] vl: add tcg_enabled() for tcg related code 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Need to disable the tcg related code in the vl.c if the disable-tcg option is added into ./configure command. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- vl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index ea8ef5f..d17c863 100644 --- a/vl.c +++ b/vl.c @@ -3933,6 +3933,10 @@ int main(int argc, char **argv, char **envp) configure_rtc(opts); break; case QEMU_OPTION_tb_size: + if (!tcg_enabled()) { + error_report("TCG is disabled"); + exit(1); + } if (qemu_strtoul(optarg, NULL, 0, &tcg_tb_size) < 0) { error_report("Invalid argument to -tb-size"); exit(1); @@ -4481,7 +4485,9 @@ int main(int argc, char **argv, char **envp) qemu_opts_del(icount_opts); } =20 - qemu_tcg_configure(accel_opts, &error_fatal); + if (tcg_enabled()) { + qemu_tcg_configure(accel_opts, &error_fatal); + } =20 if (default_net) { QemuOptsList *net =3D qemu_find_opts("net"); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239935656246.4554237414925; Wed, 5 Jul 2017 00:32:15 -0700 (PDT) Received: from localhost ([::1]:44563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSenG-0003o8-HQ for importer@patchew.org; Wed, 05 Jul 2017 03:32:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWy-0004s2-Nn for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWx-0007n2-Jv for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:24 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWx-0007mT-DT for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:23 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so30448584wmj.0 for ; Wed, 05 Jul 2017 00:15:23 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=QyMKvXjqCjuUxbr0FeyifsmV0Wgz3kf012+AzfMWtHg=; b=f+0b64TkONQd0IHN4effBoEnK735G1Onnqk69GeiJPEhY1TnI4dFrbSDYfqUxcMEBF 1VW/CLKqnPnNzGk5kqLYWTVb3kp9xBgL/Un031qPN5e6uaJGtKPfch3o0oUutX8B0oHB TRJYpIUD30de6/w8fKVxS18Oq7lstoKEhqjg5QMnXEUIzOc5+pV6soGhXyNJzMi/rrsy 6LL5AqOgJVHQUzcvFX5IZtQXGdiQhqwBzTLqs69bDzR7WfwZMfZzKTi6sID/d3yfUx21 uoocBwxPLFiq7G2l0O7XINfHlMAHAY4+zW9GdKxGdELoz6qKFWH278gfvLK0A8yBoZcv ssvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=QyMKvXjqCjuUxbr0FeyifsmV0Wgz3kf012+AzfMWtHg=; b=LmF7T+h0G+tuQ4z0X/Vr5AHg4qXQJRH/7wPA0cEv+yRL5lNXsyohtDCHbZlv5oe+lm j98Osu99iGU3kvxlajy6yi8s5URkQ2K2/QvaolQXd+xHGMdnVGqhGqdITbaP0XxJ9YR3 98MRPvhRkMhj1Lb1lFX4dKm3z0uXGVxL0GQDweVMkQEwwUGDEp9Bdy17nxL8gZsF6ebc DGPxIniYRhhyEH1Uzvd4R/SWBnASuAE0RwdIrcKuoH68dClEYGspJTEsb/cG5d0Wbfku EvOgHgfZCzH20xUW9fujjaX2D4PpJwfYYTT7g4jRNUrU4vGDXAhbmS4NRTE6zfAYR9Q1 g7Hw== X-Gm-Message-State: AKS2vOz5A4lhN0Pt87pw15Cza6Q3Rv7GiJZWdPV1F24P/UdjctzGzjBc rKyPIYBqoNNh+UGJHW4= X-Received: by 10.28.111.215 with SMTP id c84mr31848017wmi.72.1499238922089; Wed, 05 Jul 2017 00:15:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:30 +0200 Message-Id: <1499238885-26161-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 27/42] tcg: move page_size_init() function 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong translate-all.c will be disabled if tcg is disabled in the build, so page_size_init() function and related variables will be moved to exec.c file. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- accel/tcg/translate-all.c | 18 ------------------ accel/tcg/translate-common.c | 3 --- exec.c | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index dc7e816..4fda383 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -112,9 +112,6 @@ typedef struct PageDesc { #define V_L2_BITS 10 #define V_L2_SIZE (1 << V_L2_BITS) =20 -uintptr_t qemu_host_page_size; -intptr_t qemu_host_page_mask; - /* * L1 Mapping properties */ @@ -363,21 +360,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retadd= r) return r; } =20 -void page_size_init(void) -{ - /* NOTE: we can always suppose that qemu_host_page_size >=3D - TARGET_PAGE_SIZE */ - qemu_real_host_page_size =3D getpagesize(); - qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; - if (qemu_host_page_size =3D=3D 0) { - qemu_host_page_size =3D qemu_real_host_page_size; - } - if (qemu_host_page_size < TARGET_PAGE_SIZE) { - qemu_host_page_size =3D TARGET_PAGE_SIZE; - } - qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; -} - static void page_init(void) { page_size_init(); diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c index 40fe5a1..e6b8c4c 100644 --- a/accel/tcg/translate-common.c +++ b/accel/tcg/translate-common.c @@ -23,9 +23,6 @@ #include "sysemu/cpus.h" #include "qemu/main-loop.h" =20 -uintptr_t qemu_real_host_page_size; -intptr_t qemu_real_host_page_mask; - #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ static void tcg_handle_interrupt(CPUState *cpu, int mask) diff --git a/exec.c b/exec.c index 42ad1ea..ee61915 100644 --- a/exec.c +++ b/exec.c @@ -118,6 +118,11 @@ __thread CPUState *current_cpu; 2 =3D Adaptive rate instruction counting. */ int use_icount; =20 +uintptr_t qemu_host_page_size; +intptr_t qemu_host_page_mask; +uintptr_t qemu_real_host_page_size; +intptr_t qemu_real_host_page_mask; + bool set_preferred_target_page_bits(int bits) { /* The target page size is the lowest common denominator for all @@ -3590,3 +3595,18 @@ err: } =20 #endif + +void page_size_init(void) +{ + /* NOTE: we can always suppose that qemu_host_page_size >=3D + TARGET_PAGE_SIZE */ + qemu_real_host_page_size =3D getpagesize(); + qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; + if (qemu_host_page_size =3D=3D 0) { + qemu_host_page_size =3D qemu_real_host_page_size; + } + if (qemu_host_page_size < TARGET_PAGE_SIZE) { + qemu_host_page_size =3D TARGET_PAGE_SIZE; + } + qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; +} --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239761006233.1757866877798; Wed, 5 Jul 2017 00:29:21 -0700 (PDT) Received: from localhost ([::1]:44545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSekR-00017L-M5 for importer@patchew.org; Wed, 05 Jul 2017 03:29:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX0-0004tn-5l for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWy-0007nl-R2 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:26 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWy-0007nM-HR for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:24 -0400 Received: by mail-wm0-x243.google.com with SMTP id y5so30408955wmh.3 for ; Wed, 05 Jul 2017 00:15:24 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=gA1sJonI+J58Okd/Jcb/4cX+1EZiBH+ri6c3FlJrNjk=; b=QT0bhYrI0f+pSZ+p0ZLpbhbelypUkA94XcusL/Gl5Uiz/vupeL3+iX28qm/s6mpJjN UHOm5MAGOLJEfJMIRiU5yLZoTNQU+Rzf/p7uwT206MkAd6/3l02URtTfcXEn0AyfEEq1 L/On/jliuuloshFW8UZYenJ60Y1ADWVKlizj+0B6wHU+pauxmfHPLydNDA//emTP+PeL 8bDp6iQErq9wsnAqtobjYo5jPosxyy+WMaTvLFrbxovvy9RJDcgHcloRW1Bw+YwbV0o/ CvYp2uZztR4GxWo+WxRY7snQPvdNpCzVNmZwH813iaWTXjdiC7W/tHOY1aqpWfVkRiUc JTiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=gA1sJonI+J58Okd/Jcb/4cX+1EZiBH+ri6c3FlJrNjk=; b=C1Mpb6WnVx3dSynb84pFYErOQLrNb8EufpqxPGJyq6BwykZzpDpd3Q2r4mjomQmr9d PiNSbcQSkC4nb6zmx+2dcHs31jvhQfwgGri+a87UKaXsj1N3pmWtdCSXZQKuUV/k4QYM zhg+Qn1bontz+AIqtz0bEUYJjAKAWiFi1fubegPqClM814Xp07kr2Gsr49UCOIv7Ko+T u0V0bgCH2OBm+m/Hd9HuzmeFxKisKPNWocjvoF7BdOxKqsyBNYIeaZ/Lyv2gYu1xiLbz 0W0GVLtzppTofWN1EFMw6zwwXQgNHXJc8j4tkw38l+XfoSU/g1p+9TPBhzuDTfUb+PtR 7xNw== X-Gm-Message-State: AIVw112l9JkBSNxnXFRAbfa1vQgjEY5kq+y7+r8BWb/o4qYsal/uAQQt dEYlwCrA5Q+ztOTetwY= X-Received: by 10.28.47.67 with SMTP id v64mr6480511wmv.84.1499238923258; Wed, 05 Jul 2017 00:15:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:31 +0200 Message-Id: <1499238885-26161-29-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 28/42] cpu: move interrupt handling out of translate-common.c 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" translate-common.c will not be available anymore with --disable-tcg, so we cannot leave cpu_interrupt_handler there. Move the TCG-specific handler to accel/tcg/tcg-all.c, and adopt KVM's handler as the default one, since it works just as well for Xen and qtest. Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 11 --------- accel/tcg/Makefile.objs | 2 +- accel/tcg/tcg-all.c | 32 ++++++++++++++++++++++++++ accel/tcg/translate-common.c | 53 ----------------------------------------= ---- qom/cpu.c | 13 +++++++++++ 5 files changed, 46 insertions(+), 65 deletions(-) delete mode 100644 accel/tcg/translate-common.c diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index cd71e28..2eef7da 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -981,15 +981,6 @@ static MemoryListener kvm_io_listener =3D { .priority =3D 10, }; =20 -static void kvm_handle_interrupt(CPUState *cpu, int mask) -{ - cpu->interrupt_request |=3D mask; - - if (!qemu_cpu_is_self(cpu)) { - qemu_cpu_kick(cpu); - } -} - int kvm_set_irq(KVMState *s, int irq, int level) { struct kvm_irq_level event; @@ -1774,8 +1765,6 @@ static int kvm_init(MachineState *ms) =20 s->many_ioeventfds =3D kvm_check_many_ioeventfds(); =20 - cpu_interrupt_handler =3D kvm_handle_interrupt; - return 0; =20 err: diff --git a/accel/tcg/Makefile.objs b/accel/tcg/Makefile.objs index f173cd5..70cd474 100644 --- a/accel/tcg/Makefile.objs +++ b/accel/tcg/Makefile.objs @@ -1,3 +1,3 @@ obj-$(CONFIG_SOFTMMU) +=3D tcg-all.o obj-$(CONFIG_SOFTMMU) +=3D cputlb.o -obj-y +=3D cpu-exec.o cpu-exec-common.o translate-all.o translate-common.o +obj-y +=3D cpu-exec.o cpu-exec-common.o translate-all.o diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index e327d90..c1ccad3 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -27,13 +27,45 @@ #include "sysemu/accel.h" #include "sysemu/sysemu.h" #include "qom/object.h" +#include "qemu-common.h" +#include "qom/cpu.h" +#include "sysemu/cpus.h" +#include "qemu/main-loop.h" =20 unsigned long tcg_tb_size; static bool tcg_allowed =3D true; =20 +#ifndef CONFIG_USER_ONLY +/* mask must never be zero, except for A20 change call */ +static void tcg_handle_interrupt(CPUState *cpu, int mask) +{ + int old_mask; + g_assert(qemu_mutex_iothread_locked()); + + old_mask =3D cpu->interrupt_request; + cpu->interrupt_request |=3D mask; + + /* + * If called from iothread context, wake the target cpu in + * case its halted. + */ + if (!qemu_cpu_is_self(cpu)) { + qemu_cpu_kick(cpu); + } else { + cpu->icount_decr.u16.high =3D -1; + if (use_icount && + !cpu->can_do_io + && (mask & ~old_mask) !=3D 0) { + cpu_abort(cpu, "Raised interrupt while not in I/O function"); + } + } +} +#endif + static int tcg_init(MachineState *ms) { tcg_exec_init(tcg_tb_size * 1024 * 1024); + cpu_interrupt_handler =3D tcg_handle_interrupt; return 0; } =20 diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c deleted file mode 100644 index e6b8c4c..0000000 --- a/accel/tcg/translate-common.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Host code generation common components - * - * Copyright (c) 2015 Peter Crosthwaite - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ - -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "qom/cpu.h" -#include "sysemu/cpus.h" -#include "qemu/main-loop.h" - -#ifndef CONFIG_USER_ONLY -/* mask must never be zero, except for A20 change call */ -static void tcg_handle_interrupt(CPUState *cpu, int mask) -{ - int old_mask; - g_assert(qemu_mutex_iothread_locked()); - - old_mask =3D cpu->interrupt_request; - cpu->interrupt_request |=3D mask; - - /* - * If called from iothread context, wake the target cpu in - * case its halted. - */ - if (!qemu_cpu_is_self(cpu)) { - qemu_cpu_kick(cpu); - } else { - cpu->icount_decr.u16.high =3D -1; - if (use_icount && - !cpu->can_do_io - && (mask & ~old_mask) !=3D 0) { - cpu_abort(cpu, "Raised interrupt while not in I/O function"); - } - } -} - -CPUInterruptHandler cpu_interrupt_handler =3D tcg_handle_interrupt; -#endif diff --git a/qom/cpu.c b/qom/cpu.c index 7b20f84..8757f03 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -32,6 +32,8 @@ #include "hw/qdev-properties.h" #include "trace-root.h" =20 +CPUInterruptHandler cpu_interrupt_handler; + bool cpu_exists(int64_t id) { CPUState *cpu; @@ -417,6 +419,17 @@ static vaddr cpu_adjust_watchpoint_address(CPUState *c= pu, vaddr addr, int len) return addr; } =20 +static void generic_handle_interrupt(CPUState *cpu, int mask) +{ + cpu->interrupt_request |=3D mask; + + if (!qemu_cpu_is_self(cpu)) { + qemu_cpu_kick(cpu); + } +} + +CPUInterruptHandler cpu_interrupt_handler =3D generic_handle_interrupt; + static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240380438461.50157903137574; Wed, 5 Jul 2017 00:39:40 -0700 (PDT) Received: from localhost ([::1]:44597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeuR-0002L3-5q for importer@patchew.org; Wed, 05 Jul 2017 03:39:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX4-0004y0-DU for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWz-0007oO-Oc for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWz-0007ny-I2 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:25 -0400 Received: by mail-wm0-x242.google.com with SMTP id u23so30504077wma.2 for ; Wed, 05 Jul 2017 00:15:25 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mrtbm0wiIbSdcQtkyOcqXjRLVYJhdr7PIdTZnz45XSo=; b=J4FeubZ456iHrpmf0GpurOCMSg2lJin+QemoV770ZdpLLznTfqtjfPoiqtp/gSEFYs iahmpLm5HSLJ77KPjTSC+7fs0t4rcQCUolsoaIiaxW58UcK4uJ4ZeJj2q+SxIEicLxdI MAzO5sXxdfTqM65vXbfCUfmiKH8VKlGBdchZjEeTeAzi9bAHNlezx/QQwAKs0wJEtvQJ 1G7a5M8/fgNRYCbAYTo0pqcTAgmMA15D0cMhRuFJ9ZVAMTHJwP2554gsXMrdAz7VKk9v 1ILMCCf6dUG64IY+16JG9CVlyO37ehnH+iBMH15AvjoB4uflHvlVQKfD/aZWXAcajmVY ighg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mrtbm0wiIbSdcQtkyOcqXjRLVYJhdr7PIdTZnz45XSo=; b=qEOnOrLMFbq/bxOk5KHHEiQdQw6v4JmXg9JuGjxmYu1O8A7GLdbcsiRaXU746ubypx 5ayZm9/Z4cSm0IKLMtirQ0QH8Zds6PCojiQG1SA6xVk4mbUvR9IowW4RlqfTop1fi/GG 4BMZ3Gkru4LGglxd7dx+zhJSBGbfETc6pVKWcbAikoqNTIN1WM1UUKIRQtzU4MWAUoLV EkJeUS9wkIYiyBI2693opHcnXln0Rq4EN3OZq3pOh9hhN6gH3OiNk9HRcGOxjy9jDU6g T4AzbHEWfFAs9lu43lGvfbBzZuKXatn6q+hhUnaPCd/48ghUPU6m8cOtKA/jUWg1re4h JpRw== X-Gm-Message-State: AKS2vOyHFU7wl8Kt5RJZaWodlVODDoUe+SbWkIZDx2UgBVsixPDqXncX VQWWljzQ34HIypcSXmA= X-Received: by 10.28.68.66 with SMTP id r63mr20824171wma.120.1499238924356; Wed, 05 Jul 2017 00:15:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:32 +0200 Message-Id: <1499238885-26161-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 29/42] tcg: make tcg_allowed global 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Change the tcg_enabled() and make sure user build still enable tcg even x86 softmmu disable tcg. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- accel/tcg/cpu-exec-common.c | 2 ++ accel/tcg/tcg-all.c | 1 - accel/tcg/translate-all.c | 6 +----- include/qemu-common.h | 7 ++++++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index e81da27..5b4ae54 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -23,6 +23,8 @@ #include "exec/exec-all.h" #include "exec/memory-internal.h" =20 +bool tcg_allowed; + /* exit the current TB, but without causing any exception to be raised */ void cpu_loop_exit_noexc(CPUState *cpu) { diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index c1ccad3..56dbb56 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -33,7 +33,6 @@ #include "qemu/main-loop.h" =20 unsigned long tcg_tb_size; -static bool tcg_allowed =3D true; =20 #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 4fda383..f768681 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -784,6 +784,7 @@ static void tb_htable_init(void) size. */ void tcg_exec_init(unsigned long tb_size) { + tcg_allowed =3D true; cpu_gen_init(); page_init(); tb_htable_init(); @@ -795,11 +796,6 @@ void tcg_exec_init(unsigned long tb_size) #endif } =20 -bool tcg_enabled(void) -{ - return tcg_ctx.code_gen_buffer !=3D NULL; -} - /* * Allocate a new translation block. Flush the translation buffer if * too many translation blocks or too much generated code. diff --git a/include/qemu-common.h b/include/qemu-common.h index 387ef52..b5adbfa 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -76,8 +76,13 @@ int qemu_openpty_raw(int *aslave, char *pty_name); sendto(sockfd, buf, len, flags, destaddr, addrlen) #endif =20 +extern bool tcg_allowed; void tcg_exec_init(unsigned long tb_size); -bool tcg_enabled(void); +#ifdef CONFIG_TCG +#define tcg_enabled() (tcg_allowed) +#else +#define tcg_enabled() 0 +#endif =20 void cpu_exec_init_all(void); void cpu_exec_step_atomic(CPUState *cpu); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240234122956.6292683224632; Wed, 5 Jul 2017 00:37:14 -0700 (PDT) Received: from localhost ([::1]:44587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSes5-0008UE-1X for importer@patchew.org; Wed, 05 Jul 2017 03:37:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX4-0004xk-C6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX0-0007oq-OD for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX0-0007oX-Gr for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:26 -0400 Received: by mail-wm0-x244.google.com with SMTP id u23so30504140wma.2 for ; Wed, 05 Jul 2017 00:15:26 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=5hLAIIGQ2/HTXxRgc8Tz+SgopmNwnaaVTbmcUG6ik64=; b=bXhx15NyGFRZFT+GV8yKHFj1HlmyxR/rjiRdWW/1rqEaHj3UyqVoL5kldWs3Kg81o6 NhFFuSwudliyVsqWJd0nYP+fQWpdDWk4b+IcwKk0k6P0plxfkUCrmULcOgKxw2m6xwfx 57IDSjfvvaGG+e41S0TsiFECuRkQi/ymv9BXrA/qCWsij2yV2xNGEasAMN9Ai+KiLTnA 3xgo7+WGXm5dx/iakE1dH57lFPaAlnvRE7QEmWriWwuoEVIXun+TIxglnC5Cc0IP/K5T Bh5l2N6ck2I94ZdaAdsspyCKuOKOXGS2w19ppvYboFrpgPo8Vxy+fim00AZDWcdbXNXE c/FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=5hLAIIGQ2/HTXxRgc8Tz+SgopmNwnaaVTbmcUG6ik64=; b=t5hKYzedAA9k4PbFRkz7ugGTijmtedaviWLRBiUgO24WA1LHJGU+kIFGm4fx4pjTE0 49cXa202Unq8IGheOxFY75coj4YtAB1p7mBjliPxqs2G8GV9ZzGTNrFdOV4kYASTnkAw qJ7OoGlKArXDvxlLhdC+u9py1wrWl2vLHgNNkSwQuS1ZUgnZ84WWJTJ5UKpnAeh1/F1K Sf6ycoLFJ05RdOEHXB3HMceXJ5ADHdxsf7Fz4F7IpBk6Gx3Je0mVCvEJastzeqncfn3H RDqOy2riYm+uw2ZTx9/HI1ZmS31q4OuWziA7+R8T/ObBFZIH9i+OHo5PGLuc0RYBPc9k 9PAw== X-Gm-Message-State: AIVw11095RTnslIKyL6bkBLXA7xiAXCmABShCe89n1Alok5aIiij9fEe wSfIVhWDhKRPmPplynU= X-Received: by 10.28.145.12 with SMTP id t12mr127866wmd.107.1499238925345; Wed, 05 Jul 2017 00:15:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:33 +0200 Message-Id: <1499238885-26161-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 30/42] monitor: disable "info jit" and "info opcount" if !TCG 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- accel/tcg/translate-all.c | 5 +++++ hmp-commands-info.hx | 4 ++++ monitor.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index f768681..dfb9f0d 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1851,6 +1851,11 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fp= rintf) =20 tb_lock(); =20 + if (!tcg_enabled()) { + cpu_fprintf(f, "TCG not enabled\n"); + return; + } + target_code_size =3D 0; max_target_code_size =3D 0; cross_page =3D 0; diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ba98e58..07500ef 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -261,6 +261,7 @@ STEXI Show memory tree. ETEXI =20 +#if defined(CONFIG_TCG) { .name =3D "jit", .args_type =3D "", @@ -268,6 +269,7 @@ ETEXI .help =3D "show dynamic compiler info", .cmd =3D hmp_info_jit, }, +#endif =20 STEXI @item info jit @@ -275,6 +277,7 @@ STEXI Show dynamic compiler info. ETEXI =20 +#if defined(CONFIG_TCG) { .name =3D "opcount", .args_type =3D "", @@ -282,6 +285,7 @@ ETEXI .help =3D "show dynamic compiler opcode counters", .cmd =3D hmp_info_opcount, }, +#endif =20 STEXI @item info opcount diff --git a/monitor.c b/monitor.c index 4031876..d8ac20f 100644 --- a/monitor.c +++ b/monitor.c @@ -1098,6 +1098,7 @@ static void hmp_info_registers(Monitor *mon, const QD= ict *qdict) } } =20 +#ifdef CONFIG_TCG static void hmp_info_jit(Monitor *mon, const QDict *qdict) { if (!tcg_enabled()) { @@ -1113,6 +1114,7 @@ static void hmp_info_opcount(Monitor *mon, const QDic= t *qdict) { dump_opcount_info((FILE *)mon, monitor_fprintf); } +#endif =20 static void hmp_info_history(Monitor *mon, const QDict *qdict) { --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149923990769580.13471308203907; Wed, 5 Jul 2017 00:31:47 -0700 (PDT) Received: from localhost ([::1]:44560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSemn-0003SE-9H for importer@patchew.org; Wed, 05 Jul 2017 03:31:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX4-0004xj-C0 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX1-0007pM-K6 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX1-0007p2-EU for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:27 -0400 Received: by mail-wr0-x243.google.com with SMTP id 77so49088179wrb.3 for ; Wed, 05 Jul 2017 00:15:27 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=kMS7WBjucsljnD/dbwvMIt+udsARuLnGkSsPYUZsHfc=; b=H/7mGg67b5ZPEbVm32xlzDGjo+LSyK9r1PJTKBUnIx/Cc0SnsrX9U0u5i2eFf2KvKj ZXCF0BEz/SNyL9O1m7RrVWnFNYYdD5/IB+2mZ331lI2ox0BDulnLdZ436kqrVuXqpfBv NVFlKxvG4Lig9bAPTkQkTiMNZ5qXpg4avy+TltowtXPeUpC4hfkoAn4VKoMXrbDXD2+p LjMkCzlIzCaTuOznpimeOkb2iNFmVjHNQDm75D549PLtyLZT1IgnU4cNLPDjvALCJdPx 1HjRTprXu1YwxsYt/+IhmnWjAeC0MC/Q33n5HbUw4dH71tK3+2s6iCUBRbgQ05zBzcHf QrGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=kMS7WBjucsljnD/dbwvMIt+udsARuLnGkSsPYUZsHfc=; b=I8HmnM3BL7y1BXz7h5SF34ku7Ffia2QpHP7kXU9Lmv/D6MDzmyw8MLjlD7lt6DasN1 FvlT9c86k7bjWxegyyJ9yVVPzZxZtRDkzjRza+Ud9Sf0q/W0UjKyhCE1x++E9sw21COd tqTh9ezfT+hiNtntAzxjjCEGJdJnQ7PZhQPHiq9/QODUYhOMX7EVANEO2YIwiTNH6Jm7 dY36DRMg3WRvuiJCqyGnsnVKpwkj1oKO27mz/qIqVvt4YXRGUvRY5wC8z/gRJXrY9i8z jC0X9zAsx0CJ/V7LhQ7q0J8OHgYcSAEVY7/V6ojoX4BBFxemSNnK7pU3j7cjD260zRtV 0Yvg== X-Gm-Message-State: AKS2vOyJPsvRTnU3sxqob0sCRKucH9z3h+Hlnt49j8ijSGj4l3XBRtMr uoeZuOohMzMHpA4NCMU= X-Received: by 10.223.133.211 with SMTP id 19mr43538491wru.27.1499238926313; Wed, 05 Jul 2017 00:15:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:34 +0200 Message-Id: <1499238885-26161-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 31/42] vapic: use tcg_enabled 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- hw/i386/kvmvapic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 82a4955..0d9ef77 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -410,7 +410,8 @@ static void patch_instruction(VAPICROMState *s, X86CPU = *cpu, target_ulong ip) handlers =3D &s->rom_state.mp; } =20 - if (!kvm_enabled()) { + if (tcg_enabled()) { + cpu_restore_state(cs, cs->mem_io_pc); cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, ¤t_flags); /* Account this instruction, because we will exit the tb. @@ -456,7 +457,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU = *cpu, target_ulong ip) =20 resume_all_vcpus(); =20 - if (!kvm_enabled()) { + if (tcg_enabled()) { /* Both tb_lock and iothread_mutex will be reset when * longjmps back into the cpu_exec loop. */ tb_lock(); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240073922412.39020507047655; Wed, 5 Jul 2017 00:34:33 -0700 (PDT) Received: from localhost ([::1]:44570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSepS-0006Bb-Fe for importer@patchew.org; Wed, 05 Jul 2017 03:34:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX4-0004xl-Bv for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX2-0007qU-Tx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX2-0007pd-Nt for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:28 -0400 Received: by mail-wm0-x241.google.com with SMTP id j85so30448883wmj.0 for ; Wed, 05 Jul 2017 00:15:28 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=m4P4pffAz2ucw1wUV0HkXbEwLvlDKqXHKDfQZrt0OM0=; b=gTF9pTVt+zKmUgj2U/44Ylmc0UScnl7mdXDb5MYr1Ig6Mpjbpwe6UPrhlcExy1oOet z1XspJVNF89ioAoTGToT1x2CdGMSviBQ36GOUoKSFg47jTzu0+P+CviXoR3TGff0Yxrz XRJ2r6AtWBSTfqi1j5MP/ikZ1Bmnkkpd18pUH63lw58IexKXCBSSKR6mZTvenYrZ9VeV uA+OqI9kBz35vD/FyKFi/eLsJe1kCzSb9DbMvP93ZonEWKUu28mo+1LQg50CiqVRrbXg uxdjVa8Ys/X9dX6ixzutgjQjYUfhjsEVOpREkH/tC6ZOcjowtdQjkufnV28rCVrfnYUy A+dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=m4P4pffAz2ucw1wUV0HkXbEwLvlDKqXHKDfQZrt0OM0=; b=PCCYu2l93CeH2Mf9JsKZHRGQFB2jhFzPVSIc3RwH9vbjOEdDDeBydxCMfRr9rd5iBR cBWEcOKExtx97CBBCYTA9iV04arrbNfXSRK6JP58qMwkxQyMsCUI/Xq8AGkxYZzbcVPr hksEncsk/G+KE+a9hWmHx9pS12ZyhomOw+Jr1iUSEoSYFPVBNoxs++VdL7rn/RGDzcSm kRMEnOIQr7/5PhvLW8r4DxepFNlSRwshjKFLoAZHYHXvK0e8RWL3urA4DNrvsxm6rSJ4 dX0bdG/rUJAYQBRmML/Ztk50MRCzFYHvN6xyBzQ07Uvm4EmZkQ+DD8F8yLVycyS0BBX3 a6gA== X-Gm-Message-State: AKS2vOw8bQFGJNG0Gj+y9yaWJo5ZRFJv3PA3W3f1zq/v6hX0u4CXGi3+ 36g19J8eVkHhywBA9xU= X-Received: by 10.28.229.209 with SMTP id c200mr26560077wmh.43.1499238927579; Wed, 05 Jul 2017 00:15:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:35 +0200 Message-Id: <1499238885-26161-33-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 32/42] tcg: add the tcg-stub.c file into accel/stubs/ 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong If tcg is disabled, the functions in tcg-stub.c file will be called. This file is target-independent file, do not include any platform related stub functions into this file. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- accel/stubs/Makefile.objs | 1 + accel/stubs/tcg-stub.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 accel/stubs/tcg-stub.c diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs index bd5794f..fdfbf73 100644 --- a/accel/stubs/Makefile.objs +++ b/accel/stubs/Makefile.objs @@ -1 +1,2 @@ obj-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o +obj-$(call lnot,$(CONFIG_TCG)) +=3D tcg-stub.o diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c new file mode 100644 index 0000000..5dd480b --- /dev/null +++ b/accel/stubs/tcg-stub.c @@ -0,0 +1,22 @@ +/* + * QEMU TCG accelerator stub + * + * Copyright Red Hat, Inc. 2013 + * + * Author: Paolo Bonzini + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "tcg/tcg.h" +#include "exec/cpu-common.h" +#include "exec/exec-all.h" + +void tb_flush(CPUState *cpu) +{ +} --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149924022533258.00704297296977; Wed, 5 Jul 2017 00:37:05 -0700 (PDT) Received: from localhost ([::1]:44585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dServ-0008Ml-H0 for importer@patchew.org; Wed, 05 Jul 2017 03:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX4-0004yR-Sx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX4-0007r3-0e for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:32808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX3-0007qa-QM for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:29 -0400 Received: by mail-wr0-x241.google.com with SMTP id x23so49173673wrb.0 for ; Wed, 05 Jul 2017 00:15:29 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=Ex2DPmJmRoBpcEzb8KdU3KCNwWWorF93AR6SYasqLsw=; b=sCyhZn1McEcDHlM0USSSOJbaaVrXTgpxf2YM3xb8cYKWCDEuaXYxFXm1hFcF4OeuZ2 C4/+ibqZJHdurKwSWWAepxQ2dvYxf0hDt8okuWIm1UwSLejZU7wPsnQ2gK1XSVdmk6gP 3P8We+zvnRPbeJc7lIIHC5xpEQQbv7Ic9XYDsICzw0JsqNZa7hatW8KeB6cJoCb7VV3X oi/83fiFE1VQv5xezHCmeiySTYKfJAsgg7nnEoVxObw0RXx1pdjLLXE+XMSgnxHa1XIO xQeFJ7DiikjK2TCdfTbiJmM4/ATJHCzezabCaFKgI4pUVA7TzksqDZnJAJQzKUoEKuRq Y48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=Ex2DPmJmRoBpcEzb8KdU3KCNwWWorF93AR6SYasqLsw=; b=jarjf2g9v4y1H/ScwTKZrQZB0TOKEIp4tNlr7UmoQU7WK1e91LdCy8Hu5D1jFo658j tGmiM9rP0RnSRv1ewEe6ws+9f6ghSIDDFxvnaztqDqNLXjtE3yYIuQpA3zwNc+KVJo+C eMzFqz7fFjrgf60RM7NXsGl2eBgvdJyo9O+34qO6JnhBhwCeNFrYbLxaCE19KT6fpkzr Hjqolrwhuk1n8iqJvDvz1RsNaBIPZlr5ofQkI/eUDSGYksz7RfLbcfgHDAgeG/cLImnM Hj45j5nBPnQ4xURSa8oAgoVFysgjV9CV0MtnxMfdCBrDRt1S0xt2IwwEhlSjrb5IXDEA vh/Q== X-Gm-Message-State: AKS2vOwkvJFIKZZXwogiPk6CR2OaciB+5m2DnYqwgTBl22YHANsGU5s3 CgXm9axHsMy1RENeIoo= X-Received: by 10.223.161.219 with SMTP id v27mr38095936wrv.135.1499238928593; Wed, 05 Jul 2017 00:15:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:36 +0200 Message-Id: <1499238885-26161-34-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 33/42] tcg: move tb_lock out of translate-all.h 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- bsd-user/main.c | 1 - include/exec/exec-all.h | 4 ++++ tcg/tcg.h | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 04f95dd..fa9c012 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -25,7 +25,6 @@ #include "qemu/config-file.h" #include "qemu/path.h" #include "qemu/help_option.h" -/* For tb_lock */ #include "cpu.h" #include "exec/exec-all.h" #include "tcg.h" diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 724ec73..0b56432 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -467,6 +467,10 @@ extern uintptr_t tci_tb_ptr; smaller than 4 bytes, so we don't worry about special-casing this. */ #define GETPC_ADJ 2 =20 +void tb_lock(void); +void tb_unlock(void); +void tb_lock_reset(void); + #if !defined(CONFIG_USER_ONLY) =20 struct MemoryRegion *iotlb_to_region(CPUState *cpu, diff --git a/tcg/tcg.h b/tcg/tcg.h index 9e37722..da78721 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -757,10 +757,6 @@ void *tcg_malloc_internal(TCGContext *s, int size); void tcg_pool_reset(TCGContext *s); TranslationBlock *tcg_tb_alloc(TCGContext *s); =20 -void tb_lock(void); -void tb_unlock(void); -void tb_lock_reset(void); - /* Called with tb_lock held. */ static inline void *tcg_malloc(int size) { --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240370659136.44183734437922; Wed, 5 Jul 2017 00:39:30 -0700 (PDT) Received: from localhost ([::1]:44595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeuH-0002AR-Ew for importer@patchew.org; Wed, 05 Jul 2017 03:39:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX5-0004zU-MC for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX4-0007ro-QD for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:31 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:32809) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX4-0007r7-Ku for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:30 -0400 Received: by mail-wr0-x243.google.com with SMTP id x23so49173699wrb.0 for ; Wed, 05 Jul 2017 00:15:30 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=uY8b1+PsQay1HxMJulvbKsNHUBC91JB9HVcxSfUv8ac=; b=ISeZ0It5ZmjDEyDcVsTFlhmXFXLHHoQ9Hk1BHYYUpSEq+kZEfEvNVwm0HXbPi9aFza efxjzE5d9q2ZzAGdtXRGS49HpsfG2hnL0HrnkdEVIShPEVQKMhK3sznmJ66xMKJtwDOp zyLuDZcUIpT58xnuO5aH6R3ywilhxEwrm1NEZWIcTHjpHgdDsS41LSih0kWth5kBcmtg xA+TMGIe3FVzYIZNgimw2kh5tFp1YACoU2jKloSBBpsT3TA/bPAZf2UB91ziszyHeKUI pa7YAN3R2hDQai2lYdXHNbhzFx0F0Gbh/z16T/+Hn1lCgv7ZsF9yjdsbIXTum6sDLz6y Ta7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=uY8b1+PsQay1HxMJulvbKsNHUBC91JB9HVcxSfUv8ac=; b=htr1jFLac6PzQZNmMR7CnQxXPsHNjE7I1pCrWrPh4+pmW6gtjRVu6wOf/gpJ8rBfQo 5um+6pUM8QWjdCFyFUyGN9G/x5svnhwp2nsl0jzXY1IgUIBfnZiFqQ1JR5ZlC+t2aC0k 4P203J8G/9IdcfHLBk2NoWPiHoHKNCIKVtZ22dbQ7e0igQXHaweDmRyJXSkPAX4GMS57 GU1KYvZzT/LMs3QoiK5jyGDQxnsFkpeK1Q/McAadg4oZNwe0bf4lRKxk8oM2qb2LGkv1 ayjEULuQp4WCTdRb1VM7tk4HpDIIfUs67O+/LxoXskjytCJfs6M6Od0fSv2V/TFf+goh kA7Q== X-Gm-Message-State: AKS2vOzCYOISm5MDIuGZnlJa9LgMbbMj/jhdAO/l7gnVJIlP/OMyB6SH OSvxouPnNSXnL7mkwBk= X-Received: by 10.223.136.109 with SMTP id e42mr36747914wre.81.1499238929542; Wed, 05 Jul 2017 00:15:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:37 +0200 Message-Id: <1499238885-26161-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 34/42] exec: elide calls to tb_lock and tb_unlock 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Adding assertions fixes link errors. Signed-off-by: Paolo Bonzini --- exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exec.c b/exec.c index ee61915..a083ff8 100644 --- a/exec.c +++ b/exec.c @@ -2317,6 +2317,7 @@ static void notdirty_mem_write(void *opaque, hwaddr r= am_addr, { bool locked =3D false; =20 + assert(tcg_enabled()); if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) { locked =3D true; tb_lock(); @@ -2375,6 +2376,7 @@ static void check_watchpoint(int offset, int len, Mem= TxAttrs attrs, int flags) CPUWatchpoint *wp; uint32_t cpu_flags; =20 + assert(tcg_enabled()); if (cpu->watchpoint_hit) { /* We re-entered the check after replacing the TB. Now raise * the debug interrupt so that is will trigger after the @@ -2820,6 +2822,7 @@ static void invalidate_and_set_dirty(MemoryRegion *mr= , hwaddr addr, cpu_physical_memory_range_includes_clean(addr, length, dirty_l= og_mask); } if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) { + assert(tcg_enabled()); tb_lock(); tb_invalidate_phys_range(addr, addr + length); tb_unlock(); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240638240507.78341282805934; Wed, 5 Jul 2017 00:43:58 -0700 (PDT) Received: from localhost ([::1]:44623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeyb-0006hF-3p for importer@patchew.org; Wed, 05 Jul 2017 03:43:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX7-000512-6I for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX6-0007sh-3z for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:33 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:34290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX5-0007sA-Ti for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:32 -0400 Received: by mail-wr0-x243.google.com with SMTP id k67so48981001wrc.1 for ; Wed, 05 Jul 2017 00:15:31 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Sr95e7HAd6MkPa4TYjC2QbWYmgexT0idY7ORHR/2Fc=; b=bD9drV5LIooRLvH5P8+MpuQrXCMVG4hB0/yVukomcEULh4uU7WdRIY/Qrdm2xmrjBv 9nLF1Ygw5QU6SjUY8kkIW6+1QB1tf+aAjosp+rIrT/tive5AKdBsT4hmy3oBv+0f8Aun Bb9kpDYkAgSh0zLXu9miBWK7FIA3a6iZ4Ee/UpnM283qs2DC+vAn7ZBsW9A3zM//VGTX N8Q83/JACDSWaL9JNay8vkdhc3TBmJsunEFn20M7sFAphA1ncJ6XNn9WR6ZGEofCZRsY M+H/d9gztpj4LxQJMfC2U+RdwPm/kXt+2wk4lX38qKmQNzmHUJEObo847NfYKtizE6me 1pYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7Sr95e7HAd6MkPa4TYjC2QbWYmgexT0idY7ORHR/2Fc=; b=SzBlL86ntUmPgkVKP1ozdi7jFVfXaJ48xqHyOeUeDh++k/VQAfLwyy69YkM/lH/HwH qHI2uUdWde8uSZm5Z5nlnTqUO4b02fFhtlQTpEQ0y69JmsRSVnbw95TLMueWeStYAPSj pn8g/gXXE7Fe2mt52uxjNNLube26zN38z91Tbz9IIY7xGWFCnYPpVMU0wqFA6fcXfYHl r0+9jGIZ7H0bPx6/gcYMUhdZ4ZAEB0tjLPfdBlzS93gCGpPQObxZlwOQ8UTdju7fk7Be o3F4cpuYzAvO9PDS4DfyDDNWoWIUOOL+vyCdxyiopxRsJKo/UUe2qsE0WhesDkZa6y42 0oww== X-Gm-Message-State: AKS2vOwy0c5okqfTNecJjYOSVVU4kA41PIcf82zEC9dHf+SmNsr9KKjv TfDg6pJOCTCOlOsWuS0= X-Received: by 10.223.153.165 with SMTP id y34mr36886145wrb.41.1499238930779; Wed, 05 Jul 2017 00:15:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:38 +0200 Message-Id: <1499238885-26161-36-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 35/42] tcg: add CONFIG_TCG guards in headers 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add CONFIG_TCG around TLB-related functions and structure declarations. Some of these functions are defined in ./accel/tcg/cputlb.c, which will not be linked in if TCG is disabled, and have no stubs; therefore, their callers will also be compiled out for --disable-tcg. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- include/exec/cpu-defs.h | 4 +++- include/exec/exec-all.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 5f4e303..bc8e7f8 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -25,7 +25,9 @@ =20 #include "qemu/host-utils.h" #include "qemu/queue.h" +#ifdef CONFIG_TCG #include "tcg-target.h" +#endif #ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" #endif @@ -54,7 +56,7 @@ typedef uint64_t target_ulong; #error TARGET_LONG_SIZE undefined #endif =20 -#if !defined(CONFIG_USER_ONLY) +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* use a fully associative victim tlb of 8 entries */ #define CPU_VTLB_SIZE 8 =20 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 0b56432..8096d64 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -82,6 +82,9 @@ void cpu_reloading_memory_map(void); * Note that with KVM only one address space is supported. */ void cpu_address_space_init(CPUState *cpu, AddressSpace *as, int asidx); +#endif + +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ /** * tlb_flush_page: --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149924074856684.10621141863453; Wed, 5 Jul 2017 00:45:48 -0700 (PDT) Received: from localhost ([::1]:44640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSf0N-0000BL-9i for importer@patchew.org; Wed, 05 Jul 2017 03:45:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX7-00051d-S3 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX7-0007t9-0k for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:33 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:32812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX6-0007sm-Qq for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:32 -0400 Received: by mail-wr0-x241.google.com with SMTP id x23so49173773wrb.0 for ; Wed, 05 Jul 2017 00:15:32 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=T67GrNM5nV+2W+OjagLFw+XDCc/4Tgr+0Tieey1AUAA=; b=hWYmQMk/CrTVRRq7Y1dWa44A2TuRyPr55aGbqGwSmClS+7Y/mATvf8VGs8gbZEOnT+ Pwnah9y278Zo7jtChLwGvsAW603/sdPQm2WfBMq2fP4r/F/LXULoID102ASxMt3yPUIm I7lsNgVETFDRRP2ivOnRMVHn3rJ9X7zzyr8vAPbJLMGZtGKtp8w5Ct9k7TThBup/B9kX Q+Ag/ofovvlrRidIfnBxkYUEY45q6bfcPmkL2LpHy4ZPsiRX0layiE7aW9uRyryZ42QB CnCoDaAIw1jl9VPI5lIQ8NBWR1+yJo00CEqKzYB1nt3c7DxvBV2ypVWIwUQca9WYdiBV Cdlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=T67GrNM5nV+2W+OjagLFw+XDCc/4Tgr+0Tieey1AUAA=; b=coc7FW22G1SYWfBSBauwUosW1bpWM6p7bLBYNsVtqo8jXhDPOxrsIzS5nwUynLLupc fm2HiyhglJ53d6AXbX/IW2kx0TSTH8h/oTpn1iFmJjNc1MevkZwQVNxRsEKaGR1r5N5X igfgLmTLrOG/qNl+nLhnbcZmSkiJq4L2LtCCmyZhO+pRGItoYkDxWCvkHiOxRpl0anXY /Ggky+AN9eQ/gaoeBeE+CZ+Y/OjL2T4UqlOGMlH37dybR3npLpQcw5/5jOEBELiDE2IS Z3WmIxhQ3V9MkVoVjfNdYyFQT8W2Ud7dAPnXmIao95I6fOH7/kxvqeftqpvgPMw/5Qex QddA== X-Gm-Message-State: AKS2vOzvOMz159aAQH/MMfMoPuG7/iOl7If6DZk1YRo0eLHT3OxDcpAP wKfOV8+cyY13hvuY3fw= X-Received: by 10.223.129.6 with SMTP id 6mr25812756wrm.23.1499238931692; Wed, 05 Jul 2017 00:15:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:39 +0200 Message-Id: <1499238885-26161-37-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 36/42] tcg: add the CONFIG_TCG into Makefiles 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the CONFIG_TCG for frontend and backend's files in the related Makefiles. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- Makefile.target | 4 ++-- accel/Makefile.objs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.target b/Makefile.target index ffa7a8f..2baec92 100644 --- a/Makefile.target +++ b/Makefile.target @@ -90,8 +90,8 @@ all: $(PROGS) stap # cpu emulator library obj-y +=3D exec.o obj-y +=3D accel/ -obj-y +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o -obj-y +=3D tcg/tcg-common.o tcg/tcg-runtime.o +obj-$(CONFIG_TCG) +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o +obj-$(CONFIG_TCG) +=3D tcg/tcg-common.o tcg/tcg-runtime.o obj-$(CONFIG_TCG_INTERPRETER) +=3D tcg/tci.o obj-$(CONFIG_TCG_INTERPRETER) +=3D disas/tci.o obj-y +=3D fpu/softfloat.o diff --git a/accel/Makefile.objs b/accel/Makefile.objs index cd5702f..10666ed 100644 --- a/accel/Makefile.objs +++ b/accel/Makefile.objs @@ -1,4 +1,4 @@ obj-$(CONFIG_SOFTMMU) +=3D accel.o obj-y +=3D kvm/ -obj-y +=3D tcg/ +obj-$(CONFIG_TCG) +=3D tcg/ obj-y +=3D stubs/ --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240131268562.7205811103606; Wed, 5 Jul 2017 00:35:31 -0700 (PDT) Received: from localhost ([::1]:44578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeqO-00071q-Uy for importer@patchew.org; Wed, 05 Jul 2017 03:35:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeX8-000535-Vx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX8-0007uL-01 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:34 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX7-0007tH-PW for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:33 -0400 Received: by mail-wm0-x242.google.com with SMTP id p204so30536215wmg.1 for ; Wed, 05 Jul 2017 00:15:33 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=TXvAuNcgwgxxJBGPvDW90MkfsBvHau0DCDQH/1qh6u8=; b=HaFDAGdHb1/AMq9S9chF38a089Sy4Q3YeU97xj1P8aYtENmtd76EhTaYEd4kcaYLu5 ZIrcxzIc6GskUVAcBmdYqfQ75fesWOlvXkzBAwqF4i1vL/yhc6Eri7QwoODeZdc8QGCc JK3OrBHwVWxGYZjy33A4LfiHFnpSSVigNB0fMTN95G8H2hkLXrhItAwG5p2/ZAgK5RZQ /b53pUunNUkVPlcLENJuCa7vy9Bgdk5Rt/0kZvFVIUXQY7vLShHX7q6k7EFXD93lgY0C v/r0vhWvDcuW3sgcj8JCflL2BcjAUBKU0d3lLNp/WOfMQLuFvn3AmD4PSdiIai59HFQi uo6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=TXvAuNcgwgxxJBGPvDW90MkfsBvHau0DCDQH/1qh6u8=; b=WfEZCdMJTTevPrWH1F7SwGlnI4yBYta9ibANnzVzXUo3XS6t/wqkjsySaAsJ2H8plq RJku/MeXMmInw0wLUDplVCPexO79wA4B8yV6CsEwqJSqxht+GLsblwOl7OxKamqggaPe bMQhoy21m8dChOyLE/1XvTg5I2/JwS1DQDlCVzzgFNfB/H3aF8gwc1cWBBuOBvxJ9L6F NvoWODppj75QzRp5IqxB6gb1FKcYCIodz1DH1JMJfhfSNv2IIxgIr1o6J4rjvQ9A3jrL b3KVnbu/sgRp3A5v/H+M/rQ66WMMxZ/tOg3nEajqeUPArZLDzVHIrkuE6cvybmhIjXdY Ct0A== X-Gm-Message-State: AIVw113BU7MxWRGUa6TZlGLIBDtpbZ37mqKS0dKh71jbxItYstzHA+RN 5rxnehnr6KxDa15clhU= X-Received: by 10.28.7.18 with SMTP id 18mr11005967wmh.20.1499238932664; Wed, 05 Jul 2017 00:15:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:40 +0200 Message-Id: <1499238885-26161-38-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 37/42] target/i386: move cpu_sync_bndcs_hflags() function 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Move cpu_sync_bndcs_hflags() function from mpx_helper.c to helper.c because mpx_helper.c need be disabled when tcg is disabled. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- target/i386/helper.c | 30 ++++++++++++++++++++++++++++++ target/i386/mpx_helper.c | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index ef05059..4d584b5 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -29,6 +29,36 @@ #include "hw/i386/apic_internal.h" #endif =20 +void cpu_sync_bndcs_hflags(CPUX86State *env) +{ + uint32_t hflags =3D env->hflags; + uint32_t hflags2 =3D env->hflags2; + uint32_t bndcsr; + + if ((hflags & HF_CPL_MASK) =3D=3D 3) { + bndcsr =3D env->bndcs_regs.cfgu; + } else { + bndcsr =3D env->msr_bndcfgs; + } + + if ((env->cr[4] & CR4_OSXSAVE_MASK) + && (env->xcr0 & XSTATE_BNDCSR_MASK) + && (bndcsr & BNDCFG_ENABLE)) { + hflags |=3D HF_MPX_EN_MASK; + } else { + hflags &=3D ~HF_MPX_EN_MASK; + } + + if (bndcsr & BNDCFG_BNDPRESERVE) { + hflags2 |=3D HF2_MPX_PR_MASK; + } else { + hflags2 &=3D ~HF2_MPX_PR_MASK; + } + + env->hflags =3D hflags; + env->hflags2 =3D hflags2; +} + static void cpu_x86_version(CPUX86State *env, int *family, int *model) { int cpuver =3D env->cpuid_version; diff --git a/target/i386/mpx_helper.c b/target/i386/mpx_helper.c index 7e44820..ade5d24 100644 --- a/target/i386/mpx_helper.c +++ b/target/i386/mpx_helper.c @@ -24,36 +24,6 @@ #include "exec/exec-all.h" =20 =20 -void cpu_sync_bndcs_hflags(CPUX86State *env) -{ - uint32_t hflags =3D env->hflags; - uint32_t hflags2 =3D env->hflags2; - uint32_t bndcsr; - - if ((hflags & HF_CPL_MASK) =3D=3D 3) { - bndcsr =3D env->bndcs_regs.cfgu; - } else { - bndcsr =3D env->msr_bndcfgs; - } - - if ((env->cr[4] & CR4_OSXSAVE_MASK) - && (env->xcr0 & XSTATE_BNDCSR_MASK) - && (bndcsr & BNDCFG_ENABLE)) { - hflags |=3D HF_MPX_EN_MASK; - } else { - hflags &=3D ~HF_MPX_EN_MASK; - } - - if (bndcsr & BNDCFG_BNDPRESERVE) { - hflags2 |=3D HF2_MPX_PR_MASK; - } else { - hflags2 &=3D ~HF2_MPX_PR_MASK; - } - - env->hflags =3D hflags; - env->hflags2 =3D hflags2; -} - void helper_bndck(CPUX86State *env, uint32_t fail) { if (unlikely(fail)) { --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240515178453.62390767404725; Wed, 5 Jul 2017 00:41:55 -0700 (PDT) Received: from localhost ([::1]:44611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSewb-0004qA-UU for importer@patchew.org; Wed, 05 Jul 2017 03:41:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeXA-00054n-5f for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeX9-0007wk-58 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:36 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:35912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeX8-0007uj-Uc for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:35 -0400 Received: by mail-wr0-x242.google.com with SMTP id 77so49088394wrb.3 for ; Wed, 05 Jul 2017 00:15:34 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1YWVu8t2x0HGh43WK51jgINtsgyH/VH5eKsUAVUhM3Q=; b=YcJq/vezvCqcNUxGUXTSMKI1B02I5hZBE/2OAAVtAqQAMlcCMmLQtoK4fAyyW+Bksx T49224GV6ESEh+86fW1t0MGM8RCnOQ9W3DD2Vv4pkuJiXeWsv+PfPXXupyURdh5FV1m4 tOfNwRGBe/BLraR2TtNVfRCVMAZ+fI+dX9oEtbzp+36qA6JDKIzhUWR0FM3s5PDW5Lb+ E0W9jzsZ2EjxRxTnzuw3OcqGwXJBom64A/iReN37IAyl7SS+gBGH3M8XicIQ0tjXHOgC xItLZ9rc7EkxdWAgdlGAcg7HUnAlwo7bL6olFp2Y+4+XhfbsceEphfhkAh1VjyS5fXqq W4lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1YWVu8t2x0HGh43WK51jgINtsgyH/VH5eKsUAVUhM3Q=; b=Hm4seehia7pYfuObvXhRROqcY7AZ3VA4FYGi4pgqEUrbxhUOcAV9RAf/YQ0iNtffqe cXsRnwzuCsJ50S1hwtgMy2qvzW6zbvEwNy3cOLPDDcLHGFoGj+ACeTGfdjbOwrP79sLS +GmK8wF0rosXo0lp3IthIKERHNa3OWBBxugJ+W2j4/66EdXVuuVlr9jbH9xSRyRGhR69 O26yvpPK1emvq45UN03Vea5evecDp/oHPRR288PR6A/adb87d9zJnMGsWu4dxK1H0EV2 r+XbMMtKJsNIufw2bvMcs0cGtHVb+UHYL+KsRadU5UXd2twMvtiFH4+BD6TYYtYn6juN Ezqw== X-Gm-Message-State: AKS2vOx3KIgnuHJl0C7E2Hfn6F+FENUS+6F18uktKJJIOj9ADFF6qLAR GRTyr6/XTjcgGxlrL5o= X-Received: by 10.223.164.80 with SMTP id e16mr40598660wra.24.1499238933855; Wed, 05 Jul 2017 00:15:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:41 +0200 Message-Id: <1499238885-26161-39-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 38/42] target/i386: make cpu_get_fp80()/cpu_set_fp80() static 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Move cpu_get_fp80()/cpu_set_fp80() from fpu_helper.c to machine.c because fpu_helper.c will be disabled if tcg is disabled in the build. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 -- target/i386/fpu_helper.c | 18 ------------------ target/i386/machine.c | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c5e143e..8d9ba36 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1418,8 +1418,6 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigne= d int selector, =20 /* op_helper.c */ /* used for debug or cpu save/restore */ -void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f); -floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper); =20 /* cpu-exec.c */ /* the following helpers are only usable in user mode simulation as diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c index 69ea33a..34fb5fc 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -1539,24 +1539,6 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, u= int64_t mask) raise_exception_ra(env, EXCP0D_GPF, GETPC()); } =20 -void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f) -{ - CPU_LDoubleU temp; - - temp.d =3D f; - *pmant =3D temp.l.lower; - *pexp =3D temp.l.upper; -} - -floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper) -{ - CPU_LDoubleU temp; - - temp.l.upper =3D upper; - temp.l.lower =3D mant; - return temp.d; -} - /* MMX/SSE */ /* XXX: optimize by storing fptt and fptags in the static cpu state */ =20 diff --git a/target/i386/machine.c b/target/i386/machine.c index 8c7a822..53587ae 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -142,6 +142,24 @@ typedef struct x86_FPReg_tmp { uint16_t tmp_exp; } x86_FPReg_tmp; =20 +static void cpu_get_fp80(uint64_t *pmant, uint16_t *pexp, floatx80 f) +{ + CPU_LDoubleU temp; + + temp.d =3D f; + *pmant =3D temp.l.lower; + *pexp =3D temp.l.upper; +} + +static floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper) +{ + CPU_LDoubleU temp; + + temp.l.upper =3D upper; + temp.l.lower =3D mant; + return temp.d; +} + static void fpreg_pre_save(void *opaque) { x86_FPReg_tmp *tmp =3D opaque; --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240557718565.2954661838436; Wed, 5 Jul 2017 00:42:37 -0700 (PDT) Received: from localhost ([::1]:44613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSexI-0005Ne-2h for importer@patchew.org; Wed, 05 Jul 2017 03:42:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeXF-00059L-7W for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeXA-0007zG-KX for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:41 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35861) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeXA-0007xY-7W for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:36 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so30409698wmh.3 for ; Wed, 05 Jul 2017 00:15:36 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1IhOkGMi82nj2iCX7wsVrBQTBd/htwYmHPa6bNpA3d4=; b=hUaIF7xZUUZNHaDBCIRumUlqfI5yMsleUfsTphwIGdwhfvZ/psGhzsWwU+1+WgaKWK +dSMf6eZVOE2EhA9QpqzXP28PAl5XdVftzHjcNApaug09BoZEKa89w46aKt41HR9GEhq AsMWxDZtX+jWG8xCKpO9NRRcWxqJAHveFhCK4Vb+3qmzacKhrBs6ZPFz4LpNoDa34dRP w/hjz3Oeyhf94yZld2ljMc8YnZKd/LeUuWbnijD+OlDncZrS99EBAyvfLvfCaATL/7gl VvSGM/NINO777x8urv7Fddkfb0Udkt3Xjxm92X0JiRpzpdk4QQrN0adVl4Uy/agianCQ hPHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1IhOkGMi82nj2iCX7wsVrBQTBd/htwYmHPa6bNpA3d4=; b=i9fONA3KDGcW+Ome3oirzwQ9fe8M9gGP8ECO65NfzKOqG0qlthlxIfv4HfBwpHVaPt SObaA++BPdKIN04uZqib29ioFchoZeyxYV7KzxHrjf0IDQW9zPVa8lB+B/HHpFH3B0UI 78DNrY/FmbKnOxp4xRXYPWld64yAq6v6UdrHDOR69hpXOMiRlorjo3gmbzt8zdcuw0uz zfRmFyPsaPikzKXUW10olH7QCN/31eShf8i5H+JB/s9J1MD5QBQjNMWVDjUUUcc5w6D1 Ufy2H7s2AJxzlGD88gfuZbllTDfc4g1cRW9FW1xoDOAAwquKCvhtXMSTORcu/nsq9clq FtGg== X-Gm-Message-State: AIVw1133tz4ux4iStM4dEL1jpVKoD4z/t9Pu5ROwO+eGJ3SnpZwCcewu DA/MnAD0uuumVFjWbgQ= X-Received: by 10.28.23.137 with SMTP id 131mr454634wmx.7.1499238935070; Wed, 05 Jul 2017 00:15:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:42 +0200 Message-Id: <1499238885-26161-40-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 39/42] target/i386: split cpu_set_mxcsr() and make cpu_set_fpuc() inline 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Split the cpu_set_mxcsr() and make cpu_set_fpuc() inline with specific tcg code. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 21 ++++++++++++++++++--- target/i386/fpu_helper.c | 11 ++--------- target/i386/machine.c | 5 ++++- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8d9ba36..3495a91 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1594,7 +1594,6 @@ void QEMU_NORETURN raise_interrupt(CPUX86State *nenv,= int intno, int is_int, /* cc_helper.c */ extern const uint8_t parity_table[256]; uint32_t cpu_cc_compute_all(CPUX86State *env1, int op); -void update_fp_status(CPUX86State *env); =20 static inline uint32_t cpu_compute_eflags(CPUX86State *env) { @@ -1643,8 +1642,24 @@ static inline int32_t x86_get_a20_mask(CPUX86State *= env) } =20 /* fpu_helper.c */ -void cpu_set_mxcsr(CPUX86State *env, uint32_t val); -void cpu_set_fpuc(CPUX86State *env, uint16_t val); +void update_fp_status(CPUX86State *env); +void update_mxcsr_status(CPUX86State *env); + +static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +{ + env->mxcsr =3D mxcsr; + if (tcg_enabled()) { + update_mxcsr_status(env); + } +} + +static inline void cpu_set_fpuc(CPUX86State *env, uint16_t fpuc) +{ + env->fpuc =3D fpuc; + if (tcg_enabled()) { + update_fp_status(env); + } +} =20 /* mem_helper.c */ void helper_lock_init(void); diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c index 34fb5fc..9014b6f 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -1550,12 +1550,11 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, = uint64_t mask) #define SSE_RC_CHOP 0x6000 #define SSE_FZ 0x8000 =20 -void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) +void update_mxcsr_status(CPUX86State *env) { + uint32_t mxcsr =3D env->mxcsr; int rnd_type; =20 - env->mxcsr =3D mxcsr; - /* set rounding mode */ switch (mxcsr & SSE_RC_MASK) { default: @@ -1581,12 +1580,6 @@ void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->fp_status); } =20 -void cpu_set_fpuc(CPUX86State *env, uint16_t val) -{ - env->fpuc =3D val; - update_fp_status(env); -} - void helper_ldmxcsr(CPUX86State *env, uint32_t val) { cpu_set_mxcsr(env, val); diff --git a/target/i386/machine.c b/target/i386/machine.c index 53587ae..e0417fe 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -280,7 +280,10 @@ static int cpu_post_load(void *opaque, int version_id) for(i =3D 0; i < 8; i++) { env->fptags[i] =3D (env->fptag_vmstate >> i) & 1; } - update_fp_status(env); + if (tcg_enabled()) { + update_fp_status(env); + update_mxcsr_status(env); + } =20 cpu_breakpoint_remove_all(cs, BP_CPU); cpu_watchpoint_remove_all(cs, BP_CPU); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240681013706.9219324996474; Wed, 5 Jul 2017 00:44:41 -0700 (PDT) Received: from localhost ([::1]:44626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSezF-0007dD-Ke for importer@patchew.org; Wed, 05 Jul 2017 03:44:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeXF-00059N-8E for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeXC-00080d-Nm for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:41 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:38546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeXC-000803-C9 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:38 -0400 Received: by mail-wm0-x22f.google.com with SMTP id f67so102829050wmh.1 for ; Wed, 05 Jul 2017 00:15:38 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=479NudqirQPMKn66U7/+sq9S2AOHKqVw+Rfp6U0b/zc=; b=LOjvytQ9FY0GG3EFdLoA13CcJDcdCdTH4oiTcA8OHTPnpcMzfLffxT9SrBAKTh3792 cppimpdNmSvxtFNFNOupFf/R/Vp4SCRidngda1zw+/z/Ztvd65nBXV1USa3AhFT8tNAG oIV1abTRb7lE6dGwMTwY8t42vFyidSfYtL4XaAArQke4HplzaYaCVHxhp6TF17ST8As7 8waKzzzeuzmFT0a/k/ORc+MKXOpV4vnFHS+RPrE4E6xGv3ATJ+7dpCQgNHwNad3IirrB 882BZBcm/HX5CuMPrjQdy7yep9pdRTxYfeknlQ4iDTI5qjc8rJAPkaLXEPXYwmBwTIBw HgPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=479NudqirQPMKn66U7/+sq9S2AOHKqVw+Rfp6U0b/zc=; b=IuIp/SBlW2QuGKbzAKZxZDqnWdtWhb5whcF/eEwBAa1lKh9XWUDJJJLH1geE7L5Hsl ToyU6TyCP6WkJr2BRPoVqyDRBQlClSRnEOld3P73UtGOYpLBSAp2YAR5Ad7pbfjLT4vo w1nJlXVoa6b870hwaMgrLXQsPSz60YB6cRbHKJ1yNGOSupbOgfN6Pv+1lzvuqqTK2pmP dmsf34BpTFaM1jXYcRzuCoqO3MQPB2PWh8QD8FUNic0s25jjXkh9Wj+YvmJUk9vjwggI /+SH18IfoZqI8DguigGhj26CiPPpUo2pGm08upPIIUAj75X2umAQzjbXzAtzMR1EGdKx u0rQ== X-Gm-Message-State: AKS2vOyzpBrOTvELvxY6vtO/7yM87qN/LDhMh+bEtN9zwygOKVoGtevQ EcfEt54JGhYaHM26aIs= X-Received: by 10.28.173.10 with SMTP id w10mr29552529wme.98.1499238936415; Wed, 05 Jul 2017 00:15:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:43 +0200 Message-Id: <1499238885-26161-41-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f Subject: [Qemu-devel] [PULL 40/42] target/i386: move TLB refill function out of helper.c 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This function calls tlb_set_page_with_attrs, which is not available when TCG is disabled. Move it to excp_helper.c. Signed-off-by: Paolo Bonzini --- target/i386/excp_helper.c | 343 ++++++++++++++++++++++++++++++++++++++++++= +++ target/i386/helper.c | 344 +-----------------------------------------= ---- 2 files changed, 344 insertions(+), 343 deletions(-) diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c index b769772..cef4449 100644 --- a/target/i386/excp_helper.c +++ b/target/i386/excp_helper.c @@ -136,3 +136,346 @@ void raise_exception_ra(CPUX86State *env, int excepti= on_index, uintptr_t retaddr { raise_interrupt2(env, exception_index, 0, 0, 0, retaddr); } + +#if defined(CONFIG_USER_ONLY) +int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, + int is_write, int mmu_idx) +{ + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + + /* user mode only emulation */ + is_write &=3D 1; + env->cr[2] =3D addr; + env->error_code =3D (is_write << PG_ERROR_W_BIT); + env->error_code |=3D PG_ERROR_U_MASK; + cs->exception_index =3D EXCP0E_PAGE; + env->exception_is_int =3D 0; + env->exception_next_eip =3D -1; + return 1; +} + +#else + +/* return value: + * -1 =3D cannot handle fault + * 0 =3D nothing more to do + * 1 =3D generate PF fault + */ +int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, + int is_write1, int mmu_idx) +{ + X86CPU *cpu =3D X86_CPU(cs); + CPUX86State *env =3D &cpu->env; + uint64_t ptep, pte; + int32_t a20_mask; + target_ulong pde_addr, pte_addr; + int error_code =3D 0; + int is_dirty, prot, page_size, is_write, is_user; + hwaddr paddr; + uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; + uint32_t page_offset; + target_ulong vaddr; + + is_user =3D mmu_idx =3D=3D MMU_USER_IDX; +#if defined(DEBUG_MMU) + printf("MMU fault: addr=3D%" VADDR_PRIx " w=3D%d u=3D%d eip=3D" TARGET= _FMT_lx "\n", + addr, is_write1, is_user, env->eip); +#endif + is_write =3D is_write1 & 1; + + a20_mask =3D x86_get_a20_mask(env); + if (!(env->cr[0] & CR0_PG_MASK)) { + pte =3D addr; +#ifdef TARGET_X86_64 + if (!(env->hflags & HF_LMA_MASK)) { + /* Without long mode we can only address 32bits in real mode */ + pte =3D (uint32_t)pte; + } +#endif + prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + page_size =3D 4096; + goto do_mapping; + } + + if (!(env->efer & MSR_EFER_NXE)) { + rsvd_mask |=3D PG_NX_MASK; + } + + if (env->cr[4] & CR4_PAE_MASK) { + uint64_t pde, pdpe; + target_ulong pdpe_addr; + +#ifdef TARGET_X86_64 + if (env->hflags & HF_LMA_MASK) { + bool la57 =3D env->cr[4] & CR4_LA57_MASK; + uint64_t pml5e_addr, pml5e; + uint64_t pml4e_addr, pml4e; + int32_t sext; + + /* test virtual address sign extension */ + sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; + if (sext !=3D 0 && sext !=3D -1) { + env->error_code =3D 0; + cs->exception_index =3D EXCP0D_GPF; + return 1; + } + + if (la57) { + pml5e_addr =3D ((env->cr[3] & ~0xfff) + + (((addr >> 48) & 0x1ff) << 3)) & a20_mask; + pml5e =3D x86_ldq_phys(cs, pml5e_addr); + if (!(pml5e & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pml5e & (rsvd_mask | PG_PSE_MASK)) { + goto do_fault_rsvd; + } + if (!(pml5e & PG_ACCESSED_MASK)) { + pml5e |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pml5e_addr, pml5e); + } + ptep =3D pml5e ^ PG_NX_MASK; + } else { + pml5e =3D env->cr[3]; + ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; + } + + pml4e_addr =3D ((pml5e & PG_ADDRESS_MASK) + + (((addr >> 39) & 0x1ff) << 3)) & a20_mask; + pml4e =3D x86_ldq_phys(cs, pml4e_addr); + if (!(pml4e & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pml4e & (rsvd_mask | PG_PSE_MASK)) { + goto do_fault_rsvd; + } + if (!(pml4e & PG_ACCESSED_MASK)) { + pml4e |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pml4e_addr, pml4e); + } + ptep &=3D pml4e ^ PG_NX_MASK; + pdpe_addr =3D ((pml4e & PG_ADDRESS_MASK) + (((addr >> 30) & 0x= 1ff) << 3)) & + a20_mask; + pdpe =3D x86_ldq_phys(cs, pdpe_addr); + if (!(pdpe & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pdpe & rsvd_mask) { + goto do_fault_rsvd; + } + ptep &=3D pdpe ^ PG_NX_MASK; + if (!(pdpe & PG_ACCESSED_MASK)) { + pdpe |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pdpe_addr, pdpe); + } + if (pdpe & PG_PSE_MASK) { + /* 1 GB page */ + page_size =3D 1024 * 1024 * 1024; + pte_addr =3D pdpe_addr; + pte =3D pdpe; + goto do_check_protect; + } + } else +#endif + { + /* XXX: load them when cr3 is loaded ? */ + pdpe_addr =3D ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & + a20_mask; + pdpe =3D x86_ldq_phys(cs, pdpe_addr); + if (!(pdpe & PG_PRESENT_MASK)) { + goto do_fault; + } + rsvd_mask |=3D PG_HI_USER_MASK; + if (pdpe & (rsvd_mask | PG_NX_MASK)) { + goto do_fault_rsvd; + } + ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; + } + + pde_addr =3D ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) <= < 3)) & + a20_mask; + pde =3D x86_ldq_phys(cs, pde_addr); + if (!(pde & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pde & rsvd_mask) { + goto do_fault_rsvd; + } + ptep &=3D pde ^ PG_NX_MASK; + if (pde & PG_PSE_MASK) { + /* 2 MB page */ + page_size =3D 2048 * 1024; + pte_addr =3D pde_addr; + pte =3D pde; + goto do_check_protect; + } + /* 4 KB page */ + if (!(pde & PG_ACCESSED_MASK)) { + pde |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pde_addr, pde); + } + pte_addr =3D ((pde & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) <<= 3)) & + a20_mask; + pte =3D x86_ldq_phys(cs, pte_addr); + if (!(pte & PG_PRESENT_MASK)) { + goto do_fault; + } + if (pte & rsvd_mask) { + goto do_fault_rsvd; + } + /* combine pde and pte nx, user and rw protections */ + ptep &=3D pte ^ PG_NX_MASK; + page_size =3D 4096; + } else { + uint32_t pde; + + /* page directory entry */ + pde_addr =3D ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & + a20_mask; + pde =3D x86_ldl_phys(cs, pde_addr); + if (!(pde & PG_PRESENT_MASK)) { + goto do_fault; + } + ptep =3D pde | PG_NX_MASK; + + /* if PSE bit is set, then we use a 4MB page */ + if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { + page_size =3D 4096 * 1024; + pte_addr =3D pde_addr; + + /* Bits 20-13 provide bits 39-32 of the address, bit 21 is res= erved. + * Leave bits 20-13 in place for setting accessed/dirty bits b= elow. + */ + pte =3D pde | ((pde & 0x1fe000LL) << (32 - 13)); + rsvd_mask =3D 0x200000; + goto do_check_protect_pse36; + } + + if (!(pde & PG_ACCESSED_MASK)) { + pde |=3D PG_ACCESSED_MASK; + x86_stl_phys_notdirty(cs, pde_addr, pde); + } + + /* page directory entry */ + pte_addr =3D ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & + a20_mask; + pte =3D x86_ldl_phys(cs, pte_addr); + if (!(pte & PG_PRESENT_MASK)) { + goto do_fault; + } + /* combine pde and pte user and rw protections */ + ptep &=3D pte | PG_NX_MASK; + page_size =3D 4096; + rsvd_mask =3D 0; + } + +do_check_protect: + rsvd_mask |=3D (page_size - 1) & PG_ADDRESS_MASK & ~PG_PSE_PAT_MASK; +do_check_protect_pse36: + if (pte & rsvd_mask) { + goto do_fault_rsvd; + } + ptep ^=3D PG_NX_MASK; + + /* can the page can be put in the TLB? prot will tell us */ + if (is_user && !(ptep & PG_USER_MASK)) { + goto do_fault_protect; + } + + prot =3D 0; + if (mmu_idx !=3D MMU_KSMAP_IDX || !(ptep & PG_USER_MASK)) { + prot |=3D PAGE_READ; + if ((ptep & PG_RW_MASK) || (!is_user && !(env->cr[0] & CR0_WP_MASK= ))) { + prot |=3D PAGE_WRITE; + } + } + if (!(ptep & PG_NX_MASK) && + (mmu_idx =3D=3D MMU_USER_IDX || + !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)))) { + prot |=3D PAGE_EXEC; + } + if ((env->cr[4] & CR4_PKE_MASK) && (env->hflags & HF_LMA_MASK) && + (ptep & PG_USER_MASK) && env->pkru) { + uint32_t pk =3D (pte & PG_PKRU_MASK) >> PG_PKRU_BIT; + uint32_t pkru_ad =3D (env->pkru >> pk * 2) & 1; + uint32_t pkru_wd =3D (env->pkru >> pk * 2) & 2; + uint32_t pkru_prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + + if (pkru_ad) { + pkru_prot &=3D ~(PAGE_READ | PAGE_WRITE); + } else if (pkru_wd && (is_user || env->cr[0] & CR0_WP_MASK)) { + pkru_prot &=3D ~PAGE_WRITE; + } + + prot &=3D pkru_prot; + if ((pkru_prot & (1 << is_write1)) =3D=3D 0) { + assert(is_write1 !=3D 2); + error_code |=3D PG_ERROR_PK_MASK; + goto do_fault_protect; + } + } + + if ((prot & (1 << is_write1)) =3D=3D 0) { + goto do_fault_protect; + } + + /* yes, it can! */ + is_dirty =3D is_write && !(pte & PG_DIRTY_MASK); + if (!(pte & PG_ACCESSED_MASK) || is_dirty) { + pte |=3D PG_ACCESSED_MASK; + if (is_dirty) { + pte |=3D PG_DIRTY_MASK; + } + x86_stl_phys_notdirty(cs, pte_addr, pte); + } + + if (!(pte & PG_DIRTY_MASK)) { + /* only set write access if already dirty... otherwise wait + for dirty access */ + assert(!is_write); + prot &=3D ~PAGE_WRITE; + } + + do_mapping: + pte =3D pte & a20_mask; + + /* align to page_size */ + pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); + + /* Even if 4MB pages, we map only one 4KB page in the cache to + avoid filling it too fast */ + vaddr =3D addr & TARGET_PAGE_MASK; + page_offset =3D vaddr & (page_size - 1); + paddr =3D pte + page_offset; + + assert(prot & (1 << is_write1)); + tlb_set_page_with_attrs(cs, vaddr, paddr, cpu_get_mem_attrs(env), + prot, mmu_idx, page_size); + return 0; + do_fault_rsvd: + error_code |=3D PG_ERROR_RSVD_MASK; + do_fault_protect: + error_code |=3D PG_ERROR_P_MASK; + do_fault: + error_code |=3D (is_write << PG_ERROR_W_BIT); + if (is_user) + error_code |=3D PG_ERROR_U_MASK; + if (is_write1 =3D=3D 2 && + (((env->efer & MSR_EFER_NXE) && + (env->cr[4] & CR4_PAE_MASK)) || + (env->cr[4] & CR4_SMEP_MASK))) + error_code |=3D PG_ERROR_I_D_MASK; + if (env->intercept_exceptions & (1 << EXCP0E_PAGE)) { + /* cr2 is not modified in case of exceptions */ + x86_stq_phys(cs, + env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), + addr); + } else { + env->cr[2] =3D addr; + } + env->error_code =3D error_code; + cs->exception_index =3D EXCP0E_PAGE; + return 1; +} +#endif diff --git a/target/i386/helper.c b/target/i386/helper.c index 4d584b5..bcf9b22 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -722,349 +722,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t ne= w_cr4) cpu_sync_bndcs_hflags(env); } =20 -#if defined(CONFIG_USER_ONLY) - -int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, - int is_write, int mmu_idx) -{ - X86CPU *cpu =3D X86_CPU(cs); - CPUX86State *env =3D &cpu->env; - - /* user mode only emulation */ - is_write &=3D 1; - env->cr[2] =3D addr; - env->error_code =3D (is_write << PG_ERROR_W_BIT); - env->error_code |=3D PG_ERROR_U_MASK; - cs->exception_index =3D EXCP0E_PAGE; - env->exception_is_int =3D 0; - env->exception_next_eip =3D -1; - return 1; -} - -#else - -/* return value: - * -1 =3D cannot handle fault - * 0 =3D nothing more to do - * 1 =3D generate PF fault - */ -int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, - int is_write1, int mmu_idx) -{ - X86CPU *cpu =3D X86_CPU(cs); - CPUX86State *env =3D &cpu->env; - uint64_t ptep, pte; - int32_t a20_mask; - target_ulong pde_addr, pte_addr; - int error_code =3D 0; - int is_dirty, prot, page_size, is_write, is_user; - hwaddr paddr; - uint64_t rsvd_mask =3D PG_HI_RSVD_MASK; - uint32_t page_offset; - target_ulong vaddr; - - is_user =3D mmu_idx =3D=3D MMU_USER_IDX; -#if defined(DEBUG_MMU) - printf("MMU fault: addr=3D%" VADDR_PRIx " w=3D%d u=3D%d eip=3D" TARGET= _FMT_lx "\n", - addr, is_write1, is_user, env->eip); -#endif - is_write =3D is_write1 & 1; - - a20_mask =3D x86_get_a20_mask(env); - if (!(env->cr[0] & CR0_PG_MASK)) { - pte =3D addr; -#ifdef TARGET_X86_64 - if (!(env->hflags & HF_LMA_MASK)) { - /* Without long mode we can only address 32bits in real mode */ - pte =3D (uint32_t)pte; - } -#endif - prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; - page_size =3D 4096; - goto do_mapping; - } - - if (!(env->efer & MSR_EFER_NXE)) { - rsvd_mask |=3D PG_NX_MASK; - } - - if (env->cr[4] & CR4_PAE_MASK) { - uint64_t pde, pdpe; - target_ulong pdpe_addr; - -#ifdef TARGET_X86_64 - if (env->hflags & HF_LMA_MASK) { - bool la57 =3D env->cr[4] & CR4_LA57_MASK; - uint64_t pml5e_addr, pml5e; - uint64_t pml4e_addr, pml4e; - int32_t sext; - - /* test virtual address sign extension */ - sext =3D la57 ? (int64_t)addr >> 56 : (int64_t)addr >> 47; - if (sext !=3D 0 && sext !=3D -1) { - env->error_code =3D 0; - cs->exception_index =3D EXCP0D_GPF; - return 1; - } - - if (la57) { - pml5e_addr =3D ((env->cr[3] & ~0xfff) + - (((addr >> 48) & 0x1ff) << 3)) & a20_mask; - pml5e =3D x86_ldq_phys(cs, pml5e_addr); - if (!(pml5e & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pml5e & (rsvd_mask | PG_PSE_MASK)) { - goto do_fault_rsvd; - } - if (!(pml5e & PG_ACCESSED_MASK)) { - pml5e |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pml5e_addr, pml5e); - } - ptep =3D pml5e ^ PG_NX_MASK; - } else { - pml5e =3D env->cr[3]; - ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; - } - - pml4e_addr =3D ((pml5e & PG_ADDRESS_MASK) + - (((addr >> 39) & 0x1ff) << 3)) & a20_mask; - pml4e =3D x86_ldq_phys(cs, pml4e_addr); - if (!(pml4e & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pml4e & (rsvd_mask | PG_PSE_MASK)) { - goto do_fault_rsvd; - } - if (!(pml4e & PG_ACCESSED_MASK)) { - pml4e |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pml4e_addr, pml4e); - } - ptep &=3D pml4e ^ PG_NX_MASK; - pdpe_addr =3D ((pml4e & PG_ADDRESS_MASK) + (((addr >> 30) & 0x= 1ff) << 3)) & - a20_mask; - pdpe =3D x86_ldq_phys(cs, pdpe_addr); - if (!(pdpe & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pdpe & rsvd_mask) { - goto do_fault_rsvd; - } - ptep &=3D pdpe ^ PG_NX_MASK; - if (!(pdpe & PG_ACCESSED_MASK)) { - pdpe |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pdpe_addr, pdpe); - } - if (pdpe & PG_PSE_MASK) { - /* 1 GB page */ - page_size =3D 1024 * 1024 * 1024; - pte_addr =3D pdpe_addr; - pte =3D pdpe; - goto do_check_protect; - } - } else -#endif - { - /* XXX: load them when cr3 is loaded ? */ - pdpe_addr =3D ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & - a20_mask; - pdpe =3D x86_ldq_phys(cs, pdpe_addr); - if (!(pdpe & PG_PRESENT_MASK)) { - goto do_fault; - } - rsvd_mask |=3D PG_HI_USER_MASK; - if (pdpe & (rsvd_mask | PG_NX_MASK)) { - goto do_fault_rsvd; - } - ptep =3D PG_NX_MASK | PG_USER_MASK | PG_RW_MASK; - } - - pde_addr =3D ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) <= < 3)) & - a20_mask; - pde =3D x86_ldq_phys(cs, pde_addr); - if (!(pde & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pde & rsvd_mask) { - goto do_fault_rsvd; - } - ptep &=3D pde ^ PG_NX_MASK; - if (pde & PG_PSE_MASK) { - /* 2 MB page */ - page_size =3D 2048 * 1024; - pte_addr =3D pde_addr; - pte =3D pde; - goto do_check_protect; - } - /* 4 KB page */ - if (!(pde & PG_ACCESSED_MASK)) { - pde |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pde_addr, pde); - } - pte_addr =3D ((pde & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) <<= 3)) & - a20_mask; - pte =3D x86_ldq_phys(cs, pte_addr); - if (!(pte & PG_PRESENT_MASK)) { - goto do_fault; - } - if (pte & rsvd_mask) { - goto do_fault_rsvd; - } - /* combine pde and pte nx, user and rw protections */ - ptep &=3D pte ^ PG_NX_MASK; - page_size =3D 4096; - } else { - uint32_t pde; - - /* page directory entry */ - pde_addr =3D ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & - a20_mask; - pde =3D x86_ldl_phys(cs, pde_addr); - if (!(pde & PG_PRESENT_MASK)) { - goto do_fault; - } - ptep =3D pde | PG_NX_MASK; - - /* if PSE bit is set, then we use a 4MB page */ - if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { - page_size =3D 4096 * 1024; - pte_addr =3D pde_addr; - - /* Bits 20-13 provide bits 39-32 of the address, bit 21 is res= erved. - * Leave bits 20-13 in place for setting accessed/dirty bits b= elow. - */ - pte =3D pde | ((pde & 0x1fe000LL) << (32 - 13)); - rsvd_mask =3D 0x200000; - goto do_check_protect_pse36; - } - - if (!(pde & PG_ACCESSED_MASK)) { - pde |=3D PG_ACCESSED_MASK; - x86_stl_phys_notdirty(cs, pde_addr, pde); - } - - /* page directory entry */ - pte_addr =3D ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & - a20_mask; - pte =3D x86_ldl_phys(cs, pte_addr); - if (!(pte & PG_PRESENT_MASK)) { - goto do_fault; - } - /* combine pde and pte user and rw protections */ - ptep &=3D pte | PG_NX_MASK; - page_size =3D 4096; - rsvd_mask =3D 0; - } - -do_check_protect: - rsvd_mask |=3D (page_size - 1) & PG_ADDRESS_MASK & ~PG_PSE_PAT_MASK; -do_check_protect_pse36: - if (pte & rsvd_mask) { - goto do_fault_rsvd; - } - ptep ^=3D PG_NX_MASK; - - /* can the page can be put in the TLB? prot will tell us */ - if (is_user && !(ptep & PG_USER_MASK)) { - goto do_fault_protect; - } - - prot =3D 0; - if (mmu_idx !=3D MMU_KSMAP_IDX || !(ptep & PG_USER_MASK)) { - prot |=3D PAGE_READ; - if ((ptep & PG_RW_MASK) || (!is_user && !(env->cr[0] & CR0_WP_MASK= ))) { - prot |=3D PAGE_WRITE; - } - } - if (!(ptep & PG_NX_MASK) && - (mmu_idx =3D=3D MMU_USER_IDX || - !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)))) { - prot |=3D PAGE_EXEC; - } - if ((env->cr[4] & CR4_PKE_MASK) && (env->hflags & HF_LMA_MASK) && - (ptep & PG_USER_MASK) && env->pkru) { - uint32_t pk =3D (pte & PG_PKRU_MASK) >> PG_PKRU_BIT; - uint32_t pkru_ad =3D (env->pkru >> pk * 2) & 1; - uint32_t pkru_wd =3D (env->pkru >> pk * 2) & 2; - uint32_t pkru_prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; - - if (pkru_ad) { - pkru_prot &=3D ~(PAGE_READ | PAGE_WRITE); - } else if (pkru_wd && (is_user || env->cr[0] & CR0_WP_MASK)) { - pkru_prot &=3D ~PAGE_WRITE; - } - - prot &=3D pkru_prot; - if ((pkru_prot & (1 << is_write1)) =3D=3D 0) { - assert(is_write1 !=3D 2); - error_code |=3D PG_ERROR_PK_MASK; - goto do_fault_protect; - } - } - - if ((prot & (1 << is_write1)) =3D=3D 0) { - goto do_fault_protect; - } - - /* yes, it can! */ - is_dirty =3D is_write && !(pte & PG_DIRTY_MASK); - if (!(pte & PG_ACCESSED_MASK) || is_dirty) { - pte |=3D PG_ACCESSED_MASK; - if (is_dirty) { - pte |=3D PG_DIRTY_MASK; - } - x86_stl_phys_notdirty(cs, pte_addr, pte); - } - - if (!(pte & PG_DIRTY_MASK)) { - /* only set write access if already dirty... otherwise wait - for dirty access */ - assert(!is_write); - prot &=3D ~PAGE_WRITE; - } - - do_mapping: - pte =3D pte & a20_mask; - - /* align to page_size */ - pte &=3D PG_ADDRESS_MASK & ~(page_size - 1); - - /* Even if 4MB pages, we map only one 4KB page in the cache to - avoid filling it too fast */ - vaddr =3D addr & TARGET_PAGE_MASK; - page_offset =3D vaddr & (page_size - 1); - paddr =3D pte + page_offset; - - assert(prot & (1 << is_write1)); - tlb_set_page_with_attrs(cs, vaddr, paddr, cpu_get_mem_attrs(env), - prot, mmu_idx, page_size); - return 0; - do_fault_rsvd: - error_code |=3D PG_ERROR_RSVD_MASK; - do_fault_protect: - error_code |=3D PG_ERROR_P_MASK; - do_fault: - error_code |=3D (is_write << PG_ERROR_W_BIT); - if (is_user) - error_code |=3D PG_ERROR_U_MASK; - if (is_write1 =3D=3D 2 && - (((env->efer & MSR_EFER_NXE) && - (env->cr[4] & CR4_PAE_MASK)) || - (env->cr[4] & CR4_SMEP_MASK))) - error_code |=3D PG_ERROR_I_D_MASK; - if (env->intercept_exceptions & (1 << EXCP0E_PAGE)) { - /* cr2 is not modified in case of exceptions */ - x86_stq_phys(cs, - env->vm_vmcb + offsetof(struct vmcb, control.exit_info_2), - addr); - } else { - env->cr[2] =3D addr; - } - env->error_code =3D error_code; - cs->exception_index =3D EXCP0E_PAGE; - return 1; -} - +#if !defined(CONFIG_USER_ONLY) hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { X86CPU *cpu =3D X86_CPU(cs); --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240282806828.1296568335848; Wed, 5 Jul 2017 00:38:02 -0700 (PDT) Received: from localhost ([::1]:44588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSesr-0000nM-GD for importer@patchew.org; Wed, 05 Jul 2017 03:38:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeXF-00059J-77 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeXD-00080o-01 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:41 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeXC-00080H-Ll for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:38 -0400 Received: by mail-wm0-x243.google.com with SMTP id u23so30504867wma.2 for ; Wed, 05 Jul 2017 00:15:38 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dBzEDr7zoDMRHjeEF6PPHrZNXqGHBGz9M2TeGYJbSt0=; b=NRQdxXR6V/bURJj9QrMPJC5zoeUlkAT0J8Hc3/qEhQgx342F3K2dmacoBvSMtGIgXI zmLMHM1cRJaDHLuXZEusAl3tDbItt/G4+wmKgj20MLHmN7OikKlf8hcpo8FnweFGmfdG uS+DDRdWpILkvC2gv9TBLkpYkJlcPkjaNjMjEKluQCAefRcYtk7kPMP0pW/mH2upRpaI m8Px+7tTihEAzSlXXzCXIV/GUqT/VkQuXpM9LeuyGEEYBlR6ovuzfzvYnRfvBSB+BiRL cdK1PZySv/Lfdi+HTw8MzkTSKATtX1fdqk85sARonqvBuLkxdcFML9P6fNYV7IDr9AoW Fa5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=dBzEDr7zoDMRHjeEF6PPHrZNXqGHBGz9M2TeGYJbSt0=; b=QGY5Cv+UwwnYuzc7XuLUQLjWp6EVz41NXDWIPK6WvtCElfU/XS3yuq8uFWlguimn46 Cx7K6Mt2YDp2BG+pZA9EISZcl/0OBDXWirrPEgZZhOPtoLi07t0uED98XiTAn8PfRMEA rde1cdqspm1PiTN6srIwoW2+Ukqoz3BESVZgocfYaXhoq7p+takocbUioytYX+JLbplO nAEoYytFHNGjm2styIiuBSByB2+KkpDxBW3JRGOQ+PjHzWhdEFxw1nB+9Idqq43T1ijf vsPbzHhGNvXbHidPTV8XSaMS/0WDzZ6Fug25LBL2aahb8x1Iqz5uXjgwmbwVpk0eKJar x1Og== X-Gm-Message-State: AIVw11176J0ewT/xYpwqQ7Pahqm9kkjiTq1xMDf9mld15weAnr+KnqT/ 9cuP9pPt/SZh8ikULKI= X-Received: by 10.28.107.131 with SMTP id a3mr930298wmi.60.1499238937545; Wed, 05 Jul 2017 00:15:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:44 +0200 Message-Id: <1499238885-26161-42-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 41/42] target/i386: add the tcg_enabled() in target/i386/ 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the tcg_enabled() where the x86 target needs to disable TCG-specific code. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 +++- target/i386/cpu.h | 8 +++++++- target/i386/helper.c | 2 +- target/i386/machine.c | 10 +++++----- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 642519a..c571772 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4040,8 +4040,10 @@ static void x86_cpu_common_class_init(ObjectClass *o= c, void *data) cc->class_by_name =3D x86_cpu_class_by_name; cc->parse_features =3D x86_cpu_parse_featurestr; cc->has_work =3D x86_cpu_has_work; +#ifdef CONFIG_TCG cc->do_interrupt =3D x86_cpu_do_interrupt; cc->cpu_exec_interrupt =3D x86_cpu_exec_interrupt; +#endif cc->dump_state =3D x86_cpu_dump_state; cc->get_crash_info =3D x86_cpu_get_crash_info; cc->set_pc =3D x86_cpu_set_pc; @@ -4070,7 +4072,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) cc->gdb_core_xml_file =3D "i386-32bit.xml"; cc->gdb_num_core_regs =3D 41; #endif -#ifndef CONFIG_USER_ONLY +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) cc->debug_excp_handler =3D breakpoint_handler; #endif cc->cpu_exec_enter =3D x86_cpu_exec_enter; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 3495a91..7a228af 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -52,7 +52,9 @@ =20 #include "exec/cpu-defs.h" =20 +#ifdef CONFIG_TCG #include "fpu/softfloat.h" +#endif =20 #define R_EAX 0 #define R_ECX 1 @@ -1597,7 +1599,11 @@ uint32_t cpu_cc_compute_all(CPUX86State *env1, int o= p); =20 static inline uint32_t cpu_compute_eflags(CPUX86State *env) { - return env->eflags | cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MA= SK); + uint32_t eflags =3D env->eflags; + if (tcg_enabled()) { + eflags |=3D cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK); + } + return eflags; } =20 /* NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS diff --git a/target/i386/helper.c b/target/i386/helper.c index bcf9b22..f63eb3d 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -990,7 +990,7 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAccess = access) env->tpr_access_type =3D access; =20 cpu_interrupt(cs, CPU_INTERRUPT_TPR); - } else { + } else if (tcg_enabled()) { cpu_restore_state(cs, cs->mem_io_pc); =20 apic_handle_tpr_access_report(cpu->apic_state, env->eip, access); diff --git a/target/i386/machine.c b/target/i386/machine.c index e0417fe..eab3372 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -281,16 +281,16 @@ static int cpu_post_load(void *opaque, int version_id) env->fptags[i] =3D (env->fptag_vmstate >> i) & 1; } if (tcg_enabled()) { + target_ulong dr7; update_fp_status(env); update_mxcsr_status(env); - } =20 - cpu_breakpoint_remove_all(cs, BP_CPU); - cpu_watchpoint_remove_all(cs, BP_CPU); - { + cpu_breakpoint_remove_all(cs, BP_CPU); + cpu_watchpoint_remove_all(cs, BP_CPU); + /* Indicate all breakpoints disabled, as they are, then let the helper re-enable them. */ - target_ulong dr7 =3D env->dr[7]; + dr7 =3D env->dr[7]; env->dr[7] =3D dr7 & ~(DR7_GLOBAL_BP_MASK | DR7_LOCAL_BP_MASK); cpu_x86_update_dr7(env, dr7); } --=20 1.8.3.1 From nobody Fri May 3 04:44:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499240844319258.95347456410957; Wed, 5 Jul 2017 00:47:24 -0700 (PDT) Received: from localhost ([::1]:44650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSf1v-0001HX-7i for importer@patchew.org; Wed, 05 Jul 2017 03:47:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeXF-00059K-78 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeXD-00081P-SJ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:41 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeXD-00080v-LJ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:39 -0400 Received: by mail-wm0-x241.google.com with SMTP id j85so30449524wmj.0 for ; Wed, 05 Jul 2017 00:15:39 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fnJXm8f0uhbu8IlF8b5qyiCuZCArMcK1kp+v4s7JoMg=; b=tost9x7epOSmWtV69H58Pj0zzJI0EJ54q6bra4yWjJGDmIDDPr7gTsvV5sv4GvkFqe cg1X4gUuSfL2kqDq72+yleIj/lFlDS3L/lKSZjwmj+bPufqpimImvv1NTfofP+NlNcnp F/ibWKLG0hvhUpf/AENA1IMiG4oowUNSe/ltKh8+M3pukFgxzXOm8AD/PAPYM34kNxSw crO+KkF6gvvHphPGkNsDevkQVzLZgNGkpKzlfgYmS8dXL1p62uxdFT6DghxVi0I8s6eC XVCj4p5mb3jh79wGM2nZmnKRiXX6EJcfgqbyZbs95hsQO3DOwkm/cZvsVpkcVVrWToqi 2OBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fnJXm8f0uhbu8IlF8b5qyiCuZCArMcK1kp+v4s7JoMg=; b=mn7LOTAx09WeDgNI6r2MZ0oP0qzBVWzib50yxuuQX6KpDoT0ldmyRTU3s/n2UNexXL PXvD0P7Vb7arhcdMnWGEoZ9ZbDOws6fWz/cb+eNQ/wC8wzo4Btl6fXnVKynbGDGEAIcu uCwO7T+8DzyXjrH4LfJJCOFCLO4+S8JpCcS7JWV6Og04fFiUID1qq3c0ifpx++Qq4BOE ARKbO2WN7kxrWRpd2hYRYTtwHMIVPk/OkKJ6JUvBm+3lgcY+JbMQ5sZmvJZcsRYCMpTL MvVEApqlSBZIreGzNCIZzNFyvd0Pi2Kl7iEkTnUIquol/Hsl7qFSy2CksYSogdTYWQ3O Zqlg== X-Gm-Message-State: AKS2vOxUFdTSg75ZcutlJQbURVD5Ubpy/nme5F8GOpZWdr6zC/mqChzQ S2gt0HWHlwuSpYLRW+k= X-Received: by 10.28.157.205 with SMTP id g196mr30101337wme.84.1499238938565; Wed, 05 Jul 2017 00:15:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:45 +0200 Message-Id: <1499238885-26161-43-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 42/42] target/i386: add the CONFIG_TCG into Makefiles 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yang Zhong Add the CONFIG_TCG for frontend and backend's files in the related Makefiles. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- target/i386/Makefile.objs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index ca3bd21..6a26e9d 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -1,8 +1,8 @@ -obj-y +=3D translate.o helper.o cpu.o bpt_helper.o -obj-y +=3D excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o -obj-y +=3D smm_helper.o misc_helper.o mem_helper.o seg_helper.o mpx_helper= .o -obj-y +=3D xsave_helper.o -obj-y +=3D gdbstub.o +obj-y +=3D helper.o cpu.o gdbstub.o xsave_helper.o +obj-$(CONFIG_TCG) +=3D translate.o +obj-$(CONFIG_TCG) +=3D bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o +obj-$(CONFIG_TCG) +=3D int_helper.o mem_helper.o misc_helper.o mpx_helper.o +obj-$(CONFIG_TCG) +=3D seg_helper.o smm_helper.o svm_helper.o obj-$(CONFIG_SOFTMMU) +=3D machine.o arch_memory_mapping.o arch_dump.o mon= itor.o obj-$(CONFIG_KVM) +=3D kvm.o hyperv.o obj-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o --=20 1.8.3.1