From patchwork Wed Feb 12 16:41:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=kLg9vX/c; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HlpV5fpnz9s29 for ; Thu, 13 Feb 2020 03:44:02 +1100 (AEDT) Received: from localhost ([::1]:40312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v7I-00082L-LW for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:44:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36561) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v4w-0003Av-Ui for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v4v-0001XS-Pv for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:34 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:45697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v4v-0001VW-Jn for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:33 -0500 Received: by mail-wr1-x430.google.com with SMTP id g3so3174969wrs.12 for ; Wed, 12 Feb 2020 08:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JT9C6l5cMam9Id8e97W1nQcd6eNpyd3ZDkBP7+S4YoY=; b=kLg9vX/ceW2zrRYHMBPJQ+F88tGJek7bOgDLHOVfBEfnyhiuhRJJJptq+NyUShj2mu TR4K54dYUOM5aqSSGmriAdosVdUlUMr9a4XZZTEl7PAciMUIk7EaaRx1NX6PnA4LShzg IBW7ETBzOQoZCMi1YSkP79u6znaUzIn8kpLGhstAKdK45J3r+TtH8TGiQYq/v2JjZ55k beUdsOZM8gUNG0VF034LMTgIuONKAkkcmwA2H7vFfv5obujXCGMVDe+0VmZBG8QSMFQ1 4XHWM+g74VMCxGh0tE4dbfJFpFPQaQL0l5JYCqA7ZCybxRMKI8dfDMr6lxhR75qA7jU7 ETnQ== 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=JT9C6l5cMam9Id8e97W1nQcd6eNpyd3ZDkBP7+S4YoY=; b=ZW2kp4xkBOM/7aFyHCes7T9MPtmqOv4/fgnuvZr3cLFhUoV6Jf9CE8KAadGcXa+q6D tPs0NwFD29lEkDqcxaMgIkugehATcWqOi22nhq/6xpYiVpoNV+SbhEPHL+/uKDFQko/J zPMCILeqtcIx/tmaG+D6gSCtjWKXg7RNxCUzs6SWcOxAodT2sTlY/8IBWYWWA/35dK5P SAuBvCt6hB/g9Bs2TakG+Vn8RfCGvmLs2NcG+MUD+kIZpcjqH9Qzc21yi7N4hSuqRII1 uF6CFvcdCyHd+pH3GzP6ugqXXcIBF/M2V754sTRpnKGgog+n2SElF/ShuxlM4tus8DXG F7IA== X-Gm-Message-State: APjAAAWxLmcqxibfldWBBZhUU2wdVzujXaIgtoHdAuFnCR1M5xKA1h2c sFf4Xi2UE5bYVZerVv3DgLdTN0em X-Google-Smtp-Source: APXvYqxyyAik/Ns4GkKTfUdfqSItmebsY6yELfJdH6bnYaGSr97vGniXdBcoHI75bE1Y48oFNM2hkA== X-Received: by 2002:a5d:5188:: with SMTP id k8mr1161196wrv.151.1581525692348; Wed, 12 Feb 2020 08:41:32 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 1/9] vl: Don't mismatch g_strsplit()/g_free() Date: Wed, 12 Feb 2020 17:41:21 +0100 Message-Id: <20200212164129.6968-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::430 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pan Nengyuan , Euler Robot Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pan Nengyuan It's a mismatch between g_strsplit and g_free, it will cause a memory leak as follow: [root@localhost]# ./aarch64-softmmu/qemu-system-aarch64 -accel help Accelerators supported in QEMU binary: tcg kvm ================================================================= ==1207900==ERROR: LeakSanitizer: detected memory leaks Direct leak of 8 byte(s) in 2 object(s) allocated from: #0 0xfffd700231cb in __interceptor_malloc (/lib64/libasan.so.4+0xd31cb) #1 0xfffd6ec57163 in g_malloc (/lib64/libglib-2.0.so.0+0x57163) #2 0xfffd6ec724d7 in g_strndup (/lib64/libglib-2.0.so.0+0x724d7) #3 0xfffd6ec73d3f in g_strsplit (/lib64/libglib-2.0.so.0+0x73d3f) #4 0xaaab66be5077 in main /mnt/sdc/qemu-master/qemu-4.2.0-rc0/vl.c:3517 #5 0xfffd6e140b9f in __libc_start_main (/lib64/libc.so.6+0x20b9f) #6 0xaaab66bf0f53 (./build/aarch64-softmmu/qemu-system-aarch64+0x8a0f53) Direct leak of 2 byte(s) in 2 object(s) allocated from: #0 0xfffd700231cb in __interceptor_malloc (/lib64/libasan.so.4+0xd31cb) #1 0xfffd6ec57163 in g_malloc (/lib64/libglib-2.0.so.0+0x57163) #2 0xfffd6ec7243b in g_strdup (/lib64/libglib-2.0.so.0+0x7243b) #3 0xfffd6ec73e6f in g_strsplit (/lib64/libglib-2.0.so.0+0x73e6f) #4 0xaaab66be5077 in main /mnt/sdc/qemu-master/qemu-4.2.0-rc0/vl.c:3517 #5 0xfffd6e140b9f in __libc_start_main (/lib64/libc.so.6+0x20b9f) #6 0xaaab66bf0f53 (./build/aarch64-softmmu/qemu-system-aarch64+0x8a0f53) Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Message-Id: <20200110091710.53424-2-pannengyuan@huawei.com> Signed-off-by: Paolo Bonzini --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 7dcb0879c4..c5beda7d48 100644 --- a/vl.c +++ b/vl.c @@ -3501,7 +3501,7 @@ int main(int argc, char **argv, char **envp) gchar **optname = g_strsplit(typename, ACCEL_CLASS_SUFFIX, 0); printf("%s\n", optname[0]); - g_free(optname); + g_strfreev(optname); } g_free(typename); } From patchwork Wed Feb 12 16:41:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=jSZ4NELS; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HlmD47V5z9s29 for ; Thu, 13 Feb 2020 03:42:04 +1100 (AEDT) Received: from localhost ([::1]:40274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v5O-0003IH-Ef for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:42:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36575) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v4x-0003Bv-RT for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v4w-0001aD-PK for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:35 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:44969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v4w-0001Y0-Ii for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:34 -0500 Received: by mail-wr1-x429.google.com with SMTP id m16so3169620wrx.11 for ; Wed, 12 Feb 2020 08:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l/AgXBV6DaQrKl5QgbkJnKxXBovTmb0GOhwB0Jdunvg=; b=jSZ4NELS3N5ZQHNUZStq1QI/1oxM94YeVO3gRLCkC67cqSUldMrrgybtFgQMaAQwAH YVyqCfAxTqFrV4kGm8CbhfohgMG/obUxBh0DiNBRtMlIYVyIB27QBWhe8DOgE6Z+uIEY wBfqFm2AVWKlsMhdibPh7FhZvfe51mp3usfIT6JBG3TN9GEvGlxRX5XTZjRhpvotrjAK 2i4knTHDMiMobvXJ0FzSIOvtt5Xy90SCufBi6qLKXLXlA16GSnBQ7YyAew8wssXJZBsV dTbfufe8BPvdYmt0kKD2xBzW9uVFz9GDgnu78B5KvLWOd/Vjpkphvt5YhhVMyVgxGToz SpNQ== 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=l/AgXBV6DaQrKl5QgbkJnKxXBovTmb0GOhwB0Jdunvg=; b=j89lnLqUcFfUvP8Xm1ghgae3ZYQ6bn/hBDXtIlT4EtFdICPbhvjbOcDV80L97EvwBS F0CU9cvNsoGGeb4CH4eKSbgVbetS+SG31OLffy/zFELC6UOorqdhTIyweGiqGgleS5NO 4W255776mapkPvo7ZyH6A6tZFG6WI/Pl4ckSmmVM+ZobEzgh7lt8FPTWT+TvJLf3z7/G CziNwC6JjaYaSRRurMAHXzo4PY9Ciz6pL7GlLz8LITTHZbRqC9utXdNdwEY2RA8ZAnj7 bFDiPRV5ctml8K2hEIrXeV/dgxMTRGvO78Efmr9+bCWbu0cq9JgVDwen7L+4IazOORrk Mm7g== X-Gm-Message-State: APjAAAXRCYRpEcCacC442TpDYAwyqumjsvKNnsNPEnEAJuix0/GBP3H5 68NQg5xWf6GLfjIu8tujkHTpCK4u X-Google-Smtp-Source: APXvYqzBu7Z+ywm1OvreW9HDbBFrfeBKev83gXRZumjYLb5gC6JszamV4ybcZk8MLia+9IsATDSZKA== X-Received: by 2002:adf:ec83:: with SMTP id z3mr15538203wrn.133.1581525693355; Wed, 12 Feb 2020 08:41:33 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 2/9] seqlock: fix seqlock_write_unlock_impl function Date: Wed, 12 Feb 2020 17:41:22 +0100 Message-Id: <20200212164129.6968-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::429 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Luc Michel Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Luc Michel The seqlock write unlock function was incorrectly calling seqlock_write_begin() instead of seqlock_write_end(), and was releasing the lock before incrementing the sequence. This could lead to a race condition and a corrupted sequence number becoming odd even though the lock is not held. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200129144948.2161551-1-luc.michel@greensocs.com> Fixes: 988fcafc73 ("seqlock: add QemuLockable support", 2018-08-23) Signed-off-by: Paolo Bonzini --- include/qemu/seqlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h index fd408b7ec5..8b6b4ee4bb 100644 --- a/include/qemu/seqlock.h +++ b/include/qemu/seqlock.h @@ -55,11 +55,11 @@ static inline void seqlock_write_lock_impl(QemuSeqLock *sl, QemuLockable *lock) #define seqlock_write_lock(sl, lock) \ seqlock_write_lock_impl(sl, QEMU_MAKE_LOCKABLE(lock)) -/* Lock out other writers and update the count. */ +/* Update the count and release the lock. */ static inline void seqlock_write_unlock_impl(QemuSeqLock *sl, QemuLockable *lock) { + seqlock_write_end(sl); qemu_lockable_unlock(lock); - seqlock_write_begin(sl); } #define seqlock_write_unlock(sl, lock) \ seqlock_write_unlock_impl(sl, QEMU_MAKE_LOCKABLE(lock)) From patchwork Wed Feb 12 16:41:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=hCL+tnsL; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HlmC1Jqcz9s29 for ; Thu, 13 Feb 2020 03:42:03 +1100 (AEDT) Received: from localhost ([::1]:40272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v5N-0003GA-2C for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:42:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36589) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v4z-0003DZ-J2 for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v4y-0001cv-Hh for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:37 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:34583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v4y-0001bp-Bz for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:36 -0500 Received: by mail-wr1-x42a.google.com with SMTP id n10so1246279wrm.1 for ; Wed, 12 Feb 2020 08:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CWJvAvx0dchzpGCPANbmzUz7ah1bBr5dRqjSpIoNg1Q=; b=hCL+tnsLmT+AXe6cFASvJyq49VQuOT+HhdcGF/IDzpSys96fGMg9cwwXd+meWrHIWn UGomxzzRyJInJEVQUcgIhDFBr3naI/BnMrlXL9nfkYUGe7fqrb/GWQvfESoDZNr442/d gLnrXOrz6Cj+ihdiTYlf57XfYg09U9Ux/qEdpjGD78g+H4TWDgp1LpaHleNBD4y5LMZY D/k4Qf9P0C6m+LlT7PY7kyZjuYa5GFiEi8IJ6kGEFgO2znhoVMGlYEgB8+7GJWMAqmse G9RZtvMrYY+lB27owQ2ON8cYfe3Bog3t7CjAL+2MLWUUYZGz65ZfsN5qlk5Jm5mK4wrS Y6lw== 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=CWJvAvx0dchzpGCPANbmzUz7ah1bBr5dRqjSpIoNg1Q=; b=RDYL6XSpH79HcLR8Mw4027APcz1A3dx+ns5yF6peBykj5HS4idLApLzPfsbVoji1XW LEgW1r+g0uKskF7ONvigPGEAr8clHklDSN2t7Wc5lNxbEglWLkrl5zqK4JqUt0OF7FLS lHd+UqVSMVtwZkar1R7VX/J2NZojOgvMeGJLuEjl7LD47/DV/4iztNkxqMWJPtC9figM m4QY+ZAJCU4zLKCnDwLQ/bvAlLxeFftEFX/ILSLQlRCNOKh24OBG0cjFVDjJVT0EXM9C bfqa4/xUvhEXie+fB51Cz2hn9sF/mRjfyojrf+yjCRSW6kxpR9YTN8T+8JxFLP/waAwV YE+Q== X-Gm-Message-State: APjAAAV0ufCm5B39gSa5NY9f9WEvN3/u5zoW/rxJGdPqO8aA83RG/ahb AQ66L7BCeGdvvJ/Knn/GhdCuyD4S X-Google-Smtp-Source: APXvYqylJOEOG4noTE7X1DesW0JAviLRllHXiugDWYnLVCvxPvjnXZLCgbXeksCEcjz0wtyicls5bQ== X-Received: by 2002:adf:f302:: with SMTP id i2mr16087362wro.21.1581525695112; Wed, 12 Feb 2020 08:41:35 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 3/9] Remove support for CLOCK_MONOTONIC not being defined Date: Wed, 12 Feb 2020 17:41:23 +0100 Message-Id: <20200212164129.6968-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::42a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Some older parts of QEMU's codebase assume that CLOCK_MONOTONIC might not be defined by the host OS, and have workarounds to deal with this. However, more recently (notably in commit 50290c002c045280f8d for qemu-img in mid-2019, but also much earlier in 2011 in commit 22795174a37e0 for ui/spice-display.c) we've written code that assumes CLOCK_MONOTONIC is always defined. The only host OS anybody's ever noticed this on is OSX 10.11 and earlier, which we don't support. So we can assume that all our host OSes have the #define, and we can remove some now-unnecessary ifdefs. Signed-off-by: Peter Maydell Message-Id: <20200201172252.6605-1-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini --- include/qemu/timer.h | 5 +---- util/qemu-timer-common.c | 11 ++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 85bc6eb00b..6a8b48b5a9 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -838,14 +838,11 @@ extern int use_rt_clock; static inline int64_t get_clock(void) { -#ifdef CLOCK_MONOTONIC if (use_rt_clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return ts.tv_sec * 1000000000LL + ts.tv_nsec; - } else -#endif - { + } else { /* XXX: using gettimeofday leads to problems if the date changes, so it should be avoided. */ return get_clock_realtime(); diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c index 06d084d364..baf3317f74 100644 --- a/util/qemu-timer-common.c +++ b/util/qemu-timer-common.c @@ -49,14 +49,11 @@ int use_rt_clock; static void __attribute__((constructor)) init_get_clock(void) { + struct timespec ts; + use_rt_clock = 0; -#ifdef CLOCK_MONOTONIC - { - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { - use_rt_clock = 1; - } + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { + use_rt_clock = 1; } -#endif } #endif From patchwork Wed Feb 12 16:41:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=Q6+kKDxB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Hlnq5Wy2z9s29 for ; Thu, 13 Feb 2020 03:43:27 +1100 (AEDT) Received: from localhost ([::1]:40304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v6h-0006pt-U5 for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:43:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36600) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v51-0003Fo-6v for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v50-0001gY-9M for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:39 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v50-0001fm-3R for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id c9so3191290wrw.8 for ; Wed, 12 Feb 2020 08:41:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sk9WshqGTq9cCur9E6esTWtP0xlnXywDapbkjl0RGOM=; b=Q6+kKDxBlMkENLKz28HVgnBJtW8Q5wB+Dbgs7tPkrz2SUaWnBKVs5g8472EBH6pkC/ enGWcIAps1DJiDcZqkJoxRr5MvVkz6qzlZ8p9ISVs5Hkj9Fvg5pCn3Rv+nUomdYkpn7m jszlHhOc19DOpOYy3rHxtqAYWd8i7vi6Mk+fXOleynGWcJN859phidjtLYQGA83mPwyo itN0SXRq+QL8nUT5ufbHf9+S8RKGbdkFYM6CqqRtBuZcjEYaRQbVu87iOWF3KKlgSJ5t qjqVFju71PV7TT58YL6um4VPaQlN+SjxqBb0YNBFAoCqrkrshX2EQKoF2YwJAsmqnlOX 625w== 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=Sk9WshqGTq9cCur9E6esTWtP0xlnXywDapbkjl0RGOM=; b=TB5wgJAbgCCmJicKzlHXiTyOmhSppbnYHsXT1FfNtTGcmBfCpboFkw6j7Cab+mfAPL Lzxx1R1YUEYB4J8RC2+4aW5A5USq0s0JqjhxiHtAvs2hbUhPDudG4Lp7ZFeNMBlo+3gG pNQYNKEHFzo1MdPW4iIRkoW7ojlnxuklhqk2omdhPomQUC/j7Frvv7t5PrPbVPE54t8j 7p3ZYILwcFY3acI1FYED0dthZTadsnV25JcWgz+/vI4Gd+DOb7UOb0y8NG0UX8gy5Dno 5zm4CHNLC1MZ7U5cJ3XDAfKzGd/Cm1B3XsJO+Q2tLQgCVd03DUmfKwhhWPtTl4p08xfy fxkg== X-Gm-Message-State: APjAAAXRlx1we93SRoXp///iBOTYyJdmu22bHMCrygoJV7TTTDkftlne yBl1MjPTfROtA0PcXo+N7zKAvQd3 X-Google-Smtp-Source: APXvYqzMW9M8hAiYtzselwEvAJXNDK/EGBCOfZGvTJmRnyb2RU7e1mR95B315E7gVOZwsiXtqbZlTg== X-Received: by 2002:a5d:4709:: with SMTP id y9mr16103264wrq.412.1581525696743; Wed, 12 Feb 2020 08:41:36 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 4/9] minikconf: accept alnum identifiers Date: Wed, 12 Feb 2020 17:41:24 +0100 Message-Id: <20200212164129.6968-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::435 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- scripts/minikconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/minikconf.py b/scripts/minikconf.py index 40ae1989e1..febd9a479f 100644 --- a/scripts/minikconf.py +++ b/scripts/minikconf.py @@ -645,7 +645,7 @@ class KconfigParser: self.cursor = self.src.find('\n', self.cursor) self.val = self.src[start:self.cursor] return TOK_SOURCE - elif self.tok.isalpha(): + elif self.tok.isalnum(): # identifier while self.src[self.cursor].isalnum() or self.src[self.cursor] == '_': self.cursor += 1 From patchwork Wed Feb 12 16:41:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=d7lj4n+g; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HlmH4yrqz9sPJ for ; Thu, 13 Feb 2020 03:42:07 +1100 (AEDT) Received: from localhost ([::1]:40276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v5R-0003R7-Gb for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:42:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36612) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v53-0003Jb-05 for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v51-0001ie-WE for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:40 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:36349) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v51-0001i9-QH for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:39 -0500 Received: by mail-wm1-x335.google.com with SMTP id p17so3298332wma.1 for ; Wed, 12 Feb 2020 08:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oo23LZ+bVDGb+bI6Wuhk5pe6slIqDak+OkHafTFG1M8=; b=d7lj4n+gGvjSeLgmK0OhVz0NM90F/ZZqU2NfatMzFSfMg2FdpqcJW/t/bJxywR6LRu DsbEF6qg6j8xQhoi8uzr+peOcrlRLJDx8caLvvKdVqipVLWzHq7+NnpEqje0rRoXl0ta n3xugMBSBHdbC8tEuN3vrx5/mbyEBMZJXY9sdN4nXf18tzbCh2e+RarQgUyHETGSfHcU mdhWNpH7Lzq+n2YH3RbwgiYGVs5+RgaAWCDre/PnnVOy+vKmwZrZNWOoQOtYRJYS8GRF rX6z6E/rfX2QiAuphgA/WJFO4qkcfv3p+293pmZ9p7c/U8CBebODG/TXxr5rPctZq771 WAng== 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=Oo23LZ+bVDGb+bI6Wuhk5pe6slIqDak+OkHafTFG1M8=; b=qXhSdZDk1/RDgtuSqoQyFNgXiwpHbOW4Z4cFtiPAsnRlk86XaE5HDt2cohXnWf72Zp 4mBAxpdV+PgIEciL/7mm5GQZ4QOsoBVFz4sljC653w2zEIlaUVImNnOcUFD8z515NsFB K7KPqmAuQD7MLMoi/dSzcrs3zHil0e7gYKoYGrsrboY9ctfYe3XxCU4vjh8ak4b7ICa1 AtYIXaPB7Pp06Rv/btbRuKBVltnBe0jACAlOWiaiGEnalXVGao2SeFLKGnZyFOazD5wP YVhf75qx+NcRoFCu5AE+zYkVmk+ToFktAV6proTHBe/bNsBb6oNFx5+BlJoylvk/YSw2 JakQ== X-Gm-Message-State: APjAAAWVzkUJwHTCPNv/yZPdNQs56uKdWhiClsmOhZZBeaI0ec6Z1mZi keFlx5Sm+BOsheEQ/4IZXgnx5rHk X-Google-Smtp-Source: APXvYqyYRPihTdET1TDMyHzIpvQHHZAjXmCNuf4dgq93R4RQuwG+DbeMzt8e0ijVbEB37AdsQXcRxw== X-Received: by 2002:a05:600c:21c5:: with SMTP id x5mr13987288wmj.72.1581525698598; Wed, 12 Feb 2020 08:41:38 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 5/9] exec: do not define use_icount for user-mode emulation Date: Wed, 12 Feb 2020 17:41:25 +0100 Message-Id: <20200212164129.6968-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" use_icount is also defined by stubs/cpu-get-icount.c, we do not need to have a useless definition in exec.c. Signed-off-by: Paolo Bonzini Message-id: <20200204161036.20889-1-pbonzini@redhat.com> Reviewed-by: Alex Bennée --- exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index 67e520d18e..5fc3746053 100644 --- a/exec.c +++ b/exec.c @@ -98,15 +98,15 @@ CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus); /* current CPU in the current thread. It is only valid inside cpu_exec() */ __thread CPUState *current_cpu; -/* 0 = Do not count executed instructions. - 1 = Precise instruction counting. - 2 = Adaptive rate instruction counting. */ -int use_icount; uintptr_t qemu_host_page_size; intptr_t qemu_host_page_mask; #if !defined(CONFIG_USER_ONLY) +/* 0 = Do not count executed instructions. + 1 = Precise instruction counting. + 2 = Adaptive rate instruction counting. */ +int use_icount; typedef struct PhysPageEntry PhysPageEntry; From patchwork Wed Feb 12 16:41:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=ailBCaG4; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Hlp36Kfnz9sPJ for ; Thu, 13 Feb 2020 03:43:39 +1100 (AEDT) Received: from localhost ([::1]:40308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v6v-00070T-PF for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:43:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36624) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v55-0003PZ-81 for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v54-0001lW-2n for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:43 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v53-0001kI-Sx for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:42 -0500 Received: by mail-wr1-x433.google.com with SMTP id g3so3175561wrs.12 for ; Wed, 12 Feb 2020 08:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yp9J3Sdvti8kkDmOijc4vUS6SBVhz37pfagJZGeOW6o=; b=ailBCaG4TCTkPA5mxR1PSHwKqickulvu+C/zHMVk7yRJ10By3WN/ZPNeVwiy42t4zt CwKHzqbl/Ql1IdNfk5jEhz58gtkKBZNE1vi96lwjMaAmCAm9KSyvLhSLdmDDrO4R7/13 lngQ3NVhFAw1O1YzspDsEZ1olsx4D704nAOzTgt9SwRrkFmo2x8j02J80rBprV3ceQKw FgSo3PXdc3JnU6sMKUtu2P7sT4Yl5o1kBl1bQIjlJcpa/dFk/M+/gnSHh6Ty733dDRze qYJ5WOKcfbhwmUFKu/7YxNmMtbP3kTrZ0l/+FXDPZ4XhHrNCo8GSmckbYt2Hsv/kEcMI 73bA== 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=Yp9J3Sdvti8kkDmOijc4vUS6SBVhz37pfagJZGeOW6o=; b=JuqL3oXLFGrR8E6UqKy5rXqTd89FWVhoAuQHsKf7N6LaKb1H7C4funWhDQ7a2Xqn5r hEkI7z4PSWBSdjIEb0ae+0vNy+oVCwf4MznlGedKL/W7bGRoPhGhUPpbYHPwOfwWG9ry FJ5ILqEYHSA8Mb0GYru7LFRaZS/ik7bSZnpkNykwu6VpVtddVaShPrLj7/GsefmDilhP zEpgQkrPGqYjKKA6+V9wL/3Ik9eYAG8bJiqpdSp/QS8d/r8uZpXrc8JzP0K0y51VBul/ lreizseFiPVRP+NNG32CRNXKxXEQfK9GWkPiQZoWY9v4RsLCOJdw3Z5SLJYrDRo16AfX Bjkw== X-Gm-Message-State: APjAAAVcJI7WTqd/Q2zcnvyk9RYOMkrc9JKXLnB2w/Capqj0O0z07eMV JPtUCs4fcmgiCO4OsLzcHdzbC0mI X-Google-Smtp-Source: APXvYqynxyW7pu+cCTXgugSscnx59Lb6tH7dPxrYdnmSqQ4o8AdS891gbaekg4qGW2tYY3exztNgCQ== X-Received: by 2002:adf:f80c:: with SMTP id s12mr16090640wrp.1.1581525700560; Wed, 12 Feb 2020 08:41:40 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 6/9] build: move TARGET_GPROF to config-host.mak Date: Wed, 12 Feb 2020 17:41:26 +0100 Message-Id: <20200212164129.6968-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::433 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" TARGET_GPROF is the same for all targets, write it to config-host.mak instead. Reviewed-by: Alex Bennée Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-id: <20200204161104.21077-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- bsd-user/syscall.c | 6 +++--- configure | 4 +++- linux-user/exit.c | 4 ++-- linux-user/signal.c | 2 +- tests/check-block.sh | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 0d45b654bb..d38ec7a162 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -330,7 +330,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, switch(num) { case TARGET_FREEBSD_NR_exit: -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF _mcleanup(); #endif gdb_exit(cpu_env, arg1); @@ -432,7 +432,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, switch(num) { case TARGET_NETBSD_NR_exit: -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF _mcleanup(); #endif gdb_exit(cpu_env, arg1); @@ -511,7 +511,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, switch(num) { case TARGET_OPENBSD_NR_exit: -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF _mcleanup(); #endif gdb_exit(cpu_env, arg1); diff --git a/configure b/configure index 115dc38085..16f94cd96b 100755 --- a/configure +++ b/configure @@ -6771,6 +6771,9 @@ fi if test "$l2tpv3" = "yes" ; then echo "CONFIG_L2TPV3=y" >> $config_host_mak fi +if test "$gprof" = "yes" ; then + echo "CONFIG_GPROF=y" >> $config_host_mak +fi if test "$cap_ng" = "yes" ; then echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak fi @@ -7951,7 +7954,6 @@ alpha) esac if test "$gprof" = "yes" ; then - echo "TARGET_GPROF=y" >> $config_target_mak if test "$target_linux_user" = "yes" ; then cflags="-p $cflags" ldflags="-p $ldflags" diff --git a/linux-user/exit.c b/linux-user/exit.c index a362ef67d2..1594015444 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -18,7 +18,7 @@ */ #include "qemu/osdep.h" #include "qemu.h" -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF #include #endif @@ -28,7 +28,7 @@ extern void __gcov_dump(void); void preexit_cleanup(CPUArchState *env, int code) { -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF _mcleanup(); #endif #ifdef CONFIG_GCOV diff --git a/linux-user/signal.c b/linux-user/signal.c index 5ca6d62b15..02f860ecb9 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -509,7 +509,7 @@ void signal_init(void) act.sa_flags = SA_SIGINFO; act.sa_sigaction = host_signal_handler; for(i = 1; i <= TARGET_NSIG; i++) { -#ifdef TARGET_GPROF +#ifdef CONFIG_GPROF if (i == SIGPROF) { continue; } diff --git a/tests/check-block.sh b/tests/check-block.sh index 679aedec50..ad320c21ba 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -16,7 +16,7 @@ if [ "$#" -ne 0 ]; then format_list="$@" fi -if grep -q "TARGET_GPROF=y" *-softmmu/config-target.mak 2>/dev/null ; then +if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then echo "GPROF is enabled ==> Not running the qemu-iotests." exit 0 fi From patchwork Wed Feb 12 16:41:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=rDUwGT8f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Hlnm13t1z9s29 for ; Thu, 13 Feb 2020 03:43:24 +1100 (AEDT) Received: from localhost ([::1]:40302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v6f-0006lQ-VD for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:43:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36635) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v57-0003Wv-F2 for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v56-0001np-Dk for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:45 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:36341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v56-0001nA-7W for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:44 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p17so3298652wma.1 for ; Wed, 12 Feb 2020 08:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=km9KJtTEdqE+REKT3Wda2LEqxI4SZkYCzOPSCu2gScg=; b=rDUwGT8f8rgrm6XX38PBo5572jgZvebxLekk3lKpX9mrdw1cAQaGjm+p5NyxLzY1ku T+RET/yaVlu2Uz59Yzs9n977ZfSkpg8ww/cxTSDjuwFzNsChrqiG9WSMz/0LaEx/8quw 1jGzdmR+OyVOwJNt7nZ6IliowpEGmZz+Z2qAPA7aaTrTnVbF98LDs2FPpOhS7a7WcGH4 iAZ7wQmyqOgsXCJX1N8XtsH7VS8UIuGi0yzaVY63njOt2RAw1b8E1t/dRRWwaF+Js8bG sO2Z4F5uqFjF/d0gzfncIu5ZGJI0vM6dAl0FJr1Q7uNbpPae3ReEiRMrbApmflqeiiZV MXjg== 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=km9KJtTEdqE+REKT3Wda2LEqxI4SZkYCzOPSCu2gScg=; b=iN20zXdvxHMZtvnhFe8A7oayqEKJ6/jGmjaaMIACSbSBrNQm4VkqydGuYFu/ro3rah 7K8SoGLTL/GWX5DmcXq8xSicbrV/gRPXG9rre+7YXyntrU5SzcRTrgnLmZ/YJ/dUJnLZ NSbize8xkOBDI6oCiALtKYTI/RVv+AbeKBUNI+M3FNeDMG1kub75YMtVf7PNwv28kQgZ j+6qzUY1xGosWEOFE9U/InFBNe4tZcVQbq2rxGBaq8HB/PMyPrssojxmpc2Kq47/IXcV 7Q3wmnXIo7trdWmesltJWtsgXmZYaAY+7XopIGNXNdKrYGukNKnwWBsfYvD8Tlwo3b/Q CGFg== X-Gm-Message-State: APjAAAW4izybUIPU2I1JWn/sofAwq6Ii6HrJUaroFp5X/F8hYxA+9B9N JVe1Wgxm/a+F2/1d4POse/fM+GOI X-Google-Smtp-Source: APXvYqxQwTW4aCkBGV3itmTgHXaBdqc2aEKrNRR29zsryCOSlw4fvNvyhyUjN1pYjOSU5RAMihj67Q== X-Received: by 2002:a7b:c088:: with SMTP id r8mr13752212wmh.18.1581525702376; Wed, 12 Feb 2020 08:41:42 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 7/9] target/i386: fix TCG UCODE_REV access Date: Wed, 12 Feb 2020 17:41:27 +0100 Message-Id: <20200212164129.6968-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" This was a very interesting semantic conflict that caused git to move the MSR_IA32_UCODE_REV read to helper_wrmsr. Not a big deal, but still should be fixed... Fixes: 4e45aff398 ("target/i386: add a ucode-rev property", 2020-01-24) Message-id: <20200206171022.9289-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/misc_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c index aed16fe3f0..7d61221024 100644 --- a/target/i386/misc_helper.c +++ b/target/i386/misc_helper.c @@ -229,7 +229,6 @@ void helper_rdmsr(CPUX86State *env) #else void helper_wrmsr(CPUX86State *env) { - X86CPU *x86_cpu = env_archcpu(env); uint64_t val; cpu_svm_check_intercept_param(env, SVM_EXIT_MSR, 1, GETPC()); @@ -372,9 +371,6 @@ void helper_wrmsr(CPUX86State *env) env->msr_bndcfgs = val; cpu_sync_bndcs_hflags(env); break; - case MSR_IA32_UCODE_REV: - val = x86_cpu->ucode_rev; - break; default: if ((uint32_t)env->regs[R_ECX] >= MSR_MC0_CTL && (uint32_t)env->regs[R_ECX] < MSR_MC0_CTL + @@ -393,6 +389,7 @@ void helper_wrmsr(CPUX86State *env) void helper_rdmsr(CPUX86State *env) { + X86CPU *x86_cpu = env_archcpu(env); uint64_t val; cpu_svm_check_intercept_param(env, SVM_EXIT_MSR, 0, GETPC()); @@ -526,6 +523,9 @@ void helper_rdmsr(CPUX86State *env) case MSR_IA32_BNDCFGS: val = env->msr_bndcfgs; break; + case MSR_IA32_UCODE_REV: + val = x86_cpu->ucode_rev; + break; default: if ((uint32_t)env->regs[R_ECX] >= MSR_MC0_CTL && (uint32_t)env->regs[R_ECX] < MSR_MC0_CTL + From patchwork Wed Feb 12 16:41:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=do9JqFBK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HlrH0Fc4z9sPJ for ; Thu, 13 Feb 2020 03:45:35 +1100 (AEDT) Received: from localhost ([::1]:40340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v8m-0002kx-TB for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:45:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36646) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v58-0003a2-Hv for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v57-0001oi-Gq for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:46 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v57-0001o0-Ae for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:45 -0500 Received: by mail-wm1-x342.google.com with SMTP id b17so3322428wmb.0 for ; Wed, 12 Feb 2020 08:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3v35o9BfB+j3gudZ3LlZULM6oRAe5V+pWxwM58xyau8=; b=do9JqFBKX7zxOu4Ay6ioYUzyMUasZBY2ARIEs6apLWqTEK4rGLD08trPW5zj66w7wy 9oq3Zd3ad11cRYYK20b93zSRUZfrAjoQwH9PVfeliaNgCqxr8PZ+o6ufnl9VyAh6KeHp JNbq6+IygjrrXwc58ggj3OI2Uft8KUwuhej4IhYGrgEnbP0xcZdmYy9ytUSWj3lI2D83 sW1+9XnqntmBTwAxUw110MO35spBa541BHVuD1UstMhk97grTwvZvpnvSh7ErxWLx3qd i6AwpwZovsyrrtfqgKUxDBONKmSTvq1/IjIx/4Wukt/tq6NdPeERulEKQZgx2ZuKKvL/ 1TVA== 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=3v35o9BfB+j3gudZ3LlZULM6oRAe5V+pWxwM58xyau8=; b=LZ7JMRRiVppblL9EXcYicU1BJbweLJMqxc18nhIqtgGVr28kAP/3dy4YHYNBnR45iT wYhI7Cn3g27FbrlrIKq1aAaoXWoxCurdSFE31IdxhP6V89/FCeIpecKET5KnKkOAwYQm 40kGOjtawehU4JEtovv+RuaFwm0QJMt/HLv8PgMcoEUI0beKglroSd9hQRpMOSMX4oyy PtKoAvmnSJvxJOuLEhhgovnW4SflKI+Vu1dJGONPNrsxKKanOnCbTjCY8+QFZAe5sP9Y UcQZiulgzPUNfi21riVOzR8oXjc325cnGUhr/NVr9/YLt8PMSWGulzMRnyQAQ9HSjPGJ CEMA== X-Gm-Message-State: APjAAAU4pAqKqp0P5Sv1RFhzyk0C8FQzxaPWCMRymd4tqsXZTW4cwDeZ Ba35y5oQHgqWcVlRKqGGEq/QvUdG X-Google-Smtp-Source: APXvYqzANyiP4a6CSLDOVSplqGpyTQ3S2zWyc5Ezx48yQZutiGgXWA6f8Zf+9IsPdQUT3R7QFbBPAw== X-Received: by 2002:a05:600c:2207:: with SMTP id z7mr13098782wml.167.1581525704105; Wed, 12 Feb 2020 08:41:44 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 8/9] target/i386: check for availability of MSR_IA32_UCODE_REV as an emulated MSR Date: Wed, 12 Feb 2020 17:41:28 +0100 Message-Id: <20200212164129.6968-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Even though MSR_IA32_UCODE_REV has been available long before Linux 5.6, which added it to the emulated MSR list, a bug caused the microcode version to revert to 0x100000000 on INIT. As a result, processors other than the bootstrap processor would not see the host microcode revision; some Windows version complain loudly about this and crash with a fairly explicit MICROCODE REVISION MISMATCH error. [If running 5.6 prereleases, the kernel fix "KVM: x86: do not reset microcode version on INIT or RESET" should also be applied.] Reported-by: Alex Williamson Message-id: <20200211175516.10716-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 6ef291d580..69eb43d796 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -105,6 +105,7 @@ static bool has_msr_smi_count; static bool has_msr_arch_capabs; static bool has_msr_core_capabs; static bool has_msr_vmx_vmfunc; +static bool has_msr_ucode_rev; static uint32_t has_architectural_pmu_version; static uint32_t num_architectural_pmu_gp_counters; @@ -2056,6 +2057,9 @@ static int kvm_get_supported_msrs(KVMState *s) case MSR_IA32_VMX_VMFUNC: has_msr_vmx_vmfunc = true; break; + case MSR_IA32_UCODE_REV: + has_msr_ucode_rev = true; + break; } } } @@ -2696,8 +2700,7 @@ static void kvm_init_msrs(X86CPU *cpu) env->features[FEAT_CORE_CAPABILITY]); } - if (kvm_arch_get_supported_msr_feature(kvm_state, - MSR_IA32_UCODE_REV)) { + if (has_msr_ucode_rev) { kvm_msr_entry_add(cpu, MSR_IA32_UCODE_REV, cpu->ucode_rev); } From patchwork Wed Feb 12 16:41:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1236954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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.a=rsa-sha256 header.s=20161025 header.b=n7G66yIi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Hlqm6rRNz9sPJ for ; Thu, 13 Feb 2020 03:45:08 +1100 (AEDT) Received: from localhost ([::1]:40328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v8M-0001pi-PM for incoming@patchwork.ozlabs.org; Wed, 12 Feb 2020 11:45:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36658) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1v59-0003da-Un for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1v58-0001qW-UB for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:47 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:53114) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1v58-0001pF-Ns for qemu-devel@nongnu.org; Wed, 12 Feb 2020 11:41:46 -0500 Received: by mail-wm1-x332.google.com with SMTP id p9so3072798wmc.2 for ; Wed, 12 Feb 2020 08:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mz00RFFNAoguGGP8hvX8GCqEJMfOE+04kRLpScSRYxs=; b=n7G66yIiq9YaVlpdnBNyz8h5bouoUuZR6ObFfkibce0HmlDRxUuGvfPsoisOwooJPe mA9VlrN7Af/5HDezr2i+1AQ0RfHzmnTLBQ34vwnpCatPlOHFIJXV5NUu88AJZbB8Ivla sVAIChfAyzBEQlM1wqeLAZ44afNSzu+8CrJiF9jAvgk1Odz9Mm12V9pdhs+z3cQLBtLP Tw1XjhTkrXZeJxJ8/HKp2dW/5m7muXZHkNa35diUfiDjdr3o8m0hnAFVhN1mU28BzpDl xVrvrqBHhA2WNqO9/HyALP9nrpazpahw7VHcLgv1WO7CvlTgqAsABg7LalFAfOgzWAgE K7lg== 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=Mz00RFFNAoguGGP8hvX8GCqEJMfOE+04kRLpScSRYxs=; b=uJt3jbPNnFo2SNMeYbKpyNmT+353bivInLGUiBCpAC2B3rXWimu/2TCca/pkbHBThB wyRtzKc1yYnhvOiPRjR3T3hu4CT7zDG+q/Sc1jmpcUH1bPyU45iOMrUkirVPcm6xUT10 +0kXz+uNrrJm5mZtIvK8508sHgu9XNGA/s5nIR+SMoqIwOkMY3ulRJos7eoUmdi7vAFi wxXblEZgYdeGBd/tlAKvNoCLsBuwxd49/+peHRGjLol0P6xreDbyiksoNzsFdfWoZBba j/qMYBZdImqX7zuLyEKHP5i2Q0piMiv6ZHaYi95TGEt6sOrE0SvlKTecn/Q7UBjvM32D 7DJg== X-Gm-Message-State: APjAAAW54uWtoQ9KUfaPgSqRIrJmLT6JWgIaueJVzXOr9KUxg1KB4WEb A92sZyFCj0SyByR1Zs/48P1vNWUa X-Google-Smtp-Source: APXvYqx1ftccN9hhH/lEPfkyImZ861sYc8RFgBWl0Dl/KtDs8SHKprJ5jU4eM3y4aF212fWsvvkQCw== X-Received: by 2002:a05:600c:292:: with SMTP id 18mr14356210wmk.128.1581525705540; Wed, 12 Feb 2020 08:41:45 -0800 (PST) Received: from donizetti.fritz.box ([151.30.86.140]) by smtp.gmail.com with ESMTPSA id a16sm1195122wrt.30.2020.02.12.08.41.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:41:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 9/9] target/i386: enable monitor and ucode revision with -cpu max Date: Wed, 12 Feb 2020 17:41:29 +0100 Message-Id: <20200212164129.6968-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200212164129.6968-1-pbonzini@redhat.com> References: <20200212164129.6968-1-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::332 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" These two features were incorrectly tied to host_cpuid_required rather than cpu->max_features. As a result, -cpu max was not enabling either MONITOR features or ucode revision. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 32efa46852..92fafa2659 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6414,7 +6414,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) error_setg(&local_err, "CPU model '%s' requires KVM", name); goto out; } + } + if (cpu->max_features && accel_uses_host_cpuid()) { if (enable_cpu_pm) { host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx, &cpu->mwait.ecx, &cpu->mwait.edx);