From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552117867295652.8026027616907; Fri, 8 Mar 2019 23:51:07 -0800 (PST) Received: from localhost ([127.0.0.1]:55286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wkx-0005Fq-Mo for importer@patchew.org; Sat, 09 Mar 2019 02:50:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wia-0003qU-9q for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2WiX-0000NQ-4G for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:27 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2WiV-0000JY-SO for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:24 -0500 Received: by mail-wr1-x436.google.com with SMTP id d17so23651006wre.10 for ; Fri, 08 Mar 2019 23:48:22 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:20 -0800 (PST) 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=yQ26pOTy7P4ofiTlf/SZaifTVQD5oVp7I02mOeiuF9I=; b=XwR7R4bX68c0pxNhZewLV9LTaknhf3/OF+/XaVTT6ucpcHen5ywwbbIt8wcCEkOJ3d o9V/57O4mkR1IfWzbgccRJ2bIX1ECYrk4a8aQQGg1JEHGwMRsPMDKU1MiBbZJLgob+LD wyG87c4eXbpkE9Zh2WRtUrEjSsQ1/H3/ixQLWclwSgxrijGV5s/tVhDCewW4hHQuYPNa MmYItg0k/VzxlTDVBHrcrOycg+lQqQYWYUzElhI7AfxEA6uBwtWDjPMrYkjIYQTyrzcC JcqHZ7EERZvSDAasZ6ucppyymkNcnt/gTyNQnpjEaqyn9XLGpH41q+t69WFNgqnNexV6 sfew== 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=yQ26pOTy7P4ofiTlf/SZaifTVQD5oVp7I02mOeiuF9I=; b=b8cuTZzex1NdLcgOC0NKro4HTtUubUb3Mkk+t8S9lGIAabnM2rOMdfZenhF5T8oscB JZ2sNegsnmecjA2ij/MKY6ECoGk/9ufOSz8FMeYP9wX8ha0wSP8xbeqOHSZt/iPHzSZq z+NaAiEw0jvID4PUpHa+os9qHuSi4X263keA3aH61tjgH4K4qR5RokJAoOkwsZVvE34D e48mvX7VZLc6EuE4IcJy7WNjWZr8VVDA3bZFlj6t1j/fMrrTOS9DYvTWHofwBCaIj49/ BUsFw2ZHv+VA4fDI4xztqdpfmT6K/BDh7srjmDO9JXB0ut4z9wHNihwMcnKeFmOh6lkg fp6Q== X-Gm-Message-State: APjAAAXEelD/wFhBiM+YwOHZZ9f6OqGBIY46ig/5Ae/c6wLArExGFjii 6inV0Zh19F2PoZnb+yDpVPBFR7tn X-Google-Smtp-Source: APXvYqzQNXmxU5QYafksCjAzs0JSQGBkFNtaup8rFPlu6Hiqt9VY12otuSAJ8obF60ve7sbl5V7zqQ== X-Received: by 2002:adf:e3cb:: with SMTP id k11mr13983141wrm.263.1552117700778; Fri, 08 Mar 2019 23:48:20 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:54 +0100 Message-Id: <1552117698-12355-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::436 Subject: [Qemu-devel] [PULL 01/25] memory: Do not update coalesced IO range in the case of NOP 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: Jagannathan Raman Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jagannathan Raman Do not add/del coalesced IO ranges in the case where the same FlatRanges are present in both old and new FlatViews Fixes: 3ac7d43a6fbb ("memory: update coalesced_range on transaction_commit") Signed-off-by: Jagannathan Raman Message-Id: <59572a7353830be4b7aa57d79ccb7ad6b72f0dda.1549406119.git.jag.ra= man@oracle.com> Signed-off-by: Paolo Bonzini --- memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/memory.c b/memory.c index 61d66e4..e49369d 100644 --- a/memory.c +++ b/memory.c @@ -932,9 +932,7 @@ static void address_space_update_topology_pass(AddressS= pace *as, } else if (frold && frnew && flatrange_equal(frold, frnew)) { /* In both and unchanged (except logging may have changed) */ =20 - if (!adding) { - flat_range_coalesced_io_del(frold, as); - } else { + if (adding) { MEMORY_LISTENER_UPDATE_REGION(frnew, as, Forward, region_n= op); if (frnew->dirty_log_mask & ~frold->dirty_log_mask) { MEMORY_LISTENER_UPDATE_REGION(frnew, as, Forward, log_= start, @@ -946,7 +944,6 @@ static void address_space_update_topology_pass(AddressS= pace *as, frold->dirty_log_mask, frnew->dirty_log_mask); } - flat_range_coalesced_io_add(frnew, as); } =20 ++iold; --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552117875990450.7844278906193; Fri, 8 Mar 2019 23:51:15 -0800 (PST) Received: from localhost ([127.0.0.1]:55290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wl6-0005J8-6I for importer@patchew.org; Sat, 09 Mar 2019 02:51:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wic-0003qk-6k for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wia-0000QS-9B for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:39834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2WiX-0000KL-3A for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:26 -0500 Received: by mail-wr1-x42e.google.com with SMTP id l12so7191028wrp.6 for ; Fri, 08 Mar 2019 23:48:22 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:21 -0800 (PST) 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=wvilk2qu5Qdx5WUowgMvoj7mxDtjtQ6brm9r1tUVsfI=; b=D2JNIfEcuXHO0c+OS+g8AyUev4dLiN07A1WfzheUZzaB/T6s21shUI9P5r2wb2rJsu /JsoGstIdsf3uxDb3I4rUARKMtzNyJF5aaW59OeiokDO0lwqGg/RPfVE22wNropNch8W igjqGF1fyvSrMAnfBH564W7TgUGQllWGl/xqdTTvXjnwFM37h2zbj+9GD9j2yO2CUp4Y 2whbH1H8C2XtSYSkZu9sjcAzHW57qPTQvWWgmJ0REEfvVQkbwpflYRHF/Is9XkmQy04j nVFKRSDY4mtBIgSuR48oGJY49K0N+MYypFEjPSQzuMWAxihh0cJQqL18swNPl8SriEAQ jzpg== 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=wvilk2qu5Qdx5WUowgMvoj7mxDtjtQ6brm9r1tUVsfI=; b=ZAfEdPK2Ijn/f8IGNCh6YUHzINIs70CwZyCIBGtMUcanp7hePSacME14h8EF3q6WSx esfblNhXbz/WPNRbDOuZR0mFpjJ8oEH97artsYv5lqTwWzmizsKy2XV9Gvu4Zd/ybnVX /0C+h++UqwYGqrhQY+qQYgw9mILvoJVnmn7oRBrQRuCHm5EE6zM52HEhQCOG/ou3bKhA o26M0nxpQBbTz37iW7QTsjkyjJo6LipBKApBOMbqU4szPDhNo3oASh4daUQpUUZ753Hg ItYpCZBiatwgSjvRuweGujNAcxEdBdhgyc6RnJTPzFaCcusDU7SdStRRXy08h/wyAb10 mHxA== X-Gm-Message-State: APjAAAWsXleXJhNOnrUidDhiIHY/kKr7tE8MHPO38YzRfZyMrxqalvB2 lP0LYagTFiamJVdWbSqYxpMxObp8 X-Google-Smtp-Source: APXvYqwADcvgYV5J0e4jag1xdIgATZpJznJCex2KU1ER8QOfHtXnPAmK6BwDG6O+Zd+DsHE+wI4H5A== X-Received: by 2002:a5d:6542:: with SMTP id z2mr13534986wrv.237.1552117701568; Fri, 08 Mar 2019 23:48:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:55 +0100 Message-Id: <1552117698-12355-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42e Subject: [Qemu-devel] [PULL 02/25] vfio-pci: enable by default 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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" CONFIG_VFIO_PCI was not "default y" - and once you do that, it is also important to disable it if PCI is not there. Reported-by: Alex Williamson Tested-by: Alex Williamson Signed-off-by: Paolo Bonzini --- hw/vfio/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig index ebda9fd..34da2a3 100644 --- a/hw/vfio/Kconfig +++ b/hw/vfio/Kconfig @@ -4,8 +4,9 @@ config VFIO =20 config VFIO_PCI bool + default y select VFIO - depends on LINUX + depends on LINUX && PCI =20 config VFIO_CCW bool --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155211787715523.969448768600955; Fri, 8 Mar 2019 23:51:17 -0800 (PST) Received: from localhost ([127.0.0.1]:55292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wl9-0005Jw-1P for importer@patchew.org; Sat, 09 Mar 2019 02:51:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wic-0003qi-6f for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2WiZ-0000Pn-Oo for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2WiW-0000LG-Fn for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:25 -0500 Received: by mail-wr1-x431.google.com with SMTP id l12so7191067wrp.6 for ; Fri, 08 Mar 2019 23:48:23 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:21 -0800 (PST) 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=AM8HhrwvKQY6Ow4NfI33vktmHaZVGL6hHIAkSjpQLFY=; b=LweokVyr26pgYoP9vGhHSjHpxpRY0V+lKAiGf/mAU9DdtVj2jA+nhuVEcnVxHu1h+u cecg2vXtNAFdkNVbJYwu3jhEVliCnfK3XlvbJlB/OzeTTrSO2AZbvpK04L7kZuihAh0l CPgjMMJcWxR1Ek83ufL5FfCih5JV9b/NOERE0i53aRjXMSfGZg5KrfG2A0C2Yz1JXc25 qCxgK0Kr+FelM7JTrbl4qAb35xjvNhbE0P/CPPhTrq586p4xrCJm6cMNGB3nqonpz1PY lvhezRHKsx/FcTksYdEhnEJPdJG/XE7ZRU2ZaECYOVWR7vqeW/64rb0JgCPxsSK5IOBX gxAA== 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=AM8HhrwvKQY6Ow4NfI33vktmHaZVGL6hHIAkSjpQLFY=; b=TCp60XNzVspfDer6SKwueKL/VxgWWiViWXbdT688SRtoW+1MTS58TsZdXkBjc6BGTG 61qC6XkzOqfbHdMfrHAZDsmegc7ECdlJ4sURBqS7mLZipFvLsfB1hsn8Mh4Ml/oL7ULz 2RAviS9KhLwhi5Gg+7VctIgPks8daecuHWuDZU5Hibiwrp5NPutVK79SjMb1fKnbbMXC cwu9ZeLZiLQ/cKoF+6S0A+QT2xTLVdOo6czohSbX1g2UJugY2CDVrE7cxJS0roB7P/6g VyleH/YMQogBHO3c+p+Y0GSisv4h7oArOEUGmmP4amdGg6M0fxD7Tr4736ctu4fMbXLB t0LA== X-Gm-Message-State: APjAAAU8dUbYCyc44pII41fBwruXUJX8KFwkTTYrc+CX9hJZUN7bjptL t3yMHMXLzH8jDZls8J4mL0JLTpSf X-Google-Smtp-Source: APXvYqyf2cubQbiEmeTdzBngYe5BpG9kzx/lPQVAbYTZ47o7VByXJXWQDf4JTi4vyZLqquXU9zW72A== X-Received: by 2002:a05:6000:1152:: with SMTP id d18mr14274167wrx.128.1552117702506; Fri, 08 Mar 2019 23:48:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:56 +0100 Message-Id: <1552117698-12355-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::431 Subject: [Qemu-devel] [PULL 03/25] hw/i386/pc: run the multiboot loader before the PVH loader 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: Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella Some multiboot images could be in the ELF format. In the current implementation QEMU fails because we try to load these images as a PVH image. In order to fix this issue, we should try multiboot first (we already check the multiboot magic header before to load it). If it is not a multiboot image, we can try the PVH loader. Fixes: ab969087da6 ("pvh: Boot uncompressed kernel using direct boot ABI", = 2019-01-15) Reported-by: Paolo Bonzini Signed-off-by: Stefano Garzarella Message-Id: <20190214180216.246707-1-sgarzare@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4212818..9c8f833 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1210,6 +1210,17 @@ static void load_linux(PCMachineState *pcms, protocol =3D lduw_p(header+0x206); } else { /* + * This could be a multiboot kernel. If it is, let's stop treating= it + * like a Linux kernel. + * Note: some multiboot images could be in the ELF format (the sam= e of + * PVH), so we try multiboot first since we check the multiboot ma= gic + * header before to load it. + */ + if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename, + kernel_cmdline, kernel_size, header)) { + return; + } + /* * Check if the file is an uncompressed kernel file (ELF) and load= it, * saving the PVH entry point used by the x86/HVM direct boot ABI. * If load_elfboot() is successful, populate the fw_cfg info. @@ -1262,12 +1273,6 @@ static void load_linux(PCMachineState *pcms, =20 return; } - /* This looks like a multiboot kernel. If it is, let's stop - treating it like a Linux kernel. */ - if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename, - kernel_cmdline, kernel_size, header)) { - return; - } protocol =3D 0; } =20 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118060685213.09125910769797; Fri, 8 Mar 2019 23:54:20 -0800 (PST) Received: from localhost ([127.0.0.1]:55317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2WoC-0007vB-LE for importer@patchew.org; Sat, 09 Mar 2019 02:54:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wic-0003qj-6k for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wia-0000Qe-AN for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:55316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2WiY-0000M2-Ci for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:27 -0500 Received: by mail-wm1-x335.google.com with SMTP id q187so14583757wme.5 for ; Fri, 08 Mar 2019 23:48:24 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:22 -0800 (PST) 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=AU8ultyrv17wvuIcnzZd3UcpLg2rpRKoFS5qpal8H18=; b=oST2Ndnh8I/cHqtjpCggiH2Rog8Jisnyag+YNFAA/pHwiPkdzaLah3j6Y/igqaXc1H w0BwiR592E0NRXdms8IIosGQV1eMRkfF20/RSuh9ygFwkwvO0fOHQuRL1Vlpd65oBMIX gZx+u0ihQMw4FiQzLUayJQxciOdT1vcfFmG2wl+6ulhpRrvvxfawOu/Kb1feHgIs8EVd wp9HcY/9eL8WhJoUZUf56Z1asrO8yhl3gHa4dkAhO8+T2ThBV9MibsgGS86twdHRA0iz mG12aZFAng04JwY1FV79dQUCHJjJrtGl178ZCQ1yWnoi6n0t/RCwTaYbLUPEUfzq/mir IbWA== 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=AU8ultyrv17wvuIcnzZd3UcpLg2rpRKoFS5qpal8H18=; b=kselsKKo09Ye8TaQlJqRvwC4C28ln9Ey7xgUo6cXMn0Bq3gOktObXDueEM/LLmXYT0 yVqCJEZS2vQz7bpcWxfOsblb7k1jccjgOVhSrzoe0Y3sPxZJrTWl/BOoVX2/afxp/MlY k22OQeKzDIjaA2sEUtjH4hhNhX+7Fe7KoC31mjN7oinX669bczfNKeZBJv3/Aed2a/bw xMgeALOLYQA/HHJScMhtmz+mbnwaxjzfUgayngTrZiSE00BMnAWlDOS0ZMQAjj5MUMv4 S+BcOfjIxRiQpU2w+xelTmrxKL2YgWfScMyYSRV25cuevGMsAYR5divHNb7eeZX9qnOL Ja0A== X-Gm-Message-State: APjAAAXZC4jupDtIFltTaRh8mHN0rYqKX8KLekgKOMNny0N0H/1jgzzF mTcWbSCSfyLfmLuI3pTpTQG5gcyk X-Google-Smtp-Source: APXvYqy9UCf5wQTcL/2IXUOW/tnKDa5ByPEArTz+hRuBi3sUq1a97JCqans3WaIocWWAfwymCPJf/g== X-Received: by 2002:a7b:c017:: with SMTP id c23mr11220520wmb.50.1552117703358; Fri, 08 Mar 2019 23:48:23 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:57 +0100 Message-Id: <1552117698-12355-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::335 Subject: [Qemu-devel] [PULL 04/25] block/iscsi: Restrict Linux-specific 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Some Linux specific code is missing guards, leading to build failure on OSX: $ sudo brew install libiscsi $ ./configure && make [...] CC block/iscsi.o qemu/block/iscsi.c:338:24: error: 'iscsi_aiocb_info' defined but not used= [-Werror=3Dunused-const-variable=3D] static const AIOCBInfo iscsi_aiocb_info =3D { ^~~~~~~~~~~~~~~~ qemu/block/iscsi.c:168:1: error: 'iscsi_schedule_bh' defined but not used= [-Werror=3Dunused-function] iscsi_schedule_bh(IscsiAIOCB *acb) ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Add guards to restrict this code for Linux. Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190220000553.28438-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/iscsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index a0c0084..f31c612 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -145,6 +145,8 @@ static const unsigned iscsi_retry_times[] =3D {8, 32, 1= 28, 512, 2048, 8192, 32768} * unallocated. */ #define ISCSI_CHECKALLOC_THRES 64 =20 +#ifdef __linux__ + static void iscsi_bh_cb(void *p) { @@ -172,6 +174,8 @@ iscsi_schedule_bh(IscsiAIOCB *acb) qemu_bh_schedule(acb->bh); } =20 +#endif + static void iscsi_co_generic_bh_cb(void *opaque) { struct IscsiTask *iTask =3D opaque; @@ -290,6 +294,8 @@ static void iscsi_co_init_iscsitask(IscsiLun *iscsilun,= struct IscsiTask *iTask) }; } =20 +#ifdef __linux__ + /* Called (via iscsi_service) with QemuMutex held. */ static void iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command= _data, @@ -338,6 +344,7 @@ static const AIOCBInfo iscsi_aiocb_info =3D { .cancel_async =3D iscsi_aio_cancel, }; =20 +#endif =20 static void iscsi_process_read(void *arg); static void iscsi_process_write(void *arg); --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118055754502.8925900899376; Fri, 8 Mar 2019 23:54:15 -0800 (PST) Received: from localhost ([127.0.0.1]:55313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wo8-0007m1-Kw for importer@patchew.org; Sat, 09 Mar 2019 02:54:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wig-0003t6-23 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wie-0000UL-2B for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:33 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:34878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wia-0000N4-8X for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:30 -0500 Received: by mail-wm1-x331.google.com with SMTP id y15so14270957wma.0 for ; Fri, 08 Mar 2019 23:48:25 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:23 -0800 (PST) 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=EbLP00A4BLiP9DapEqSnouNkDQH3tjoU/b+1XsA4uo8=; b=MHu454cvDvFHlmqrEFwMU1v8aQuA/Jv7/rkKV8UpFDmAUV82CdrzaRx3WX6Eno9O8I KLhO36bUhp6DJ5akbJXxcTpS5lZ+Th+Pgm3ngLBe4Tz0vpMVGuB55Plq2oIy9eRFuOqI gqyOk/B1b64FQHB7tGWtX3lSYQw+GtQTFH5F8eMHHNgjlsPkeZH+GhYmVSbfmbuY7/ye an+mfP8mrAC6+0cobOqHL1Lx4OMxwGTV2hMKZfrZy4x20eSXUtZcwW8L0yXbROULPi7q ZXiyZ9UorON0D7DxZNWJ1wMyIiBDSK4Bi6f+WfhDPT1CXcWExS38fZYbt4pvwmT/wTLh KQXw== 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=EbLP00A4BLiP9DapEqSnouNkDQH3tjoU/b+1XsA4uo8=; b=RWPKYHymwAUuGy2bIUngyJLK1vwGd6r+ZVmw11s6c2556N5Zf7liQyAG5njetDxGK9 cDZeZr3buVs6i6XJoT4pQ+IcoCSeIYWIH7/07NXXBtJQnVskduaxzY0ki+tVsp4zWvBN SyH4h8YZrUjOH/apB9vyIZISlhfsgbxq6I737uWtC54IyDj0VEuiYiPq8WAcIJs0IPFb RjN6ISZP+XiSsQJoQjROFfU5FGcKM0fspvHfhDUrTc81xPGt6TMlHAtf0mAs6bKd2xvt tnGdm/cZLkO/np2shNB2oUcsvg3OqM16U+l+oj+tGNJAQGTdktOSZ5U17UBiMxGy4Mlr +U4Q== X-Gm-Message-State: APjAAAXjDGNXwGkR4E6VYiwIicRjs+asnk3fPmJ1wWSIuBGvn616zB6R MMFWMav4MdlxzMFxw0PES8mQzekY X-Google-Smtp-Source: APXvYqwMdq7FuLOG8G+wxSeBaXLOMyETXDPdVXRoCy2sDHw7K96n/Wi9BatHI+SXiiUDFMQ2SCgXEQ== X-Received: by 2002:a1c:8088:: with SMTP id b130mr11065964wmd.96.1552117704290; Fri, 08 Mar 2019 23:48:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:58 +0100 Message-Id: <1552117698-12355-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::331 Subject: [Qemu-devel] [PULL 05/25] contrib/elf2dmp: add kernel start address checking 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: Viktor Prutyanov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Viktor Prutyanov Before this patch, if elf2dmp failed to find NT kernel PE magic in allowed virtual address range, then it assumes NULL as NT kernel address and cause segfault. This patch fix the problem described above by checking NT kernel address before futher processing. Signed-off-by: Viktor Prutyanov Message-Id: <20190219211936.6466-1-viktor.prutyanov@phystech.edu> Signed-off-by: Paolo Bonzini --- contrib/elf2dmp/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 1a45eaf..1bfeb89 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -524,6 +524,12 @@ int main(int argc, char *argv[]) } } =20 + if (!nt_start_addr) { + eprintf("Failed to find NT kernel image\n"); + err =3D 1; + goto out_ps; + } + printf("KernBase =3D 0x%016"PRIx64", signature is \'%.2s\'\n", KernBas= e, (char *)nt_start_addr); =20 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118416253321.2323561810531; Sat, 9 Mar 2019 00:00:16 -0800 (PST) Received: from localhost ([127.0.0.1]:55398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wtw-0004cu-5L for importer@patchew.org; Sat, 09 Mar 2019 03:00:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003tK-EF for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000WM-4Q for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:36839) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wif-0000Nx-7j for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wr1-x444.google.com with SMTP id o17so23668688wrw.3 for ; Fri, 08 Mar 2019 23:48:26 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:24 -0800 (PST) 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=Z71wi9k2aAi0+2DvbEnqT56WoXDZVpAnTd+sSqaC6T8=; b=NeLzo7dFPPO32ItEpAOOTuWZc1NDgTPpfhR6hEZXBPIV9VZpKewfPXbPMshXZSqOE1 N84J+xg37OnTqSUkoHgqrQi5ybantsLdzQPxz0BrnIlF9Ajw//6Z+QSfgqQukDfx+GrF 2uXN06Bmhc2N3SSOCIojTKYE5CP9LyCf0orb2ngGGhBSLmjMnwVb/LP3HYRmeuOe/VxR 6ZtSJxDNZUXEKnbNOfbYIaS1FVYgJsYcsPCqk+C6H9MoPUcwhj1bOlzfKliSl9pqgB1C MJWsqgHBme3yDp9olGXD/U1XSQCYX9N+eulzMC82lpts0+indyiCNWgSRh8cXANw5T+W rPWw== 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=Z71wi9k2aAi0+2DvbEnqT56WoXDZVpAnTd+sSqaC6T8=; b=I75Kvg27+ER5wElckdlock1orRn78XVPF/HZ/yTQa1bkvZxXRq5N5hMgS4ETXo/seJ QVLaxWBct7DBqzZwVaJM8mzbqR9HncRJMY2auds5TRHU/ZS6f9w1t8DUcP1C3+B3nPlo rJ8eobHu99B7BTFWNGjElrMYlyXVYYlxh5fvQR3cPpaACnj7/hColKLIWUaDjdhD1rp2 AQ+1z8RUJbNJ57IRbZYfDXkmINN3rO6azC1PcGwNMjjEIYa7yWc+O3SdKVAug+L0DaMo JLOPce9yWeU27lKob7LZZePelzxdkIBUHeOg/EoyNwYIPZWY2dhHMpTdlvpNJTXT09Cs O2/g== X-Gm-Message-State: APjAAAWMsLfyIWyNB3V7RAW7M1EFfeKyCY6AazVnFwlkuEhzOA+iapG9 p9JdC4t/+wTYKWcT1c7mvBkKkAyP X-Google-Smtp-Source: APXvYqzsDgf2tqHucpE2bM63uFZaAW4Sm7nVZfR0+C6enlYLVZ1AA2QQRICTQrm+6dqQ9y87ZX2NLQ== X-Received: by 2002:adf:f40d:: with SMTP id g13mr13550775wro.18.1552117705135; Fri, 08 Mar 2019 23:48:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:47:59 +0100 Message-Id: <1552117698-12355-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::444 Subject: [Qemu-devel] [PULL 06/25] configure: Enable werror for git worktrees 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: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy The configure script checks multiple times whether it works in a git repository and it does this by "test -e "${source_path}/.git" in 4 cases but in one case where it tries to enable werror "-d" is used there which fails on git worktrees as .git is a file then and not a directory. This changes the test to "-e" as other occurrences. Signed-off-by: Alexey Kardashevskiy Message-Id: <20190228043503.68494-1-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 79453a6..c9a260c 100755 --- a/configure +++ b/configure @@ -1836,7 +1836,7 @@ fi # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds if test -z "$werror" ; then - if test -d "$source_path/.git" && \ + if test -e "$source_path/.git" && \ { test "$linux" =3D "yes" || test "$mingw32" =3D "yes"; }; then werror=3D"yes" else --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155211823682887.55382342039343; Fri, 8 Mar 2019 23:57:16 -0800 (PST) Received: from localhost ([127.0.0.1]:55371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wqu-00024V-75 for importer@patchew.org; Sat, 09 Mar 2019 02:57:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wig-0003t7-Q9 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000Vz-0f for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wic-0000Og-BW for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:32 -0500 Received: by mail-wr1-x42a.google.com with SMTP id o9so448323wrv.9 for ; Fri, 08 Mar 2019 23:48:27 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:25 -0800 (PST) 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=1ytn1RT3QC9c4jD4A8N0j1+dRL6KVsvQjz23DA1x0Ks=; b=mixRHGICSNo5O0mFQIZ1qj4JVvzg8IuQ9sCukYlNxcpPZwZvzg6NhF1R2CrzHWQ8X4 eKgONAigRMfriYFz64YwvtSHl+8bUm3JbH2Cn/oNTqg1W0yWh3buMmBSyKTEi7f5yn6S xrWO1bl31vqYjByYJ1mD+LeUsaH76s/XnUliYTHF7auJ/UUbW//r28f5DsyyFQBww33Z GObxDzfcdvIO8R6F9fjhy3Rv6wBjlbA6qOWeTBQRRHvulSGKZu3Ob9LPKhYf8E2Z4o1X s8wC3Vddw4j3Tc4EdQwbdZHSNsJSX3OmFM2BqRIcwSlTAvipsJCCYjmratqNQ5CfM5mX rg7A== 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=1ytn1RT3QC9c4jD4A8N0j1+dRL6KVsvQjz23DA1x0Ks=; b=TQ4bFBolxXfdvyy3Aarv+u/ppQfHizxcnuI4J80OAn4TmR7HJCVBQxIxZGpcvItzsu a5+V4gWB/WNGQ295UC8imbfCA9CWGhU5EIf1bC+3TwzIPG4SUlZutGAPBLSfh2SUZ7aa X0qdFfQroyyvzkdOpVzohuWhuPWWeu/LhQut0Tw2wZLGSx8upe6UhKOgxgf+YHbiiCjk qPdW9Qzg62Y83ob5v75Raw6wPJkixALtsCtMWwR+/DtOpUhFrHyldf659bkaFXexgXQL nB4MGiyAthoVD9XDhY6bzZNF/5ZFE1TcjkJCzpJQ/+YdXeGfNcckND7m6SlwY3I5rQgs VpXg== X-Gm-Message-State: APjAAAXNVzKQsnN9M9hUCq3q6SBRFiPIMrkfeYg8Ax744t2FdCMazJ7J zMoOgesxwMnKI6fWjuW83FwodMjv X-Google-Smtp-Source: APXvYqw5tvvHA4L1RE/FRv7Z2MDAaw2prz6rjr3vp+oac8N725KYsHYkGuQzvA+KNy780F8XEGppxA== X-Received: by 2002:a5d:6b8f:: with SMTP id n15mr13913333wrx.110.1552117706030; Fri, 08 Mar 2019 23:48:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:00 +0100 Message-Id: <1552117698-12355-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42a Subject: [Qemu-devel] [PULL 07/25] target-i386: add kvm stubs to user-mode emulators 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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The CPUID code will call kvm_arch_get_supported_cpuid() and, even though it is undef kvm_enabled() so it never runs for user-mode emulators, sometimes clang will not optimize it out at -O0. That could be considered a compiler bug, however at -O0 we give it a pass and just add the stubs. Reported-by: Kamil Rytarowski Tested-by: Kamil Rytarowski Signed-off-by: Paolo Bonzini --- target/i386/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index cb9c265..48e0c28 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -3,10 +3,10 @@ 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-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o ifeq ($(CONFIG_SOFTMMU),y) obj-y +=3D machine.o arch_memory_mapping.o arch_dump.o monitor.o obj-$(CONFIG_KVM) +=3D kvm.o -obj-$(call lnot,$(CONFIG_KVM)) +=3D kvm-stub.o obj-$(CONFIG_HYPERV) +=3D hyperv.o obj-$(call lnot,$(CONFIG_HYPERV)) +=3D hyperv-stub.o ifeq ($(CONFIG_WIN32),y) --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118056292535.8105458230797; Fri, 8 Mar 2019 23:54:16 -0800 (PST) Received: from localhost ([127.0.0.1]:55315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wo9-0007nu-AS for importer@patchew.org; Sat, 09 Mar 2019 02:54:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wig-0003t5-22 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wie-0000UU-4W for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:33 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:36876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wic-0000Pd-6G for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:31 -0500 Received: by mail-wm1-x32f.google.com with SMTP id x10so14099387wmg.2 for ; Fri, 08 Mar 2019 23:48:28 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:26 -0800 (PST) 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=adXagn2OnV312ZWQcd9hoEeDPAMN44SnRuCEEhj/Dk0=; b=mXjrvHHOn5na9PvYGqxho5P5GAFoQH7KtYnhNvhJcgbj125BJSUFQ6mwnZaV8VvehU aM7MBzO+Si4h+XJ/7MpU0IhkUM/yFhjRxdp1cUFq7kQ0O4IYpMxqRssZpiE7X67hF19V D72wXY6qCfxgyEbatZIarV/eBiOp5P/MakLWXkJR8wBHUNuixXeEW7MWkPmZBqt2bstE wT1KSW0vs9JV49tdlsKshoa5a75QVXdNvvFV3S/c/4LeLryyS2YHrnAV99poY72sV8Z4 pSyXnvFgRFKJtEi/AiFyzOVcD14fPrqsEVv9vfbpA6kPmFoFySUV4/AKPskas6u40U20 joVg== 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=adXagn2OnV312ZWQcd9hoEeDPAMN44SnRuCEEhj/Dk0=; b=Ij/LUdzIwCslicwZG4WRSAVpAE9ZzbW62qKZLoMwO3b9JfbZFI67Ox9btopDbo3e4T 9sy5Egnp8fEnD0ZWhJ/7M8J/dJJ9WWA/kv5IKrQlvORfg2PAMNdr0MhdTcsXXtViNdJd f5i25bCVtNV6QmdnTlHchmC04qAoDiRRKiO9ADH6lhoixJudC2TcAgXCR86iEkRL7C0Z Zhn1ii0oMZvgWZAKcn8z1U5R28oiFZkYmEwJ1pIsSEEzsyc2UwXmvMWqHejWPJKWgwsz w1D473e9FXVRMUL/dufWdhFV84fgDJ6pVz9QLDNqwuq1lOLlup3dl4nkNh+2dNyxoeY4 HnRA== X-Gm-Message-State: APjAAAUzEn972QiXX+sxcy+Vi24GU4mQzc0weF9JxmBUBGzLo3EQdloo MJN0iPS2Siu4pn/DksjBp8igFPDH X-Google-Smtp-Source: APXvYqy0TWHuj8vNaAidaFmdMgjVjpJjBneWieD9ARKBTMNjJKlw0gl3+8zwQxCfMyh/zp2wpWc9lQ== X-Received: by 2002:a1c:9957:: with SMTP id b84mr11810762wme.95.1552117706970; Fri, 08 Mar 2019 23:48:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:01 +0100 Message-Id: <1552117698-12355-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::32f Subject: [Qemu-devel] [PULL 08/25] i386: extended the cpuid_level when Intel PT is 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: , Cc: Luwei Kang , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Luwei Kang Intel Processor Trace required CPUID[0x14] but the cpuid_level have no change when create a kvm guest with e.g. "-cpu qemu64,+intel-pt". Signed-off-by: Eduardo Habkost Signed-off-by: Luwei Kang Message-Id: <1548805979-12321-1-git-send-email-luwei.kang@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 1 + target/i386/cpu.c | 9 +++++++++ target/i386/cpu.h | 3 +++ 3 files changed, 13 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 9c8f833..c6d047b 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -136,6 +136,7 @@ GlobalProperty pc_compat_3_1[] =3D { { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" }, + { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" }, }; const size_t pc_compat_3_1_len =3D G_N_ELEMENTS(pc_compat_3_1); =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d3aa6a8..d90c01a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5031,6 +5031,13 @@ static void x86_cpu_expand_features(X86CPU *cpu, Err= or **errp) x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX); x86_cpu_adjust_feat_level(cpu, FEAT_SVM); x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE); + + /* Intel Processor Trace requires CPUID[0x14] */ + if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT) && + kvm_enabled() && cpu->intel_pt_auto_level) { + x86_cpu_adjust_level(cpu, &cpu->env.cpuid_min_level, 0x14); + } + /* SVM requires CPUID[0x8000000A] */ if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) { x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); @@ -5824,6 +5831,8 @@ static Property x86_cpu_properties[] =3D { DEFINE_PROP_INT32("x-hv-max-vps", X86CPU, hv_max_vps, -1), DEFINE_PROP_BOOL("x-hv-synic-kvm-only", X86CPU, hyperv_synic_kvm_only, false), + DEFINE_PROP_BOOL("x-intel-pt-auto-level", X86CPU, intel_pt_auto_level, + true), DEFINE_PROP_END_OF_LIST() }; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 95112b9..83fb522 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1454,6 +1454,9 @@ struct X86CPU { /* Enable auto level-increase for all CPUID leaves */ bool full_cpuid_auto_level; =20 + /* Enable auto level-increase for Intel Processor Trace leave */ + bool intel_pt_auto_level; + /* if true fill the top bits of the MTRR_PHYSMASKn variable range */ bool fill_mtrr_mask; =20 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118487484961.7273409153632; Sat, 9 Mar 2019 00:01:27 -0800 (PST) Received: from localhost ([127.0.0.1]:55435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wv5-0005hL-F5 for importer@patchew.org; Sat, 09 Mar 2019 03:01:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003tB-5y for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000Wo-DT for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:38723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wig-0000R1-3Y for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wr1-x442.google.com with SMTP id g12so23639139wrm.5 for ; Fri, 08 Mar 2019 23:48:29 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:27 -0800 (PST) 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=jeq1Z775uJWBwJh4Co74sW+KjrQOpq+rUqMR7K7W0yk=; b=TZjS7GrA95hWoaKp+aISkMCYLErMZmGx6OVfqsE6MlSuzxSnVfzs6JwBareu058uYD VGVGexfEZL/NVAx3281F6C6FC1E+Y8xKEWUyv6T9GCRXzyJPhUZ6mX0amnlQfwdPSvmc O603YMvhFxcNruoPfjQDoaGi9DckkmKJA91sht66i9oyHjMD+2GdegIP+syKYzfueDqW U7K51Z7KSFK5lsW9LI8O8xtrkJhCML7cVnHA6pyf9edE+pZLUdtLrEytZ222gdlG/Wfe KBYf5A1QqrlbgMUEohXXFfxJo4g9K3L3xvLL+hTg0eNBGEfitMBacHF0LcyH/8Bu0f4g +xng== 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=jeq1Z775uJWBwJh4Co74sW+KjrQOpq+rUqMR7K7W0yk=; b=uZM1DfYM+49jIvrZwFWAgyrVkhpCKL8TA/iT6rEVxO5KZrDDo9/LeRC7FMDfmiIcb9 hGjY0W5gbInFVZeLcHLbeMzj5klCnZXug4j39SHl05RYuPQagkNOhLCq1VfFUbilfGr9 9mlgvTPAbmYr1bVbYyuS0dY/astVvY2Akc5bLfghOESabMatfpS3jpFn4bNA6Q2ZISDU 20txXh+flSe/x/v7t38lSERM2R3a/xvIrgV/uOjsIWxCc/1LXeIdYBgluLlVWpNXWdZz paDilSdFXUYORwrelicQSMtddHm5ePlcTWp47rzf8IaCrk5YMWXLqT0NyRIOMwZoB/Aq TORw== X-Gm-Message-State: APjAAAUfeDgp85Njytn8/l+xotIAm0mim229XGfrkeIlZKylUn8EE0w1 AAfLwrfUwjDOkNdcDXMy+gW5eEQd X-Google-Smtp-Source: APXvYqx8ZjfNTd75wD1FjPZVu8+Txw7CdbnbDXix6Aat8gEi0+gEQapLQSj12ZdN+v5MHjAi+xQoYw== X-Received: by 2002:adf:edd1:: with SMTP id v17mr13748948wro.300.1552117707866; Fri, 08 Mar 2019 23:48:27 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:02 +0100 Message-Id: <1552117698-12355-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::442 Subject: [Qemu-devel] [PULL 09/25] virtio-scsi: Fix build with gcc 9 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: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Greg Kurz Build fails with gcc 9: CC ppc64-softmmu/hw/scsi/virtio-scsi.o hw/scsi/virtio-scsi.c: In function =C3=A2=E2=82=AC=CB=9Cvirtio_scsi_do_tmf= =C3=A2=E2=82=AC=E2=84=A2: hw/scsi/virtio-scsi.c:265:39: error: taking address of packed member of =C3= =A2=E2=82=AC=CB=9Cstruct virtio_scsi_ctrl_tmf_req=C3=A2=E2=82=AC=E2=84=A2 m= ay result in an unaligned pointer value [-Werror=3Daddress-of-packed-member] 265 | virtio_tswap32s(VIRTIO_DEVICE(s), &req->req.tmf.subtype); | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors All the fields in struct virtio_scsi_ctrl_tmf_req are naturally aligned, so we could in theory drop QEMU_PACKED. Unfortunately, the header file is imported from linux which already has the packed attribute. Trying to fix that in the update-linux-headers.sh script is likely to produce ugliness. Turn the call to virtio_tswap32s() into an assignment instead. Signed-off-by: Greg Kurz Message-Id: <155137678223.44753.5438092367451176318.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index ce99d28..839f120 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -262,7 +262,13 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCS= IReq *req) /* Here VIRTIO_SCSI_S_OK means "FUNCTION COMPLETE". */ req->resp.tmf.response =3D VIRTIO_SCSI_S_OK; =20 - virtio_tswap32s(VIRTIO_DEVICE(s), &req->req.tmf.subtype); + /* + * req->req.tmf has the QEMU_PACKED attribute. Don't use virtio_tswap3= 2s() + * to avoid compiler errors. + */ + req->req.tmf.subtype =3D + virtio_tswap32(VIRTIO_DEVICE(s), req->req.tmf.subtype); + switch (req->req.tmf.subtype) { case VIRTIO_SCSI_T_TMF_ABORT_TASK: case VIRTIO_SCSI_T_TMF_QUERY_TASK: --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118239761810.4153089375924; Fri, 8 Mar 2019 23:57:19 -0800 (PST) Received: from localhost ([127.0.0.1]:55373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wr0-00027L-GX for importer@patchew.org; Sat, 09 Mar 2019 02:57:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003t8-1f for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000W8-22 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:54746) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wie-0000Rv-2X for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:33 -0500 Received: by mail-wm1-x342.google.com with SMTP id f3so14573470wmj.4 for ; Fri, 08 Mar 2019 23:48:30 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:28 -0800 (PST) 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=g9D+NaM9cjVGJCOh2bax1tlthJuA5sOo9R0akmBER38=; b=dcsLtDOpxtSqHUcF8l7GYxdjk7XoMyV1Ihb3QPkmnbVXQ47toNGb+Ge/NzmzHx4LQN lr/n/r995k5Bat+XYeNbbmnbxBhB8dR+udugGjsyX+9wko8Zd4zkn17NhrHUg10N95Mj ZPBRigubhLiNHkp1Ug6lHIkeN3Q4903A7TjjmP1csK2Bj31M96X0/shIHWb5NJv49XBv vjm8xraXrhGSQyVtu+YNMEptOwIp2gdhheuS0a2QLWAB4owgotrIZjxGPoyDNJNcOZTp e4Ps2dGR67fNDnGVAsWsSd5hJgjMSD9OmlkNPgnIJXHLphBkJpIwGJ6W9VObeNrQ0w2A uTNA== 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=g9D+NaM9cjVGJCOh2bax1tlthJuA5sOo9R0akmBER38=; b=jTYTPIkkD2ekVIGk5ctGl4sAoIEV87Xhe6k/VbAZxEE+3HNdVPCHqkG+CcF/BpA/5t eIAGCLc6RnHhwlEfJNLVdS1gQ1407wCc7CfowAeZEXs45U5WzdPaPHc+tPhf3WwwRZly QPlMy5tf/8TwiZ9Tu1iEny2BaVH1x3SJ3QFetx18zLbOuNosYOz/mAfXiltWuicGCEZm Rlei3cjVraqEjk3VMPL39+zK/8qi+g7tTwv6HA7gtXttB05mWTj5IBptyrvWBo1PNW90 GxV/D/VOsqBDCQaJW2AeqovA8EilmN6arq9Db0pqK164bl0rCYi8c//vTFWH5NT/lZW4 3/Ng== X-Gm-Message-State: APjAAAV5vw8douTIdaIvWzTHhUtDNa3odoej/WRRETP9eyAlVRNaUEZ7 hjalixIhC9BVTIpamrHDuaup8DTT X-Google-Smtp-Source: APXvYqyucHppBPKDAImghaGxI3FuDbeOIowEwXy/Xo5H8qACSeTEX4gDulykLPYNBcGuyZXJLIO1ng== X-Received: by 2002:a1c:7d8c:: with SMTP id y134mr11985840wmc.102.1552117708798; Fri, 08 Mar 2019 23:48:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:03 +0100 Message-Id: <1552117698-12355-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::342 Subject: [Qemu-devel] [PULL 10/25] lsi: implement basic SBCL functionality 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sven Schnelle HP-UX checks this register after sending data to the target. If there's no = valid information present, it assumes the client disconnected because the kernel = sent to much data. Implement at least some of the SBCL functionality that is pos= sible without having a real SCSI bus. Signed-off-by: Sven Schnelle Message-Id: <20190215194021.20543-1-svens@stackframe.org> Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 89def14..8ba07f8 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -160,6 +160,11 @@ static const char *names[] =3D { #define LSI_CCNTL1_DDAC 0x08 #define LSI_CCNTL1_ZMOD 0x80 =20 +#define LSI_SBCL_ATN 0x08 +#define LSI_SBCL_BSY 0x20 +#define LSI_SBCL_ACK 0x40 +#define LSI_SBCL_REQ 0x80 + /* Enable Response to Reselection */ #define LSI_SCID_RRE 0x60 =20 @@ -258,6 +263,7 @@ typedef struct { uint8_t sdid; uint8_t ssid; uint8_t sfbr; + uint8_t sbcl; uint8_t stest1; uint8_t stest2; uint8_t stest3; @@ -356,6 +362,7 @@ static void lsi_soft_reset(LSIState *s) s->socl =3D 0; s->sdid =3D 0; s->ssid =3D 0; + s->sbcl =3D 0; s->stest1 =3D 0; s->stest2 =3D 0; s->stest3 =3D 0; @@ -530,6 +537,8 @@ static void lsi_script_dma_interrupt(LSIState *s, int s= tat) =20 static inline void lsi_set_phase(LSIState *s, int phase) { + s->sbcl &=3D ~PHASE_MASK; + s->sbcl |=3D phase | LSI_SBCL_REQ; s->sstat1 =3D (s->sstat1 & ~PHASE_MASK) | phase; } =20 @@ -567,6 +576,7 @@ static void lsi_disconnect(LSIState *s) { s->scntl1 &=3D ~LSI_SCNTL1_CON; s->sstat1 &=3D ~PHASE_MASK; + s->sbcl =3D 0; } =20 static void lsi_bad_selection(LSIState *s, uint32_t id) @@ -1265,7 +1275,9 @@ again: s->scntl1 |=3D LSI_SCNTL1_CON; if (insn & (1 << 3)) { s->socl |=3D LSI_SOCL_ATN; + s->sbcl |=3D LSI_SBCL_ATN; } + s->sbcl |=3D LSI_SBCL_BSY; lsi_set_phase(s, PHASE_MO); break; case 1: /* Disconnect */ @@ -1297,8 +1309,14 @@ again: insn & (1 << 10) ? " CC" : ""); if (insn & (1 << 3)) { s->socl |=3D LSI_SOCL_ATN; + s->sbcl |=3D LSI_SBCL_ATN; lsi_set_phase(s, PHASE_MO); } + + if (insn & (1 << 6)) { + s->sbcl |=3D LSI_SBCL_ACK; + } + if (insn & (1 << 9)) { qemu_log_mask(LOG_UNIMP, "lsi_scsi: Target mode not implemented\n"); @@ -1314,7 +1332,13 @@ again: insn & (1 << 10) ? " CC" : ""); if (insn & (1 << 3)) { s->socl &=3D ~LSI_SOCL_ATN; + s->sbcl &=3D ~LSI_SBCL_ATN; } + + if (insn & (1 << 6)) { + s->sbcl &=3D ~LSI_SBCL_ACK; + } + if (insn & (1 << 10)) s->carry =3D 0; break; @@ -1591,9 +1615,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) ret =3D s->ssid; break; case 0xb: /* SBCL */ - /* ??? This is not correct. However it's (hopefully) only - used for diagnostics, so should be ok. */ - ret =3D 0; + ret =3D s->sbcl; break; case 0xc: /* DSTAT */ ret =3D s->dstat | LSI_DSTAT_DFE; @@ -2143,7 +2165,7 @@ static int lsi_post_load(void *opaque, int version_id) =20 static const VMStateDescription vmstate_lsi_scsi =3D { .name =3D "lsiscsi", - .version_id =3D 0, + .version_id =3D 1, .minimum_version_id =3D 0, .pre_save =3D lsi_pre_save, .post_load =3D lsi_post_load, @@ -2202,6 +2224,7 @@ static const VMStateDescription vmstate_lsi_scsi =3D { VMSTATE_UINT8(stime0, LSIState), VMSTATE_UINT8(respid0, LSIState), VMSTATE_UINT8(respid1, LSIState), + VMSTATE_UINT8_V(sbcl, LSIState, 1), VMSTATE_UINT32(mmrs, LSIState), VMSTATE_UINT32(mmws, LSIState), VMSTATE_UINT32(sfs, LSIState), --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118832489564.0453667406396; Sat, 9 Mar 2019 00:07:12 -0800 (PST) Received: from localhost ([127.0.0.1]:55553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X0e-0001h0-Eq for importer@patchew.org; Sat, 09 Mar 2019 03:07:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003t9-4b for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000Wh-C1 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:54879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wig-0000Tc-3n for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wm1-x329.google.com with SMTP id f3so14573501wmj.4 for ; Fri, 08 Mar 2019 23:48:31 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:29 -0800 (PST) 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=6zDQbSwZUxX7y2jiQ2tcr21YfVkxewJV+Z414eERG8A=; b=MlZgtHqDZr51IRmG9rlZBG5SqmmwrP5Yp54mUi5z8dtR4x0Hxaiu6EOF/2i05BKb/Y ze5HQBjS16Dn8ZptKIB7yKraQWjQzEDP3DwzBtEMWFPz7CefrWnZFyz24XGYSRtfrWxY 83mF5/tCwlN9hjCNz/ATw62zO8ZIt3A5LcaxKQ84tCa4jm6HuZHUOPMA1SF9PhFhEDMZ 7gzWlMwnhZmEfQmpc/vmhU+3V6e08iLr+avSL1wr6ff4zqinKMforyiSmn5nxl+sSZ21 1rwrHCZmytC0EFFDGR0hjMx53kkCsT0quasO3eLNcOLqPDrZAscNfx/fOR/YCvqqgT1F kvSg== 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=6zDQbSwZUxX7y2jiQ2tcr21YfVkxewJV+Z414eERG8A=; b=QTjEtXwUYXlaTRhhrcCB/8nz+ngZKAghxhW8niWY7t0CwwV7DfyNbH2j+/xAa56o1s pia5mIa2EgqhgU/UENQtAd1Mf8I14UkhCTAQMXLRk8VPcE0A3UxIHp+oVqRTanlRFY/f SjH2OAEnKFjPZkbmnaeX9NoCOh02FYWQavWikNLnm0XaPVOKco/1/+bQcYVv1nRviJm5 TsrUBL11b/gY6JycZ+9sP8ysFsg9TfSPD2y3k/xEudcP9+ll5mg7Lrz6bfqcU+I3xVbt bdTdt3taqfFshkS6OWZx0GuwVAUrf1WryT0taYbg8nVZAI9S8pyProkHOJSAcO6bhN52 SiEg== X-Gm-Message-State: APjAAAURQj0R1YV46W6kc/xXeUbAD9Q1mwA/WZWq1ni1H4hjtrxlgwjq b1XHLdXrIIPUCtcoLA9XaqVj8jbn X-Google-Smtp-Source: APXvYqyr962ZyFZMnhBMd6KI65iRLrx4jibfEE+Ta99PaDwdfc/iwm+cP5T27Eyfwwyu0bK+9qUUBQ== X-Received: by 2002:a1c:7e58:: with SMTP id z85mr11701852wmc.52.1552117710311; Fri, 08 Mar 2019 23:48:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:04 +0100 Message-Id: <1552117698-12355-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::329 Subject: [Qemu-devel] [PULL 11/25] lsi: check if SIGP bit is already set in Wait reselect 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sven Schnelle If SIGP is set, the 'Wait for Reselection' command should jump immediately to the address stored in the second DWORD of the instruction. This fixes spurious hangs in the HP-UX 11.11 installer when the SIGP bit gets set by the kernel before the 'Wait for Reselection' command is executed by SCRIPTS. Signed-off-by: Sven Schnelle Tested-by: Helge Deller Message-Id: <20190217113717.7077-1-svens@stackframe.org> Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 8ba07f8..bcff859 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1297,8 +1297,10 @@ again: } break; case 2: /* Wait Reselect */ - if (!lsi_irq_on_rsl(s)) { - lsi_wait_reselect(s); + if (s->istat0 & LSI_ISTAT0_SIGP) { + s->dsp =3D s->dnad; + } else if (!lsi_irq_on_rsl(s)) { + lsi_wait_reselect(s); } break; case 3: /* Set */ --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118675657771.112910729814; Sat, 9 Mar 2019 00:04:35 -0800 (PST) Received: from localhost ([127.0.0.1]:55505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wy7-00087L-MG for importer@patchew.org; Sat, 09 Mar 2019 03:04:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003tC-9c for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000Wv-Eu for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:40850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wig-0000UC-5l for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wm1-x336.google.com with SMTP id g20so14081951wmh.5 for ; Fri, 08 Mar 2019 23:48:32 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:30 -0800 (PST) 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=zzzWGOMxi9Lwua8QNuvDpRax40r+iZtpNX4NGZNCT94=; b=edd+Jm2aaefyyxjIpf4cVovhxMzP3E53cSau9WGu/SSdnD8A2OlUSQzT6oGU3Fs6aV flaJ0xAA43er9ZvDKTn20GNcqzTpluyqnG1xkEaGe8EeW2scmq58bUaLXbFjckHjoNbY 3RsYDg2SBuAiWmTBDKTaXHPNm1BcXm0m2C3nzvl1O6MU7vNuN+FTzb+lGSOyqdj+l2GH 4ay0XNyvirF7ua3PFWWKb7lIYCg4toDsajLAzUqSvMCa1+E5VQoW8+5CeQlZUIBGjbUz in5dI2n0cjOghlMoNxm0QmrbfQAFlChXc6AAPtzTaxUUKsljE0TaEB8rDCv5eFwlHTc9 h89Q== 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=zzzWGOMxi9Lwua8QNuvDpRax40r+iZtpNX4NGZNCT94=; b=pWzbSvOKS6rpmc0LKnTNJ7y6vPHNkISzTAVmy78UyfnOkmo25uYTTzLmoBE5UexMBa xnfYKYrYV/2qQtt8eK+tiP9TmYPXR0bueVu6bI7uwEYa25hIJvJXMAm2H+W0NJ9kC6gp KB4sg/kb9AxVWFC6r1hJeNzJ8aN+dQ7fANXLE8gDuNfLXkaZupkXzv/kejkOnDaEK3v8 wFjVffW53GviNXFETaymQWGteF6X5g7MZZ2Ah5odMOjpC5Z7juJcj9q0xCeuZTQtLtxE IdgbG7/vFHKiS7qQkF4kb2s376dvGSjDSc9JkMPg+Tc1LQKu1zADkX93oUZYYWWdG1JN TeqA== X-Gm-Message-State: APjAAAWzwNj935VbtCtSc/8QlqpmqJnJdSDgK506w1udwSo155hpHKfB rx9RaVwmgiEQyrqmy5e/3sd9RfIG X-Google-Smtp-Source: APXvYqwDemPIn3utubhPh3xsN6Nq/fjRjZba9hHAZpinm9e3g5SqFpiD7Wr2pUkRTnQC3rov8v+U+w== X-Received: by 2002:a1c:9acd:: with SMTP id c196mr12061601wme.145.1552117711253; Fri, 08 Mar 2019 23:48:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:05 +0100 Message-Id: <1552117698-12355-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::336 Subject: [Qemu-devel] [PULL 12/25] update copyright notice 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: David Kiarie Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Kiarie Signed-off-by: David Kiarie Message-Id: <20190304151827.1813-2-davidkiarie4@gmail.com> Signed-off-by: Paolo Bonzini --- hw/i386/amd_iommu.c | 2 +- hw/i386/amd_iommu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 8ad707a..6eabdf9 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -2,7 +2,7 @@ * QEMU emulation of AMD IOMMU (AMD-Vi) * * Copyright (C) 2011 Eduard - Gabriel Munteanu - * Copyright (C) 2015 David Kiarie, + * Copyright (C) 2015, 2016 David Kiarie Kahurani * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index c52886f..0ff9095 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -2,7 +2,7 @@ * QEMU emulation of an AMD IOMMU (AMD-Vi) * * Copyright (C) 2011 Eduard - Gabriel Munteanu - * Copyright (C) 2015 David Kiarie, + * Copyright (C) 2015, 2016 David Kiarie Kahurani * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118063704744.0068641276102; Fri, 8 Mar 2019 23:54:23 -0800 (PST) Received: from localhost ([127.0.0.1]:55319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2WoF-0007zp-Ks for importer@patchew.org; Sat, 09 Mar 2019 02:54:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003tJ-Dy for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000X1-Fd for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:34764) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wig-0000V3-5c for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wm1-x331.google.com with SMTP id o10so10308183wmc.1 for ; Fri, 08 Mar 2019 23:48:33 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:31 -0800 (PST) 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=jFDEogMG2G9oz3LylDbDQT4FsF6rosmiU7KQy1L/n+c=; b=XasfcqzfAnfJ/VTSOj1UVAS0RQHiS7jXv22yA5H5PxqTTEvPaKI8thl9dn77F33v2F LqZlSftEch+SXyzNIv0iH3ucZPeIS4b5B0XKVmKW41Ay+34y4q+hKVZzVwR4jr26hgE1 wjh3D3Fh3MdjhVBVft0m1+/NNJAoiq9V6VDUPejn8lQl1jvv1ujslPIAST0KttK2DyTI of7drS/BJSToWh7C+3boBA5lUKUi3J3xE5kr58txuB/Ui6IHxusItx9jk/y6zmOc69sp 4Z8fZUd/Ka1te91/fAg2qpDJv8/OBMR2r2H0HhYIXXinGXzXuYELPJvvf6EagqEG9xUj 7L9w== 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=jFDEogMG2G9oz3LylDbDQT4FsF6rosmiU7KQy1L/n+c=; b=NW48YvSH1tifLibQ3jeGus3bIGDEAVWbK1bBJ5a/D/g6x6UrhbM4GQXw5MaTccThOq 7TbE6ucMjuW5sKcWrI+4GlWWqqxMmkRzvZoiiiuBAMMCILnf+l52U46+C6F4caHJKGOz 5TJ3iZPMJ3zJyvU23isWGrN6Q27hbTcKNXHxbetJ/e/XMvus+AFUSE99JlNDeUT6nyeq 2W4JrVohT29SOIyfl1TSkTerV6fHzPZczikofmfC2vChwaDUWCsFwiu7On4uXQEvAqux S6U4qE/Suv6YQWX2tNvDQ1WM2J4EuLlJlNMt3qt27FzngFd/jo1O85rwEf2wo/nHPch3 AK+g== X-Gm-Message-State: APjAAAUHZUTDwEARtE3p+6CpsU7DhPyv90/S2HJBXnocvWiySDmCScL6 FQ4vhZckvOi5FlFJZyyjwJ2J4NUk X-Google-Smtp-Source: APXvYqwY8odkcWvPwK66QSOcIjZicGC+D8Og91iz4ymM96nR50Abw7loWOT079wZqk795lbV+f5DCw== X-Received: by 2002:a1c:eb14:: with SMTP id j20mr12004218wmh.32.1552117712096; Fri, 08 Mar 2019 23:48:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:06 +0100 Message-Id: <1552117698-12355-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::331 Subject: [Qemu-devel] [PULL 13/25] build: get rid of target-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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It is possible to specify the trace/ directory already in objs-y; there is no need to have a separate unnest-vars invocation. Signed-off-by: Paolo Bonzini --- Makefile.objs | 1 - Makefile.target | 7 ++----- trace/Makefile.objs | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index ef65a6c..acc53aa 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -101,7 +101,6 @@ version-obj-$(CONFIG_WIN32) +=3D $(BUILD_DIR)/version.o ###################################################################### # tracing util-obj-y +=3D trace/ -target-obj-y +=3D trace/ =20 ###################################################################### # guest agent diff --git a/Makefile.target b/Makefile.target index 40830c5..a458506 100644 --- a/Makefile.target +++ b/Makefile.target @@ -105,6 +105,8 @@ all: $(PROGS) stap # Dummy command so that make thinks it has done something @true =20 +obj-y +=3D trace/ + ######################################################### # cpu emulator library obj-y +=3D exec.o @@ -173,13 +175,10 @@ endif # CONFIG_SOFTMMU dummy :=3D $(call unnest-vars,,obj-y) all-obj-y :=3D $(obj-y) =20 -target-obj-y :=3D block-obj-y :=3D common-obj-y :=3D chardev-obj-y :=3D include $(SRC_PATH)/Makefile.objs -dummy :=3D $(call unnest-vars,,target-obj-y) -target-obj-y-save :=3D $(target-obj-y) dummy :=3D $(call unnest-vars,.., \ authz-obj-y \ block-obj-y \ @@ -191,9 +190,7 @@ dummy :=3D $(call unnest-vars,.., \ io-obj-y \ common-obj-y \ common-obj-m) -target-obj-y :=3D $(target-obj-y-save) all-obj-y +=3D $(common-obj-y) -all-obj-y +=3D $(target-obj-y) all-obj-y +=3D $(qom-obj-y) all-obj-$(CONFIG_SOFTMMU) +=3D $(authz-obj-y) all-obj-$(CONFIG_SOFTMMU) +=3D $(block-obj-y) $(chardev-obj-y) diff --git a/trace/Makefile.objs b/trace/Makefile.objs index afd571c..c544509 100644 --- a/trace/Makefile.objs +++ b/trace/Makefile.objs @@ -36,7 +36,7 @@ $(obj)/generated-helpers.c-timestamp: $(SRC_PATH)/trace-e= vents $(BUILD_DIR)/conf =20 $(obj)/generated-helpers.o: $(obj)/generated-helpers.c =20 -target-obj-y +=3D generated-helpers.o +obj-y +=3D generated-helpers.o =20 =20 $(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp @@ -55,5 +55,5 @@ $(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/tra= ce-events $(BUILD_DIR)/ util-obj-$(CONFIG_TRACE_SIMPLE) +=3D simple.o util-obj-$(CONFIG_TRACE_FTRACE) +=3D ftrace.o util-obj-y +=3D control.o -target-obj-y +=3D control-target.o +obj-y +=3D control-target.o util-obj-y +=3D qmp.o --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118307460144.54090070790858; Fri, 8 Mar 2019 23:58:27 -0800 (PST) Received: from localhost ([127.0.0.1]:55377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2WsC-00037G-D4 for importer@patchew.org; Sat, 09 Mar 2019 02:58:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wih-0003tA-5M for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wig-0000X7-GI for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:40838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wig-0000Vb-58 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:34 -0500 Received: by mail-wm1-x329.google.com with SMTP id g20so14081989wmh.5 for ; Fri, 08 Mar 2019 23:48:34 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:32 -0800 (PST) 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=bPmWozRpF+GF+4OY5aOPErBQNJZqUrJaP5ePOQdGsu0=; b=YozVOdJoKsiJ5TjSiO73n6t5atU+B4tFgRGiLX91rQDQocuX7LdeEWhAVxh9v4KCQj Bs0jt7Up/BCgkQK34MWro9llEXbJ/i0RZYiR2kAKJ0l6ivf8ufqXw6ZpUvkF8axTdeQy 5SaDrsL3gJ/KSNGPmDDPp30lK1VH6NSNi5xhirKFEuPD3ec6P68Fl+s6ZA3dIriOOjWA pjj/y+JYLY6Gvym0rUwgM3vVUzAdco551q8DKXFO0kFC55j4CKPkCKCx+3Pcp/8noUUK 256oyxnY3e01S/90w1pNo60AfqsRYiICID6+phi3Ph9B9EQiaP1+tuoRlsRoEgXFJxfB Aweg== 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=bPmWozRpF+GF+4OY5aOPErBQNJZqUrJaP5ePOQdGsu0=; b=Y1NkKrnFYKhQc3MYbFfh1Riz6+AS7bBmqnDtrjLrAdd8fMvKGe5jPiKYUXqbDlRqBD 5l6gxuTSsg0QwbnIchCfK1h/V/4FiMx4xZn8KfClJITaacqygfd3xcbCjqDrnnWeuk2K LtQtMlLEycEWMacAtnHCYgBCNU2yPxZd3DPV7YN8QA7k3Gm9ArU9QDrGSj6/kRyiESMG ohY/ys/yJEwxE8O47oPVRthC27M0DvFQabGQJO7uxTh7W7nD0+0bYGGIusTS9Db0laCg xG/4FDBH2qPHxmzciXk+ARzyNA4moa9X0+jV7vOjjQqpSgrWBfkTlzsC7CjUhS3gaQR1 qQ3g== X-Gm-Message-State: APjAAAX75Zn3/RlYsZiXDIe55eXeMo/P6281AW3GDaKOJfUfpYy7K4VX v5mTNx3/YVTwQkvfFvcZyJmW6mwP X-Google-Smtp-Source: APXvYqyz+32Nfd5pk1waONI0VeDwcRlBD3843+McdJOA/CbV+Rrc/5ZuoDMAFEK5+NrOFQoG2Vq1qQ== X-Received: by 2002:a7b:c457:: with SMTP id l23mr11178748wmi.2.1552117712910; Fri, 08 Mar 2019 23:48:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:07 +0100 Message-Id: <1552117698-12355-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::329 Subject: [Qemu-devel] [PULL 14/25] build: remove unnecessary assignments from Makefile.target 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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It is only necessary to clear block-obj-y because Makefile.objs uses "+=3D" instead of "=3D"; fix that and remove the assignment. The other variables need not be cleared at all. Signed-off-by: Paolo Bonzini --- Makefile.objs | 2 +- Makefile.target | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index acc53aa..31a84b7 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -13,7 +13,7 @@ authz-obj-y =3D authz/ ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img =20 -block-obj-y +=3D nbd/ +block-obj-y =3D nbd/ block-obj-y +=3D block.o blockjob.o job.o block-obj-y +=3D block/ scsi/ block-obj-y +=3D qemu-io-cmds.o diff --git a/Makefile.target b/Makefile.target index a458506..441ace6 100644 --- a/Makefile.target +++ b/Makefile.target @@ -175,9 +175,6 @@ endif # CONFIG_SOFTMMU dummy :=3D $(call unnest-vars,,obj-y) all-obj-y :=3D $(obj-y) =20 -block-obj-y :=3D -common-obj-y :=3D -chardev-obj-y :=3D include $(SRC_PATH)/Makefile.objs dummy :=3D $(call unnest-vars,.., \ authz-obj-y \ --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118242165386.6431213863541; Fri, 8 Mar 2019 23:57:22 -0800 (PST) Received: from localhost ([127.0.0.1]:55375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wr6-0002CI-CG for importer@patchew.org; Sat, 09 Mar 2019 02:57:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wii-0003ue-9U for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wih-0000Yx-J8 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wih-0000XI-AA for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:35 -0500 Received: by mail-wr1-x429.google.com with SMTP id f14so23644573wrg.1 for ; Fri, 08 Mar 2019 23:48:35 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:33 -0800 (PST) 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=0WS5Q4JyUIwxgsUEeiGuov4FYjyDp84pAKGKZ9Rzb3I=; b=CQWMYC6MK3/ijlpjzuC+IqlyR32hLYuXGUskaQZwk5IJB1dtYEDaQgfLvscJfvO5gH DDQGmOTUHg5W6dXM3Giyl8okYO6rHDXqkrDkAP4TGOB5nUWqbsxRJCI8d60hWi+e0YHB K0JByiSKRM74Slg2N0qDMBdufteH8P/Os6Rk4juSrEyEdIE2uiUp4Y7eBVnKe9AKO5zy sHz8TOZzJ2HsPOFSCd9Iy6PlQ++4FN6YrDlgqe9dKsfLd3xfRmDbDPZNihS19oEajYHd yAu6e2ibYhzQDmEY+QTMPAAFoK7Ip7Pm31bZOMYXsN9P4VWbZTnHDvFBRw1bStQtqTOD ErDQ== 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=0WS5Q4JyUIwxgsUEeiGuov4FYjyDp84pAKGKZ9Rzb3I=; b=TlnHv5NubL6pOt6l1i0CZS8q3uMPerk3S3wcbbPqwPpGvmVVgxdMxtuQJSdZwDQOMZ Uh1kCeSA3ooSh7+iygIoI8yCq/7EMw0jfBFLJM97XN/8fZZtYXJPBS2cGAshqFtCYPGg ItjvyPXI79e9xsjfHWW17S3xpMliKthUdLoYOgXYXnu2n9G6OIlQrPu5kLG0E4w2Kehi VxSc2uNg/s7fR08iagLnCNy/QMwe2NZOsoNG1aG87cm+rmp4Pc7Uy7WivjPfotuwhQs4 L1CZIdqWWelIbRmdNd7+IFqdjs2s9KHge4ZXTrlSrN1SLw50zHRp42KPY0P7Bsj8bMH8 vJcA== X-Gm-Message-State: APjAAAUdmpTlS0WepGUOg/BHBzGn13Mh7zOpSkrL40JgBPGGsEvnPXkM 4lOp0Boke5MDz6lNr+dbODMCmHsd X-Google-Smtp-Source: APXvYqxzyMh1mCHwWMQaGr7yM6+V16K4VrwO1W9ZzQpY701IZSYXzzXQcOkcXCw/giUkEO/6rfyRsQ== X-Received: by 2002:adf:f711:: with SMTP id r17mr5502181wrp.38.1552117713710; Fri, 08 Mar 2019 23:48:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:08 +0100 Message-Id: <1552117698-12355-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::429 Subject: [Qemu-devel] [PULL 15/25] build: clean trace/generated-helpers.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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- Makefile.target | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.target b/Makefile.target index 441ace6..d8048aa 100644 --- a/Makefile.target +++ b/Makefile.target @@ -222,6 +222,7 @@ clean: clean-target rm -f *.a *~ $(PROGS) rm -f $(shell find . -name '*.[od]') rm -f hmp-commands.h gdbstub-xml.c + rm -f trace/generated-helpers.c trace/generated-helpers.c-timestamp ifdef CONFIG_TRACE_SYSTEMTAP rm -f *.stp endif --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118772919332.8278328482754; Sat, 9 Mar 2019 00:06:12 -0800 (PST) Received: from localhost ([127.0.0.1]:55551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wzg-0000zQ-VB for importer@patchew.org; Sat, 09 Mar 2019 03:06:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wij-0003wJ-Uu for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wii-0000a1-J9 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:37 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:34139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wii-0000Z8-Bi for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:36 -0500 Received: by mail-wr1-x42b.google.com with SMTP id f14so23644612wrg.1 for ; Fri, 08 Mar 2019 23:48:36 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:34 -0800 (PST) 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=2duoC/tBK1ofZRrOqZGp8KdZEP7lucvaRvdiprmgyIY=; b=eArtw+SYhEMbRZ52JIfwZCNI6pYxTwBthy+I6nEUqB0US8zmOJgD/lhbUb/i+JLocE 9Rv/HCSeJwQhE69nwoWM6CxgrXgyyQvUov57yGIrrNmP0MUxIef3Vr6D88sWWMGCUNYe qYs8DDxur2Fl/lkay2sNAFOXQWPYj3nxIdcPV2184tnz8XB98rYMOCJtZWGGgC6+JP72 aRy+wZb/wCIoJjmtBIs5wM47L2ft/pXQ6aBqcDQFETngRpwFRAkAHXEtp3XOl/cCUmNY bCxVBwINnsPR+lDBGf2Eb8JkNo+ymjpUBnfbPW8h0NZODid/b5phHAVBNilRKDbeJ+oZ uOEQ== 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=2duoC/tBK1ofZRrOqZGp8KdZEP7lucvaRvdiprmgyIY=; b=XDJZibXi/OVz86DvfeeQlGY4Di9O1nGWjBFQ/TX1fXfzX+dTaYLO5kIvjnSOUsnjd/ +Y7l7Yut/vxjJogLS0CfhJgExPfPgaDm8mJAWHRdpo1q2Kljs3wDtXMYvWv5dne2nJ23 HxtVTcvorNgDoBfWxAYiO74rt9CNBZ82i2/8MWAlJ69yc+AMa47f2ONyc3p7lWR7eLnV vq8iHPfdo/ZIJTi6FyCu1SQqZjI+6j3r6FgrSGyjiOrX3QB/QguCTtVrU1U6mwHkOP0D NvjZh7zPrMtO43AYyFO6cLft6Ox2uYj2zqnuUkJ19F/8itOxXS4n8Q88ZLXN5jY796qw Smfg== X-Gm-Message-State: APjAAAUHIK+gPPvqOUmJ9hpvxS+Tdv2+FVcmWRUAYcCqoTSLNU6ycwlt OMbzUiJdgvU3uQF9QgO41FMcHZQJ X-Google-Smtp-Source: APXvYqwfLW+DLcODCzxw1pRHfJV4CN0LfCPE0oOKPMVQWviPKE5Gof+KVS54Mr9Hv9oHtrMZwZfI3A== X-Received: by 2002:adf:d84c:: with SMTP id k12mr4700605wrl.58.1552117715074; Fri, 08 Mar 2019 23:48:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:09 +0100 Message-Id: <1552117698-12355-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42b Subject: [Qemu-devel] [PULL 16/25] accel: Allow to build QEMU without TCG or KVM 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: Anthony PERARD Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Anthony PERARD Instead of deny build of QEMU without a default accelerator, simply report an error when the user haven't passed -accel or -machine accel=3D and TCG and KVM isn't builtin. ./configure already check that at least one accelerator is available. Signed-off-by: Anthony PERARD Signed-off-by: Paolo Bonzini --- accel/accel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accel/accel.c b/accel/accel.c index 68b6d56..0d5b370 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -91,7 +91,9 @@ void configure_accelerator(MachineState *ms, const char *= progname) #elif defined(CONFIG_KVM) accel =3D "kvm"; #else -#error "No default accelerator available" + error_report("No accelerator selected and" + " no default accelerator available"); + exit(1); #endif } } --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118419531960.6294622429051; Sat, 9 Mar 2019 00:00:19 -0800 (PST) Received: from localhost ([127.0.0.1]:55400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wtz-0004hG-Gb for importer@patchew.org; Sat, 09 Mar 2019 03:00:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wik-0003wK-9a for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wij-0000af-Bn for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:38 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wij-0000Zs-4e for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:37 -0500 Received: by mail-wr1-x433.google.com with SMTP id n2so23650011wrw.8 for ; Fri, 08 Mar 2019 23:48:37 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:35 -0800 (PST) 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=iD7mIAMgyrJupzYWncjcIj7c+SmiAknzmsni0tOtG/c=; b=SBK6HBTU4bpGnUPvXmK1wZpMiGGxgyEKKv22OrO9r34bT3LSu4B6cpZqiKnIli+Ehv GuVfLYNV6osIoi2NEsitg5OhqmNm3jmtHla35E9wLquRnMiA/RLWPXndaZvYOF76lXZt 4k3ePf9NIEbs9XV9SC5IPnxcUCvu65sSMDOockpLryvteDGNvKBxNUoyd7xpKuppe+o4 Jza1gfWWbWyuQYv8bySRXvVPx3sAxMcgYmsnOlW/ga6ooevu7FseTD34Jz0z7jES08zQ enBepV3LEJRMzHB18MfFzYmUp9pX7NQyHZC8V+Z4sYYZh8cyDvZk/EioBEVnz0JfXlZI pmeA== 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=iD7mIAMgyrJupzYWncjcIj7c+SmiAknzmsni0tOtG/c=; b=jY3OZUol2q5Bq/3b1aXrgIDFh64/+zGs9+C6Ji/idPJta19ziL1uOE4rgTBoFcz3tD 1b6Bku4ycagfDHzP+Ze2ExrFCyxmWminLuxb+nZoC4IXa2d0JFEXPffYGV7kIFOYC+nM c+4nxxW2AymyGjNwsyrW8P1BBj052j29oAsgGG2yFCEGa0jeQ8Gx5MR4uOzh4/mUasCN DGz87OsoNrG0cKgcyW5HDpcIiB8++FhWOBgV8KoPyb644RrkbWW4IBsXioi4IPIXXx5L HjnCE5rocnkB7saz6OmS+gswwPb2CKHp+47bj1Puv63ji3WDkwijwho1XE10uIe2DxFu sAKQ== X-Gm-Message-State: APjAAAXTDjI9kL1N4CMQ1oPbBOphkQC++QiAJYfeaAY6FGejJaOYvFmu 9netfOYwnJl5NNJh7WTmIs/9zsDi X-Google-Smtp-Source: APXvYqw100GfeDHm4KbkHPy4/x4Gy9BgDMT1S7KgytDW33LY8RybC4gCuesRE7HLzsBonpEM7mGZ8Q== X-Received: by 2002:adf:dfca:: with SMTP id q10mr13962412wrn.45.1552117715831; Fri, 08 Mar 2019 23:48:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:10 +0100 Message-Id: <1552117698-12355-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::433 Subject: [Qemu-devel] [PULL 17/25] oslib-posix: Ignore fcntl("/dev/null", F_SETFL, O_NONBLOCK) failure 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-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Previous to OpenBSD 6.3 [1], fcntl(F_SETFL) is not permitted on memory devices. Trying this call sets errno to ENODEV ("not a memory device"): 19 ENODEV Operation not supported by device. An attempt was made to apply an inappropriate function to a device, for example, trying to read a write-only device such as a printer. Do not assert fcntl failures in this specific case (errno set to ENODEV) on OpenBSD. This fixes: $ lm32-softmmu/qemu-system-lm32 assertion "f !=3D -1" failed: file "util/oslib-posix.c", line 247, functi= on "qemu_set_nonblock" Abort trap (core dumped) [1] The fix seems https://github.com/openbsd/src/commit/c2a35b387f9d3c "fcntl(F_SETFL) invokes the FIONBIO and FIOASYNC ioctls internally, so the memory devices (/dev/null, /dev/zero, etc) need to permit them." Reviewed-by: Peter Maydell Reviewed-by: Michael S. Tsirkin Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190307142822.8531-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- util/oslib-posix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 37c5854..326d92d 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -244,7 +244,19 @@ void qemu_set_nonblock(int fd) f =3D fcntl(fd, F_GETFL); assert(f !=3D -1); f =3D fcntl(fd, F_SETFL, f | O_NONBLOCK); +#ifdef __OpenBSD__ + if (f =3D=3D -1) { + /* + * Previous to OpenBSD 6.3, fcntl(F_SETFL) is not permitted on + * memory devices and sets errno to ENODEV. + * It's OK if we fail to set O_NONBLOCK on devices like /dev/null, + * because they will never block anyway. + */ + assert(errno =3D=3D ENODEV); + } +#else assert(f !=3D -1); +#endif } =20 int socket_set_fast_reuse(int fd) --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118982192363.7325657436886; Sat, 9 Mar 2019 00:09:42 -0800 (PST) Received: from localhost ([127.0.0.1]:55571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X33-0003Yp-JR for importer@patchew.org; Sat, 09 Mar 2019 03:09:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wil-0003wL-8I for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wik-0000bg-CJ for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:39 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wik-0000aj-4F for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id w2so23643921wrt.11 for ; Fri, 08 Mar 2019 23:48:37 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:36 -0800 (PST) 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=jf3SBzXtbre7n8BFijtQxqJe87YPslLUMcCq/d2F6Ac=; b=qXtcjtNP3OT5SLNr6RhRiacpBik8fvX+yOX9PoQdxjHBik6zhmwTPWN2C7Ooi/czH/ /najNLoX3sCjxLwNHDWi4BkOdczOfzL1nob5AFKmsXsUC3tyZ7P2SqWsKxNQM4LJbuhU jMtuYLf1E5H+RvRM+svYKbiwlAytI6qMvXUiNvrUw0NGiRUUyMxldXtRdXc3focrQgxP 73m/XZF3InWqaX1OwbhoDZ1TM3yEwIgXMPYaOQ9rG/UXsreSaBwiz2NodNJn3NHf7sR7 n2CwSHKq8SSJ1o58edZ1SzA/DVWy1c2PmqDYK/kY9SX4gA8OWdz0Ejv0E2YNLhBimoYT Ui8Q== 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=jf3SBzXtbre7n8BFijtQxqJe87YPslLUMcCq/d2F6Ac=; b=qDR++uc1tCgj5iMpf0izuZA6ljmQGPwo7R0QjmQ7Ffa3OVzqcuF6KLWKPVs5NMRo/y yvIPScFLtSqK/HPwO9J0tk84bv4W99CeEg48im3I4+HSHqVDMmrVnme0Y+0xEB8lOrnV KjQkRWfCH0LjTETszCOZ+k3L9LHb38elMzrtAZlsBuip5jCmndUccY9IUNYKBtlzJ9mm IYWgwOdNBoKCdXqrr03QoAhutQs9Z5s4UnTi8vE1trQVxKMsiosnpXbZ2l2fFBZISWAl 4ZBtWTjyu+c8nfrla5cH11Yu4jFoIEgRVxC3/9s9nx4fvUGFJXddRnRHgZV0O98Gl8r2 nPew== X-Gm-Message-State: APjAAAVPxGyPwRTfZR4k0LuY/mPaMDndSArpp2ARfSUHyX0js/tYggMW LN+xVYn1JUiiile2Yqv2kZa3avk4 X-Google-Smtp-Source: APXvYqw5EOwKfHI6IWNgf7d+oVmofYFvKgSrxQn3bhKBL8FH9Y1TQV2p7wZ6y+qK9FIs/m2jXly0UA== X-Received: by 2002:adf:c7c6:: with SMTP id y6mr13420951wrg.217.1552117716741; Fri, 08 Mar 2019 23:48:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:11 +0100 Message-Id: <1552117698-12355-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::435 Subject: [Qemu-devel] [PULL 18/25] configure: Disable W^X on OpenBSD 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-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Since OpenBSD 6.0 [1], W^X is enforced by default [2]. TCG requires WX access. Disable W^X if it is available. This fixes: # lm32-softmmu/qemu-system-lm32 Could not allocate dynamic translator buffer # sysctl kern.wxabort=3D1 kern.wxabort: 0 -> 1 # lm32-softmmu/qemu-system-lm32 mmap: Not supported Abort trap (core dumped) # gdb -q lm32-softmmu/qemu-system-lm32 qemu-system-lm32.core (gdb) bt #0 0x000017e3c156c50a in _thread_sys___syscall () at {standard input}:5 #1 0x000017e3c15e5d7a in *_libc_mmap (addr=3DVariable "addr" is not avai= lable.) at /usr/src/lib/libc/sys/mmap.c:47 #2 0x000017e17d9abc8b in alloc_code_gen_buffer () at /usr/src/qemu/accel= /tcg/translate-all.c:1064 #3 0x000017e17d9abd04 in code_gen_alloc (tb_size=3D0) at /usr/src/qemu/a= ccel/tcg/translate-all.c:1112 #4 0x000017e17d9abe81 in tcg_exec_init (tb_size=3D0) at /usr/src/qemu/ac= cel/tcg/translate-all.c:1149 #5 0x000017e17d9897e9 in tcg_init (ms=3D0x17e45e456800) at /usr/src/qemu= /accel/tcg/tcg-all.c:66 #6 0x000017e17d9891b8 in accel_init_machine (acc=3D0x17e3c3f50800, ms=3D= 0x17e45e456800) at /usr/src/qemu/accel/accel.c:63 #7 0x000017e17d989312 in configure_accelerator (ms=3D0x17e45e456800, pro= gname=3D0x7f7fffff07b0 "lm32-softmmu/qemu-system-lm32") at /usr/src/qemu/ac= cel/accel.c:111 #8 0x000017e17d9d8616 in main (argc=3D1, argv=3D0x7f7fffff06b8, envp=3D0= x7f7fffff06c8) at vl.c:4325 [1] https://www.openbsd.org/faq/upgrade60.html [2] https://undeadly.org/cgi?action=3Darticle&sid=3D20160527203200 Signed-off-by: Philippe Mathieu-Daud=C3=83=C2=A9 Message-Id: <20190307142822.8531-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure b/configure index c9a260c..62a2a49 100755 --- a/configure +++ b/configure @@ -5903,6 +5903,17 @@ if test "$mingw32" =3D "yes" ; then done fi =20 +# Disable OpenBSD W^X if available +if test "$tcg" =3D "yes" && test "$targetos" =3D "OpenBSD"; then + cat > $TMPC < Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155211910330485.10622279648089; Sat, 9 Mar 2019 00:11:43 -0800 (PST) Received: from localhost ([127.0.0.1]:55655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X51-0005K1-8s for importer@patchew.org; Sat, 09 Mar 2019 03:11:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wim-0003wM-4u for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wil-0000cW-94 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:40 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:34141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wil-0000bd-13 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:39 -0500 Received: by mail-wr1-x42d.google.com with SMTP id f14so23644671wrg.1 for ; Fri, 08 Mar 2019 23:48:38 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:37 -0800 (PST) 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=rNbPQl/4UypgmmLWc5VlRaP5gdCkG3GIJuH7uo4XxeA=; b=YE3tFBmd6lH8QByi8FFZPTFbCquhfWyhh/TJkC1kLzBSrAA/eF9c7MWkT/757ekLPg SiIwDrSk8HowS6fxmAezAM+mqqrfKStxpWXx548bwPPP2JyOciAUedEJFcQk1/agzov4 cIufsmJAtOijI0sUffBT2/5Bc/FBLBl6umOGueUfagrl1SLDxDqbx1Mq+UstBCjKwQ9O x5xlhE6WWRUSdJmivkL8z37q9p/rD3xDCl0NDAjER7Ja4hZFpxmRD9z2SNjfjgARzeLd juPWwyAx3pUiCWKd+gPLbH22+rN0xRgrqUvrewVxJPvCvK9SpV1IfpddhJ2haVX3/Lla OCgw== 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=rNbPQl/4UypgmmLWc5VlRaP5gdCkG3GIJuH7uo4XxeA=; b=qmGXrRlwx9cMrxcM+9VdhGksC68VwYNyr1YTxHbdfiQDaC2teH1QBZmrqXmMdswVM4 /yjm42zfD0aVYrJ6O8DKI9nn17taxHKHKlc49AxbssuZw6YAOt7PyZ7P2cdRL9FrLzlL KEKU4SNk6AnaariAltn1ROJy5JN0fNurzPrCSMQu2nxGaF/Uc8+kyDeWv6Pj9/N/lztN XCxAD71J7rsXdBU+xtdi0j90eEBVVEuNonoDz4LRZS5zUiXLsApYXOiOgZi7gCMVe8or h0dTPgmxhNNnNLLbyNYvs5351WSgFuUhjX5GmQV5VENeVopfrJ9YC1dEgh9IOk0AJ+7/ YzTQ== X-Gm-Message-State: APjAAAUl/PTcZgUikdyCgPXGcJ6UfRCXseLdpsw8jZQ4JEDCKY8oO7W8 6ci3suvp0D73g1SfjrpxIp4j9O90 X-Google-Smtp-Source: APXvYqx5tkzFnDilUSyi6gE3fp9XsUzMT5j9HWrWIast1xSqvi3UeJSd2ZurLCkeDNqfTVkAJUlYyg== X-Received: by 2002:a5d:4b05:: with SMTP id v5mr4478602wrq.323.1552117717678; Fri, 08 Mar 2019 23:48:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:12 +0100 Message-Id: <1552117698-12355-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42d Subject: [Qemu-devel] [PULL 19/25] scsi-disk: Fix crash if request is invaild or disk is no medium 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: Zhengui Li Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhengui Li Qemu will crash with the assertion error that "assert(r->req.aiocb !=3D NULL)" in scsi_read_complete if request is invaild or disk is no medium. The error is below: qemu-kvm: hw/scsi/scsi_disk.c:299: scsi_read_complete: Assertion `r->req.aiocb !=3D NULL' failed. This patch add a funtion scsi_read_complete_noio to fix it. Signed-off-by: Zhengui Li Message-Id: <1551949966-20092-1-git-send-email-lizhengui@huawei.com> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index d4e83ae..e7e865a 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -296,22 +296,15 @@ static void scsi_dma_complete(void *opaque, int ret) aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); } =20 -static void scsi_read_complete(void * opaque, int ret) +static void scsi_read_complete_noio(SCSIDiskReq *r, int ret) { - SCSIDiskReq *r =3D (SCSIDiskReq *)opaque; - SCSIDiskState *s =3D DO_UPCAST(SCSIDiskState, qdev, r->req.dev); - int n; + uint32_t n; =20 - assert(r->req.aiocb !=3D NULL); - r->req.aiocb =3D NULL; - aio_context_acquire(blk_get_aio_context(s->qdev.conf.blk)); - if (scsi_disk_req_check_error(r, ret, true)) { + assert(r->req.aiocb =3D=3D NULL); + if (scsi_disk_req_check_error(r, ret, false)) { goto done; } =20 - block_acct_done(blk_get_stats(s->qdev.conf.blk), &r->acct); - trace_scsi_disk_read_complete(r->req.tag, r->qiov.size); - n =3D r->qiov.size / 512; r->sector +=3D n; r->sector_count -=3D n; @@ -319,6 +312,24 @@ static void scsi_read_complete(void * opaque, int ret) =20 done: scsi_req_unref(&r->req); +} + +static void scsi_read_complete(void *opaque, int ret) +{ + SCSIDiskReq *r =3D (SCSIDiskReq *)opaque; + SCSIDiskState *s =3D DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + + assert(r->req.aiocb !=3D NULL); + r->req.aiocb =3D NULL; + + aio_context_acquire(blk_get_aio_context(s->qdev.conf.blk)); + if (ret < 0) { + block_acct_failed(blk_get_stats(s->qdev.conf.blk), &r->acct); + } else { + block_acct_done(blk_get_stats(s->qdev.conf.blk), &r->acct); + trace_scsi_disk_read_complete(r->req.tag, r->qiov.size); + } + scsi_read_complete_noio(r, ret); aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); } =20 @@ -395,12 +406,12 @@ static void scsi_read_data(SCSIRequest *req) scsi_req_ref(&r->req); if (r->req.cmd.mode =3D=3D SCSI_XFER_TO_DEV) { trace_scsi_disk_read_data_invalid(); - scsi_read_complete(r, -EINVAL); + scsi_read_complete_noio(r, -EINVAL); return; } =20 if (!blk_is_available(req->dev->conf.blk)) { - scsi_read_complete(r, -ENOMEDIUM); + scsi_read_complete_noio(r, -ENOMEDIUM); return; } =20 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118613664208.76958161294795; Sat, 9 Mar 2019 00:03:33 -0800 (PST) Received: from localhost ([127.0.0.1]:55477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wx7-0007F4-HU for importer@patchew.org; Sat, 09 Mar 2019 03:03:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wim-0003wQ-OV for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wim-0000dF-0f for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:40 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wil-0000cJ-PA for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:39 -0500 Received: by mail-wr1-x42f.google.com with SMTP id f14so23644687wrg.1 for ; Fri, 08 Mar 2019 23:48:39 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:37 -0800 (PST) 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=vfSlUZJuyhAvM26ok+RXB9eSxcSKcy+3I5M39JJNxEA=; b=Q2hZSkdHAn8fnhr5oWmbEXrvqjM6OHebc2Bb/d+YXplZ2Q3a9TwDINERvvwftSuiNh 4Z0Y4ldIkMZ+8Zr2HnAB1sK2iryblqnfWiP0eaVuIaU8fbLzBJoGwPH9UNaBN9NzwZV7 0zqXcZNZoy2UPpUGnlWDgJ95Xfqr6Atyp5OalP3dNo5JldoSa8iym6g9ea/JKmFTEoeb SEoX1w5tvA8lQjA6+j7XbaejtTOjuHJKiwNRe7G1FBuPwEOtsMjx4WxkzSCyT9IyhqS3 /tEx3znxcExEW0M/2KkkAetsrjrSTBA8f4o5CjMVz6bx37ECSIiV4tW2CbC4re4k9ELX 3Uwg== 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=vfSlUZJuyhAvM26ok+RXB9eSxcSKcy+3I5M39JJNxEA=; b=CbxmBxpFXdMPbeUCUS+ruahWi3YA/VXM+L16yDN2NwbdNn/cj6/WpuDmsE3uyEXCmY +lpx4YMmwkqh5fRHdgm5idb5SlYFC4e2FlR18cYyq+tMTLT4rt1WFAofFfX1jMppl0Ka v+Ms/jZgbMQr3y1kj1A2cly+BuIIFMAla2JO13of2+CAN2TAVLC0kB0tnE0WSuLLAlA8 KoGGKrkiogqpQxvZfwLr0KrQoHAelFexeUVajOEHk9A4dIixh+ObkHWsPO64D26f7Uiz YmdCb2/fE2c0gwlDJNWpP1sMCNriw3TgF+Uev178bn/TBQoUp/9O24VzmeQn8raKFBl7 eZsg== X-Gm-Message-State: APjAAAWgpzG1uTtPoQ4r00xzG2tPT3hyS2UnbBCkb2aWA4nvZYS56mzU SJJ0C8zaNzyaf6qNVDtvubJ96RgZ X-Google-Smtp-Source: APXvYqy+UT+lLE6/jBgJbd4HOjdXl+ofO3RZ17dbaKlloMShL8XDMQ5AEUT0VJzkFkb2b7Rr6lm1Bg== X-Received: by 2002:a5d:4608:: with SMTP id t8mr14340838wrq.186.1552117718551; Fri, 08 Mar 2019 23:48:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:13 +0100 Message-Id: <1552117698-12355-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42f Subject: [Qemu-devel] [PULL 20/25] lsi: use ldn_le_p()/stn_le_p() 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Sven Schnelle Instead of using the open-coded versions, use the helper already present as this makes the code easier to read and less error-prone. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190305195519.24303-2-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index bcff859..402b785 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -289,8 +289,7 @@ typedef struct { uint8_t sbr; uint32_t adder; =20 - /* Script ram is stored as 32-bit words in host byteorder. */ - uint32_t script_ram[2048]; + uint8_t script_ram[2048 * sizeof(uint32_t)]; } LSIState; =20 #define TYPE_LSI53C810 "lsi53c810" @@ -2079,29 +2078,14 @@ static void lsi_ram_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { LSIState *s =3D opaque; - uint32_t newval; - uint32_t mask; - int shift; - - newval =3D s->script_ram[addr >> 2]; - shift =3D (addr & 3) * 8; - mask =3D ((uint64_t)1 << (size * 8)) - 1; - newval &=3D ~(mask << shift); - newval |=3D val << shift; - s->script_ram[addr >> 2] =3D newval; + stn_le_p(s->script_ram + addr, size, val); } =20 static uint64_t lsi_ram_read(void *opaque, hwaddr addr, unsigned size) { LSIState *s =3D opaque; - uint32_t val; - uint32_t mask; - - val =3D s->script_ram[addr >> 2]; - mask =3D ((uint64_t)1 << (size * 8)) - 1; - val >>=3D (addr & 3) * 8; - return val & mask; + return ldn_le_p(s->script_ram + addr, size); } =20 static const MemoryRegionOps lsi_ram_ops =3D { @@ -2244,7 +2228,7 @@ static const VMStateDescription vmstate_lsi_scsi =3D { VMSTATE_BUFFER_UNSAFE(scratch, LSIState, 0, 18 * sizeof(uint32_t)), VMSTATE_UINT8(sbr, LSIState), =20 - VMSTATE_BUFFER_UNSAFE(script_ram, LSIState, 0, 2048 * sizeof(uint3= 2_t)), + VMSTATE_BUFFER_UNSAFE(script_ram, LSIState, 0, 8192), VMSTATE_END_OF_LIST() } }; --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118409110280.63087951576017; Sat, 9 Mar 2019 00:00:09 -0800 (PST) Received: from localhost ([127.0.0.1]:55396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wtp-0004Xv-St for importer@patchew.org; Sat, 09 Mar 2019 03:00:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Win-0003xM-TA for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wim-0000e3-TG for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:47016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wim-0000dJ-Je for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:40 -0500 Received: by mail-wr1-x42f.google.com with SMTP id i16so23627107wrs.13 for ; Fri, 08 Mar 2019 23:48:40 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:38 -0800 (PST) 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=0KtITCFgm7yckdK/wn/O5zJgkB2Z62Yl4ofit5ZEqQ0=; b=ge5VS7DPruTEiCSWkOjQdqtjyfe7Fw1EtuyJ4r6UfVPqcrPOkD3p6rjnjw9GTzJ6PW /Yhba8PcqVAiGcrXAcoPmjzOQV+uD7ovGZ2/YVIhsDbcS3CQeBweJsm70MG5wrG4LF1d yjq7sWwi00iJ1+gNbCX/XBa3TCJfTY7hIbXai9Qe2YlbtuYAj/zp5379btUHB9SpG4Rb tjNQrkz1XwIPZPHuiUMx/xDJ1R/WzkreEK9d2Y+7x4g1uKkcsTB10flFfauQU0S4AzC5 X0/cp4ASAW3UpZuSOH24b1crdeLdE05FD+tNMQcVC0zmklTY4b+NbBIHKUSS23z9kYG1 WEng== 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=0KtITCFgm7yckdK/wn/O5zJgkB2Z62Yl4ofit5ZEqQ0=; b=YjcVXKVnQQdcIgxjO+CczvuqOmGddoywgfh2pp9cFuky8K+zLVigo792W2ZZdANWr7 y0B4lq5isKSv/PmYCll3OzNHDAx5pig0GulkPbuR4PjGxTm0vY1idQdV9JjEr1hfF4JW dhU8osO75YMH4wc8qMA5Ig6BY/rtsBBCDvaZN+tR0ahZxS+XEDRUB3JYevjYgOb4fLxW ycjsmaWRSrYF0sIcwdqOdMIQvr2yZu4Iyq3ooNkRtzxhHeKE4YKcKPtsGQ3QhrF6U99t Yj3vuKjKYEuzw3DuWSL5yReLQLP1+eJ/SKlMMMfWA3+Jxb1OeQNfbPjqDKo6uBm4F1c2 PQkA== X-Gm-Message-State: APjAAAWH7XvuuT0ZHDT3MejHt7eiBn8bd7s84g/C9QHIUqcoV07Wv9hb 9Ba+KoyTJyBJLrLNlgIyruLIp92b X-Google-Smtp-Source: APXvYqxuXv3cu+3GHHZBlpvCEDglhzU81ApL14GR0mmvRc4DdnvsMuWoH/J03AA8LpNinPavZzFfgA== X-Received: by 2002:adf:8273:: with SMTP id 106mr14223058wrb.34.1552117719396; Fri, 08 Mar 2019 23:48:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:14 +0100 Message-Id: <1552117698-12355-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::42f Subject: [Qemu-devel] [PULL 21/25] lsi: use enum type for s->waiting 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Sven Schnelle This makes the code easier to read - no functional change. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190305195519.24303-3-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 402b785..c17bb4f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -194,6 +194,13 @@ typedef struct lsi_request { QTAILQ_ENTRY(lsi_request) next; } lsi_request; =20 +enum { + LSI_NOWAIT, /* SCRIPTS are running or stopped */ + LSI_WAIT_RESELECT, /* Wait Reselect instruction has been issued */ + LSI_DMA_SCRIPTS, /* processing DMA from lsi_execute_script */ + LSI_DMA_IN_PROGRESS, /* DMA operation is in progress */ +}; + typedef struct { /*< private >*/ PCIDevice parent_obj; @@ -212,10 +219,6 @@ typedef struct { int msg_action; int msg_len; uint8_t msg[LSI_MAX_MSGIN_LEN]; - /* 0 if SCRIPTS are running or stopped. - * 1 if a Wait Reselect instruction has been issued. - * 2 if processing DMA from lsi_execute_script. - * 3 if a DMA operation is in progress. */ int waiting; SCSIBus bus; int current_lun; @@ -322,7 +325,7 @@ static void lsi_soft_reset(LSIState *s) =20 s->msg_action =3D 0; s->msg_len =3D 0; - s->waiting =3D 0; + s->waiting =3D LSI_NOWAIT; s->dsa =3D 0; s->dnad =3D 0; s->dbc =3D 0; @@ -564,10 +567,10 @@ static void lsi_bad_phase(LSIState *s, int out, int n= ew_phase) static void lsi_resume_script(LSIState *s) { if (s->waiting !=3D 2) { - s->waiting =3D 0; + s->waiting =3D LSI_NOWAIT; lsi_execute_script(s); } else { - s->waiting =3D 0; + s->waiting =3D LSI_NOWAIT; } } =20 @@ -744,7 +747,7 @@ static int lsi_queue_req(LSIState *s, SCSIRequest *req,= uint32_t len) Since no interrupt stacking is implemented in the emulation, it is also required that there are no pending interrupts waiting for service from the device driver. */ - if (s->waiting =3D=3D 1 || + if (s->waiting =3D=3D LSI_WAIT_RESELECT || (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON) && !(s->istat0 & (LSI_ISTAT0_SIP | LSI_ISTAT0_DIP)))) { /* Reselect device. */ @@ -789,7 +792,7 @@ static void lsi_transfer_data(SCSIRequest *req, uint32_= t len) int out; =20 assert(req->hba_private); - if (s->waiting =3D=3D 1 || req->hba_private !=3D s->current || + if (s->waiting =3D=3D LSI_WAIT_RESELECT || req->hba_private !=3D s->cu= rrent || (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) { if (lsi_queue_req(s, req, len)) { return; @@ -803,7 +806,7 @@ static void lsi_transfer_data(SCSIRequest *req, uint32_= t len) s->current->dma_len =3D len; s->command_complete =3D 1; if (s->waiting) { - if (s->waiting =3D=3D 1 || s->dbc =3D=3D 0) { + if (s->waiting =3D=3D LSI_WAIT_RESELECT || s->dbc =3D=3D 0) { lsi_resume_script(s); } else { lsi_do_dma(s, out); @@ -1093,7 +1096,7 @@ static void lsi_wait_reselect(LSIState *s) lsi_reselect(s, p); } if (s->current =3D=3D NULL) { - s->waiting =3D 1; + s->waiting =3D LSI_WAIT_RESELECT; } } =20 @@ -1202,16 +1205,16 @@ again: s->dnad64 =3D addr_high; switch (s->sstat1 & 0x7) { case PHASE_DO: - s->waiting =3D 2; + s->waiting =3D LSI_DMA_SCRIPTS; lsi_do_dma(s, 1); if (s->waiting) - s->waiting =3D 3; + s->waiting =3D LSI_DMA_IN_PROGRESS; break; case PHASE_DI: - s->waiting =3D 2; + s->waiting =3D LSI_DMA_SCRIPTS; lsi_do_dma(s, 0); if (s->waiting) - s->waiting =3D 3; + s->waiting =3D LSI_DMA_IN_PROGRESS; break; case PHASE_CMD: lsi_do_command(s); @@ -1278,6 +1281,7 @@ again: } s->sbcl |=3D LSI_SBCL_BSY; lsi_set_phase(s, PHASE_MO); + s->waiting =3D LSI_NOWAIT; break; case 1: /* Disconnect */ trace_lsi_execute_script_io_disconnect(); @@ -1544,7 +1548,7 @@ again: } } } - if (insn_processed > 10000 && !s->waiting) { + if (insn_processed > 10000 && s->waiting =3D=3D LSI_NOWAIT) { /* Some windows drivers make the device spin waiting for a memory location to change. If we have been executed a lot of code then assume this is the case and force an unexpected device disconne= ct. @@ -1556,7 +1560,7 @@ again: } lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0); lsi_disconnect(s); - } else if (s->istat1 & LSI_ISTAT1_SRUN && !s->waiting) { + } else if (s->istat1 & LSI_ISTAT1_SRUN && s->waiting =3D=3D LSI_NOWAIT= ) { if (s->dcntl & LSI_DCNTL_SSM) { lsi_script_dma_interrupt(s, LSI_DSTAT_SSI); } else { @@ -1887,9 +1891,9 @@ static void lsi_reg_writeb(LSIState *s, int offset, u= int8_t val) s->istat0 &=3D ~LSI_ISTAT0_INTF; lsi_update_irq(s); } - if (s->waiting =3D=3D 1 && val & LSI_ISTAT0_SIGP) { + if (s->waiting =3D=3D LSI_WAIT_RESELECT && val & LSI_ISTAT0_SIGP) { trace_lsi_awoken(); - s->waiting =3D 0; + s->waiting =3D LSI_NOWAIT; s->dsp =3D s->dnad; lsi_execute_script(s); } --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118928459555.0521279169527; Sat, 9 Mar 2019 00:08:48 -0800 (PST) Received: from localhost ([127.0.0.1]:55567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X24-0002ji-PG for importer@patchew.org; Sat, 09 Mar 2019 03:08:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wio-0003yj-Rf for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Win-0000ew-OD for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:42 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Win-0000dz-Gr for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:41 -0500 Received: by mail-wr1-x434.google.com with SMTP id d17so23651518wre.10 for ; Fri, 08 Mar 2019 23:48:41 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:39 -0800 (PST) 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=UQJ8d0TbAzHktegHdOg5NvPUwjF5mKHJ/Disi/YaUQQ=; b=VDQGqWWBge5ayXlNN2/AGTuBqBk8Fpo1QK84I1dtZGGwcpJ1yA2Xal43K6ShPyjp2v QJQfsiY5B2PCcYc6e2mn0dazGGEurgu2efxT7UA4FqSHlbHihDd3dXYD/XJBi2BoVCq7 qlCLjpMrxTszr4WOCIbg1v8zfFdk7sA/t23hPqMwi5w0CdORluybkzx3A6rGY0IWtj1f B/O21OrP/iDMpIp3i3kE+StF3NO+Ey22F+pkrq4aGAD7atNKSntv5InndmAN5uz+44fO OnkPYzO0256rEggTRyJ86McYQHmE5whRFEeE6MSzPzBDA9ggKNcdrLcIkjs1g2Iq+Y8r YjgQ== 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=UQJ8d0TbAzHktegHdOg5NvPUwjF5mKHJ/Disi/YaUQQ=; b=QzsLX8fvrhdHLqHbneGr0JBdb4ssq3nLaGa+xLUVpE/J4FpLnElpMqVPdyEuW2dgSV 0I2aWwKj7kSrhk2OslvrmLNBLi5/+BV+tO7cywtXX5VVA5TYXFXzhDvcdfZdt22naR3a CV4OQhw3RdbWYC7MbSz4sAK8ibtxMk19vXHpUx7SVwf1w/CNsdaQSGacN1tGZvAG8Lff N9ksKz33VjT5L1y1xVy9fW6+Ux7kffh81OO9j7SrR/MW6yaVncS2TTNjUVAehiMlJKnH BohuKd5wq3rRUCD775/7qz8HBMzSsz/aqxt4/BrhCZ3L1afmZsmjnm8CnvZ3n/vvITDk ITpw== X-Gm-Message-State: APjAAAUWVpE752DP8pEjkNSK6hDE1T9SucFWhYr3Adk10uUbU1GzvqTq NRvnjvY1QssXLOW1Wp8zdMBY2dNI X-Google-Smtp-Source: APXvYqzhCqdRaA7+WgpqhvyRNnAny3JWrTduXhSlS/tQasMhep6TrJo+zv/m5ZOzQTvrqqPkJejcRA== X-Received: by 2002:adf:e80c:: with SMTP id o12mr13112451wrm.114.1552117720223; Fri, 08 Mar 2019 23:48:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:15 +0100 Message-Id: <1552117698-12355-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::434 Subject: [Qemu-devel] [PULL 22/25] lsi: use enum type for s->msg_action 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Sven Schnelle This makes the code easier to read - no functional change. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190305195519.24303-4-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index c17bb4f..d67584e 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -201,6 +201,13 @@ enum { LSI_DMA_IN_PROGRESS, /* DMA operation is in progress */ }; =20 +enum { + LSI_MSG_ACTION_COMMAND =3D 0, + LSI_MSG_ACTION_DISCONNECT =3D 1, + LSI_MSG_ACTION_DOUT =3D 2, + LSI_MSG_ACTION_DIN =3D 3, +}; + typedef struct { /*< private >*/ PCIDevice parent_obj; @@ -214,8 +221,6 @@ typedef struct { =20 int carry; /* ??? Should this be an a visible register somewhere? */ int status; - /* Action to take at the end of a MSG IN phase. - 0 =3D COMMAND, 1 =3D disconnect, 2 =3D DATA OUT, 3 =3D DATA IN. */ int msg_action; int msg_len; uint8_t msg[LSI_MAX_MSGIN_LEN]; @@ -323,7 +328,7 @@ static void lsi_soft_reset(LSIState *s) trace_lsi_reset(); s->carry =3D 0; =20 - s->msg_action =3D 0; + s->msg_action =3D LSI_MSG_ACTION_COMMAND; s->msg_len =3D 0; s->waiting =3D LSI_NOWAIT; s->dsa =3D 0; @@ -686,7 +691,7 @@ static void lsi_reselect(LSIState *s, lsi_request *p) trace_lsi_reselect(id); s->scntl1 |=3D LSI_SCNTL1_CON; lsi_set_phase(s, PHASE_MI); - s->msg_action =3D p->out ? 2 : 3; + s->msg_action =3D p->out ? LSI_MSG_ACTION_DOUT : LSI_MSG_ACTION_DIN; s->current->dma_len =3D p->pending; lsi_add_msg_byte(s, 0x80); if (s->current->tag & LSI_TAG_VALID) { @@ -857,7 +862,7 @@ static void lsi_do_command(LSIState *s) lsi_add_msg_byte(s, 4); /* DISCONNECT */ /* wait data */ lsi_set_phase(s, PHASE_MI); - s->msg_action =3D 1; + s->msg_action =3D LSI_MSG_ACTION_DISCONNECT; lsi_queue_command(s); } else { /* wait command complete */ @@ -878,7 +883,7 @@ static void lsi_do_status(LSIState *s) s->sfbr =3D status; pci_dma_write(PCI_DEVICE(s), s->dnad, &status, 1); lsi_set_phase(s, PHASE_MI); - s->msg_action =3D 1; + s->msg_action =3D LSI_MSG_ACTION_DISCONNECT; lsi_add_msg_byte(s, 0); /* COMMAND COMPLETE */ } =20 @@ -901,16 +906,16 @@ static void lsi_do_msgin(LSIState *s) /* ??? Check if ATN (not yet implemented) is asserted and maybe switch to PHASE_MO. */ switch (s->msg_action) { - case 0: + case LSI_MSG_ACTION_COMMAND: lsi_set_phase(s, PHASE_CMD); break; - case 1: + case LSI_MSG_ACTION_DISCONNECT: lsi_disconnect(s); break; - case 2: + case LSI_MSG_ACTION_DOUT: lsi_set_phase(s, PHASE_DO); break; - case 3: + case LSI_MSG_ACTION_DIN: lsi_set_phase(s, PHASE_DI); break; default: @@ -1062,7 +1067,7 @@ bad: qemu_log_mask(LOG_UNIMP, "Unimplemented message 0x%02x\n", msg); lsi_set_phase(s, PHASE_MI); lsi_add_msg_byte(s, 7); /* MESSAGE REJECT */ - s->msg_action =3D 0; + s->msg_action =3D LSI_MSG_ACTION_COMMAND; } =20 #define LSI_BUF_SIZE 4096 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118928950585.3512391233011; Sat, 9 Mar 2019 00:08:48 -0800 (PST) Received: from localhost ([127.0.0.1]:55569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X2B-0002sL-QR for importer@patchew.org; Sat, 09 Mar 2019 03:08:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wip-0003yw-L8 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wio-0000fz-L7 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wio-0000el-C8 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:42 -0500 Received: by mail-wr1-x432.google.com with SMTP id l12so7191524wrp.6 for ; Fri, 08 Mar 2019 23:48:42 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:40 -0800 (PST) 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=MeXgrkegz45A7u724nmrmyFXzBs4nH52uk5SITDRMIs=; b=seHbQTuOZwPCzqn5dX0GqB+0ucAjJkXjXFRMxVQEvyn/RWA8k/3jxLT3cN1l/DRdf7 6qWunyLXBSupF3ggwMBbmrlozU6wUYBZySQ71xmpmNFP0940v/DEKFsTWr9KiSO7mesi ldWT+tiPOYEdfLTdnhHzM2fb63VAjVTnCtyrFKzGF4kQ0CTH0Vn1D54hHxTFZAj+iH7K 4D0hMa5rLFvL+/483dFg5YwBG1ZTmGliD6Sj1ZCwtxBIx0UdQQnmB7XMlR+7msqidyEx 4LqWha/aLKyddl/iUpO77zEI4f67qdZAjzIvoeh+Iy0I6zF0RDGgdJm51R5UmoOQilXO s9sA== 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=MeXgrkegz45A7u724nmrmyFXzBs4nH52uk5SITDRMIs=; b=DcBhhi/RII/fquD+hOJP7q+7yYQ8K31EXfkmunbfgSPUguCZGK1TmbBCCY8Jn/zco9 pCThnieiRQf4egTNy8JLwMCAAy+zQT57H49kq+SUANCBitMBvPPHYETOCY+ZTywhOqpt oy6hnfROcb7IAJiyCnliHetFrgymCzafiB0PHggQKCZikRWTr+nRq8Mj4qyt1TvS/dvH IiwS3B4fsEv0KJ41czNnZkM5toPjFiGuo+5iH+FPTsa179qCgk/yS+429b5CwX89UNQ9 QB7mvuWH2hX2QpYp6QMzoA7OTHWQweDPUuB2kEwB4ZN331I35/CtJPMsS1UT566B6Sji Lbzg== X-Gm-Message-State: APjAAAWEOefK9TJnHhRkL8C3M6zDKRzWzfUlLqkysbUzW7Lr7ujpUQ2Y xu+lNTsq5+HrRv4vdiYysZyBUrbk X-Google-Smtp-Source: APXvYqzSrxO98QULNb1Xk7sKXkHfeCr5iydD7c9SQGZvM+/nUPISM4sIiSVQe9AjzSZE8bWRzpzQSg== X-Received: by 2002:a05:6000:1110:: with SMTP id z16mr13911926wrw.28.1552117721081; Fri, 08 Mar 2019 23:48:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:16 +0100 Message-Id: <1552117698-12355-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::432 Subject: [Qemu-devel] [PULL 23/25] lsi: use SCSI phase names instead of numbers in trace 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Sven Schnelle This makes trace logs much easier to read, especially for people who are not fluent in SCSI. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190305195519.24303-5-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 31 +++++++++++++++++++++++-------- hw/scsi/trace-events | 6 +++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index d67584e..66f217f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -306,6 +306,22 @@ typedef struct { #define LSI53C895A(obj) \ OBJECT_CHECK(LSIState, (obj), TYPE_LSI53C895A) =20 +static const char *scsi_phases[] =3D { + "DOUT", + "DIN", + "CMD", + "STATUS", + "RSVOUT", + "RSVIN", + "MSGOUT", + "MSGIN" +}; + +static const char *scsi_phase_name(int phase) +{ + return scsi_phases[phase & PHASE_MASK]; +} + static inline int lsi_irq_on_rsl(LSIState *s) { return (s->sien0 & LSI_SIST0_RSL) && (s->scid & LSI_SCID_RRE); @@ -1201,8 +1217,9 @@ again: s->ia =3D s->dsp - 12; } if ((s->sstat1 & PHASE_MASK) !=3D ((insn >> 24) & 7)) { - trace_lsi_execute_script_blockmove_badphase(s->sstat1 & PHASE_= MASK, - (insn >> 24) & 7); + trace_lsi_execute_script_blockmove_badphase( + scsi_phase_name(s->sstat1), + scsi_phase_name(insn >> 24)); lsi_script_scsi_interrupt(s, LSI_SIST0_MA, 0); break; } @@ -1234,8 +1251,8 @@ again: lsi_do_msgin(s); break; default: - qemu_log_mask(LOG_UNIMP, "lsi_scsi: Unimplemented phase %d\n", - s->sstat1 & PHASE_MASK); + qemu_log_mask(LOG_UNIMP, "lsi_scsi: Unimplemented phase %s\n", + scsi_phase_name(s->sstat1)); } s->dfifo =3D s->dbc & 0xff; s->ctest5 =3D (s->ctest5 & 0xfc) | ((s->dbc >> 8) & 3); @@ -1463,10 +1480,8 @@ again: cond =3D s->carry !=3D 0; } if (cond =3D=3D jmp && (insn & (1 << 17))) { - trace_lsi_execute_script_tc_compp( - (s->sstat1 & PHASE_MASK), - jmp ? '=3D' : '!', - ((insn >> 24) & 7)); + trace_lsi_execute_script_tc_compp(scsi_phase_name(s->sstat= 1), + jmp ? '=3D' : '!', scsi_phase_name(insn >> 24)); cond =3D (s->sstat1 & PHASE_MASK) =3D=3D ((insn >> 24) & 7= ); } if (cond =3D=3D jmp && (insn & (1 << 18))) { diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 29aaa75..09f3fc3 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -268,7 +268,7 @@ lsi_memcpy(uint32_t dest, uint32_t src, int count) "mem= cpy dest 0x%"PRIx32" src lsi_wait_reselect(void) "Wait Reselect" lsi_execute_script(uint32_t dsp, uint32_t insn, uint32_t addr) "SCRIPTS ds= p=3D0x%"PRIx32" opcode 0x%"PRIx32" arg 0x%"PRIx32 lsi_execute_script_blockmove_delayed(void) "Delayed select timeout" -lsi_execute_script_blockmove_badphase(uint8_t phase, uint8_t expected) "Wr= ong phase got %d expected %d" +lsi_execute_script_blockmove_badphase(const char *phase, const char *expec= ted) "Wrong phase got %s expected %s" lsi_execute_script_io_alreadyreselected(void) "Already reselected, jumping= to alternative address" lsi_execute_script_io_selected(uint8_t id, const char *atn) "Selected targ= et %d%s" lsi_execute_script_io_disconnect(void) "Wait Disconnect" @@ -278,8 +278,8 @@ lsi_execute_script_io_opcode(const char *opcode, int re= g, const char *opname, ui lsi_execute_script_tc_nop(void) "NOP" lsi_execute_script_tc_delayedselect_timeout(void) "Delayed select timeout" lsi_execute_script_tc_compc(int result) "Compare carry %d" -lsi_execute_script_tc_compp(uint8_t phase, int op, uint8_t insn_phase) "Co= mpare phase %d %c=3D %d" -lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, int op, int resul= t) "Compare data 0x%"PRIx32" & 0x%x %c=3D 0x%x" +lsi_execute_script_tc_compp(const char *phase, char op, const char *insn_p= hase) "Compare phase %s %c=3D %s" +lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, char op, int resu= lt) "Compare data 0x%"PRIx32" & 0x%x %c=3D 0x%x" lsi_execute_script_tc_jump(uint32_t addr) "Jump to 0x%"PRIx32 lsi_execute_script_tc_call(uint32_t addr) "Call 0x%"PRIx32 lsi_execute_script_tc_return(uint32_t addr) "Return to 0x%"PRIx32 --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118766492142.81602233850867; Sat, 9 Mar 2019 00:06:06 -0800 (PST) Received: from localhost ([127.0.0.1]:55549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wza-0000tP-FW for importer@patchew.org; Sat, 09 Mar 2019 03:06:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wip-0003yy-PT for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wip-0000gm-69 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:34146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wio-0000fj-VN for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:43 -0500 Received: by mail-wr1-x432.google.com with SMTP id f14so23644780wrg.1 for ; Fri, 08 Mar 2019 23:48:42 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:41 -0800 (PST) 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=MVbKGZ5IZNniHsdQwSGV9lfa6JW/VzOYJ/nU6DXVyag=; b=oGDB7RQkutifDL/7TALzZex5Vld6VBgAswSKBmO+hGHAzi+fE1Jhrhk4RzSrOCSGpT ndFNMwdw3WtTubpsUqrWw7AHi5VpF/KCZXVCie1dTxqQvtWql2RrUsIMArTtO+YuKS76 yqx3FfC4s+0ZlWsczRejrbVfEeND3O2vwmVqkkLUH8J9u3qj5XJu2criGPMSvnB9NWEo v5eKDMpK7tLpJ0C8H/9mAg8gl5gAUckbQ1Okl85c7VklGagzvOameER0q7i3NoiTXH74 hsK5dNFdukaPUZSYcBqWKTaSalnoOf8XZ91F0tnOHxr8reGWSIeFelCVLnXsu0PgkiMY A8xg== 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=MVbKGZ5IZNniHsdQwSGV9lfa6JW/VzOYJ/nU6DXVyag=; b=OD9ikg2Or46tu4HgMCBIF8zWS54sav4nQX7CWg3GYNdhDdJ2An3IO0kjUOEt6S03ID t/PGB7umw7HEfz5sZ9H0NeoKkSshrxlpTheU6JSqZckB/6ZF3ciD7qMFiifV2p7SAyAL dXEGumOq8U0UfH6PfcDisHH/+uYqmJ0Pw/fXDjrZMFXapINlq6nqACY8MuEg0/WS/oDD LqdHXiXSJWyqgHJzP7Nx24XPhRFF3XrPUM1zvgC/MPBv3m73Nx8/EiRObcaaOl3zk5Li pHAHlz3Xl5z/ZzP/sVZZR9sz/UWQHyAg9CLs9h4MmOZ0QZHNuxj/9GjuOq+d97DAwkEj rhIQ== X-Gm-Message-State: APjAAAUFttFCdPd0flp2UkopEnHm3Igf6HWqh+Qj24FIJXaWY4dGygE1 B779R87idpOulQYFY6UqteAIA2id X-Google-Smtp-Source: APXvYqzDBJmDF4mkW2wkTj0QNjiEATbPGx3S0SZRwG2NQomezZf4XL5tEEfWIh3Tbf/pu0enufxmuQ== X-Received: by 2002:a5d:5386:: with SMTP id d6mr13026753wrv.104.1552117721802; Fri, 08 Mar 2019 23:48:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:17 +0100 Message-Id: <1552117698-12355-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::432 Subject: [Qemu-devel] [PULL 24/25] lsi: return dfifo 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: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sven Schnelle Code was assigning DFIFO, but didn't return the value to users. Signed-off-by: Sven Schnelle Message-Id: <20190305195519.24303-6-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 66f217f..bf6b6a5 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1688,7 +1688,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) break; CASE_GET_REG32(temp, 0x1c) case 0x20: /* DFIFO */ - ret =3D 0; + ret =3D s->dfifo; break; case 0x21: /* CTEST4 */ ret =3D s->ctest4; --=20 1.8.3.1 From nobody Sun Nov 9 20:45:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118600712950.9261863625746; Sat, 9 Mar 2019 00:03:20 -0800 (PST) Received: from localhost ([127.0.0.1]:55467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wwv-00075O-Go for importer@patchew.org; Sat, 09 Mar 2019 03:03:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wir-0003yz-1v for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wiq-0000hq-6E for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:45 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wip-0000h7-VW for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:44 -0500 Received: by mail-wr1-x432.google.com with SMTP id o9so448759wrv.9 for ; Fri, 08 Mar 2019 23:48:43 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:42 -0800 (PST) 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=uIBSjJbSBlzJmgYY+P1hbCL5o/SExbcPwhWFh0qmdgw=; b=Gv1MEUeATxo8rC8ISqv/CWUtUPS8r86W+rnITkzg6d7YVCTMpM3K493Q87GIDxv9ma Aq5zwurq79LPKzh2I47z1vqwnL2XDlFfBWKEfbinbvplVn613JVsLfGOuYc3T4Q1g+Qv qHFO5AeCb0rrI/hqxCksRxzR4pVVyxzH+DU+lsQAh1LU4Zs6S8yJFdp0JjOJuqCG36fb /h6KBXkassrwRFAKzbdV8OhxXNHrlCIAWWkRe/NsGrKFrujpAd/TPwnc3KrKDO3zr28G jac9IGuJe7K/MIQUWxzluT8gYZUtNi+KbTkwEdpa0x9sWsRqTJeYJnilcVkvHgL2cuJg AifQ== 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=uIBSjJbSBlzJmgYY+P1hbCL5o/SExbcPwhWFh0qmdgw=; b=htVqJ1qcNAWW317ODXWGWPMijN5cZdTuFXJ754r+1Obpu5ADtIgyKPyXjQ4+qKlvsY QQqadUHV4gonST08rVxh5798Xr59H+Ln7k8XVZy2qeR81CaUFcWCCENxDJK/+92o8LuN hA2pGknHxsO0hRrEQiGi/jvXj7aCQuMMEwVNaallHhvyeqrDP/V0n6YTLJ9wJOmuYerP N2R6Mjj5u0N1RIjNP7BtzKN2tv11NznZct4PQr6t9FEbndySaQh4vnTziGrCub+u6P5u SuVaRmG5cUIgx0Zk4OtsXvNAb7/MiVbpo7jF/Oy76pvbEO1HjuMnN9b+GDgRhSS4eT0o g7MA== X-Gm-Message-State: APjAAAXKV09XAFFK9pzmjvqA5lMS18fLRlA9YwMvW4tGLitOLU23eukK KWxr9npxr14ocz84RlNKXOPAgtL1 X-Google-Smtp-Source: APXvYqyBUmDCBeBoE/SO446Ev6EuuX/ZlckSxvWPoyhQqaqwrw3cnLGQAkF+af8a3ybCijfdq6DHqA== X-Received: by 2002:a5d:6542:: with SMTP id z2mr13535745wrv.237.1552117722753; Fri, 08 Mar 2019 23:48:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:18 +0100 Message-Id: <1552117698-12355-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-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:4864:20::432 Subject: [Qemu-devel] [PULL 25/25] exec: streamline flatview_add_to_dispatch 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) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The while loop in flatview_add_to_dispatch can only be executed twice and it will go through different paths on each execution (in fact one of the "if" branches is dead). Remove the loop completely, the code becomes clearer at the cost of a handful of duplicated lines. Reported-by: Wei Yang Signed-off-by: Paolo Bonzini --- exec.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/exec.c b/exec.c index 1d4f378..9647593 100644 --- a/exec.c +++ b/exec.c @@ -1601,33 +1601,37 @@ static void register_multipage(FlatView *fv, =20 void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section) { - MemoryRegionSection now =3D *section, remain =3D *section; + MemoryRegionSection remain =3D *section; Int128 page_size =3D int128_make64(TARGET_PAGE_SIZE); =20 - if (now.offset_within_address_space & ~TARGET_PAGE_MASK) { + if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { + MemoryRegionSection now =3D remain; uint64_t left =3D TARGET_PAGE_ALIGN(now.offset_within_address_spac= e) - now.offset_within_address_space; =20 now.size =3D int128_min(int128_make64(left), now.size); register_subpage(fv, &now); - } else { - now.size =3D int128_zero(); - } - while (int128_ne(remain.size, now.size)) { + if (int128_eq(remain.size, now.size)) { + return; + } remain.size =3D int128_sub(remain.size, now.size); remain.offset_within_address_space +=3D int128_get64(now.size); remain.offset_within_region +=3D int128_get64(now.size); - now =3D remain; - if (int128_lt(remain.size, page_size)) { - register_subpage(fv, &now); - } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK)= { - now.size =3D page_size; - register_subpage(fv, &now); - } else { - now.size =3D int128_and(now.size, int128_neg(page_size)); - register_multipage(fv, &now); + } + + if (int128_ge(remain.size, page_size)) { + MemoryRegionSection now =3D remain; + now.size =3D int128_and(now.size, int128_neg(page_size)); + register_multipage(fv, &now); + if (int128_eq(remain.size, now.size)) { + return; } + remain.size =3D int128_sub(remain.size, now.size); + remain.offset_within_address_space +=3D int128_get64(now.size); + remain.offset_within_region +=3D int128_get64(now.size); } + + register_subpage(fv, &remain); } =20 void qemu_flush_coalesced_mmio_buffer(void) --=20 1.8.3.1