From patchwork Mon Mar 11 16:55:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hZOUlZWe"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Dp3yWSz9s3q for ; Tue, 12 Mar 2019 04:03:22 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OKe-0004ET-GI for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:03:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODF-0006j0-QT for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODF-0002nb-4L for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:41 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODE-0002mw-Sj for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:41 -0400 Received: by mail-wr1-x436.google.com with SMTP id y15so4133155wro.4 for ; Mon, 11 Mar 2019 09:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yQ26pOTy7P4ofiTlf/SZaifTVQD5oVp7I02mOeiuF9I=; b=hZOUlZWeCEEX+AtZpcOqSSEH8KwFfoLuRbAjDT/oRQTakoAnNmjD/xDsvaeQWx7mT5 /ThuYRmYdzTaSlLfUgKEFjkAhd///x52FBx9a+/5ed0qXHNqjm0Bcr9AgQrgcXXm3soA G3okjjbZLX/X5Wo6Vda48qJTVCwuRhCoGaULGZElnnc8VqtyTqTLMfmfgabAMSKa/tjD Mnk+e1+H0vkZUrTWRx704ajAfjoAX2re4b8spz9ygzdud+3biRzSKwdgCQnkL1MDtsjx rQxgyCo+DBz5/sSMIFgpz3Knkivl7nw2OxWwtCuQM8PpFyahY3evEdO4RFv3amH97zUU xpLQ== 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=Qg3yehgVSFnrdOqtLqa8FQdkSkDaT7g9kS7CzlCbOSz+htFo3jNkMTMsksEDRdrpgJ t91dvRtd6stUYP0d8ZQxN3SUVj1GgtR+Hjcux4GhYpOpz9rbVfJBuxnWqt70Ft3Xu5mL dXbfuTItqOyGQ0/JHzYH2JQF3uTV8UIAj04/ztAmItRYGJoAtMcfZZVkFKv9gq88wxIj PkP2no7/hNuNwP1FlCHDxf7R07Cx8KAzTaPZVGcfrv1ABCrkbcsvziuXG8l4SMZkmiki yT4MaBYCx+Gq40PgPwF8Ppupy6XY/nT2H67/0fiGxcAiOGLZtR8e/bwQ3EmX2yeHAiEY tzWA== X-Gm-Message-State: APjAAAXKOiF6EaGPFIl48YpcjG0vb/ZoJU4Ulf5xHqjjvb/+seoVIAyf CeXMkhl8SbORm5hsCcfux55t0Fmv X-Google-Smtp-Source: APXvYqzbnLryiYUg3iTlk+EWoj2VgdfU+Um6GhxzvOfcQdf3D1qw8wDwuCWAHqIFfhEZcViIINqgag== X-Received: by 2002:a5d:6207:: with SMTP id y7mr20185771wru.60.1552323339435; Mon, 11 Mar 2019 09:55:39 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:05 +0100 Message-Id: <1552323335-46779-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 01/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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.raman@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(AddressSpace *as, } else if (frold && frnew && flatrange_equal(frold, frnew)) { /* In both and unchanged (except logging may have changed) */ - if (!adding) { - flat_range_coalesced_io_del(frold, as); - } else { + if (adding) { MEMORY_LISTENER_UPDATE_REGION(frnew, as, Forward, region_nop); 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(AddressSpace *as, frold->dirty_log_mask, frnew->dirty_log_mask); } - flat_range_coalesced_io_add(frnew, as); } ++iold; From patchwork Mon Mar 11 16:55:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RI/hW/ih"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Ns4LWvz9s4V for ; Tue, 12 Mar 2019 04:10:21 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ORP-0001Pw-GE for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:10:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODI-0006lm-H0 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODH-0002p9-K1 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:44 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:38539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODH-0002od-Bw for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:43 -0400 Received: by mail-wm1-x331.google.com with SMTP id a188so5017216wmf.3 for ; Mon, 11 Mar 2019 09:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=wvilk2qu5Qdx5WUowgMvoj7mxDtjtQ6brm9r1tUVsfI=; b=RI/hW/ihOcqyrjER+W1G3KByN/Rd44v+nRE4MxYIhY0Xx7BhvHGpQG5jXpfl43BAjZ 9d1yQSo6h/wSe4rLpTEUr65ra6rj7upRRs8ylYM9iEO4LCz6f8AC8cCL2z/DfamYnvoZ B0Df7QPRRkdyWu2rApp9Cl2eiQxQbbnBooqF72OvNchJi3fjqJD7gfdGyIeeYm+7A6oQ ZTuSga0wNH/gXMyw6A94oKxFuPrBIDe6TQDaDeu3w5Fc4wOHB9M9FeqaWwM60uRyeQfq /0nuoW8QLjjJR7PCIax7Y8TSkgE/C5LpA/u7MloZpTUi6W2fw+MMfRHKrh5pLw0r/02E /0nA== 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=o7Vr4wrDCWAU8+Px7LBvGiprWavMTFgViB9BxmZG6lXmkf7qh59hzd5hIxS20AViH1 86S9ORvwM86762hIsLUDyO/IMcu8Tc/6TL4hm/E89Cml0fHYANPJ/npua4G+gXX+LNr9 aJFB6NBRofuRKBE4Vpli0ce3N/PV9NHsK2POLsrR5ZlJk2sNcQoohWnhQBoPb935mm0D L88gKvSQeFy6XSq784pswCPjDgpcNRZeS7KHf57xMikApdfIxUdixtCFyHZcMDGEsG06 VqMqvOTlJzFCf2Bv6iWn4QYJyVuS7bDS7rx3xA/bxj4zsix0G3MpvtthSmUpw9w08lxf QBAw== X-Gm-Message-State: APjAAAX443Ax3JvGQIxjxdX4GrAp+mTC4fGq/v+3aHPioGr6d5QQ/DKc EUm0ksNXcYlIl2pSKw5tfpnDn2gF X-Google-Smtp-Source: APXvYqyQRwz6WXjGFus+SHOkA5iM7RLVUfBc7ylWrqCVp8MTixwHMHHInNkgPFz6wLL7R9AxfJqFeQ== X-Received: by 2002:a1c:14e:: with SMTP id 75mr30431wmb.48.1552323340682; Mon, 11 Mar 2019 09:55:40 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:39 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:06 +0100 Message-Id: <1552323335-46779-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 02/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 config VFIO_PCI bool + default y select VFIO - depends on LINUX + depends on LINUX && PCI config VFIO_CCW bool From patchwork Mon Mar 11 16:55:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="R4boyBlG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4JZ6PHsz9s4V for ; Tue, 12 Mar 2019 04:06:38 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ONo-0006vu-QE for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:06:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODH-0006l3-WD for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODH-0002ot-9b for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:43 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODH-0002oQ-1k for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:43 -0400 Received: by mail-wr1-x433.google.com with SMTP id t6so5931268wrw.7 for ; Mon, 11 Mar 2019 09:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4jWUIkYyF1/yowJvaHGxULC2QYyKxdJmTvmZH/ZkC5Y=; b=R4boyBlGIbi1LVgEjyMWL55DqzT0XhDqf95d+jNbgz9ULisk8DAW0GwhCl0Uecf3hO sjp+yA4/yh4YbyjcQC7BH7MONXFKQHfm2wF7sHrXOtrB2OfaU4TuNVzYEa6DSLeVA30l n/KGxPRZNQ/eJvd/ZqWBmxHVA93ogHcIsojtpwHYNa7rDARyNnJd5HqSjImmu+Ge6QD+ 2R0bv21bITs0iv1nsdN5oXtVajU3JNZ3SjrjObGze75aVoXDpEklW/i8CFVayI9Y5Nvi TdoV2CzWE7INlAKsQAzPmMJ4B5Mgk4loV9tCTOOizpSZjgHwfhWndjBTQJjp8gpOHClJ TDtA== 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=4jWUIkYyF1/yowJvaHGxULC2QYyKxdJmTvmZH/ZkC5Y=; b=Enbv4RaUUcfRqxkRGP8rJLJSrxEDGYWvbDWVDizG29MKIqedCh0t6UVZhsDC2lOfvP IEyRkbdlvcZdZQiWxzuqHlNIcmzlUuU6uODIMRefvoZYXP3RNQLN8pMuVE+wkBTdweYk OrSTb13phVAxGhpZMp0iw5zfIWvhWHwdK0fah8KJurBy2O725knPAKQoPCYwvkOuWrhv RtUZWSvevbQL+DkW93ET3smM65VoqwPzVwpSRjUXF8MbtPE84av4sNfP1TNGclPUk7SH S9dV3/1MV1kKQR7mxwMuXsdzTHMBkp6nEVIw8hGWaFW53uGn/a6ExQrGMawkVQGlqH7n 9Ojg== X-Gm-Message-State: APjAAAX8aVxQ0WXOFuupXSUaXPkPNqthsYZF7vJ32r2rMhkxIJVfUqXf YblMNdu1bgGQS720hxAu7Ta5tVM5 X-Google-Smtp-Source: APXvYqz6V4xYvFuC3Qo5//LurpqUKkOy1Mi+t0D1paRi9Nfo8Qh/uBEDJpPBMlt9XUSBAjUmfhjSDA== X-Received: by 2002:adf:f88f:: with SMTP id u15mr14638926wrp.117.1552323341653; Mon, 11 Mar 2019 09:55:41 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:07 +0100 Message-Id: <1552323335-46779-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::433 Subject: [Qemu-devel] [PULL v2 03/31] riscv/Kconfig: enable PCI_DEVICES X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Abdurachmanov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Abdurachmanov Re-enable PCI_DEVICES for RISC-V. The patch is based on other /Kconfig. Signed-off-by: David Abdurachmanov Fixes: 82a230d5a303 ("riscv-softmmu.mak: replace CONFIG_* with Kconfig "select" directives") Message-Id: <20190311091256.18385-1-david.abdurachmanov@gmail.com> Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- hw/riscv/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig index e0ee304..8c7fc1f 100644 --- a/hw/riscv/Kconfig +++ b/hw/riscv/Kconfig @@ -26,6 +26,9 @@ config SPIKE config RISCV_VIRT bool + imply PCI_DEVICES + imply TEST_DEVICES + select PCI select HART select SERIAL select VIRTIO_MMIO From patchwork Mon Mar 11 16:55:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UGTwFJc1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4N65Gx4z9s4V for ; Tue, 12 Mar 2019 04:09:42 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OQm-0000qg-FK for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:09:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODJ-0006mi-7W for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODI-0002pu-Gg for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:45 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODI-0002pD-7R for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:44 -0400 Received: by mail-wr1-x436.google.com with SMTP id t6so5931326wrw.7 for ; Mon, 11 Mar 2019 09:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UYfR+EBQv+wIrOV/ZnJBemqrNRF1eWItvm/B3GDCrfU=; b=UGTwFJc1UNWc4IqrpjdR3YqWx4E72iCEZuYSuhAzKhF/ukIO0ujI8Bx63yaxEtJbA1 RjSWE4aaL4G5o4BMubXHvIQUgSVHRJ0tQ1LTM3/CGcejRrASGB4uIMJomDLfXxCNGPNA 509G88E0ygt9a0iB+cbfWu/kn4rMu3S5xyy1sjlLVzqbb56aqimGxMnPHkAZhYyb8Uyu huDy8GzKCN60YEaPjDApluhH2tVVBBZ2qtDtNYEhb3hAlamE3QNMi4soVMbcgm+c0maL D6BZ6U2bPoPxMplMqsA6Iuvsfnu7ZGmtmdBD6APpqwAamwTtc/1b8a4qAyn/ROqkYDfH +Gdg== 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=UYfR+EBQv+wIrOV/ZnJBemqrNRF1eWItvm/B3GDCrfU=; b=OgU7tVyg5rQJEQKhMKcbltUoOJZpc3eG1fUq3PZVq+JUTpJo6L1FrS3FeCwNkPhG3r qxiGYelNT9b90Jk3ZjfbJ4kwHXVNW5/Igg5kCWgzRmnAmKxYeG29TsQzXm1YrTQzwYce Yhd09xE2jiQWsYsDTNT0tjgH3an3vDLNYD7LrHRkiNWmuD5dwsqsYfY6JVbme35tc4rO TShveAHKGXL/CgFuU8UKrVM7KmzPqLygb+FjmPerQN/DBLm1nzuwVwGK5y3EVo6hp+PB MBi7k8dVAtjKm2/fPBkosKQcCq4MbdQmKyHXKLnheA1WG+NOE4Q28+s0LG6MsXcVKcHk me3g== X-Gm-Message-State: APjAAAXtQlLv0CWaAvGEsZS3iKR7in7G3B/C1v8YZd2eb5TG728whP9S qs7AF3s7BkO+EN2fG9ftfihngGES X-Google-Smtp-Source: APXvYqxgGF9ZwBMY9gkRq/CWoUjgl9ZLpkkYg7bT2RSdgJAfZnOVb/R0YdW0nV+6oDL3aCPsT1MIAg== X-Received: by 2002:adf:f78e:: with SMTP id q14mr23033363wrp.227.1552323342961; Mon, 11 Mar 2019 09:55:42 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:08 +0100 Message-Id: <1552323335-46779-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 04/31] tests: test-qgraph: fix a memory leak 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: Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Li Qiang Spotted by ASAN when 'make check'. Signed-off-by: Li Qiang Message-Id: <20190310160227.103090-1-liq3ea@163.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Fixes: fc281c80202 Signed-off-by: Paolo Bonzini --- tests/test-qgraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c index f6a6565..5c7e457 100644 --- a/tests/test-qgraph.c +++ b/tests/test-qgraph.c @@ -122,7 +122,7 @@ static void check_driver(const char *driver) static void check_test(const char *test, const char *interface) { QOSGraphEdge *edge; - const char *full_name = g_strdup_printf("%s-tests/%s", interface, test); + char *full_name = g_strdup_printf("%s-tests/%s", interface, test); qos_add_test(test, interface, testfunct, NULL); g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE); @@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface) g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE); qos_graph_node_set_availability(full_name, FALSE); g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE); + g_free(full_name); } static void count_each_test(QOSGraphNode *path, int len) From patchwork Mon Mar 11 16:55:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="leLxCvkU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4SN6sWKz9s4V for ; Tue, 12 Mar 2019 04:13:24 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OUM-0003u4-QR for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:13:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODM-0006qS-Lt for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODJ-0002rC-OO for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:46 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:35246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODJ-0002qE-G6 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:45 -0400 Received: by mail-wm1-x332.google.com with SMTP id y15so5067570wma.0 for ; Mon, 11 Mar 2019 09:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AM8HhrwvKQY6Ow4NfI33vktmHaZVGL6hHIAkSjpQLFY=; b=leLxCvkUSUplTeCOi68Wb5d1GQcx+ldfuVnUlOF89RcNeGMcuhFE3+Fdr0WRpGmGOT c4MnB5w/o27cGP18vKHBeafgiT4zmCKIPxgDq7ha3Pj8UUSVPSNEfMf+NWUZWlUe7hSY mRFn9UJnWbEBhshYk0D35wt5WSfBSwDLupnHlL7y+9BZoAYx3Dh9IkSkcjPM1ZZkuQFb VogJ9ACeZEsYrx/2VyOoPrz3Ks9XcRzEMF5HFEcDul6++Z8UD0o26bUrUBirywP3ov1T 7E+gHuEjFZwbvEOUkEO/eKxRsErVWlVHEyX2nBmKKlMH/1+TGaybVba2ZPbW2awvfvUh m5Jg== 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=ccLFAWzBESPekcdJDe2lLFbQiiBXwQwqvXd28Jd+0AqP/IugHE1ABqtxrJeBZDY/md ml/PJG/7jeLFqAkqiYTOZPBR0y2oMONhQMwLpNeq6AvjQuJn1ZJR1wKABff7asP2zwuG +Rc7z0IMYU5u7On4KvwSrKwoY9lpgaY6Hv+uvBdK7eFDfdtxWILWhR6wuRYSTo9XzZ7V 8GOe3YMIZPPMUI01Mep92QzAsuKOkTKIEkpPYjidVc/msKbU643GpLv/BUqL/r1E2GDg d9RRpQn+urPUOemVAx5Y1AhMzfLus19gsrz8gHhaBlMU7so9anXYi/aM+xHyrWfWbF9t /aWQ== X-Gm-Message-State: APjAAAUnD97BroaG8L5gKYfidbj5xX+iZdPkfN+2Bb/a+c3qaW5aoUqc Ze9NNXzfiT5oImGpiJkLld0lJ+9y X-Google-Smtp-Source: APXvYqyfNx+KvfRztBS0bBeojMsI/JTp6RPjJGvi3pFFA9+Dc6/dKnX+oCQd6aMl0gcUBYnJzBDLoA== X-Received: by 2002:a1c:c90b:: with SMTP id f11mr2326wmb.61.1552323344101; Mon, 11 Mar 2019 09:55:44 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:09 +0100 Message-Id: <1552323335-46779-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::332 Subject: [Qemu-devel] [PULL v2 05/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 = 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 same of + * PVH), so we try multiboot first since we check the multiboot magic + * 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, 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 = 0; } From patchwork Mon Mar 11 16:55:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lQfH/2Eq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Rb1zVvz9s4V for ; Tue, 12 Mar 2019 04:12:43 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OTh-0003Kh-4l for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:12:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODQ-0006wD-Fe for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODO-0002wJ-Kh for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:52 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODM-0002rG-LR for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:48 -0400 Received: by mail-wm1-x32a.google.com with SMTP id e74so5327198wmg.3 for ; Mon, 11 Mar 2019 09:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rwjT2Kg2mtCpabPUiGcE4JLkN29GhylnXzHQM16bmss=; b=lQfH/2Eq+L1H8Y7vLnPtjF2eUM18zsdTqq8AogECTznY2FJrjDkKOKaTrGsr280hur nB/AgyQ4rGOlRu/m3nZt5l3LqAmJBE/SmlJQX7C0QsK/ICNNac6FuPjg5FuHZpuGuFqc B17nBS+hvmO9bYnIgD2SfmM79dFMS2bhPKsfizFFmdP6COyB+rCAs2Kr4MBZEOLZwKzs V9d4lc0cNGJSAhcEIIArVwJdGwy5HxBF0WeodZKwW+8Ia3/Qio8IFY1dphhG/smM+8ya sXWHH8w7d4e4wWmQAu0eDf188cdThLHQRWFaMJY0h4aOsW2qg8nKSuc6EyGG8XDgikqo GNpg== 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=rwjT2Kg2mtCpabPUiGcE4JLkN29GhylnXzHQM16bmss=; b=Ep1QUaREmbb0Zs/smPgFa4ua6DkbjxIMphlUBy5Vl+5yXd/lE9tWb5eiTi5UWqgZ+d 10drfIveQmY5ZVdQnRgaZSr034JNs94stN5bUWWxTVvi15wrJiaoAMuwzaBtkID4qwZF 5kIcM6l0uxXil0Zh/rkytGfW+mtI0wYV4NJGWrYW2j4NsDwx91R5E++0jffa9iTifwuh XOpndVjspfLrAGqogZmqDMnzCMBRl1uFTz130fyLhUq6pynwISaiKAApIKpdywWKKo0Z E1rYJPlzWlEafMkwS9mYIS00mjZUByr2pYR+YjMWmn5UNJpsnf30CM4iIPuzF8VC//q0 6wvw== X-Gm-Message-State: APjAAAVD+/XkLUY4nB5cd7mM7Kgq/nzZGseEDZx8dHG6pu9ZzFeGs7LV cW7neC4R6vldBKNlnywjKZm/e+UI X-Google-Smtp-Source: APXvYqwDfTzrROC6zc1+WFuPP0r90b9KEKWUDqXklCy43RzwjMMGGvaTleX6aouUIyastCXReKE3XA== X-Received: by 2002:a1c:228b:: with SMTP id i133mr432627wmi.105.1552323345007; Mon, 11 Mar 2019 09:55:45 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:10 +0100 Message-Id: <1552323335-46779-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a Subject: [Qemu-devel] [PULL v2 06/31] 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_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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=unused-const-variable=] static const AIOCBInfo iscsi_aiocb_info = { ^~~~~~~~~~~~~~~~ qemu/block/iscsi.c:168:1: error: 'iscsi_schedule_bh' defined but not used [-Werror=unused-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é Message-Id: <20190220000553.28438-1-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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[] = {8, 32, 128, 512, 2048, 8192, 32768} * unallocated. */ #define ISCSI_CHECKALLOC_THRES 64 +#ifdef __linux__ + static void iscsi_bh_cb(void *p) { @@ -172,6 +174,8 @@ iscsi_schedule_bh(IscsiAIOCB *acb) qemu_bh_schedule(acb->bh); } +#endif + static void iscsi_co_generic_bh_cb(void *opaque) { struct IscsiTask *iTask = opaque; @@ -290,6 +294,8 @@ static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask) }; } +#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 = { .cancel_async = iscsi_aio_cancel, }; +#endif static void iscsi_process_read(void *arg); static void iscsi_process_write(void *arg); From patchwork Mon Mar 11 16:55:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tpjHknsd"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4W51wzbz9s00 for ; Tue, 12 Mar 2019 04:15:45 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OWd-0006oj-4l for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:15:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODS-0006yQ-Ho for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODQ-0002xd-Fe for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:54 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODM-0002t1-Rb for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:50 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d17so5927533wre.10 for ; Mon, 11 Mar 2019 09:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EbLP00A4BLiP9DapEqSnouNkDQH3tjoU/b+1XsA4uo8=; b=tpjHknsd95G7M4dmP+ZJAoaZZZUknccADbsO9Z4uREQE+Yyx3LlTRkNblXAKDucltg muzffyknGKVgszRm8M9fUXOMlFdkFXWLuF5N+1S62WQKO7S2EDZRsnu3w4tCRyAyRAc8 4MU+/8qqF9duMUpDqHmh4vUYC4dH52JPi6kfmtTS57cgrKyT+QpJjUuz+msyPINDz7Dn R8I+LWCXCrbpTvRfOXVIKGnMwj9rNWJoL/8v19q9bSWmausxMJxUYKUDjodOPxM/ZXji aqSmV7xlT3Y+wZGr/ARUi0XLP+AuyMkR2mHgMQTwNUt0IK+SHRv3x1soZiKQit5pTo2C sY3A== 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=jMIYlUAkhhKtTFYtZVINqE1+VW1wx3pm3LV2xS23D76fFILQS9FZ5zBME6Oki5n5BH mGXLrrbOjKTvjM/BPtAnP5/bB/6K3OEfUgUCR50O8u9ENTkwJg6gEaWps10eUGbGvlP2 auU/n507qpW1f5ED+3845uNckVAVpLvXl+rwzSAoSV496vFErwdgDSNFvjdy8jZpPcQ5 KGK039cfXQO6UaieqiKvjjgwWrew5p+3znf9j4VqGLvxn0dWzr4hMhU0d065D658j2xn qnfuLxdAPqEB+dOkVelaFcw1WCNfAXYdoD9SkbdkshQQhbCMgqt0BY4/zWgkTCZ4h+ah lixQ== X-Gm-Message-State: APjAAAV1wC6/DTJ0dzh9p9yFRr0VIhpvIdySj4DbHF7+YVLKhEBXT4UC hZurTRLKayqDM1BGbM42XS6Bcb8U X-Google-Smtp-Source: APXvYqxBO5f2QRdw8GtX/GJ6y0rncZphURYaF8zDQWBslY9/mcuz7JVdzQiufpQEo/t0pGIBfSeLeQ== X-Received: by 2002:a05:6000:1152:: with SMTP id d18mr21820699wrx.128.1552323346264; Mon, 11 Mar 2019 09:55:46 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:11 +0100 Message-Id: <1552323335-46779-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 07/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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[]) } } + if (!nt_start_addr) { + eprintf("Failed to find NT kernel image\n"); + err = 1; + goto out_ps; + } + printf("KernBase = 0x%016"PRIx64", signature is \'%.2s\'\n", KernBase, (char *)nt_start_addr); From patchwork Mon Mar 11 16:55:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eksJAZ1O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4bh633Hz9s3q for ; Tue, 12 Mar 2019 04:19:44 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OaU-0001Oq-KV for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:19:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODS-0006yR-Hs for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODQ-0002xV-Eu for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:54 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:33172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODM-0002tR-SY for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:50 -0400 Received: by mail-wm1-x343.google.com with SMTP id c13so210224wmb.0 for ; Mon, 11 Mar 2019 09:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rs5/+NgdokfbYHIEtUIcTaT50tKdB7Md/8HCTEhRyDw=; b=eksJAZ1OWYbqcuvnLDFbxZm4bJSsMthGuCEXLXv7cZB5YlMI9V4wlWKGh1IinlDjJ8 B4cinT62Og44l8HJZzLL9QRMFPnwE9DNpF3Kj3/pn5W0fn4pzxRptfvMN1oVPq6F4ylB TcxvD8Oo6/u9D1aj+K3XRoFd0Hhng7egERDoY/qUtBKiSx59mzFfb6yZhxWfZBWm3iSA O/mw7MoZ5ZIuwtdtriLRU6G10K9fAybp+KsHksU6G7eaubCWIiwgnhIPe2JXaYnHqr/V Mem9/o4HYJNrZycAqZeovamvi2OAcSwim0ofEZ68sfkB+OHyFtMmPmA3Qjj5LhKlQSsl c+BA== 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=Rs5/+NgdokfbYHIEtUIcTaT50tKdB7Md/8HCTEhRyDw=; b=DVi0BH/LafBrrXBE5uouFRxFMaMSEIooHTxVyOtDi8+JJ9kwCyWAcFhFQbLPcPZsNS RflWrV2qiDDslUq1TIEJLe2ObkLp9I26hi0RY1qTWonJTk7/N6etDTGx/Z5HDGvlsMwz D8SXYczH8+pd5+JMwtpm5LbNBCtNyoQg3y35o5gBV90S5X+zECrNtSXx9HkuKPzS0CEA Z0o4nqQirhkoRsuPiexD5vwBq39MYqTom7dBi2r//MBYaX9mTVjBXPSTMK/hYfX+9r+L YMudFFjARaRvZO63hJAP1q9WQyEYtRvDdMJKNTEJIIxUrzf5kUKPG22Du6aMrJxP/0Mo xJHw== X-Gm-Message-State: APjAAAU0lUgJLL/VPSjhwYS7f15IOZ+70LtapYrg+C0rxuFCuezKFgrP jDB30Bqa2i893NOffrKPQ5ps6Cnj X-Google-Smtp-Source: APXvYqxo6Oj36V0tjrfcCTsH3UNU/+CCTaT9ngxGg+4TPtG7DG13/BlB1N6ZUCqGgLLJt6ZgWnLZPg== X-Received: by 2002:a1c:f901:: with SMTP id x1mr4651wmh.51.1552323347384; Mon, 11 Mar 2019 09:55:47 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:12 +0100 Message-Id: <1552323335-46779-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::343 Subject: [Qemu-devel] [PULL v2 08/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 b354e74..fa83e21 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" = "yes" || test "$mingw32" = "yes"; }; then werror="yes" else From patchwork Mon Mar 11 16:55:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pCQNRlgv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4S53Bl0z9s4V for ; Tue, 12 Mar 2019 04:13:09 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OU7-0003f4-C7 for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:13:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODW-00072B-BZ for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODU-00031a-DR for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:58 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODS-0002uF-FP for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:56 -0400 Received: by mail-wr1-x42f.google.com with SMTP id g18so2542773wru.3 for ; Mon, 11 Mar 2019 09:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=1ytn1RT3QC9c4jD4A8N0j1+dRL6KVsvQjz23DA1x0Ks=; b=pCQNRlgv8/pf09seKjgjsGjyw3Y1WG6hbi6+ysXqBUQJaKnPlnVgwQ/IQEqgkIBC7G f1R0JEN8E+ou8+3i2p5FhObRjnbEZpbc/M7/RTwyKRgwlIEEl/4lc6u8aotdSI4rk5ao 4FqjbuirWEQtIYS3OPYStkdyBrmYDbMPxgcKvb7BRh99rDMNxccHzAaoewH/x7NN1j7s +UhUNrXfuQnFYGBzAGekmgNMGb7awZVSRth2N5Kr4OCE4gY5WwMCBaDmfZLQHBBh0Tkz Ki8SIuebMnAcsfF+Hke43tJtHwSxQaLnw8mdXxp+SMHgAcjVGO048IrOu0b3OpQRpIrZ CCHQ== 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=g5bSFa0zt74Oho4GpLjCrV/liYf5heu7t/prClnr+0QgMd3oQlZloslfuO/PECXpnZ lsJVEWsvEUMelmbxBAb9xNhRuwJO8Bcwd+GTo+DNlbxQvauR3gpUZgSfdOLw8XZA/Bap /gBl6vO9xqWDiDt2LMGRZwHPthjsApVNyGK48+WwODklJy3y57b2UttNFH1WFkcXrLXb wBH21BD/BGCsD/rFXuwrjC6LErAr2drXm0k1jGJ/HcD0Pw7novSBfm5j0dEEab+JK/vx hovj79eCSLJCF5P63icfJME8RrGyOTTPuIFWtwpk9A8bMBVJQP47FrUmS3XYEQ4umUG7 JJbw== X-Gm-Message-State: APjAAAW/MCSlMRbRUAKc3Vu6e3DYy4lDuiSxymLbfbVCJZtxxMFOvexK E8Zn2Zw3e7oD9R3x9U5vUcQnVfVk X-Google-Smtp-Source: APXvYqxO/EjvzRddvjkZ2iwDPg8zIbThbjTMkTMmqcLtzRQwaWDaQHGh0+Ln4Ely9o0RGspcZlK1yg== X-Received: by 2002:adf:9cc3:: with SMTP id h3mr19902954wre.47.1552323348563; Mon, 11 Mar 2019 09:55:48 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:13 +0100 Message-Id: <1552323335-46779-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::42f Subject: [Qemu-devel] [PULL v2 09/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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) += translate.o obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o +obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o ifeq ($(CONFIG_SOFTMMU),y) obj-y += machine.o arch_memory_mapping.o arch_dump.o monitor.o obj-$(CONFIG_KVM) += kvm.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o obj-$(CONFIG_HYPERV) += hyperv.o obj-$(call lnot,$(CONFIG_HYPERV)) += hyperv-stub.o ifeq ($(CONFIG_WIN32),y) From patchwork Mon Mar 11 16:55:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GR5I+dkQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4hK1MxDz9sBp for ; Tue, 12 Mar 2019 04:23:45 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OeM-0004nr-Nr for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:23:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODW-000728-B2 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODT-0002zz-Ru for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:57 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:39627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODQ-0002wF-J9 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:54 -0400 Received: by mail-wm1-x336.google.com with SMTP id t124so551104wma.4 for ; Mon, 11 Mar 2019 09:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=adXagn2OnV312ZWQcd9hoEeDPAMN44SnRuCEEhj/Dk0=; b=GR5I+dkQxnHK171rjMU9J3SUAFSb0Is1amgd1B/CZswcDoIOb+Z3yUZCGZ34huI2wG wKlBNqw5GHyMdyh2vsRnjBXMJ5dN5OZvnky36d8eXY9Snlgj2GAFfrYheJjvrH5hzhy+ LoX1vCVVCjGGe27kI14T/uEl867Svg35ja5667wQDq+0fu0BiUcmkXjrZ1n2ZZ9J3Z+U EO1QGeItMrrzF9NJnTe29r9DsQYcQgsCwPFDxhiyk085BNNWtrppThhsHD2ZTfNsHDeC XJmCpiNvfJhJ7E59QEfXYPh9UsesPvB7SmJaNtCYUOOaqbDZqxd87xT2E/Zr3MQ8kvJQ cfYA== 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=n110FL7ineb5ND7Q3Rhfc8TcfscgtzKSLmH48pLS0GAR882Puv8cJxjYOGHdvXyLB2 lNik0kgI61mCd1gva89wRQZcGxlKNDSf2LXgMttv3ya2ieoNZ15DnNKOVyV7AYKH+iRk vrjh2E34Sr5ucgEYWm1phjahTem82BToxo3QHKYdvSzOsL8/LiavlcGg76Ibzopk33KQ ZdQAb61bxZ7iwAV67Gj/ajJBaIifBIoi3/JE+GAXtPDMuot22UCG29JVf/PLauXMaztH FHNruryBTCYVC0lVRHnEWecqaBvxPU/7TjwN/5Rlx2xw7t0jsGKqS9Eo4cfON8gJbC9c j9Rg== X-Gm-Message-State: APjAAAWTFOEzsvG5bWxh2NNSALOX+Qzae/ObyShncX2MQl2ah5vBPjYf OxFnqfkwLpx3UOFzSL475uhwDQ6V X-Google-Smtp-Source: APXvYqy6uKn0tx60MbJ+SPDHUECJvY0kQ4h66xVFP4GOTvC8hXxvcTnRRu7irMRo0GGc5+oX2MwI+g== X-Received: by 2002:a1c:2dd2:: with SMTP id t201mr31010wmt.44.1552323349882; Mon, 11 Mar 2019 09:55:49 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:14 +0100 Message-Id: <1552323335-46779-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 10/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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[] = { { "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 = G_N_ELEMENTS(pc_compat_3_1); 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, Error **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[] = { 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() }; 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; + /* 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; From patchwork Mon Mar 11 16:55:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rnfmF2jV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Zw1Th9z9sBF for ; Tue, 12 Mar 2019 04:19:04 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OZp-0000tu-Tx for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:19:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODW-000729-BC for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODU-00031M-5E for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:57 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODS-0002wu-Bj for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:54 -0400 Received: by mail-wm1-x343.google.com with SMTP id g20so5006739wmh.5 for ; Mon, 11 Mar 2019 09:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jeq1Z775uJWBwJh4Co74sW+KjrQOpq+rUqMR7K7W0yk=; b=rnfmF2jVZQefXTMs2tLRfMQiUchQO8opf7HUWxgamgp7pl1l/msO4YdEl2oeqOc4RV q8Vv7yOiO00/SohRPgNQHFO4j3Lwekfi6LFgI3isava8ums2nuLkoxQUHXV4gz8BdyiL TZ+PDO0zYCL4i+2wYTywe7T63omR67WCF3+XuBky0uY1YcsB66Z/PASlBRYd4ZUUL4Z0 2GqeyT10m63rKAgTL8JoY1I9Jwjvfgqw8Z+Z2U7WbrNRrA3FJ+HbXhqzyBPHkl3jh23a 03FkZr+3rRu2XAoMS8Ex6zmkf2dkGijBIpXLNCc2KvrpWCqduFRQQqxUHsri4QCm5szu CmHg== 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=EUbMD/MxuQjMeMJtZAc1uqZVzLCQBlNMQ77iHhYB2UTVWeb5U2zQ+/sDxq/AwiBUHF i68tFX9sv2R2xZFOwM9MhOoaHmnSQFaYRLy4abRyiwzBMNR8y5g/0wGXqi1lyfb9285J 3uw9NsTM+7yO/jkNzDZXESy7l4kRDwClsViUcFJd+ZtdqGhafcQV+OxkhF5fl9cg3/IZ vJPnrhSEHoqyzlyG94CbmX/KqrLpog51alQPRkxf3U2v01MwLE6t/++CqJ9d2xJQvu56 d6iS4Fg27ZmrXjmgNbIXczkSg2clqvuxfqdLaV1B1du5zSRGKhQgDL3rc8GTQvqpY+up P5zg== X-Gm-Message-State: APjAAAWqhCU/d5hzq1jMn9xBdyVj11lP6hYhQr+tE2MYdiXDlOTyATaQ xywuRcStiF6OL6KlJzO9CNrpYeUU X-Google-Smtp-Source: APXvYqyuSwVOznzy0aosjmfyGFRwtfxSD7S2Zy0xRVYSRXYCwDQgsOIiOGcvPNxlJMsWKjzC36xVVw== X-Received: by 2002:a7b:c348:: with SMTP id l8mr409039wmj.135.1552323350778; Mon, 11 Mar 2019 09:55:50 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:15 +0100 Message-Id: <1552323335-46779-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PULL v2 11/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz Build fails with gcc 9: CC ppc64-softmmu/hw/scsi/virtio-scsi.o hw/scsi/virtio-scsi.c: In function ‘virtio_scsi_do_tmf’: hw/scsi/virtio-scsi.c:265:39: error: taking address of packed member of ‘struct virtio_scsi_ctrl_tmf_req’ may result in an unaligned pointer value [-Werror=address-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, VirtIOSCSIReq *req) /* Here VIRTIO_SCSI_S_OK means "FUNCTION COMPLETE". */ req->resp.tmf.response = VIRTIO_SCSI_S_OK; - virtio_tswap32s(VIRTIO_DEVICE(s), &req->req.tmf.subtype); + /* + * req->req.tmf has the QEMU_PACKED attribute. Don't use virtio_tswap32s() + * to avoid compiler errors. + */ + req->req.tmf.subtype = + 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: From patchwork Mon Mar 11 16:55:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rid/8nf6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4mt64D8z9s3q for ; Tue, 12 Mar 2019 04:27:42 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OiC-0008N6-OA for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:27:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODY-00074h-Tg for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODW-00033I-BK for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:00 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:38433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODU-0002xk-Dg for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:57 -0400 Received: by mail-wm1-x341.google.com with SMTP id a188so5017888wmf.3 for ; Mon, 11 Mar 2019 09:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=g9D+NaM9cjVGJCOh2bax1tlthJuA5sOo9R0akmBER38=; b=Rid/8nf6CRPWpx+epC2ogFLvvtvf+psDTheg+Lw/UIY815puhRiPvQATBwYAqOZSMr fo7k9B/6CBTpSFIkSoAdsJVvHKvB/vBarBQY0Y7FKveEmfqNg/HWpRF6+cN5yj8Yt/TW DOtiLysynMGz0Ijbvtbt8M0bVimDuHqp4zNWJawIrDwwFqVvigNMygyIs7/IMM8H0weT RCjOtW+Q1MV/QwNf/s/V96SH86jFwhhIjfTFQgtioHQxPSnykGH/kbIZ+Yy0orYgAw48 tHxthdL/30AkVVTnq7banM+Eks/hjAvOJLyIAPClPoQeSEUjx+OBBlEVHmWOM2pORVUE Y7YA== 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=KM6sjXoDZOdahVMKcayhbJ/vYEtaMR8lLLn35y3rcNmKRjXaX2UgbVdauFcseqHXsd yPj9QcbN3L8e97dDAFznYKd3HifeCxTpB+TmlhwN8liCfrGvs9LwnDJuI5e+rD9Zv/MK afaV0AY7ENWHOrIq9slETo+CsY2jgaznt3OVxx4mbIqPuTS6ti82lQeEnSijZYm34hhz 02uKJJef0t7cRe9cFnxVwn7pZSiz5q+iQRs6fXOwmev3dbq/1SCJnIty2gGqikqwtddd 0u4HWG/jq5BsNNMF0tgA2BsIAtaTC+d9nwLxEuxP3fceyHF8QcowdNehIQ5j9hLRPg3z i1ng== X-Gm-Message-State: APjAAAV6XXw4sC6pZFkj+kFvrD3QmoW38iPX62cZPbWO4iFquLopgixB YwL2Zl5/pc8DClSkdegSjiex2yyk X-Google-Smtp-Source: APXvYqzWoH2VJ55f7R4lNShqSke3EvIufaA4xZmgZZSG6wjqT8HvZ1FLfrj2jdj5WK1G/w8metvMdw== X-Received: by 2002:a7b:cf32:: with SMTP id m18mr21260wmg.98.1552323351814; Mon, 11 Mar 2019 09:55:51 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:16 +0100 Message-Id: <1552323335-46779-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::341 Subject: [Qemu-devel] [PULL v2 12/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 possible 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[] = { #define LSI_CCNTL1_DDAC 0x08 #define LSI_CCNTL1_ZMOD 0x80 +#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 @@ -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 = 0; s->sdid = 0; s->ssid = 0; + s->sbcl = 0; s->stest1 = 0; s->stest2 = 0; s->stest3 = 0; @@ -530,6 +537,8 @@ static void lsi_script_dma_interrupt(LSIState *s, int stat) static inline void lsi_set_phase(LSIState *s, int phase) { + s->sbcl &= ~PHASE_MASK; + s->sbcl |= phase | LSI_SBCL_REQ; s->sstat1 = (s->sstat1 & ~PHASE_MASK) | phase; } @@ -567,6 +576,7 @@ static void lsi_disconnect(LSIState *s) { s->scntl1 &= ~LSI_SCNTL1_CON; s->sstat1 &= ~PHASE_MASK; + s->sbcl = 0; } static void lsi_bad_selection(LSIState *s, uint32_t id) @@ -1265,7 +1275,9 @@ again: s->scntl1 |= LSI_SCNTL1_CON; if (insn & (1 << 3)) { s->socl |= LSI_SOCL_ATN; + s->sbcl |= LSI_SBCL_ATN; } + s->sbcl |= 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 |= LSI_SOCL_ATN; + s->sbcl |= LSI_SBCL_ATN; lsi_set_phase(s, PHASE_MO); } + + if (insn & (1 << 6)) { + s->sbcl |= 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 &= ~LSI_SOCL_ATN; + s->sbcl &= ~LSI_SBCL_ATN; } + + if (insn & (1 << 6)) { + s->sbcl &= ~LSI_SBCL_ACK; + } + if (insn & (1 << 10)) s->carry = 0; break; @@ -1591,9 +1615,7 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset) ret = s->ssid; break; case 0xb: /* SBCL */ - /* ??? This is not correct. However it's (hopefully) only - used for diagnostics, so should be ok. */ - ret = 0; + ret = s->sbcl; break; case 0xc: /* DSTAT */ ret = s->dstat | LSI_DSTAT_DFE; @@ -2143,7 +2165,7 @@ static int lsi_post_load(void *opaque, int version_id) static const VMStateDescription vmstate_lsi_scsi = { .name = "lsiscsi", - .version_id = 0, + .version_id = 1, .minimum_version_id = 0, .pre_save = lsi_pre_save, .post_load = lsi_post_load, @@ -2202,6 +2224,7 @@ static const VMStateDescription vmstate_lsi_scsi = { 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), From patchwork Mon Mar 11 16:55:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oAbURk65"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4JC11Yfz9s4V for ; Tue, 12 Mar 2019 04:06:19 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ONV-0006bv-0E for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:06:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODW-00072C-Bl for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODU-00031c-DF for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:58 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:39617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODS-0002yb-HJ for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:56 -0400 Received: by mail-wm1-x32b.google.com with SMTP id t124so551299wma.4 for ; Mon, 11 Mar 2019 09:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6zDQbSwZUxX7y2jiQ2tcr21YfVkxewJV+Z414eERG8A=; b=oAbURk65bwaSr3HttDJ2480SAxOZ0qJyMMN4AG27HgJ+qw2aQIbVW/sTsZTWj21kn+ CjlRZ4H7aeQ8mPG2QOCwlypDQQ4EqaSJ3ayDQTZxuzYAtKjGSJS6P4HpIt8CuChxsMD1 YKNFWWvx4Hv5wwV81sBDzH/pCwSvSDIhkktMsnGhR4vsmrhlpAWiiabsFaSKmwAiLm5F 7L0PCRu+oKdxBlF4GVeGePKfbI1M9+3unXMfG74isbxLcalBJsWTo1UA9BOTbzYk1qB9 0dc6QC4+k++KyfpNgxhJs9TEYEHVZh9Ef9D2PY78/lvvW4X9DoUpLmkbdWrt0lAe6bNB 7LIA== 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=UHqXzI0fBx6bB+QCEFnb30EJ107D4PWMSJld0LMovVoO7SokC7ZnWh0KyIH29x/ZPm w1NZpt3YI+buqpDRtmWPHBN/oCzRXVd/hqaYfGvktDRdQsDVBx0BXgggApC0VU1kkQtN VAW0GhYf7SMwL58JyGk3U5JTH1R5LPD+N1yWsBND6Wbzj2TLnuxSDRY0FiuZmwkgcrsZ YILLkGtazFWIdpbgW7A7tTdqIk7TT3z8ezmQyq4r+uso6NZ/8AHrbKpwJ9pTiI5naxBn m3Z53tzifbVL90xI/ikObVyN+2ATsiEyAP+s7pxvNfy4P2MiU6FfcEzrurYUIRWs7rde ulXg== X-Gm-Message-State: APjAAAWopmCMo+tJlT9mDOZwE0jU1U3r4LEoM7ZbasT5573cZ0D84xTj QM0lxRfHwh1R6sj6cI10Ds3Jl3Kx X-Google-Smtp-Source: APXvYqwmScTgvDFJ9x0fL8PHn+0qOZ9Wy0cBbjzHMogk9y9DzLAL2F2IisbFFDDE7wJvZtSz0FoYMA== X-Received: by 2002:a1c:1986:: with SMTP id 128mr185168wmz.107.1552323352933; Mon, 11 Mar 2019 09:55:52 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:17 +0100 Message-Id: <1552323335-46779-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::32b Subject: [Qemu-devel] [PULL v2 13/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 = s->dnad; + } else if (!lsi_irq_on_rsl(s)) { + lsi_wait_reselect(s); } break; case 3: /* Set */ From patchwork Mon Mar 11 16:55:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KKPmLjJR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4kv3n03z9s3q for ; Tue, 12 Mar 2019 04:25:59 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OgX-0006wr-HA for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:25:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODY-00074g-TK for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODW-00033B-Ar for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:00 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36072) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODU-0002zO-CT for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:57 -0400 Received: by mail-wm1-x32e.google.com with SMTP id j125so5074405wmj.1 for ; Mon, 11 Mar 2019 09:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zzzWGOMxi9Lwua8QNuvDpRax40r+iZtpNX4NGZNCT94=; b=KKPmLjJR4kKnRm8KEFEoeE3kr6V4b3AnoBaJw3+fjdEFwPug8WoTZSFoLchvvDCoTr OR7dgpK0agjFsZGa5bnhT0lCTUgvyyPTNZgQ0H3rnCwq5ObLaI5Xy5JQYDO0HN9kRsMR ZZAu3MOWchxz1txQ32rIailRxRxaiNAPz5CZMHY7/BdgH8EgA3Ukqmr16U/c8YD9S3gt ddNJExiFgi0bwg0HjMma5kuTA8g49mvKdvKRlBLsPq9xYpFq+AMd63VBiGUv4dmGgJwi XnUwr8NCM/K0hAT0+0cYNqpoE+Xy9BIR2cPRJXtzcd5q8dlnndqOZFHOEyccLThNMlnZ ZvSQ== 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=WOHPtlm8wm/0TSbyYKbVXGr1CyktZffTBgTaPlNZQCa38ZUJFbbJOckuMR8en1G6g1 R6cJmrhi84hfnb9UdNGtStvuwOLg+/CZsdeUqKaHHtx6FLKQWPDc8AFCINfkeJMXaCbo k2SS0fu8oeKoMnDa9ztkB8QDdt64M5mK8guwhKvq+Pyj2axnJoURUHzUmlrfH63mVIhK orKUih5FOFaEiiNtl7tVfL4tIa9+n9lNS9H6eE7+op/k82vX+/aIsUiA5H7Q7aU6G7LS EjJoRwkByGM9x4+s8fHAQxvn6E4CKWyaneZYtHssAakgfkerybTX/1Yzo57Nj2CpoPLc 2t9A== X-Gm-Message-State: APjAAAUFmd+8iI1pfkepahpMX2XqsXKw4rSQOMJOdoAH6O0Ue94GpKwr +5RD5WHKVh66hcrmUmofUjUQbCEL X-Google-Smtp-Source: APXvYqxplm4Me0IdxY83HuJxwx6pgcIEqdT8/WxKznsED2XAtaJjWKwlOBO6Pafba50zSRBihsFrEA== X-Received: by 2002:a1c:14e:: with SMTP id 75mr30939wmb.48.1552323354085; Mon, 11 Mar 2019 09:55:54 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:18 +0100 Message-Id: <1552323335-46779-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::32e Subject: [Qemu-devel] [PULL v2 14/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 From patchwork Mon Mar 11 16:55:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nyKe4hp9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4fN2z10z9s3q for ; Tue, 12 Mar 2019 04:22:04 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Ock-0003P5-8o for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:22:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODY-00074e-ST for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODW-00033O-Bo for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:00 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:54941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODU-0002zn-DG for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:57 -0400 Received: by mail-wm1-x333.google.com with SMTP id f3so5367066wmj.4 for ; Mon, 11 Mar 2019 09:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=jFDEogMG2G9oz3LylDbDQT4FsF6rosmiU7KQy1L/n+c=; b=nyKe4hp9q7PspIr30hLq4TQEJgPstnfWXJA/XnCCJ4ECok3A4wkyZCoP0svkZgdPWH 1NfIdGB95IPBGXLd82/qqSR/LHGJV2oxDf3+mfh1F7Ge82b8s+QrZgZVQlQielXwyyfw V+r9FIV5wanZ1P4iNeC5TWj+VcgGpfBtcXO1TUbgHL0R4Zw8Nbkco81aumdeA2VgMvmF R/FmROxOJcS0kHZOrXdh5NfDFwm+B20QYJQ52q3LjgitLgfi6zvwZ/SDgHKi6RmI23Tr Z1NFzIpLOnGPgbUjzkt7Hf/isEjR1MChW6NmsHqO0MBj4O2DXDDgy55GcYZRmKAeEzwV qlZA== 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=FQQkpQG6gsshN+EiCiVR7afwtynT/4F3cDDumKNjCdWUaQTRk2kRk9a2ZF2cDVkzXw 6y7dTcd9QrboMGNjA1y7cKrwSCqUUZdcOso0eMyOEIEnmLrBNhz+LixvglxN962FYkr8 aV3v2cl4eNYSmwtbYP/a1gNBojCa+/QeebbZpPCI9ECK/Ztk6VDv1cwoDs4iwAcpdprD v86Hu/w/HtKarUQuXcY2WabJuCDyc/PGIspTZA1zd0GacsCZCSafWkQOohko9Ikabjbq hW88HDti88U5nh5Ewkw8tC1OSzk4TKVhqcJdx0hmOiWkrVZ+JoKOXEjHZ1x27RXuV80s soIA== X-Gm-Message-State: APjAAAW45GWNBacH2nykxZgo5rVMuKTF/grdrJhcKtRSGjhsfhLyK67Q puFToBjNw9IhKK/CW50sXDzH3STn X-Google-Smtp-Source: APXvYqymvOYKa/qNcF61hxFPaUqtyQaa3OX71/aZuA0+ypMf/VZf0Zfb2FtY+SQS5EWLGFKeBMHVBg== X-Received: by 2002:a1c:1d15:: with SMTP id d21mr15832wmd.132.1552323354966; Mon, 11 Mar 2019 09:55:54 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:19 +0100 Message-Id: <1552323335-46779-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::333 Subject: [Qemu-devel] [PULL v2 15/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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) += $(BUILD_DIR)/version.o ###################################################################### # tracing util-obj-y += trace/ -target-obj-y += trace/ ###################################################################### # 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 +obj-y += trace/ + ######################################################### # cpu emulator library obj-y += exec.o @@ -173,13 +175,10 @@ endif # CONFIG_SOFTMMU dummy := $(call unnest-vars,,obj-y) all-obj-y := $(obj-y) -target-obj-y := block-obj-y := common-obj-y := chardev-obj-y := include $(SRC_PATH)/Makefile.objs -dummy := $(call unnest-vars,,target-obj-y) -target-obj-y-save := $(target-obj-y) dummy := $(call unnest-vars,.., \ authz-obj-y \ block-obj-y \ @@ -191,9 +190,7 @@ dummy := $(call unnest-vars,.., \ io-obj-y \ common-obj-y \ common-obj-m) -target-obj-y := $(target-obj-y-save) all-obj-y += $(common-obj-y) -all-obj-y += $(target-obj-y) all-obj-y += $(qom-obj-y) all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y) all-obj-$(CONFIG_SOFTMMU) += $(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-events $(BUILD_DIR)/conf $(obj)/generated-helpers.o: $(obj)/generated-helpers.c -target-obj-y += generated-helpers.o +obj-y += generated-helpers.o $(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp @@ -55,5 +55,5 @@ $(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/ util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o util-obj-y += control.o -target-obj-y += control-target.o +obj-y += control-target.o util-obj-y += qmp.o From patchwork Mon Mar 11 16:55:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Q+Dx0xNR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Mn5wVzz9s4V for ; Tue, 12 Mar 2019 04:09:23 +1100 (AEDT) Received: from localhost ([127.0.0.1]:36990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OQS-0000bv-Lv for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:09:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODZ-000757-DO for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODY-000359-7X for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:01 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODW-00031z-8x for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:55:58 -0400 Received: by mail-wr1-x42c.google.com with SMTP id p8so4334262wrq.6 for ; Mon, 11 Mar 2019 09:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=bPmWozRpF+GF+4OY5aOPErBQNJZqUrJaP5ePOQdGsu0=; b=Q+Dx0xNRSJ7+qOiyiaxarctGiziuxaV4pHzoGwIGE1fc8t3/rXvFvILfoY+1iZLXA/ hnnVVBegD8Y9QULJsmeE69/kA4cU+IV8niV51F9Kxjb2g269kvEF5J7B19zgZdLkbOXm L+W/usbbSui5L1oHcBgw8O3HyPur5Mq2II7d1ivpI7+aVFDmJJJQ6NGnhQEr6PvTQ0tG TGHrRJsKHDrXJcVkIP4wnnRqnUUpS/l4vZ36UHPJnjwoYmO5zKw/oSx3bK7CRA8xANxj crUijyiDxbi8cl0H1mhSLjYcPPxCiLztnA4nnPpvypxJriS8QV3dZtIJXUyuoqE0QMIv ICoQ== 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=q4mGiWVVh/7+f/Sl6vphT9daHToDWU4VGTZgXaKS7sARjg1dodruxinDgkwy5S4ta4 5WZFA/oBccQ8Dw2eePhjNrELJJ/agA/lKvLHpIp40qoiCUTaQ/v790ChfEHBsguztmxv FlGLZKpFI5D4RZGM3SpjtuhBQsSPPbg11OBZVWYflIefA4MppsEqgaxwVpLEgo7u3toF vd0YDaBwQMXH1E1FsxtgikxS8isGLghilRJ21/+h6LGNtsnpUhpDSb0XihNevofcGO0D ZElMNfQTWMwO5gu3xRzXTGXXzUHfMDqmHGw7klRjs527HEaLittL7+g1xc6KWmADwbLc xsiA== X-Gm-Message-State: APjAAAUbN+R/TNl2wcwZrM895DcZJIYAq9f3VKMBW4mf5lB9oGb6tT/D 9nQ5R1BvDg3xJenqjTVnKHsxcW/o X-Google-Smtp-Source: APXvYqyBvQxpGMoBs8mAnol40HMP/8eFgliTQZZXBoeXkI6Xs4uEfGsMUULxfq65dnn73lzQyXmkWQ== X-Received: by 2002:adf:f089:: with SMTP id n9mr14810488wro.313.1552323355924; Mon, 11 Mar 2019 09:55:55 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:20 +0100 Message-Id: <1552323335-46779-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::42c Subject: [Qemu-devel] [PULL v2 16/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It is only necessary to clear block-obj-y because Makefile.objs uses "+=" instead of "="; 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 = authz/ ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img -block-obj-y += nbd/ +block-obj-y = nbd/ block-obj-y += block.o blockjob.o job.o block-obj-y += block/ scsi/ block-obj-y += 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 := $(call unnest-vars,,obj-y) all-obj-y := $(obj-y) -block-obj-y := -common-obj-y := -chardev-obj-y := include $(SRC_PATH)/Makefile.objs dummy := $(call unnest-vars,.., \ authz-obj-y \ From patchwork Mon Mar 11 16:55:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tpoKUQOn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4R847xgz9s4Y for ; Tue, 12 Mar 2019 04:12:20 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OTK-00033X-H0 for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:12:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODa-00076h-VE for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODa-0003EP-6n for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:35244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODY-00032q-Ru for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:01 -0400 Received: by mail-wm1-x32e.google.com with SMTP id y15so5068401wma.0 for ; Mon, 11 Mar 2019 09:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=0WS5Q4JyUIwxgsUEeiGuov4FYjyDp84pAKGKZ9Rzb3I=; b=tpoKUQOnZOzYt0S9NJNK6rgrzODU8CR8FHzpxeoga/b5cF8C0gYQhrvGMDKzNMKcQI YsKUUB+3pxecPrS9WHKI20hJcLoTY0/sEhfWcj5Zegd5QNP/CPsFGHSXwz9p4+/GqI9w 3Ool+8ZgUfHjE7wDxkUbrF9+HBQDRuXj4QhbW3KKg6CyJNiYZ6gMBRQez1+GhRJ5SbXV 0RO2kS09VLUDu0InFjEdh1ZGK8zO9THFLZJBvb/PRcS1SeSrF3CRO4tkOt/+U0zTk6BB RLaCqr/95owu0BPiXI/voAFpmtAXdkC50IgPly6izMbENj05KIUXoFzmt0SFS0VUbG6H ymNg== 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=oB9ERpxAmwfDNyujrObqVBegqFkW1lfaPPMABrBevnvc9PFfvRiPa60PnPMD/3E9h/ o0mP083+g2ThuswnBd0YVrmEVa284sCnF/DKpD+x+i4O5M8IFJQtIPcqzdIXNInGnqL4 cnjzJzfrJAKsbYifUtxjsS4XVDk61NuCspdoYYH39Z8CHlcX3Tll1ABvydygZuux8477 hzfuxxMCJkuTgrJkDN3aJ9hccGuVWsjLgHuk2ZF5KCyApDbjRhAIi1ECBngbHrdGr0GO hk7U1rPW4y19VTOGN1Hk5Rrb6C83lIovvOwn7PUPiQ7AZcJN/QHoFgwpDlkWXblPofjo HTNw== X-Gm-Message-State: APjAAAVx0tH4k+0tfrrr9Ia4PJzll3afvIvmXqx+R9buec6kTP/houFe c8gmZqIuph6Ut+uQ5II76hLMgR9i X-Google-Smtp-Source: APXvYqxStCOvHmsLNrfht8+Mn7O3ypl/DHvWyRuTqmUyEYYusQjBKl2VHAZ8pBm0nvNPlBmI4GI8Hw== X-Received: by 2002:a1c:d0c9:: with SMTP id h192mr425623wmg.103.1552323357357; Mon, 11 Mar 2019 09:55:57 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:21 +0100 Message-Id: <1552323335-46779-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::32e Subject: [Qemu-devel] [PULL v2 17/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 From patchwork Mon Mar 11 16:55:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PbmpgSLX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4q03YGNz9s3q for ; Tue, 12 Mar 2019 04:29:32 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Ojy-0001HC-FM for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:29:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODb-00077K-Ag for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODa-0003FI-C6 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:45222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODZ-00033z-BV for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: by mail-wr1-x430.google.com with SMTP id o7so5914227wrp.12 for ; Mon, 11 Mar 2019 09:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=2duoC/tBK1ofZRrOqZGp8KdZEP7lucvaRvdiprmgyIY=; b=PbmpgSLXvUtFtt9EZTYyN6KauDplWSxCrpFgieXwlTotJN3XEYpTb6L1b1948jyIp8 ne9Of1Fd05ip3cjO890wZXAOnFcfyGug4OeHJMJ9Pk5M6bN28Q7YqvdH6+XS0rB1z/c6 ASkgMeZMJTD/jJAYpzbiqC0Ufof759F2DPMVwlObE0j5bEdl5SRClaBALNMobMZ0Z1I3 BwcXdASui+1ISg28O674H20cm8YYhKKODZqLxs5myEggFA6OLlR5OeKlFijJ9qj7ruWw uTGlTmZ6Z29ntrIIgZBYgGBm2YYAklC+raCilQxgWVktQxVdY5YPASRRm87YImuWny4v iQMA== 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=CyUXIF+kB+n/kR18v6NX9nuybccCHw2vGX3HnXYLt+KPQTl0OLDRrddgp4bUKdcZ+m k/t9AzXQX2ZWD+9D4/+DK2CKV/ophHJol7RThihRQBcboxMYwiXMg507sNIKE+fQL/ob e3NkcDkgOtkHRszgNr13huZ0Fwx+kZYtIg5b1UabmRlQfd8eqUE/qmGG1zLnh1jzuoVT a1sR6/WGZ1vIRum2Z/UoPG9Pv3EcsnCPNca0GoaYSQyYIz8Y6+woiatVe+4TEYorkHp9 GBi4nPMbBVEx8Rhn6FsVM5rCD3UPw9zYOBq42FAivH9NSDeE78mCH8vF1FsVVP4rAp/a CQag== X-Gm-Message-State: APjAAAXst81JsvYn5Latz+orYnm+AVshQ5ThK+c/tGeieyEZ1AaXJFq1 XrL9XqLNLtJ0cGiOLcxoH5w6G/PN X-Google-Smtp-Source: APXvYqxgH11/1d2BEF+Ng/vSlFZ851TKwqMMz3ITS5y+9UTHzsRPsl0ErfPmqdN60wBb9sPW4qjbOQ== X-Received: by 2002:adf:cd04:: with SMTP id w4mr20918492wrm.25.1552323358281; Mon, 11 Mar 2019 09:55:58 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:22 +0100 Message-Id: <1552323335-46779-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::430 Subject: [Qemu-devel] [PULL v2 18/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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= 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 = "kvm"; #else -#error "No default accelerator available" + error_report("No accelerator selected and" + " no default accelerator available"); + exit(1); #endif } } From patchwork Mon Mar 11 16:55:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Bxfjbsf+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4Vj2Hbhz9s00 for ; Tue, 12 Mar 2019 04:15:23 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OWG-0006Fu-E2 for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:15:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODb-00077I-9n for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODa-0003FD-BL for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODZ-00034g-Ch for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: by mail-wr1-x42d.google.com with SMTP id i16so5927269wrs.13 for ; Mon, 11 Mar 2019 09:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FFXjAL/gQYc05qKrBvN/6j5CEt0yJyVBFP7GqI7giz8=; b=Bxfjbsf+aOMvpfcHN6FecgNtOnX9Sr733hI6l3XlwZ8WrXbsq3aI91qHSFnm7LL0mG R5pVX9RW6m92mTKWPdhOH1QxzJ74i980PaRqfmL0Bmt3rarAZGJviu+e3lHGA8SfyD3U VLkPkT98eA4Zuwki36lKpIIUTFMWSNbH9hTkzbVxtp+b8TwnaYArhsnMQgPtrkB8/Inn 4Ywed6v7s7jRDs0Yga4PSl/FN7KjR+MRMj/crICMcbkapd5+ZfTVr1/owWfMCd4MgQKx i7eh1U6W4nNb0y6O+AbvErbxNe1BVsmLbIVVyGN+LS3EhNmifUmiSTEZ/qeNHBhfIpSl nwiA== 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=FFXjAL/gQYc05qKrBvN/6j5CEt0yJyVBFP7GqI7giz8=; b=Sg12hmi0bUtoqk3RQV7X4SZ2pVYq0t97Rr/2CqvynEaOJ7awM1IdMXg2k4h23LZBj9 eKxvggWtH2uNfQy8dzevYvP5Wy+HwQfQvdM0XO7JCM67jaCk4wjMKOZYJpW1tlZuIWn7 4/yee1w46MVBCJGffUGXY5XEVqfjGVIVdg7PIl9yYOG2/gQGH0r3e/Tj29r5fDHdgXGu ZZbkJ/MMte52LpEODZk+tYHM3cieYYJYI2+ejGbm1eGrZJ7azT7i/hXyIt/R0WSVq1ID 31W2+Cern/RnFNxgyt5Pq49A9IA0FNI5hv5H6gxuXMcLCvOccvtG2mjuG1LMzd4qsPhB Cvuw== X-Gm-Message-State: APjAAAUj0mgZdithV8HBJC6hC7iiRyJQq9NVvc5g1RC3zE8qsrMrg5uz WNKcTIp/+s5+tP1gjPpuDzoaNaU4 X-Google-Smtp-Source: APXvYqwhAr5hQroXNsCdXGJGQcc0wbBQe/0cUJWiQTTR2IWc8XIEbIHWJ16njPy3l5WjEbS3PIY/dQ== X-Received: by 2002:adf:f14f:: with SMTP id y15mr5185626wro.223.1552323359243; Mon, 11 Mar 2019 09:55:59 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:23 +0100 Message-Id: <1552323335-46779-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 19/31] 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_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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 != -1" failed: file "util/oslib-posix.c", line 247, function "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é Message-Id: <20190307142822.8531-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- 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 = fcntl(fd, F_GETFL); assert(f != -1); f = fcntl(fd, F_SETFL, f | O_NONBLOCK); +#ifdef __OpenBSD__ + if (f == -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 == ENODEV); + } +#else assert(f != -1); +#endif } int socket_set_fast_reuse(int fd) From patchwork Mon Mar 11 16:55:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aT/JjP+/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4sJ3vfQz9s3q for ; Tue, 12 Mar 2019 04:31:32 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Olu-0002mT-I4 for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:31:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODb-00077Y-Lh for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODa-0003FW-Gl for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:53905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODa-00037k-7b for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: by mail-wm1-x32b.google.com with SMTP id e74so5327944wmg.3 for ; Mon, 11 Mar 2019 09:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5rcbev+dgu355hdB09jcSP9CdeaQX5x6mYKooDTaw20=; b=aT/JjP+/EMbFvxw2P6P8Fi6rgb1Q7iBIdgz7ngun5bIz8HrCHs6Z2lmoHxI/8avP96 WuAmb2f6Ug0rQ29XmKExnUkoKymbnk9/y4idhiZaZbgJVS5AH8/pp8hGDbkg0kxL7lE9 ZtJbYHFPt/kIVpfauj5j/Bks87ObHsve5SYN3UhUUjuNiW6bN+KtChCS6ipYFa8jPCd3 FAkIy2wEtFHYLz875V7R7AmvLshwfIKx5XlgFRGIIl7FVAO4ri/l6+3ueXjnKfWQAzJ6 r4MmQ8W4omd2sJZxEIlj+q1SHyaZxsAMJYted22VmaMXtDpkr6DlrUa+O/fg02KBkYTm P7DA== 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=5rcbev+dgu355hdB09jcSP9CdeaQX5x6mYKooDTaw20=; b=JzSW+BlCa63IuTMNlxXFU1HUOXJmfM8vrK0MTQZKMxIThn+U+D5hJl3T7Rru+q8vlk ZWjjMy0bgEwCdJnG4BQ5rBmaDIiC1aqrGlSUcL9mUyO1TU7x9fcGfTmi2h738JLoT61c LoeaXNNDwelUM/qXJD0J9R/9kF+6sAz1iwXlWUBGHMcKZBj/afjedg7Td8sUVIDiS/K2 tPqYQVY56NQrtvqKsKAZRqBCbB6jOka6pZJASJHttN/u5IRzOlJ1z6PQ+0XLhWFteZTJ 3QmaVnS0pny4suPVLyikl0VCjytmmbT8bquGuMImIKVFAs8Om0diK5ami5w1qre16pvm JdVw== X-Gm-Message-State: APjAAAUNOwpeVPWEmT5fCi9kkgGLMxIbcQ3NXGbaRj14l7PzfCe/yYo0 hhQlHuQUDFPfdKckvLeJFqLEzkMS X-Google-Smtp-Source: APXvYqxkIL+eUcIW+3soU+qbB+9JkYln+ygSZGwWZpBeCivwSFJoEMZcJUnYBOEbnXvcBAr/jqYBKQ== X-Received: by 2002:a1c:1986:: with SMTP id 128mr185454wmz.107.1552323360133; Mon, 11 Mar 2019 09:56:00 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.55.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:55:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:24 +0100 Message-Id: <1552323335-46779-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b Subject: [Qemu-devel] [PULL v2 20/31] 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_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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=1 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=Variable "addr" is not available.) 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=0) at /usr/src/qemu/accel/tcg/translate-all.c:1112 #4 0x000017e17d9abe81 in tcg_exec_init (tb_size=0) at /usr/src/qemu/accel/tcg/translate-all.c:1149 #5 0x000017e17d9897e9 in tcg_init (ms=0x17e45e456800) at /usr/src/qemu/accel/tcg/tcg-all.c:66 #6 0x000017e17d9891b8 in accel_init_machine (acc=0x17e3c3f50800, ms=0x17e45e456800) at /usr/src/qemu/accel/accel.c:63 #7 0x000017e17d989312 in configure_accelerator (ms=0x17e45e456800, progname=0x7f7fffff07b0 "lm32-softmmu/qemu-system-lm32") at /usr/src/qemu/accel/accel.c:111 #8 0x000017e17d9d8616 in main (argc=1, argv=0x7f7fffff06b8, envp=0x7f7fffff06c8) at vl.c:4325 [1] https://www.openbsd.org/faq/upgrade60.html [2] https://undeadly.org/cgi?action=article&sid=20160527203200 Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20190307142822.8531-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure b/configure index fa83e21..cab830a 100755 --- a/configure +++ b/configure @@ -5903,6 +5903,17 @@ if test "$mingw32" = "yes" ; then done fi +# Disable OpenBSD W^X if available +if test "$tcg" = "yes" && test "$targetos" = "OpenBSD"; then + cat > $TMPC < X-Patchwork-Id: 1054642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mnSP/hyF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4w06STVz9s3q for ; Tue, 12 Mar 2019 04:33:52 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OoA-0004Uo-Tg for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:33:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODc-00077z-1b for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODa-0003G1-Ng for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:41570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODa-0003Cs-FH for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:02 -0400 Received: by mail-wr1-x432.google.com with SMTP id p1so1443270wrs.8 for ; Mon, 11 Mar 2019 09:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rNbPQl/4UypgmmLWc5VlRaP5gdCkG3GIJuH7uo4XxeA=; b=mnSP/hyFxHsxVjpiKSZ34K9bYbV19wpQ6fjHxR6g5PIqEPPRdieJ6NQ0s2LHEJP06D y1lefoXVNxuIGtKmTqLSas8yy5zRWvxeCBmxu78dXxPXdbd/fKeEoNBK9/kQS8ONlWvr OzXwASuYq0fpJxfzp3VurfH/Kwqn9WDYUJRBCRq8wcpmbFywoRU3Xji2VU/fqYSWRFr+ B2zftQTpZVy0R35o4Q7aWSZzwZCensXMEjH+hul43IMeNKvS/lLsmOy4E5zJigZC8wK0 w8z7dbkQ4xlaoSGa/0raotDE3dUlFmlD+CHccA/0it/egPtSxNpISmTseFFftJqsoN/R 3BLQ== 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=T0D/cpXamNk8vIttXYoCoG1tWCa01jTAmHyi7LwVKDENKtmFxdXdxAWmPoEuStWCYL kR8SuD/xu4QXP7uQrM7neH4rymMpvInfx044alIC+BmKmSzPRS6yJp+KGM5MOchvm81l 5lLbI49XcgyS/ca6nPhdc6kwITFkapIZfHFB1bQkV96gOEgNjetNQk3972NpzBGwjL9t tp8dFVojEmYe3rvXj4QeC+4VbNhjbI6xBCTPCDqQu4GGPfw5An6KHVRyMgRluSp/hFnU Q2kqsCftoLVkOd7EUatDqdail4tot6D7UK4PGKtf3UEa5wDOd3vFdh/UsaTRhEDjuutj ZwcQ== X-Gm-Message-State: APjAAAWfByi52D5hJ9NB0yLwAWSp6GXdHxcofHOLKh2k/q1R85dOhOKr chjBotp+HadB1LwoImRToRDSB8hz X-Google-Smtp-Source: APXvYqx8k/foW3SGB6XHomqYZx7523jibvmefVt3p3oHTYh1RsWb8RIJWb0TKN8ims6xpUfxt5adSw== X-Received: by 2002:adf:f690:: with SMTP id v16mr21368188wrp.139.1552323361168; Mon, 11 Mar 2019 09:56:01 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:25 +0100 Message-Id: <1552323335-46779-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 21/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Zhengui Li Qemu will crash with the assertion error that "assert(r->req.aiocb != 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 != 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)); } -static void scsi_read_complete(void * opaque, int ret) +static void scsi_read_complete_noio(SCSIDiskReq *r, int ret) { - SCSIDiskReq *r = (SCSIDiskReq *)opaque; - SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); - int n; + uint32_t n; - assert(r->req.aiocb != NULL); - r->req.aiocb = 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 == NULL); + if (scsi_disk_req_check_error(r, ret, false)) { goto done; } - block_acct_done(blk_get_stats(s->qdev.conf.blk), &r->acct); - trace_scsi_disk_read_complete(r->req.tag, r->qiov.size); - n = r->qiov.size / 512; r->sector += n; r->sector_count -= n; @@ -319,6 +312,24 @@ static void scsi_read_complete(void * opaque, int ret) done: scsi_req_unref(&r->req); +} + +static void scsi_read_complete(void *opaque, int ret) +{ + SCSIDiskReq *r = (SCSIDiskReq *)opaque; + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + + assert(r->req.aiocb != NULL); + r->req.aiocb = 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)); } @@ -395,12 +406,12 @@ static void scsi_read_data(SCSIRequest *req) scsi_req_ref(&r->req); if (r->req.cmd.mode == SCSI_XFER_TO_DEV) { trace_scsi_disk_read_data_invalid(); - scsi_read_complete(r, -EINVAL); + scsi_read_complete_noio(r, -EINVAL); return; } if (!blk_is_available(req->dev->conf.blk)) { - scsi_read_complete(r, -ENOMEDIUM); + scsi_read_complete_noio(r, -ENOMEDIUM); return; } From patchwork Mon Mar 11 16:55:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cCMiGRUI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4WW5jm0z9s00 for ; Tue, 12 Mar 2019 04:16:07 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OWz-0007A5-IR for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:16:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODc-00078i-KC for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODb-0003I7-Q7 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:04 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:54940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODb-0003GD-G5 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:03 -0400 Received: by mail-wm1-x331.google.com with SMTP id f3so5367451wmj.4 for ; Mon, 11 Mar 2019 09:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vfSlUZJuyhAvM26ok+RXB9eSxcSKcy+3I5M39JJNxEA=; b=cCMiGRUIA7JR9HLsXNtrvdRlGy0ZIGf9v9hCeWzn2Yzs8Usc2rjX/esHg5EMgGeqBp SjdgVxxGmObDVQTntsqdmfpZZHwFxnln7J/GkhndFTWly84yBuXErKZtRTtZlbAo6NV2 NDYEkSufFDo/WZV0tVXFhyNOKZL0aMhDhHRuqlWDRQdOXKTkHzYQnbjR3qo2OO7BeO2H RveIFkN82/K1akVOO2jMT2tbrmtu1NuKpdt/i+GJAIasdtikUrerKm3feLjGRhV9w6IZ DApvP2KxlxtjbyRxiaD7F6z2M2w8rnniUCu2D0BYMVvMOMs6CdC9VTIK9vdWizKNGwN8 Cq8g== 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=qGMWU+ZKEAmPdClRLeA6x6jL96t33cyQDwPbZgp3Czp4N5LI+qiTjujcUZnFw2aKTj uWUF5+0CYQLvRh+ttee1M3YxrU6cNA+YodAc+tJJYRxtRJiqmWCFXYX71qi4xnKekUcr R51a5rNanBDpG8b5ke2Fbcjmq/NvX7+w3Y7MGKkXGVqbjlgF3rsclsBf5mdzfu9wiGhd xOqGhP8mVsWeaqncdHYOXwkZNHd3zlR3zcww8bQ726pzrI3ykSpP+rNH+4P1qz352nVn nN7wXDKAIOr/2OUJbMUAE+slf3WhcxhvOVuhlUPoKWVWzciKQmrJZnLTHkDnIx224l1h wi+A== X-Gm-Message-State: APjAAAV8t4oRcSGGrMVX+6TX3qFWPvHB63vgcJH8W9gW9wrLBIZwVZTQ Kw6t69QxiFMdXZCMaCm6fleozpbR X-Google-Smtp-Source: APXvYqwQQD+XgEeFm/olvU+g/zf8J8HKU+W+pC/JKxQCI1pQADOFNmvPqJkuCmd0orQ7MmVUPNl76Q== X-Received: by 2002:a1c:a986:: with SMTP id s128mr34857wme.44.1552323362155; Mon, 11 Mar 2019 09:56:02 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:26 +0100 Message-Id: <1552323335-46779-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 22/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é 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; - /* 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; #define TYPE_LSI53C810 "lsi53c810" @@ -2079,29 +2078,14 @@ static void lsi_ram_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { LSIState *s = opaque; - uint32_t newval; - uint32_t mask; - int shift; - - newval = s->script_ram[addr >> 2]; - shift = (addr & 3) * 8; - mask = ((uint64_t)1 << (size * 8)) - 1; - newval &= ~(mask << shift); - newval |= val << shift; - s->script_ram[addr >> 2] = newval; + stn_le_p(s->script_ram + addr, size, val); } static uint64_t lsi_ram_read(void *opaque, hwaddr addr, unsigned size) { LSIState *s = opaque; - uint32_t val; - uint32_t mask; - - val = s->script_ram[addr >> 2]; - mask = ((uint64_t)1 << (size * 8)) - 1; - val >>= (addr & 3) * 8; - return val & mask; + return ldn_le_p(s->script_ram + addr, size); } static const MemoryRegionOps lsi_ram_ops = { @@ -2244,7 +2228,7 @@ static const VMStateDescription vmstate_lsi_scsi = { VMSTATE_BUFFER_UNSAFE(scratch, LSIState, 0, 18 * sizeof(uint32_t)), VMSTATE_UINT8(sbr, LSIState), - VMSTATE_BUFFER_UNSAFE(script_ram, LSIState, 0, 2048 * sizeof(uint32_t)), + VMSTATE_BUFFER_UNSAFE(script_ram, LSIState, 0, 8192), VMSTATE_END_OF_LIST() } }; From patchwork Mon Mar 11 16:55:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TkP+nW51"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4jX4k05z9sBF for ; Tue, 12 Mar 2019 04:24:48 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OfO-0005o4-Iv for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:24:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODe-0007B7-Nd for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODd-0003O0-Jw for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:06 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:55571) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODc-0003JH-WC for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:05 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 4so289917wmf.5 for ; Mon, 11 Mar 2019 09:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0KtITCFgm7yckdK/wn/O5zJgkB2Z62Yl4ofit5ZEqQ0=; b=TkP+nW510ZNFgAW9HB60ZFsk902nKvoB25u5oZBNI2RFCIVSEc67+l+FbbJs0/GWcN lBP4QhlbkTXifBqXxOqLCTnuW3xlhrFL0rvOdPiYkQeRqUi2L0aQijrw4OFffsvtr9pY dAbFZWvHGzNTkvD0ZiCsOjpv2NBsz1/1VbWTM/0mPgr6j/kGZkfBehVARyfPHQ/yntCu 1VBwzwbEpP+aOaEGOzgUYVLRiFavcf4wgCyl5TNRMdELbvqLjhC61GbUJgsBEYOaLH0Y +pIAWAejLho+8r4RUGX2wUVHVVb6x4uc7tuQyVPaqd1t7WUwg6QuknT+Jg4VLBANCZjz Nhmw== 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=ee5CrIa6K7q5i5bfpOLE/9B1Vb5yL07EG7YyBSS4QznG1l0iG1Z+KG3XdF1ZVXuh+k ecLdk39TWKOBWtO/4U1htfSrEk1k3XwDxo0qoZONGakYnrmLG5Z9jsJNMwFq35hw82Co 6MYqFoUvqQHsr07bTXjQZryPkgFr3SP2HFUMBTWIZsoaexxED7hhVXrFXl0Gh8F+Eg3K kc0Bqu753m408yUPQx7UT5kxSvgOrl53XrIRI0r6V6Q5zxlY2RIOtx7Gc2m2SXRdoUod tOn2J5+xQOIRjKjx8a+9jT7QkADwgv3jakOuexCHNDsOxuXbLPw+4hkwfCGPwYorkHcc ccZQ== X-Gm-Message-State: APjAAAUoH5kc/l8fCaDOlqPcnujPk4bLKU45bTPKaZBSsMVd7IgHPYZx 3woFX8gK0En5/kavkPuHFcfCBsRb X-Google-Smtp-Source: APXvYqypapMh3xPY1gucT9wDLy0BS4MbMsKFwn8zOclIsW3SdtYF6Qewm5HhLdBY7LlDy2bUB53UTg== X-Received: by 2002:a1c:2dd2:: with SMTP id t201mr31560wmt.44.1552323363475; Mon, 11 Mar 2019 09:56:03 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:27 +0100 Message-Id: <1552323335-46779-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 23/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle This makes the code easier to read - no functional change. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daudé 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; +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) s->msg_action = 0; s->msg_len = 0; - s->waiting = 0; + s->waiting = LSI_NOWAIT; s->dsa = 0; s->dnad = 0; s->dbc = 0; @@ -564,10 +567,10 @@ static void lsi_bad_phase(LSIState *s, int out, int new_phase) static void lsi_resume_script(LSIState *s) { if (s->waiting != 2) { - s->waiting = 0; + s->waiting = LSI_NOWAIT; lsi_execute_script(s); } else { - s->waiting = 0; + s->waiting = LSI_NOWAIT; } } @@ -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 == 1 || + if (s->waiting == 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; assert(req->hba_private); - if (s->waiting == 1 || req->hba_private != s->current || + if (s->waiting == LSI_WAIT_RESELECT || req->hba_private != s->current || (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 = len; s->command_complete = 1; if (s->waiting) { - if (s->waiting == 1 || s->dbc == 0) { + if (s->waiting == LSI_WAIT_RESELECT || s->dbc == 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 == NULL) { - s->waiting = 1; + s->waiting = LSI_WAIT_RESELECT; } } @@ -1202,16 +1205,16 @@ again: s->dnad64 = addr_high; switch (s->sstat1 & 0x7) { case PHASE_DO: - s->waiting = 2; + s->waiting = LSI_DMA_SCRIPTS; lsi_do_dma(s, 1); if (s->waiting) - s->waiting = 3; + s->waiting = LSI_DMA_IN_PROGRESS; break; case PHASE_DI: - s->waiting = 2; + s->waiting = LSI_DMA_SCRIPTS; lsi_do_dma(s, 0); if (s->waiting) - s->waiting = 3; + s->waiting = LSI_DMA_IN_PROGRESS; break; case PHASE_CMD: lsi_do_command(s); @@ -1278,6 +1281,7 @@ again: } s->sbcl |= LSI_SBCL_BSY; lsi_set_phase(s, PHASE_MO); + s->waiting = 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 == 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 disconnect. @@ -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 == 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, uint8_t val) s->istat0 &= ~LSI_ISTAT0_INTF; lsi_update_irq(s); } - if (s->waiting == 1 && val & LSI_ISTAT0_SIGP) { + if (s->waiting == LSI_WAIT_RESELECT && val & LSI_ISTAT0_SIGP) { trace_lsi_awoken(); - s->waiting = 0; + s->waiting = LSI_NOWAIT; s->dsp = s->dnad; lsi_execute_script(s); } From patchwork Mon Mar 11 16:55:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="feQlaFZR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4lk4h4Yz9s3q for ; Tue, 12 Mar 2019 04:26:42 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OhE-0007bx-Ij for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:26:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODf-0007EW-Gg for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODe-0003Sn-GM for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:07 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:35316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODe-0003NE-1W for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:06 -0400 Received: by mail-wr1-x431.google.com with SMTP id t18so5945020wrx.2 for ; Mon, 11 Mar 2019 09:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UQJ8d0TbAzHktegHdOg5NvPUwjF5mKHJ/Disi/YaUQQ=; b=feQlaFZRuil1QYVcTupds+LvofFIJOC5ev0cdtaG9jOkQ1PBbTJGEpXMywv9w8zTLz kagzo85ReQMoUyaIQb2ekHgXBwyYnAgCgY12+Bo70rHkbURvd7FPS7HjKCkiUXd9y1fY /cRkJFj6Mq0RL7pnd4t6M86vGFIYaGHQLvtGlDR1bLhxt5tD7dKSof293NL/sC+GVu6F E9f/GUH/tvv/Y9m8aZbNc3j81zoOivfzyBS+nEZBsUrz4yBiA+Jydl0YI2A2QLSo2JSI NCeQKn0GMkgke8NfM0HNRp46REOrxhBYZN1uBIJ/G8RWpuHAZg0ZPVZtYw81Huqhdw4D Nm7A== 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=IBCz+EH0bkCisFAwPeTJAFfxWSidvgPWmyHWOmvizqj1Qm/Fa1WeY4kJxHwtsUt8D5 CZ0O0kWh/x5bZjDI1e7M9c79VYdHe6LiHaOjZ2zUZxIc6d0AIzUQYr20qP+on/0Gy23k xZvD5yMibEOYLjWmkpr22vDz2yBiwSR8LUL7PkEBE5R+VEnIfwwcQ7KkerFjoVZqb267 I9+29gjWokV7ANU/QwMN5O7grbwm0YGChRcVnj14PE615oKhIrYpUg/YR+XCAvc5KGEQ c5fjfgDY29guBNtcFYldKb8ZPfmHIKaZNIQHOilXLQGYoO21XBXqINutuAj+Jh3vlpF0 X7ZQ== X-Gm-Message-State: APjAAAWjgT4ct6MtiIIelmEdinztWGFjq9uJeMB2eyL4k43d0I+8UDQI SBBThtbDgurzS7LSW1WqWygMHshR X-Google-Smtp-Source: APXvYqy6Bojh5NV5BkALJZVp24E1M1ztZkbh0Qd9g5h6ssc0dIx2a5JJpFt2G2iFMggBZbuiYuhJPw== X-Received: by 2002:a5d:4608:: with SMTP id t8mr21907436wrq.186.1552323364600; Mon, 11 Mar 2019 09:56:04 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:28 +0100 Message-Id: <1552323335-46779-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 24/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle This makes the code easier to read - no functional change. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daudé 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 */ }; +enum { + LSI_MSG_ACTION_COMMAND = 0, + LSI_MSG_ACTION_DISCONNECT = 1, + LSI_MSG_ACTION_DOUT = 2, + LSI_MSG_ACTION_DIN = 3, +}; + typedef struct { /*< private >*/ PCIDevice parent_obj; @@ -214,8 +221,6 @@ typedef struct { int carry; /* ??? Should this be an a visible register somewhere? */ int status; - /* Action to take at the end of a MSG IN phase. - 0 = COMMAND, 1 = disconnect, 2 = DATA OUT, 3 = 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 = 0; - s->msg_action = 0; + s->msg_action = LSI_MSG_ACTION_COMMAND; s->msg_len = 0; s->waiting = LSI_NOWAIT; s->dsa = 0; @@ -686,7 +691,7 @@ static void lsi_reselect(LSIState *s, lsi_request *p) trace_lsi_reselect(id); s->scntl1 |= LSI_SCNTL1_CON; lsi_set_phase(s, PHASE_MI); - s->msg_action = p->out ? 2 : 3; + s->msg_action = p->out ? LSI_MSG_ACTION_DOUT : LSI_MSG_ACTION_DIN; s->current->dma_len = 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 = 1; + s->msg_action = 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 = status; pci_dma_write(PCI_DEVICE(s), s->dnad, &status, 1); lsi_set_phase(s, PHASE_MI); - s->msg_action = 1; + s->msg_action = LSI_MSG_ACTION_DISCONNECT; lsi_add_msg_byte(s, 0); /* COMMAND COMPLETE */ } @@ -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 = 0; + s->msg_action = LSI_MSG_ACTION_COMMAND; } #define LSI_BUF_SIZE 4096 From patchwork Mon Mar 11 16:55:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U/7sYuyL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4nq4m3cz9sBF for ; Tue, 12 Mar 2019 04:28:31 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Oiz-0000UV-Lo for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:28:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODg-0007FW-IA for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODf-0003Vy-69 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:08 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:34247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODe-0003Rf-TP for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:07 -0400 Received: by mail-wr1-x42c.google.com with SMTP id f14so5953724wrg.1 for ; Mon, 11 Mar 2019 09:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MeXgrkegz45A7u724nmrmyFXzBs4nH52uk5SITDRMIs=; b=U/7sYuyLdS2Qk6HVw3cDlEfJEkLg1Ymm8Xr7jsvIWz0zXvFJK05dgHmcUeGv5+4p7t v/Gj1TC/YsGGlFv4Tuzs4gHxv2spO5lSb6yvQp6V//Qh9hp2iD+/JTwer4oh4C/MiXXY UfQjq8TmJXmT9xntQgcRG8q6bTk+h7ExLPWZE9ffRL6+8RgftgWlGJt3BaPs3G+SSAB0 2skEDY3OwTYAaCjfv9tnAkX36GS4VmdTgqhjafX0DI6rvkE1EPe7Py769N3JJQ2ufFno ewEMemu5cQvaag+SVLQbGSi2QK8Nw9xkmt9OGId6wKfttGhD3fhdgFsw5TZWE3odlpnW r85Q== 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=fOyme96iQSovJ7VyC/S866afcjuL84EwMV6WB5RDQm8UvNUz/mbi5pr+n2KYb9shEW xhfCrXo3YhjfD/LQROd7NuWtiXCQWMLS+g6USJb69wlbBoS0IQwibHHFDTzr4vZr59TY GhiF7YiqEEMmPgC3svOvLx/BGdDGSPdfUKh/IUlvTBLJxUZDaBEmn07QOouOglAjP4tF 9dBquTrNw8l31zekShYAmREbXd4CTgEtBfwk54jjOS5Borb5/h5j4dk38MLt6IIiBxcf z0VKp13psZwCXH7vKqQ5Tvv+wBA884z7nYxEZa6J4hO+eoX9dnPzYsCnYw5+qdG+kvhq uTKg== X-Gm-Message-State: APjAAAVurYZ25vVvYI/prZmaI0aE4xkR57GWha56qN9LjXajvH2cXB6g bKkea2lHCusIMhc/UeFJJCRcDCmZ X-Google-Smtp-Source: APXvYqzlrNyrLbOLFgZuum3HsT8JUmfNEBzOVq2lV+sfM/GCTGH8h1xCPG2+Sk+2Mk4982OH4ZvHsA== X-Received: by 2002:a5d:500e:: with SMTP id e14mr20083715wrt.219.1552323365611; Mon, 11 Mar 2019 09:56:05 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:29 +0100 Message-Id: <1552323335-46779-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL v2 25/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é 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) +static const char *scsi_phases[] = { + "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 = s->dsp - 12; } if ((s->sstat1 & PHASE_MASK) != ((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 = s->dbc & 0xff; s->ctest5 = (s->ctest5 & 0xfc) | ((s->dbc >> 8) & 3); @@ -1463,10 +1480,8 @@ again: cond = s->carry != 0; } if (cond == jmp && (insn & (1 << 17))) { - trace_lsi_execute_script_tc_compp( - (s->sstat1 & PHASE_MASK), - jmp ? '=' : '!', - ((insn >> 24) & 7)); + trace_lsi_execute_script_tc_compp(scsi_phase_name(s->sstat1), + jmp ? '=' : '!', scsi_phase_name(insn >> 24)); cond = (s->sstat1 & PHASE_MASK) == ((insn >> 24) & 7); } if (cond == 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) "memcpy dest 0x%"PRIx32" src lsi_wait_reselect(void) "Wait Reselect" lsi_execute_script(uint32_t dsp, uint32_t insn, uint32_t addr) "SCRIPTS dsp=0x%"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) "Wrong phase got %d expected %d" +lsi_execute_script_blockmove_badphase(const char *phase, const char *expected) "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 target %d%s" lsi_execute_script_io_disconnect(void) "Wait Disconnect" @@ -278,8 +278,8 @@ lsi_execute_script_io_opcode(const char *opcode, int reg, 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) "Compare phase %d %c= %d" -lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, int op, int result) "Compare data 0x%"PRIx32" & 0x%x %c= 0x%x" +lsi_execute_script_tc_compp(const char *phase, char op, const char *insn_phase) "Compare phase %s %c= %s" +lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, char op, int result) "Compare data 0x%"PRIx32" & 0x%x %c= 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 From patchwork Mon Mar 11 16:55:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CNGOV1Tt"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4qr75dqz9s3q for ; Tue, 12 Mar 2019 04:30:16 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Okg-0001nk-Ma for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:30:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODk-0007H2-PI for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODj-0003cu-1e for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:12 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:53912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODg-0003Wt-HF for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:09 -0400 Received: by mail-wm1-x332.google.com with SMTP id e74so5328307wmg.3 for ; Mon, 11 Mar 2019 09:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=MVbKGZ5IZNniHsdQwSGV9lfa6JW/VzOYJ/nU6DXVyag=; b=CNGOV1TtNvQPRAQIKC9mlbB5eW1moXMVwS9eLuublFr55E4ku0DqOaLd0/eHkXxA6b cNjGDNtpTMcKxDOQ0nb4ur879Ja1pr0CGZxr5/ruqwykn4Fw6DWyIszSWMU4HHO9nRy/ tlNM593p9VL22+NTSoU89KwQxrf+HxW4gfM7JFFr3K0DAeAqmM2lDx/zVLV88lMV7js+ LLYMLcMm5CGRy9+gUcqYfdQEdsX/mYPivlMPly4DnRAfVwHbNvsF/FTskf+LaGQdDJjt FKBuU95QKfcWefZBEvtjvr2YFFSCs1Bz/VWvzMBK2TtifjNIt/PvGFMoJBM0uIos3Pef hHHQ== 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=tpEPSFQ1nA+JMIXEYPbUoYtDhxwUo+QRsdxtRqOSCE01WnlTwJaJR/V+wl7MrPMb3v LtOFb+20EKp6TQKmLILM66k1mQD76ddGCkQes6JU2bONcRaMMkfGy36XjhmTy6s4DKkz R7EWg+Vs3sdL/K2sqHLDgv77+nxPwD3ghMCETWEi/ct7uq03bmlaFe3XdlXq1pVZfFSa XER8GTT2lXo1RxwmYxOV1cx9X6g1tzpB3tuVdozafhklTuthBnFPeeyWhUPMsZYmQIa2 encynoGLze+mihwAIKERZGCwow/zbLpv0K+HE6i7N/OhocwDmQ8/WT3fXi/es/2MDwhz UcKA== X-Gm-Message-State: APjAAAW7lz0S3E1QpimFWKlPTaXtfeXmliJ7d+thbCjhv6SGnAGgKKf9 8SnJxIDDGB32bNT/Qm+HsQ6Nf2eT X-Google-Smtp-Source: APXvYqwJMWS/bxLN9pUs+y4SRpOcYKhrckImcl9+41h8+sy5J4MUYkVwIZ2F8QQ8rK/Gqxlqu1ccIg== X-Received: by 2002:a1c:1d15:: with SMTP id d21mr16318wmd.132.1552323366619; Mon, 11 Mar 2019 09:56:06 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:30 +0100 Message-Id: <1552323335-46779-27-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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::332 Subject: [Qemu-devel] [PULL v2 26/31] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 = 0; + ret = s->dfifo; break; case 0x21: /* CTEST4 */ ret = s->ctest4; From patchwork Mon Mar 11 16:55:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VRilJ3rq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4yH16h3z9sBF for ; Tue, 12 Mar 2019 04:35:51 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Oq5-00061A-3z for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:35:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODm-0007J3-PE for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODk-0003fI-Ns for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:14 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODh-0003Zq-3L for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:11 -0400 Received: by mail-wm1-x336.google.com with SMTP id e74so5328380wmg.3 for ; Mon, 11 Mar 2019 09:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RgX+6UMPE+s0mvfR0KiyWKf2o3Y9NP3BF56z0jac6GY=; b=VRilJ3rqrGkgiy9+K0XE7LuYZwh9/5v3coPYkDMpnXCfh4EJKwIHJZ2Lgr6bmS2WRu KoE31Vl1JCeWAnn1XcFi+SonRvmCBGc5o0EPChmN4j+m7FgiLyOrpHjLz8dvWGtvUn46 WsaIKFLXM0bEapWc+QBSaR6V75gsLHY7eLgpv62UDkPXE3e+fFjSU/D63llnG/qXbS/k /WNod/dZ6Ihkhhu+yD1iNcaqb4kf6L5uj+e+p5RLNdR32ACz6jtUyr9MeXeK8m+86iot pn1u22yN8CSsWQEUodlagEU8HqEQJN2MI6lmnhtzaZbYfA44YT1uPEs+jc3pGiPLnZuw /MwA== 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=RgX+6UMPE+s0mvfR0KiyWKf2o3Y9NP3BF56z0jac6GY=; b=eiaipBVKHs4uMNwreYfyAhbB7rEd325yGEL4uohkRWVQP4IqcQk9/O0QL5pzJm6Td/ /5juU2cmV1hzFqO9F1uOXItmaEPH9heFKZKqL0uTUXrMI7S8/t+mOQIovVR/Wsym/d2q E+1jKyL0fUsbIy3f/WFpiyPNOTdO7SThTRPdQwfO/ggGZVga4v3tKGBFFW7ayG+VCjHL a0Cusj/QhT2EzyyhxGBCYTwcDePTX6i2T9e3cN5JR/qtcqrIy0KJEdEjtGwJxjZQB0eh +y0GKdI3OJzE6su1PUbCb/xY6w5V/+6bCe59Vnnjhf0wIkALrPWwpF4jjKpOAV7kcyGG 2SsA== X-Gm-Message-State: APjAAAU9s0Nuu5WNfbVBv8fB61ALNdhncIPvzZQIjVdjTkb30Z0v12Sv o5PquJq08aCHUWAQG/rBGehPz7/N X-Google-Smtp-Source: APXvYqzFjrEboYzql6ZTKV0JLZO6hMr6SAesX45pRtE2GBD5WRUBOD05n0s8fu8w21iVrMB+8Jz6Wg== X-Received: by 2002:a1c:7610:: with SMTP id r16mr405067wmc.139.1552323367612; Mon, 11 Mar 2019 09:56:07 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:31 +0100 Message-Id: <1552323335-46779-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 27/31] lsi: 810/895A are always little endian 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sven Schnelle Signed-off-by: Sven Schnelle Message-Id: <20190218175529.11237-1-svens@stackframe.org> Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index bf6b6a5..da7239d 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2084,14 +2084,13 @@ static uint64_t lsi_mmio_read(void *opaque, hwaddr addr, unsigned size) { LSIState *s = opaque; - return lsi_reg_readb(s, addr & 0xff); } static const MemoryRegionOps lsi_mmio_ops = { .read = lsi_mmio_read, .write = lsi_mmio_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .impl = { .min_access_size = 1, .max_access_size = 1, @@ -2115,7 +2114,7 @@ static uint64_t lsi_ram_read(void *opaque, hwaddr addr, static const MemoryRegionOps lsi_ram_ops = { .read = lsi_ram_read, .write = lsi_ram_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static uint64_t lsi_io_read(void *opaque, hwaddr addr, @@ -2135,7 +2134,7 @@ static void lsi_io_write(void *opaque, hwaddr addr, static const MemoryRegionOps lsi_io_ops = { .read = lsi_io_read, .write = lsi_io_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .impl = { .min_access_size = 1, .max_access_size = 1, From patchwork Mon Mar 11 16:55:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PGwzz/5M"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J50Q3nb4z9s3q for ; Tue, 12 Mar 2019 04:37:42 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Ors-0007E2-3A for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:37:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODm-0007J5-PE for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODk-0003fr-Ri for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:14 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODj-0003b5-5V for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:12 -0400 Received: by mail-wr1-x42d.google.com with SMTP id t18so5945364wrx.2 for ; Mon, 11 Mar 2019 09:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Vpe/Y0UWR5sWVoGFiXlnvAck+qUEuOl5CVYOZvpMGXU=; b=PGwzz/5MKtEMhDfUUkNrDZYkOzRakM2e0CH/cnt2Rp5cP/BvdEcxO+u3gMIYZgoZed 9bT+Rs5LyH4zXs13eRLws1NfTi9Wuk76PsPt5Bk+cmxpN5AA1lTcKzqlNjgvxRychp1V zLjCaDlvSei93pfwK2nw/Ls3QI5vp7DBOkgDUDyRQZt7IDg5s27Z0jZcy9WvVoF/+636 tiGrSqGsmSf1qc1i89sS+k9fedNLDLlRi991RtU4yUZnJnChKC8IzG9mpo2SQEezl9Y8 ackOAPqHyI/Ly9mAqb0aSmUzY9z0wMmYK9dMmJuuzXw/g1zae0U+eFchr/6bzCMYeR8P hPjw== 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=Vpe/Y0UWR5sWVoGFiXlnvAck+qUEuOl5CVYOZvpMGXU=; b=g7QGMX97PgHF250ohO5bx0vDY0Qt+uZbVZJeh6XOEiPCMFpCqTHy3a9E4vxpBSJBzQ qf0WKJZYcrIOyGvGrp0pGfH6jhhrNIXZrE9KYamR0aKnB2vtZK8hButNFCfDu4kPnEFp U8GuSudrE/Rh01PTGb52udOcq8bOSMdEBlxQ9YcPtKLQ4lmgzpwmjzgg0TJNqCKWez8X h5M6FGSIdwLYCABCSggw5tOfG9hqS/moB6j1iWoMvbbSN4oIIO5IALaTOgMAZ+Wfsou/ QQkWHa0J77K98j6bxznJDdg23jesIY9jxeEGkOyZVJ+Gh+AnPx/zACHQkdLeptG87OpU 1b+Q== X-Gm-Message-State: APjAAAV5nUEezWs/lswSxr6Dr9n9m4zOpWtTgRKcdzUTtYP6uY+kYm3j /Yw8E2GzZAdhHaQ6ISp50oD09Zep X-Google-Smtp-Source: APXvYqyiXHIXrknEDEBGbe7AKr3GvjKbri5raHxjFnK3N3FrVGk4A1ZcA9YReG0dvIL/zFJxedTQuQ== X-Received: by 2002:adf:dfc4:: with SMTP id q4mr21346459wrn.276.1552323368551; Mon, 11 Mar 2019 09:56:08 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:32 +0100 Message-Id: <1552323335-46779-29-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-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 v2 28/31] exec.c: refactor function 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: , Cc: Wei Yang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wei Yang flatview_add_to_dispatch() registers page based on the condition of *section*, which may looks like this: |s|PPPPPPP|s| where s stands for subpage and P for page. The procedure of this function could be described as: - register first subpage - register page - register last subpage This means the procedure could be simplified into these three steps instead of a loop iteration. This patch refactors the function into three corresponding steps and adds some comment to clarify it. Signed-off-by: Wei Yang Message-Id: <20190311054252.6094-1-richardw.yang@linux.intel.com> [Paolo: move exit before adjustment of remain.offset_within_*, otherwise int128_get64 fails when a region is 2^64 bytes long] Signed-off-by: Paolo Bonzini --- exec.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/exec.c b/exec.c index 1d4f378..86a38d3 100644 --- a/exec.c +++ b/exec.c @@ -1599,35 +1599,49 @@ static void register_multipage(FlatView *fv, phys_page_set(d, start_addr >> TARGET_PAGE_BITS, num_pages, section_index); } +/* + * The range in *section* may look like this: + * + * |s|PPPPPPP|s| + * + * where s stands for subpage and P for page. + */ void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section) { - MemoryRegionSection now = *section, remain = *section; + MemoryRegionSection remain = *section; Int128 page_size = int128_make64(TARGET_PAGE_SIZE); - if (now.offset_within_address_space & ~TARGET_PAGE_MASK) { - uint64_t left = TARGET_PAGE_ALIGN(now.offset_within_address_space) - - now.offset_within_address_space; + /* register first subpage */ + if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { + uint64_t left = TARGET_PAGE_ALIGN(remain.offset_within_address_space) + - remain.offset_within_address_space; + MemoryRegionSection now = remain; now.size = int128_min(int128_make64(left), now.size); register_subpage(fv, &now); - } else { - now.size = int128_zero(); - } - while (int128_ne(remain.size, now.size)) { + if (int128_eq(remain.size, now.size)) { + return; + } remain.size = int128_sub(remain.size, now.size); remain.offset_within_address_space += int128_get64(now.size); remain.offset_within_region += int128_get64(now.size); - now = remain; - if (int128_lt(remain.size, page_size)) { - register_subpage(fv, &now); - } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { - now.size = page_size; - register_subpage(fv, &now); - } else { - now.size = int128_and(now.size, int128_neg(page_size)); - register_multipage(fv, &now); + } + + /* register whole pages */ + if (int128_ge(remain.size, page_size)) { + MemoryRegionSection now = remain; + now.size = int128_and(now.size, int128_neg(page_size)); + register_multipage(fv, &now); + if (int128_eq(remain.size, now.size)) { + return; } + remain.size = int128_sub(remain.size, now.size); + remain.offset_within_address_space += int128_get64(now.size); + remain.offset_within_region += int128_get64(now.size); } + + /* register last subpage */ + register_subpage(fv, &remain); } void qemu_flush_coalesced_mmio_buffer(void) From patchwork Mon Mar 11 16:55:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="om9erKUZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4bS6ZJ1z9s3q for ; Tue, 12 Mar 2019 04:19:31 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3OaE-0001Cl-HW for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:19:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODq-0007N9-CA for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODm-0003iP-Qw for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:17 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:38950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODk-0003bz-Se for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:14 -0400 Received: by mail-wr1-x434.google.com with SMTP id p8so4335160wrq.6 for ; Mon, 11 Mar 2019 09:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ASyHtr3XxDb/3QnswjqQRSY/+KGBPjflbxqM9L5GZLY=; b=om9erKUZj7o1+EEx1jaJb3+037flLt18XehQvNjGHSUYdLBHvNOZ9qCieUTzAJnrMU KIBXyMaLncVMKKcOmO3p4OmYVEk52JX2bfRzza9KoEqCt2Oqt9vIgrdntrrfwVqxsKZm 0iZPRTc4crAsGmG/oL6Y7RFER0N8jrYU8Hf5D18FLQZt8w66DB6ZG95VhoziO3V8X9T/ E3+zNDlzC3bLfa1/hwhjTU/tsWkBcBwbHbIPUv3KE/D5SsyKAQyTmUkCguWeJKGo32ap ckCw29wz9NzsCer1wBdONi3H4LSkE66PCrGcVVO3qhYFtKxbO/NYIjgoa8EYo3qz29R0 3ivg== 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=ASyHtr3XxDb/3QnswjqQRSY/+KGBPjflbxqM9L5GZLY=; b=NAN9BZuB4CVjdZokTkm6oLeVhFqrRblFL+GW9rkKuxr9dLPCS7uugrqbgaycDN2bE5 NantaYK7laJHARxRMN6yo1Vb+PVeFUq8f7hYBiDA/esfcopvSL89nNNsNRIyUC5YOcpt NH7FpPl/FUlxNT21KxsBeR/Vgjbv+h7RO5DIJDLQFCw8mubzHeGknWg81haShjOuwaZm eR/tonfl8yNKskPR4oT5ImYFao0kCZuvoncO5nsEQXkB0gaI0qhcoDuLJDYRQ4srBwF/ PMtE6aUracjBU7WMv3tzjNuIqq1T0b+rNArZ7PEIqWlLPYtRUNWcvVIyVuXPF80oFnrf 9+Xw== X-Gm-Message-State: APjAAAW5PdYgazU+GZOlnRAaTs94M7FOaFU/kRBL0uQeIobGdRh3y10k HlW4WZF9u1nXqFYwbzbtECu81/oK X-Google-Smtp-Source: APXvYqxpJRncft6gb2nLCl5SGxqlrgEcqwuGRsWK+hhZJ9kovicnwkSm2W1AIkeV8pSw1QchTyd0lg== X-Received: by 2002:adf:e3d1:: with SMTP id k17mr20432409wrm.143.1552323369847; Mon, 11 Mar 2019 09:56:09 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:33 +0100 Message-Id: <1552323335-46779-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 29/31] qom: cpu: destroy work_mutex in cpu_common_finalize 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: Li Qiang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Li Qiang Commit 376692b9dc6(cpus: protect work list with work_mutex) initialize a work_mutex in cpu_common_initfn, however forget to destroy it. This will cause resource leak when hotunplug cpu or hotplug cpu fails. Signed-off-by: Li Qiang Message-Id: <20190102074114.26988-1-liq3ea@163.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- qom/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qom/cpu.c b/qom/cpu.c index f5579b1..a8d2958 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -380,6 +380,9 @@ static void cpu_common_initfn(Object *obj) static void cpu_common_finalize(Object *obj) { + CPUState *cpu = CPU(obj); + + qemu_mutex_destroy(&cpu->work_mutex); } static int64_t cpu_common_get_arch_id(CPUState *cpu) From patchwork Mon Mar 11 16:55:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W61cbmkI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4xq0hqyz9s3q for ; Tue, 12 Mar 2019 04:35:23 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Opd-0005bm-0q for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:35:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODo-0007LA-Ho for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODm-0003ht-Kd for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:16 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:53048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODk-0003df-Oa for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:14 -0400 Received: by mail-wm1-x342.google.com with SMTP id f65so5323328wma.2 for ; Mon, 11 Mar 2019 09:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bCGrPA9zYOvkiY2i+yO0fS2Xzy5kNaot6A4WzcjEy4Q=; b=W61cbmkIMoQMMKyXk9flvGFVqxqWPLGidfPFSrKnrjY+Px6TdH2nr9fBrBjKUNcUTK +o8XXIpY2IPGO0uhYzhANFelhnb2RhHLy1E6l+AZPhOvCBh4sbHrF17Pw3xLecLrtYgL +WkghjChUsyDMJdHA1q3UISIBnMp86JMzd7AU51xAeiAQdqBUyFD4jIfErCJS61L3fNh VQv4S4Pbg9t6eXyy+Ec0KzAv81sUS7ziLlkzBFTWlyzIdQ4252uLex6oSN12BFqD4ITM 3ipJ+pntIUV6lRGKFNQmgIz+p98jgM63gJmNWCXFCXFPLusIZ7nWPiyz/chIvZyssQXX dCxg== 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=bCGrPA9zYOvkiY2i+yO0fS2Xzy5kNaot6A4WzcjEy4Q=; b=Ab+fuFlKvyAKhn82pOwG04fiDihDcYWk2uNF+NNheGqJzJ2d8bUtFJaRSc2vcklOk3 QCX3JaS9ebyyZDqx38eTuVz58iPQ7fo+SxosBEvd614690KCmDGAsj+cQd7uT94hrqfc twlFxXkNI7/dDamH8X3YeDd6ri0XJwtGa21IyxNE7x5PEFY0Fs1wE4VACfVjoItzghAv oJVkNL4+1y+Y++ZLdzbDnSeuebqOTpyake1HrTpzo18rnAwUYp75WdOJa9LEq3rt3VMH frE+fGH/Msv0Rf1gMJtl1N8CthLqh5pprzj/eSEiT12tvj8fkdP6J5QQ1DSt+EB6prd4 k0LA== X-Gm-Message-State: APjAAAX76NbMi0JyIPZUy6xEtmHqC1t8hWgrzJ7PEmR5Q3Km8El7/ulD mZfcH1m6zzkfyPBfOzpmlaPG61qA X-Google-Smtp-Source: APXvYqwSJG+AxffryOMaQNec8lLiDh0W9G1q/wmyZ2fgMBgsKOT9hlge53CdtLhJF3iZrGi2iZ65hw== X-Received: by 2002:a1c:228b:: with SMTP id i133mr433781wmi.105.1552323370919; Mon, 11 Mar 2019 09:56:10 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:34 +0100 Message-Id: <1552323335-46779-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 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 v2 30/31] chardev: add support for authorization for TLS clients 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Daniel P. Berrange" Currently any client which can complete the TLS handshake is able to use a chardev server. The server admin can turn on the 'verify-peer' option for the x509 creds to require the client to provide a x509 certificate. This means the client will have to acquire a certificate from the CA before they are permitted to use the chardev server. This is still a fairly low bar. This adds a 'tls-authz=OBJECT-ID' option to the socket chardev backend which takes the ID of a previously added 'QAuthZ' object instance. This will be used to validate the client's x509 distinguished name. Clients failing the check will not be permitted to use the chardev server. For example to setup authorization that only allows connection from a client whose x509 certificate distinguished name contains 'CN=fred', you would use: $QEMU -object tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\ endpoint=server,verify-peer=yes \ -object authz-simple,id=authz0,identity=CN=laptop.example.com,,\ O=Example Org,,L=London,,ST=London,,C=GB \ -chardev socket,host=127.0.0.1,port=9000,server,\ tls-creds=tls0,tls-authz=authz0 \ ...other qemu args... Signed-off-by: Daniel P. Berrange Reviewed-by: Marc-André Lureau --- chardev/char-socket.c | 12 +++++++++++- chardev/char.c | 3 +++ qapi/char.json | 6 ++++++ qemu-options.hx | 10 ++++++++-- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 6d287ba..3916505 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -59,6 +59,7 @@ typedef struct { QIONetListener *listener; GSource *hup_source; QCryptoTLSCreds *tls_creds; + char *tls_authz; TCPChardevState state; int max_size; int do_telnetopt; @@ -807,7 +808,7 @@ static void tcp_chr_tls_init(Chardev *chr) if (s->is_listen) { tioc = qio_channel_tls_new_server( s->ioc, s->tls_creds, - NULL, /* XXX Use an ACL */ + s->tls_authz, &err); } else { tioc = qio_channel_tls_new_client( @@ -1055,6 +1056,7 @@ static void char_socket_finalize(Object *obj) if (s->tls_creds) { object_unref(OBJECT(s->tls_creds)); } + g_free(s->tls_authz); qemu_chr_be_event(chr, CHR_EVENT_CLOSED); } @@ -1242,6 +1244,11 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, break; } + if (sock->has_tls_authz && !sock->has_tls_creds) { + error_setg(errp, "'tls_authz' option requires 'tls_creds' option"); + return false; + } + /* Validate any options which have a dependancy on client vs server */ if (!sock->has_server || sock->server) { if (sock->has_reconnect) { @@ -1320,6 +1327,7 @@ static void qmp_chardev_open_socket(Chardev *chr, } } } + s->tls_authz = g_strdup(sock->tls_authz); s->addr = addr = socket_address_flatten(sock->addr); @@ -1399,6 +1407,8 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, sock->reconnect = qemu_opt_get_number(opts, "reconnect", 0); sock->has_tls_creds = qemu_opt_get(opts, "tls-creds"); sock->tls_creds = g_strdup(qemu_opt_get(opts, "tls-creds")); + sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); + sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); addr = g_new0(SocketAddressLegacy, 1); if (path) { diff --git a/chardev/char.c b/chardev/char.c index f6d61fa..514cd6b 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -881,6 +881,9 @@ QemuOptsList qemu_chardev_opts = { .name = "tls-creds", .type = QEMU_OPT_STRING, },{ + .name = "tls-authz", + .type = QEMU_OPT_STRING, + },{ .name = "websocket", .type = QEMU_OPT_BOOL, },{ diff --git a/qapi/char.json b/qapi/char.json index 77ed847..a6e81ac 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -248,6 +248,11 @@ # @addr: socket address to listen on (server=true) # or connect to (server=false) # @tls-creds: the ID of the TLS credentials object (since 2.6) +# @tls-authz: the ID of the QAuthZ authorization object against which +# the client's x509 distinguished name will be validated. This +# object is only resolved at time of use, so can be deleted +# and recreated on the fly while the chardev server is active. +# If missing, it will default to denying access (since 4.0) # @server: create server socket (default: true) # @wait: wait for incoming connection on server # sockets (default: false). @@ -268,6 +273,7 @@ { 'struct': 'ChardevSocket', 'data': { 'addr': 'SocketAddressLegacy', '*tls-creds': 'str', + '*tls-authz' : 'str', '*server': 'bool', '*wait': 'bool', '*nodelay': 'bool', diff --git a/qemu-options.hx b/qemu-options.hx index c74f99b..7118d90 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2428,7 +2428,7 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n" "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n" " [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n" - " [,logfile=PATH][,logappend=on|off][,tls-creds=ID] (tcp)\n" + " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n" "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n" " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n" "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n" @@ -2557,7 +2557,7 @@ The available backends are: A void device. This device will not emit any data, and will drop any data it receives. The null backend does not take any options. -@item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,websocket][,reconnect=@var{seconds}][,tls-creds=@var{id}] +@item -chardev socket,id=@var{id}[,@var{TCP options} or @var{unix options}][,server][,nowait][,telnet][,websocket][,reconnect=@var{seconds}][,tls-creds=@var{id}][,tls-authz=@var{id}] Create a two-way stream socket, which can be either a TCP or a unix socket. A unix socket will be created if @option{path} is specified. Behaviour is @@ -2583,6 +2583,12 @@ and specifies the id of the TLS credentials to use for the handshake. The credentials must be previously created with the @option{-object tls-creds} argument. +@option{tls-auth} provides the ID of the QAuthZ authorization object against +which the client's x509 distinguished name will be validated. This object is +only resolved at time of use, so can be deleted and recreated on the fly +while the chardev server is active. If missing, it will default to denying +access. + TCP and unix socket options are given below: @table @option From patchwork Mon Mar 11 16:55:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1054639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fv1jLxBI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J4tK5Wysz9s3q for ; Tue, 12 Mar 2019 04:32:25 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Oml-0003RP-PG for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 13:32:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ODo-0007L8-Hj for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ODn-0003il-06 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:16 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:34534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ODm-0003fN-PG for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:56:14 -0400 Received: by mail-wm1-x334.google.com with SMTP id o10so207343wmc.1 for ; Mon, 11 Mar 2019 09:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3CmWFPZnG1ZgLBwTWU473mXqUjh1Pe/sYmEH74nDomA=; b=fv1jLxBI2jthSqpVOTvfGjg9J7uLWbm18dyYkiLy9yx9tk2ZWlnPOU1BJwGCLRmj/0 yQipyXMkUwkqm+lPlb3UsII8er8ZUqAlmEjMwX5x6GR4kfNGy9GaXRg3RBbq/OvbK32K jauaqU9JZiUsOiN6/WtpEYlJqy9rbFJ5CdsU3M/0fy4seyeFjP6N3jGQiuIT1KqXkB0w 8/l4WDM+Mb9sXHYEALodAkn+XBnK7Ab709W6t3WK02hPcooHIxd/oGzzKsz6e6QbnN3E Cu1TAYtvh35csmJ0P6XppnXF0gp8C8kgOgWrpLSrqhCfN6gOa3DU3EtCO4DfLcleRV9t X/+g== 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:mime-version:content-transfer-encoding; bh=3CmWFPZnG1ZgLBwTWU473mXqUjh1Pe/sYmEH74nDomA=; b=OfU/8SQ4uu47Ny852a0NKvPQQnvUkvT/4qYOsv/v9PxxJ+Ou/fBuT+1OjiKmi7UMmL b1QpsZAneMTXFqPOqsVSu8/+4/iu0hWXAt34kxYMOEfm+66Eg/Z0ZCNi6d2b7tLbIma9 O03KN9ZExfTK2eMRSZjf/I4N5p84p/nn7w9JrJLGJRo5FPoqokoWBN4UTAp04pOxWUKi v6Y8Ahtnla8PgFSDfOqKQmMdEJ1YgoaJQJTq2y60QdUUxrkGPup00ZYq6mAmzYW6m70T Yl0mCCW72TQEb1yiJFXWjbM9xYM+auLp/ARtxTfLWRi1KE/yPmtSq3BtdbzpugcQVvjG VIog== X-Gm-Message-State: APjAAAWmyT+4gzzFQpXW5GeEtcsmgBc9/QHnE4ZdzgZn6nt6OnKCN516 /1c8tSXh6G1daZUiq/QjLIKI+AGg X-Google-Smtp-Source: APXvYqwMNCO4GbLoakHk+7Hzc8XgzYJxBg0eKvpS3UqjCDnnjqnxaVhJp6f7tlRbhZ/twzyI/+scdw== X-Received: by 2002:a1c:64c1:: with SMTP id y184mr36193wmb.0.1552323371981; Mon, 11 Mar 2019 09:56:11 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id e12sm6484836wrs.91.2019.03.11.09.56.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 09:56:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 17:55:35 +0100 Message-Id: <1552323335-46779-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> References: <1552323335-46779-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 Subject: [Qemu-devel] [PULL v2 31/31] qemugdb: fix licensing 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" qemu-gdb.py was committed after 2012-01-13, so the notice about GPL v2-only contributions does not apply. Signed-off-by: Paolo Bonzini --- scripts/qemu-gdb.py | 7 ++----- scripts/qemugdb/coroutine.py | 7 ++----- scripts/qemugdb/mtree.py | 7 ++----- scripts/qemugdb/tcg.py | 7 ++----- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py index 690827e..f2a305c 100644 --- a/scripts/qemu-gdb.py +++ b/scripts/qemu-gdb.py @@ -7,11 +7,8 @@ # Authors: # Avi Kivity # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. -# -# Contributions after 2012-01-13 are licensed under the terms of the -# GNU GPL, version 2 or (at your option) any later version. +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. # Usage: # At the (gdb) prompt, type "source scripts/qemu-gdb.py". diff --git a/scripts/qemugdb/coroutine.py b/scripts/qemugdb/coroutine.py index 81f811a..41e079d 100644 --- a/scripts/qemugdb/coroutine.py +++ b/scripts/qemugdb/coroutine.py @@ -7,11 +7,8 @@ # Authors: # Avi Kivity # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. -# -# Contributions after 2012-01-13 are licensed under the terms of the -# GNU GPL, version 2 or (at your option) any later version. +# This work is licensed under the terms of the GNU GPL, version 2 +# or later. See the COPYING file in the top-level directory. import gdb diff --git a/scripts/qemugdb/mtree.py b/scripts/qemugdb/mtree.py index e6791b7..3030a60 100644 --- a/scripts/qemugdb/mtree.py +++ b/scripts/qemugdb/mtree.py @@ -7,11 +7,8 @@ # Authors: # Avi Kivity # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. -# -# Contributions after 2012-01-13 are licensed under the terms of the -# GNU GPL, version 2 or (at your option) any later version. +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. # 'qemu mtree' -- display the memory hierarchy diff --git a/scripts/qemugdb/tcg.py b/scripts/qemugdb/tcg.py index 8c7f1d7..18880fc 100644 --- a/scripts/qemugdb/tcg.py +++ b/scripts/qemugdb/tcg.py @@ -8,11 +8,8 @@ # Authors: # Alex Bennée # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. -# -# Contributions after 2012-01-13 are licensed under the terms of the -# GNU GPL, version 2 or (at your option) any later version. +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. # 'qemu tcg-lock-status' -- display the TCG lock status across threads