From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151083387748712.75185068753774; Thu, 16 Nov 2017 04:04:37 -0800 (PST) Received: from localhost ([::1]:40290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIu7-0005Xh-9H for importer@patchew.org; Thu, 16 Nov 2017 07:04:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpR-0001ed-O1 for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpP-0008U7-IF for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpP-0008TT-CN for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60E70C0587C7; Thu, 16 Nov 2017 11:59:30 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85F7160F87; Thu, 16 Nov 2017 11:59:29 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:16 +0100 Message-Id: <20171116115926.16627-2-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Nov 2017 11:59:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/11] Enable 8-byte wide MMIO for 16550 serial devices 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: Mike Nawrocki Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mike Nawrocki Some drivers for the PPMC7400 PowerPC evaluation board accesses the serial registers through the floating point unit (stfd/ldfd), which is an 8-byte wide access. This patch enables that behavior. Signed-off-by: Mike Nawrocki Message-Id: <20171106161039.32596-1-michael.nawrocki@gtri.gatech.edu> Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index 376bd2f240..eb72191ee7 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -1005,7 +1005,7 @@ static void serial_mm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { SerialState *s =3D opaque; - value &=3D ~0u >> (32 - (size * 8)); + value &=3D 255; serial_ioport_write(s, addr >> s->it_shift, value, 1); } =20 @@ -1014,16 +1014,22 @@ static const MemoryRegionOps serial_mm_ops[3] =3D { .read =3D serial_mm_read, .write =3D serial_mm_write, .endianness =3D DEVICE_NATIVE_ENDIAN, + .valid.max_access_size =3D 8, + .impl.max_access_size =3D 8, }, [DEVICE_LITTLE_ENDIAN] =3D { .read =3D serial_mm_read, .write =3D serial_mm_write, .endianness =3D DEVICE_LITTLE_ENDIAN, + .valid.max_access_size =3D 8, + .impl.max_access_size =3D 8, }, [DEVICE_BIG_ENDIAN] =3D { .read =3D serial_mm_read, .write =3D serial_mm_write, .endianness =3D DEVICE_BIG_ENDIAN, + .valid.max_access_size =3D 8, + .impl.max_access_size =3D 8, }, }; =20 --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833707110866.7675536234218; Thu, 16 Nov 2017 04:01:47 -0800 (PST) Received: from localhost ([::1]:40281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIrU-00039U-Pc for importer@patchew.org; Thu, 16 Nov 2017 07:01:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpW-0001i7-VB for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpR-0008W1-6L for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48224) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpQ-0008V3-Uq for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 071C04A6EA for ; Thu, 16 Nov 2017 11:59:32 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1EFC60F87; Thu, 16 Nov 2017 11:59:30 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:17 +0100 Message-Id: <20171116115926.16627-3-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 16 Nov 2017 11:59:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/11] ioapic/tracing: Remove last DPRINTFs 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: "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Remove the last few DPRINTFs from hw/intc/ioapic.c and turn them into tracing. In one case it's a new trace, in the others it's just adding a parameter to the existing traces. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20171102180310.24760-1-dgilbert@redhat.com> Reviewed-by: Peter Xu Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 17 +++-------------- hw/intc/trace-events | 5 +++-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 37c4386ae3..36139a4db6 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -35,15 +35,6 @@ #include "hw/i386/x86-iommu.h" #include "trace.h" =20 -//#define DEBUG_IOAPIC - -#ifdef DEBUG_IOAPIC -#define DPRINTF(fmt, ...) \ - do { printf("ioapic: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) -#endif - #define APIC_DELIVERY_MODE_SHIFT 8 #define APIC_POLARITY_SHIFT 14 #define APIC_TRIG_MODE_SHIFT 15 @@ -157,7 +148,7 @@ static void ioapic_set_irq(void *opaque, int vector, in= t level) * to GSI 2. GSI maps to ioapic 1-1. This is not * the cleanest way of doing it but it should work. */ =20 - DPRINTF("%s: %s vec %x\n", __func__, level ? "raise" : "lower", vector= ); + trace_ioapic_set_irq(vector, level); if (vector =3D=3D 0) { vector =3D 2; } @@ -290,11 +281,10 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned i= nt size) } } } - DPRINTF("read: %08x =3D %08x\n", s->ioregsel, val); break; } =20 - trace_ioapic_mem_read(addr, size, val); + trace_ioapic_mem_read(addr, s->ioregsel, size, val); =20 return val; } @@ -335,7 +325,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t va= l, int index; =20 addr &=3D 0xff; - trace_ioapic_mem_write(addr, size, val); + trace_ioapic_mem_write(addr, s->ioregsel, size, val); =20 switch (addr) { case IOAPIC_IOREGSEL: @@ -345,7 +335,6 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t va= l, if (size !=3D 4) { break; } - DPRINTF("write: %08x =3D %08" PRIx64 "\n", s->ioregsel, val); switch (s->ioregsel) { case IOAPIC_REG_ID: s->id =3D (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK; diff --git a/hw/intc/trace-events b/hw/intc/trace-events index b86f242b0f..b298fac7c6 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -18,8 +18,9 @@ apic_mem_writel(uint64_t addr, uint32_t val) "0x%"PRIx64"= =3D 0x%08x" ioapic_set_remote_irr(int n) "set remote irr for pin %d" ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d ve= ctor %d" ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d" -ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read= addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32 -ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem wri= te addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32 +ioapic_mem_read(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val) = "ioapic mem read addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" retval = 0x%"PRIx32 +ioapic_mem_write(uint8_t addr, uint8_t regsel, uint8_t size, uint32_t val)= "ioapic mem write addr 0x%"PRIx8" regsel: 0x%"PRIx8" size 0x%"PRIx8" val 0= x%"PRIx32 +ioapic_set_irq(int vector, int level) "vector: %d level: %d" =20 # hw/intc/slavio_intctl.c slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read c= pu %d reg 0x%"PRIx64" =3D 0x%x" --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833707090902.7081531124604; Thu, 16 Nov 2017 04:01:47 -0800 (PST) Received: from localhost ([::1]:40278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIrL-00030B-LJ for importer@patchew.org; Thu, 16 Nov 2017 07:01:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpT-0001f9-FM for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpS-000066-Al for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39760) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpS-0008WU-4Q for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:34 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DBCFA8AC; Thu, 16 Nov 2017 11:59:33 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A29050339; Thu, 16 Nov 2017 11:59:32 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:18 +0100 Message-Id: <20171116115926.16627-4-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Nov 2017 11:59:33 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/11] Makefile: simpler/faster "make help" 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Using obscure black magic introduced in eaa2ddbb767 :) In an out-of-tree directory, running "../configure && make help" will gener= ate some required files (.mak), then clone some submodules, compile at least the capstone submodule, generate QMP and Trace files, and finally display the help. On an outdated computer (Sun Blade workstation), running "make help" took more than 5h :) With this patch it took roughly 37min. Suggested-by: Daniel P. Berrange Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20171108032052.20029-1-f4bug@amsat.org> Reviewed-by: Laurent Vivier Reviewed-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ec73acfa9a..143ac81736 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BUILD_DIR=3D$(CURDIR) # Before including a proper config-host.mak, assume we are in the source t= ree SRC_PATH=3D. =20 -UNCHECKED_GOALS :=3D %clean TAGS cscope ctags docker docker-% +UNCHECKED_GOALS :=3D %clean TAGS cscope ctags docker docker-% help =20 # All following code might depend on configuration variables ifneq ($(wildcard config-host.mak),) --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833711336642.2791159873829; Thu, 16 Nov 2017 04:01:51 -0800 (PST) Received: from localhost ([::1]:40280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIrP-00032j-6O for importer@patchew.org; Thu, 16 Nov 2017 07:01:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpU-0001gD-R4 for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpU-00008i-4H for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpT-00007H-Tt for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05A902DACCD; Thu, 16 Nov 2017 11:59:35 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8411360F87; Thu, 16 Nov 2017 11:59:33 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:19 +0100 Message-Id: <20171116115926.16627-5-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Nov 2017 11:59:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/11] thread-posix: fix qemu_rec_mutex_trylock macro 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: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" We never noticed because it has no users. Signed-off-by: Emilio G. Cota Message-Id: <1510273811-13419-1-git-send-email-cota@braap.org> Signed-off-by: Paolo Bonzini --- include/qemu/thread-posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index f4296d31c4..f3f47e426f 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -7,7 +7,7 @@ typedef QemuMutex QemuRecMutex; #define qemu_rec_mutex_destroy qemu_mutex_destroy #define qemu_rec_mutex_lock qemu_mutex_lock -#define qemu_rec_mutex_try_lock qemu_mutex_try_lock +#define qemu_rec_mutex_trylock qemu_mutex_trylock #define qemu_rec_mutex_unlock qemu_mutex_unlock =20 struct QemuMutex { --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833880392585.8468415866445; Thu, 16 Nov 2017 04:04:40 -0800 (PST) Received: from localhost ([::1]:40293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIuJ-0005iW-Rx for importer@patchew.org; Thu, 16 Nov 2017 07:04:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpW-0001i9-Vv for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpW-0000BM-AD for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37002) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpW-0000AW-3X for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DB14369C4; Thu, 16 Nov 2017 11:59:37 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5341860F87; Thu, 16 Nov 2017 11:59:35 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:20 +0100 Message-Id: <20171116115926.16627-6-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 16 Nov 2017 11:59:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/11] target-i386: adds PV_TLB_FLUSH CPUID feature bit 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: Richard Henderson , Eduardo Habkost , Wanpeng Li , =?UTF-8?q?Radim=20Kr=C3=84m=C3=83=C2=A1=C3=85=E2=84=A2?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Wanpeng Li Adds PV_TLB_FLUSH CPUID feature bit. Cc: Paolo Bonzini Cc: Radim Kr=C3=84m=C3=83=C2=A1=C3=85=E2=84=A2 Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Wanpeng Li Message-Id: <1510299947-11287-1-git-send-email-wanpeng.li@hotmail.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6f21a5e518..ecebc5a70a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -347,7 +347,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS]= =3D { .feat_names =3D { "kvmclock", "kvm-nopiodelay", "kvm-mmu", "kvmclock", "kvm-asyncpf", "kvm-steal-time", "kvm-pv-eoi", "kvm-pv-unhalt", - NULL, NULL, NULL, NULL, + NULL, "kvm-pv-tlb-flush", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, --=20 2.14.3 From nobody Fri May 3 07:16:28 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833890128167.61934121227307; Thu, 16 Nov 2017 04:04:50 -0800 (PST) Received: from localhost ([::1]:40292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIuF-0005e5-9b for importer@patchew.org; Thu, 16 Nov 2017 07:04:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpa-0001lb-8f for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpY-0000DA-6f for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55478) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpY-0000Ca-0T for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:40 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 176F4C04B928; Thu, 16 Nov 2017 11:59:39 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33ABF5FCAB; Thu, 16 Nov 2017 11:59:37 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:21 +0100 Message-Id: <20171116115926.16627-7-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 16 Nov 2017 11:59:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/11] vhost-user-scsi: add missing virtqueue_size param 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: Dariusz Stojaczyk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Dariusz Stojaczyk Commit 5c0919d0 [1] introduced virtqueue_size parameter for common virtio-scsi path, without updaing the vhost-user-scsi code. vhost-user-scsi devices right now report size 0 for each vq. This patch introduces virtqueue_size param to vhost-user-scsi, that can now be set by the user. However, the most importantly, it now has a default value of 128 (same as QEMU's virtio-scsi). [1] 5c0919d0 ("virtio-scsi: Add virtqueue_size parameter allowing virtqueue size to be set.") Change-Id: I70e87eab702ebf1196c028dbf17d54fdc0c89a14 Signed-off-by: Dariusz Stojaczyk Message-Id: <1510676916-76409-1-git-send-email-dariuszx.stojaczyk@intel.com> Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-user-scsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 500fa6a067..f7561e23fa 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -135,6 +135,8 @@ static Property vhost_user_scsi_properties[] =3D { DEFINE_PROP_CHR("chardev", VirtIOSCSICommon, conf.chardev), DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0), DEFINE_PROP_UINT32("num_queues", VirtIOSCSICommon, conf.num_queues, 1), + DEFINE_PROP_UINT32("virtqueue_size", VirtIOSCSICommon, conf.virtqueue_= size, + 128), DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors, 0xFFFF), DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, = 128), --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510834051379120.24044347133406; Thu, 16 Nov 2017 04:07:31 -0800 (PST) Received: from localhost ([::1]:40313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIwx-00082B-AH for importer@patchew.org; Thu, 16 Nov 2017 07:07:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpd-0001on-Gi for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpc-0000HM-KH for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11112) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpc-0000Gk-DE for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:44 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82914C047B89; Thu, 16 Nov 2017 11:59:43 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F5FE5FCAB; Thu, 16 Nov 2017 11:59:39 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:22 +0100 Message-Id: <20171116115926.16627-8-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 16 Nov 2017 11:59:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/11] cpu-exec: don't overwrite exception_index 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: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk This patch adds a condition before overwriting exception_index fiels. It is needed when exception_index is already set to some meaningful value. Signed-off-by: Pavel Dovgalyuk Message-Id: <20171114081812.27640.26372.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini --- accel/tcg/cpu-exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 61297f8f4a..0473055a08 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -594,7 +594,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, if (unlikely(atomic_read(&cpu->exit_request) || (use_icount && cpu->icount_decr.u16.low + cpu->icount_extra =3D= =3D 0))) { atomic_set(&cpu->exit_request, 0); - cpu->exception_index =3D EXCP_INTERRUPT; + if (cpu->exception_index =3D=3D -1) { + cpu->exception_index =3D EXCP_INTERRUPT; + } return true; } =20 --=20 2.14.3 From nobody Fri May 3 07:16:28 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510834049937620.3978618071548; Thu, 16 Nov 2017 04:07:29 -0800 (PST) Received: from localhost ([::1]:40310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIwp-0007tA-IY for importer@patchew.org; Thu, 16 Nov 2017 07:07:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpj-0001u0-J9 for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpg-0000Kx-F1 for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpg-0000KO-5U for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C45749016; Thu, 16 Nov 2017 11:59:47 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A80C18BBC; Thu, 16 Nov 2017 11:59:44 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:23 +0100 Message-Id: <20171116115926.16627-9-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 16 Nov 2017 11:59:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/11] cpu-exec: avoid cpu_exec_nocache infinite loop with record/replay 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: Maria Klimushenkova , Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk This patch ensures that icount_decr.u32.high is clear before calling cpu_exec_nocache when exception is pending. Because the exception is caused by the first instruction in the block and it cannot be executed without resetting the flag. There are two parts in the fix. First, clear icount_decr.u32.high in cpu_handle_interrupt (just before processing the "dependent" request, stored in cpu->interrupt_request or cpu->exit_request) rather than cpu_loop_exec_tb; this ensures that cpu_handle_exception is always reached with zero icount_decr.u32.high unless another interrupt has happened in the meanwhile. Second, try to cause the exception at the beginning of cpu_handle_exception, and exit immediately if the TB cannot execute. With this change, interrupts are processed and cpu_exec_nocache can make process. Signed-off-by: Maria Klimushenkova Signed-off-by: Pavel Dovgalyuk Message-Id: <20171114081818.27640.33165.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini --- accel/tcg/cpu-exec.c | 95 +++++++++++++++++++++++++++++-------------------= ---- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 0473055a08..f3de96f346 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -470,48 +470,51 @@ static inline void cpu_handle_debug_exception(CPUStat= e *cpu) =20 static inline bool cpu_handle_exception(CPUState *cpu, int *ret) { - if (cpu->exception_index >=3D 0) { - if (cpu->exception_index >=3D EXCP_INTERRUPT) { - /* exit request from the cpu execution loop */ - *ret =3D cpu->exception_index; - if (*ret =3D=3D EXCP_DEBUG) { - cpu_handle_debug_exception(cpu); - } - cpu->exception_index =3D -1; - return true; - } else { + if (cpu->exception_index < 0) { +#ifndef CONFIG_USER_ONLY + if (replay_has_exception() + && cpu->icount_decr.u16.low + cpu->icount_extra =3D=3D 0) { + /* try to cause an exception pending in the log */ + cpu_exec_nocache(cpu, 1, tb_find(cpu, NULL, 0, curr_cflags()),= true); + } +#endif + if (cpu->exception_index < 0) { + return false; + } + } + + if (cpu->exception_index >=3D EXCP_INTERRUPT) { + /* exit request from the cpu execution loop */ + *ret =3D cpu->exception_index; + if (*ret =3D=3D EXCP_DEBUG) { + cpu_handle_debug_exception(cpu); + } + cpu->exception_index =3D -1; + return true; + } else { #if defined(CONFIG_USER_ONLY) - /* if user mode only, we simulate a fake exception - which will be handled outside the cpu execution - loop */ + /* if user mode only, we simulate a fake exception + which will be handled outside the cpu execution + loop */ #if defined(TARGET_I386) + CPUClass *cc =3D CPU_GET_CLASS(cpu); + cc->do_interrupt(cpu); +#endif + *ret =3D cpu->exception_index; + cpu->exception_index =3D -1; + return true; +#else + if (replay_exception()) { CPUClass *cc =3D CPU_GET_CLASS(cpu); + qemu_mutex_lock_iothread(); cc->do_interrupt(cpu); -#endif - *ret =3D cpu->exception_index; + qemu_mutex_unlock_iothread(); cpu->exception_index =3D -1; + } else if (!replay_has_interrupt()) { + /* give a chance to iothread in replay mode */ + *ret =3D EXCP_INTERRUPT; return true; -#else - if (replay_exception()) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - qemu_mutex_lock_iothread(); - cc->do_interrupt(cpu); - qemu_mutex_unlock_iothread(); - cpu->exception_index =3D -1; - } else if (!replay_has_interrupt()) { - /* give a chance to iothread in replay mode */ - *ret =3D EXCP_INTERRUPT; - return true; - } -#endif } -#ifndef CONFIG_USER_ONLY - } else if (replay_has_exception() - && cpu->icount_decr.u16.low + cpu->icount_extra =3D=3D 0) { - /* try to cause an exception pending in the log */ - cpu_exec_nocache(cpu, 1, tb_find(cpu, NULL, 0, curr_cflags()), tru= e); - *ret =3D -1; - return true; #endif } =20 @@ -522,6 +525,19 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { CPUClass *cc =3D CPU_GET_CLASS(cpu); + int32_t insns_left; + + /* Clear the interrupt flag now since we're processing + * cpu->interrupt_request and cpu->exit_request. + */ + insns_left =3D atomic_read(&cpu->icount_decr.u32); + atomic_set(&cpu->icount_decr.u16.high, 0); + if (unlikely(insns_left < 0)) { + /* Ensure the zeroing of icount_decr comes before the next read + * of cpu->exit_request or cpu->interrupt_request. + */ + smp_mb(); + } =20 if (unlikely(atomic_read(&cpu->interrupt_request))) { int interrupt_request; @@ -620,17 +636,14 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, Tr= anslationBlock *tb, =20 *last_tb =3D NULL; insns_left =3D atomic_read(&cpu->icount_decr.u32); - atomic_set(&cpu->icount_decr.u16.high, 0); if (insns_left < 0) { /* Something asked us to stop executing chained TBs; just * continue round the main loop. Whatever requested the exit * will also have set something else (eg exit_request or - * interrupt_request) which we will handle next time around - * the loop. But we need to ensure the zeroing of icount_decr - * comes before the next read of cpu->exit_request - * or cpu->interrupt_request. + * interrupt_request) which will be handled by + * cpu_handle_interrupt. cpu_handle_interrupt will also + * clear cpu->icount_decr.u16.high. */ - smp_mb(); return; } =20 --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510833877759998.5500190992678; Thu, 16 Nov 2017 04:04:37 -0800 (PST) Received: from localhost ([::1]:40291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIuB-0005bM-Sw for importer@patchew.org; Thu, 16 Nov 2017 07:04:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpj-0001u1-JB for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpi-0000N7-Vw for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54182) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpi-0000MU-Pp for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E9A397C849 for ; Thu, 16 Nov 2017 11:59:49 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F3D460F87; Thu, 16 Nov 2017 11:59:47 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:24 +0100 Message-Id: <20171116115926.16627-10-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 16 Nov 2017 11:59:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/11] util/stats64: Fix min/max comparisons 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: Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz stat64_min_slow() and stat64_max_slow() compare the wrong way. This makes iotest 136 fail with clang and -m32. Signed-off-by: Max Reitz Message-Id: <20171114232223.25207-1-mreitz@redhat.com> Signed-off-by: Paolo Bonzini --- util/stats64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/stats64.c b/util/stats64.c index 9968fcceac..389c365a9e 100644 --- a/util/stats64.c +++ b/util/stats64.c @@ -91,7 +91,7 @@ bool stat64_min_slow(Stat64 *s, uint64_t value) low =3D atomic_read(&s->low); =20 orig =3D ((uint64_t)high << 32) | low; - if (orig < value) { + if (value < orig) { /* We have to set low before high, just like stat64_min reads * high before low. The value may become higher temporarily, but * stat64_get does not notice (it takes the lock) and the only ill @@ -120,7 +120,7 @@ bool stat64_max_slow(Stat64 *s, uint64_t value) low =3D atomic_read(&s->low); =20 orig =3D ((uint64_t)high << 32) | low; - if (orig > value) { + if (value > orig) { /* We have to set low before high, just like stat64_max reads * high before low. The value may become lower temporarily, but * stat64_get does not notice (it takes the lock) and the only ill --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151083416024233.80869155733899; Thu, 16 Nov 2017 04:09:20 -0800 (PST) Received: from localhost ([::1]:40326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIyj-0001Om-FR for importer@patchew.org; Thu, 16 Nov 2017 07:09:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIpm-0001xe-Ow for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpl-0000Pc-KA for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48346) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpl-0000P1-Dy for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:53 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36C11FC7AE; Thu, 16 Nov 2017 11:59:52 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id B30B060F87; Thu, 16 Nov 2017 11:59:50 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:25 +0100 Message-Id: <20171116115926.16627-11-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 16 Nov 2017 11:59:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/11] exec: Do not resolve subpage in mru_section 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This fixes a crash caused by picking the wrong memory region in address_space_lookup_region seen with client code accessing a device model that uses alias memory regions. The expensive part of address_space_lookup_region anyway is phys_page_find; performance-wise it is okay to repeat the subsequent subpage lookup. Signed-off-by: BALATON Zoltan Message-Id: <20171114225941.072707456B5@zero.eik.bme.hu> Signed-off-by: Paolo Bonzini --- exec.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/exec.c b/exec.c index 97a24a875e..3bb9fcf257 100644 --- a/exec.c +++ b/exec.c @@ -410,22 +410,16 @@ static MemoryRegionSection *address_space_lookup_regi= on(AddressSpaceDispatch *d, { MemoryRegionSection *section =3D atomic_read(&d->mru_section); subpage_t *subpage; - bool update; =20 - if (section && section !=3D &d->map.sections[PHYS_SECTION_UNASSIGNED] = && - section_covers_addr(section, addr)) { - update =3D false; - } else { + if (!section || section =3D=3D &d->map.sections[PHYS_SECTION_UNASSIGNE= D] || + !section_covers_addr(section, addr)) { section =3D phys_page_find(d, addr); - update =3D true; + atomic_set(&d->mru_section, section); } if (resolve_subpage && section->mr->subpage) { subpage =3D container_of(section->mr, subpage_t, iomem); section =3D &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr= )]]; } - if (update) { - atomic_set(&d->mru_section, section); - } return section; } =20 --=20 2.14.3 From nobody Fri May 3 07:16:28 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510834224970350.6525460776745; Thu, 16 Nov 2017 04:10:24 -0800 (PST) Received: from localhost ([::1]:40332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIzn-0001zh-Rl for importer@patchew.org; Thu, 16 Nov 2017 07:10:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFIps-00020W-J0 for qemu-devel@nongnu.org; Thu, 16 Nov 2017 07:00:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFIpp-0000Te-GT for qemu-devel@nongnu.org; Thu, 16 Nov 2017 07:00:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37082) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFIpp-0000TC-Ak for qemu-devel@nongnu.org; Thu, 16 Nov 2017 06:59:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E6F1356C4 for ; Thu, 16 Nov 2017 11:59:56 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89C6E18BBC; Thu, 16 Nov 2017 11:59:52 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 16 Nov 2017 12:59:26 +0100 Message-Id: <20171116115926.16627-12-pbonzini@redhat.com> In-Reply-To: <20171116115926.16627-1-pbonzini@redhat.com> References: <20171116115926.16627-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 16 Nov 2017 11:59:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/11] fix scripts/update-linux-headers.sh here document 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Gerd Hoffmann The minus sign after << causes the shell to strip only preceding tabs, not spaces. Signed-off-by: Gerd Hoffmann Message-Id: <20171110090354.29608-1-kraxel@redhat.com> Fixes: 40bf8e9aede0f9105a9e1e4aaf17b20aaa55f9a0 Reviewed-by: Roman Kagan Reviewed-by: Stefan Hajnoczi Tested-by: Christian Borntraeger Signed-off-by: Paolo Bonzini --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers= .sh index ad80fe3fca..76fd894a77 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -106,7 +106,7 @@ for arch in $ARCHLIST; do if [ $arch =3D x86 ]; then cat <<-EOF >"$output/include/standard-headers/asm-x86/hyperv.h" /* this is a temporary placeholder until kvm_para.h stops includin= g it */ - EOF +EOF cp "$tmpdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x8= 6/" cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x= 86/" cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x8= 6/" --=20 2.14.3