From patchwork Tue Nov 19 16:08:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197535 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.b="icAa2MzC"; 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 47HW4775Bmz9s4Y for ; Wed, 20 Nov 2019 03:09:43 +1100 (AEDT) Received: from localhost ([::1]:46980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX64T-0001nE-Bw for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:09:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60632) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63i-0001iT-I1 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63h-0005zg-BC for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:54 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:39334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63h-0005zE-59 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:53 -0500 Received: by mail-wr1-x441.google.com with SMTP id l7so24518693wrp.6 for ; Tue, 19 Nov 2019 08:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=IxNe+PRA4UNUXRxlwBF/Lxfbz/p8jdQxx9siBVgywJQ=; b=icAa2MzC4t1MNIhDwGn3NHE9S4tsUulOXoVzxbmIp9456X0ucSSQhJsp/VbrcQDpyF w9Yfm1tyzi5T+/Fz6vCe+OgJvDGJoEWwBjRkDAhGRO51NAzAznJQX+Zn6mI1zEM5b5Jx bkAhqsfFpjkxChaQAhvs4h9V2oa/FhhVclp/V1YuhQ4N07jUFzz/NSIb6n1veIhlK2A6 HIYr5abSMeTMM/ZAeIVoTRKFWEF4bHIFtA3CQONhFE5f83YT4mC4xQeUb0ZxLgobsjNn MxeiwoecQ5oO5J4LzXhH+dC1uV8X9riBF03GFRB7Vg77dUezlG76h4hhvbITkkFXiP5J QYCA== 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=IxNe+PRA4UNUXRxlwBF/Lxfbz/p8jdQxx9siBVgywJQ=; b=YOAvSXKDaSTJEwz/wQXhM3hA0/GfrUI4mVxuGpLxXOTQTOglYIh5Wud2xlt13HdLsp d6910uvnce9hwAOqncaJPMvup4j2890ZvZQTsWZelVJjkscLjiFuRF+GMxGv4TbnOwuC FbPPoUMug4d9kbIKR+UOXlNHJP/ZN2KLa8xmTsNsRPxfLXsBW6GP90/1axczheNpMMqT WVPwA3t690fyTpO55qjiqmq7jKKpVo0/wUL1cgzFvVK1LAJjoFM1asM99TGAUcGPry3t VYOmGKaXJdWrigPG3elYtQmnzFAsjsa9VDrRjgUuj24im3CfVnOUX6x+k1ljOYgkYF5T p4KQ== X-Gm-Message-State: APjAAAUDGH25ejvtZpsmosBiMof96OjiTDstl6NpHVCske/rAb4vkjxG tW3No3bplF8sCxN04Ey9sQYJWUjx X-Google-Smtp-Source: APXvYqx77y8Q97mzu3TUCd1Ed+NqhQGmI1MLYOUi/wTaiBJF+ZPwYefR0Y9dBytOYXnHFZZKMI4dbQ== X-Received: by 2002:adf:ec4b:: with SMTP id w11mr36827280wrn.243.1574179731619; Tue, 19 Nov 2019 08:08:51 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/12] scripts: Detect git worktrees for get_maintainer.pl --git Date: Tue, 19 Nov 2019 17:08:37 +0100 Message-Id: <1574179728-35535-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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::441 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: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alexey Kardashevskiy Recent git versions support worktrees where .git is not a directory but a file with a path to the .git repository; however the get_maintainer.pl script only recognises the .git directory, let's fix it. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Greg Kurz Reviewed-by: Stefano Garzarella Tested-by: Stefano Garzarella Message-Id: <20191112034532.69079-1-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 71415e3..27991eb 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -81,7 +81,7 @@ my %VCS_cmds; my %VCS_cmds_git = ( "execute_cmd" => \&git_execute_cmd, - "available" => '(which("git") ne "") && (-d ".git")', + "available" => '(which("git") ne "") && (-e ".git")', "find_signers_cmd" => "git log --no-color --follow --since=\$email_git_since " . '--format="GitCommit: %H%n' . From patchwork Tue Nov 19 16:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197537 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.b="XzApEN9P"; 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 47HW7p1t5mz9s4Y for ; Wed, 20 Nov 2019 03:12:52 +1100 (AEDT) Received: from localhost ([::1]:47010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX67U-0006HI-UC for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:12:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63j-0001im-GH for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63i-00060c-IH for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:55 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:37504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63i-0005zy-Bx for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:54 -0500 Received: by mail-wr1-x42d.google.com with SMTP id t1so24521354wrv.4 for ; Tue, 19 Nov 2019 08:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EjE2s4dLILThkxinnyee0kv/UUrrjl0KyE1AfYKWQZo=; b=XzApEN9PqChXErKLJf0sWsbQUCSOuFJNJn2yksaCeY0AivG905dNtSD1fcbmWGf5Mr SO3blEK5i/e8869phuDZqET76qL1+DeLb2Kwee/neOUjm/0JVCDN4lXfC+RDQeyuhE3i GJ0bDh4DMT+9OHoXsi6FL7cX/mal7/Z1mJHx3FTRX/5OCR6qRHypCmDCrzfLNkZdl+hF XeUZ6Ma3oKpoGrvO+/lJsxxgvTFOhEukYx3WlCLm+Q4hFoJruY7IU0Lh9kPAbOSHrB2w Ppx9Seb+3FB6o+XQWKvn167Sbyo8ExoQVq1ZAvab7D+UyCtBCHIILcvytVdQKQVAeSRE vaKw== 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=EjE2s4dLILThkxinnyee0kv/UUrrjl0KyE1AfYKWQZo=; b=V2p3UfXcrZ5gwtlvIqYblHrNaOK7ddI2idc7JbxvNtdO1bqscgZrt7Ic2KKXtA7Y2s RA2UJ6W8fDIio1AirXm9/kDRWHbjzAe+CeT52eawO+yzwQ3OUYyCiwqR5QG47qWxYgRk fkkoAHAI85rFnLkbob1HJFXr6Uqg5vvLep4rWu+D6gAiqUX+z6MA2bWyyyrCjTFxw07L RYurBnR3Nbumh+szjXtrBlQ1bBw+xk1b/v8jYz/LpVxgVHorWw+MdSf67e8S5NAVZb+J I050kU4hogvSoHrM3bd6Vofi+ZNXKU/YcUUP5yJ5IWZxzEEkN+qOivvHq+VKNxiJZQg+ 6XJA== X-Gm-Message-State: APjAAAXynZ5xUh6z4QUkckzUz3cTdYgX2IR2BU8N+ZFGLheGLSyCEhtc 608eA03Ls7nXn0kUfwYIn108hOgB X-Google-Smtp-Source: APXvYqxXjmGuZg5VN/SO1JffK/bZztsyuumCrQ1iNKymUG1m37NnoABf6VzIi8tA8wPR1lHgIO5oKA== X-Received: by 2002:a5d:522e:: with SMTP id i14mr23364679wra.27.1574179732826; Tue, 19 Nov 2019 08:08:52 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/12] microvm: fix memory leak in microvm_fix_kernel_cmdline Date: Tue, 19 Nov 2019 17:08:38 +0100 Message-Id: <1574179728-35535-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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: Sergio Lopez Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sergio Lopez In microvm_fix_kernel_cmdline(), fw_cfg_modify_string() is duplicating cmdline instead of taking ownership of it. Free it afterwards to avoid leaking it. Reported-by: Coverity (CID 1407218) Suggested-by: Peter Maydell Signed-off-by: Sergio Lopez Message-Id: <20191112163423.91884-1-slp@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/microvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 8aacd6c..def37e6 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -331,6 +331,8 @@ static void microvm_fix_kernel_cmdline(MachineState *machine) fw_cfg_modify_i32(x86ms->fw_cfg, FW_CFG_CMDLINE_SIZE, strlen(cmdline) + 1); fw_cfg_modify_string(x86ms->fw_cfg, FW_CFG_CMDLINE_DATA, cmdline); + + g_free(cmdline); } static void microvm_machine_state_init(MachineState *machine) From patchwork Tue Nov 19 16:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197534 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.b="d8pago/j"; 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 47HW452w5mz9s4Y for ; Wed, 20 Nov 2019 03:09:41 +1100 (AEDT) Received: from localhost ([::1]:46978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX64Q-0001m5-VK for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:09:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60659) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63k-0001k2-Kp for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63j-00062Q-LE for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:56 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:37506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63j-00060n-FR for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:55 -0500 Received: by mail-wr1-x42f.google.com with SMTP id t1so24521428wrv.4 for ; Tue, 19 Nov 2019 08:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=3iLhuLQVXfPXmdgg2LSG63xjVI9pM45wRFe4JLQs6+A=; b=d8pago/jDfbLZZ+HPbpx2LkXGbpfxHc4LIkIG7awHRewvbJ5NC8RoAAQkSdzOwLo3S 4wWBC0VTTkmnRyZsNu0ENKdhZCNAocz6wwLooTk+h8lbJ9ZojXjwj8W0ZwkEFagBh0Dm 78rqsL/IbWMK9J+y4GiWg+7ABhfsqmhGP9SZdTrq5m2FGHYn7VZTrbJOvtF2M0YAh9Rx 6jkIZBOQ+pS0FfeaFWN7c8lKSZz4HcPqjwsvhOPo8vZnqLu2hEq19uRlRf2woBJ2LK13 gdTLLf+EHTfw0RCCVqrhTc9EtIwjrD+Lm+DeEaXfUx3GuT0ssBg9xbt9B6ATGWlKHtKi wsUg== 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=3iLhuLQVXfPXmdgg2LSG63xjVI9pM45wRFe4JLQs6+A=; b=a97PQ39lIUVqjFy4pJ+8XIy9ruz/PuaCO0WBAb3qCyoy0eaL9Vjww/KyGE7fBZGGjk xDTN1/dAbv4f1W2l2cXagdFdvv9DJBNMz1A0fYyeavTqPFUMRDqaHzQDUqSf0t4Q89qE sZHHHh13o5jkLASkkif9X03mKks8DnhtuTNBcU4AXhLDqimacOYceBaM7CO5Rtfc2YgS ku41sYu7Y4HtBGWh3gLZinTRcC2yltAIBgf/gBgJ28YOgzO4y65G7zjBQUzi9VhsUbSp D5Mw0u2qyvstRUJFXgou+67aH0lTUQPoXGckxqAulWupg6zww8KyzHNZw3ev0+imZeac geyw== X-Gm-Message-State: APjAAAVzv/9C/rd88PS9z4cd+ztAxuWZHJInNF6GJNGtGka9eB5VmNvA is6YmAM68Q2T4FnfVAM3XNSn1Fp4 X-Google-Smtp-Source: APXvYqzyB9RYsynBNv6Kf9XgHDG+BfBZaPpDJ8C5MxPvU7Bnjeq0eS680XGXC5yQ3ZZ8MMWP1+c72A== X-Received: by 2002:a5d:570a:: with SMTP id a10mr16805682wrv.107.1574179734119; Tue, 19 Nov 2019 08:08:54 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/12] target/i386: add PSCHANGE_NO bit for the ARCH_CAPABILITIES MSR Date: Tue, 19 Nov 2019 17:08:39 +0100 Message-Id: <1574179728-35535-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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 is required to disable ITLB multihit mitigations in nested hypervisors. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a624163..2f60df3 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1204,7 +1204,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { .type = MSR_FEATURE_WORD, .feat_names = { "rdctl-no", "ibrs-all", "rsba", "skip-l1dfl-vmentry", - "ssb-no", "mds-no", NULL, NULL, + "ssb-no", "mds-no", "pschange-mc-no", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, From patchwork Tue Nov 19 16:08:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197542 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.b="iUeUbzrQ"; 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 47HWBz3YFJz9sPn for ; Wed, 20 Nov 2019 03:15:39 +1100 (AEDT) Received: from localhost ([::1]:47062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6AC-0001Jk-SY for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:15:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60676) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63l-0001lf-SE for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63k-00063G-VQ for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:57 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:36937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63k-00062e-PD for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:56 -0500 Received: by mail-wm1-x32b.google.com with SMTP id b17so4361718wmj.2 for ; Tue, 19 Nov 2019 08:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+3FqdgoTZLjOj3AoU3SzJl29O+tJ7C+eq6tKtuYqCzA=; b=iUeUbzrQf3WU4+1bjT5jK9Uex599qgQOobjy5lkZl8HEl39x58jWX3T5q7K3poHdz9 jDdcBr/NDecfIctCZocc/jUo9+KTCW201yFlfLUT6F2vDFHiB31Eg44zBgSs8BDyZKTD OmYt03GBYdAiUVplgkxrc1ZLPXFQ3f+FYKIpSnDeHIv1dC2UNUsP/GJLYnOWRd5myJ9G O/f7CuqZ3W3h5e47vbDL6+M6JxFDXzQAf0dZ0kY9eDqh8WPxNdNChyKcGRKlEO/OTPxC m2dFKTZA1YOVsOYvFvleT39Oq3TKTj0+g2kQZAY+r011DpLPrr+FZewYDkqTcERUzAc/ u+xA== 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=+3FqdgoTZLjOj3AoU3SzJl29O+tJ7C+eq6tKtuYqCzA=; b=crpgYJMB+b73MzKSAwYG2Kii61RzSmTtEqHXCpG6qmH/5hef2pNMfttSbuXDa93646 OZMrEL/lBY6XweQrPC0LDnZ496JZQQjELcth47MsTbFuWU1Pgr2YraGsDMNooyk2tSJ1 F+NcD8p4qV1gNvWgA0fIg9P5+HoysDdswjSpYV4S0ZRjAA1bBsl4Sc5egRxnubShHMVx UlUzA9VAVMv83uamwVE5DrrJYIvt6RIDS+oAX0uxrGtNL7hbu0Re6xcivsSsdbucbP9g pZDhhWpgaWo7nmiiVzTnvsdspHozTtZiR8ap6r0p/KA72GAZv/ZOZv8OdVtn4fd9NbH0 /iJQ== X-Gm-Message-State: APjAAAXb1gm0K2Kv+2sxkxK2diCo+jXv+yGnAvzq9w16GAp8hFGrDmJt Z51txjGUE/36Z7grIwIS4D7rNknW X-Google-Smtp-Source: APXvYqzpic9ziSoieYYY4+MLVzxC3/Vl35DvSuuGUxCVzXpBrK2J0ozGrlkfORVItAus5NLnuZEP3Q== X-Received: by 2002:a1c:64d4:: with SMTP id y203mr6664971wmb.27.1574179735274; Tue, 19 Nov 2019 08:08:55 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:54 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/12] target/i386: Export TAA_NO bit to guests Date: Tue, 19 Nov 2019 17:08:40 +0100 Message-Id: <1574179728-35535-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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: Pawan Gupta Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pawan Gupta TSX Async Abort (TAA) is a side channel attack on internal buffers in some Intel processors similar to Microachitectural Data Sampling (MDS). Some future Intel processors will use the ARCH_CAP_TAA_NO bit in the IA32_ARCH_CAPABILITIES MSR to report that they are not vulnerable to TAA. Make this bit available to guests. Signed-off-by: Pawan Gupta Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 2f60df3..296b491 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1205,7 +1205,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { .feat_names = { "rdctl-no", "ibrs-all", "rsba", "skip-l1dfl-vmentry", "ssb-no", "mds-no", "pschange-mc-no", NULL, - NULL, NULL, NULL, NULL, + "taa-no", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, From patchwork Tue Nov 19 16:08:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197538 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.b="WQsAbqbz"; 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 47HW7s1bPhz9s4Y for ; Wed, 20 Nov 2019 03:12:57 +1100 (AEDT) Received: from localhost ([::1]:47024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX67a-0006my-OB for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:12:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60689) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63n-0001no-Ag for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63m-00063v-1c for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:59 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:36305) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63l-00063P-Rg for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:57 -0500 Received: by mail-wm1-x331.google.com with SMTP id c22so4362898wmd.1 for ; Tue, 19 Nov 2019 08:08:57 -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=sBQlJETMYugVSeDk54+9qbskMtGOF34Hx0TwffurVig=; b=WQsAbqbzJCKVssGPbRpeEdaidHG+YJpwbUQ2u5MufL9cje89zhlfhguUe/jWZVWPVK 40DiQVbb3P2QHVD9r+1iV+gyaHy9JE29a9ZTUV4FKBlphj7QZVNUBJrzaAMez1YQomcP y0RG5UHZJaNqtCLmfH37kbWlbvJFnXs3Ai2Q9c5hyzPNWeb69i9HG0dx9quY+erqud2S KDiN+iZawRWvaUxOnbGQ8hjnvCl7GgfX5ON4rXUV2flDWsU3VIVS1hsqJxx/AMhHjYfl gIm4DWS9m+JVjYAKUA9xR6fRocA3AthxMJ/GfRdadkB6yyrN7OLEBuDBJr8/Un44yayx zvBA== 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=sBQlJETMYugVSeDk54+9qbskMtGOF34Hx0TwffurVig=; b=a+t/VOMSELeDxMe8pOARko2bgBfMBPlpMOX2M6s8nEYGyGqUcRQ8GlEivqedNtNCqj CdcU0QxEx2TPf7hyY3fRdulkBVcGNn5LOkBun3Uta1TXtV3goseJJ/BDCYM8Xf0xDCHR bPS8vHkJvG/cZhzyItF9vZN3EbE+MM962kQEONaq27jhHEGE/a282V1cgdFIZxwBHzfI TCizOAGppBrms+c1jnzH6M+gSwArB45l6fyGeEksefrjHXcHIpCbNzu6VRUEKkiFhPpK zRn+oybg7gb2GHDx6It7W1gWKLji4Y1Ed9OyjdeX4DytDicrxKqmh2Kvfav9SeFx4/AO vssg== X-Gm-Message-State: APjAAAURuG5zR79dKYwkRgYfoz2Q05zR8g0lk/KO2w1fzJpMoUvooyql bgo7CRjj3sp7DSdCoZo+pS+13UZp X-Google-Smtp-Source: APXvYqwNpZWeTZWy4Pg6dg9vk05jArKssdsqKsfk5SfsGGzQ+oMdfBHUMgtvGH69aO6NZQ9Zzw6Ayw== X-Received: by 2002:a05:600c:2102:: with SMTP id u2mr6600993wml.49.1574179736546; Tue, 19 Nov 2019 08:08:56 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:55 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/12] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled Date: Tue, 19 Nov 2019 17:08:41 +0100 Message-Id: <1574179728-35535-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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: Thomas Huth Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth When CONFIG_IDE_ISA is disabled, compilation currently fails: hw/i386/pc_piix.c: In function ‘pc_init1’: hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable] Move the variable declaration to the right code block to avoid this problem. Fixes: 4501d317b50e ("hw/i386/pc: Extract pc_i8259_create()") Signed-off-by: Thomas Huth Message-Id: <20191115145049.26868-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 2aefa3b..849ee12 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -78,7 +78,6 @@ static void pc_init1(MachineState *machine, X86MachineState *x86ms = X86_MACHINE(machine); MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); - int i; PCIBus *pci_bus; ISABus *isa_bus; PCII440FXState *i440fx_state; @@ -253,7 +252,8 @@ static void pc_init1(MachineState *machine, } #ifdef CONFIG_IDE_ISA else { - for(i = 0; i < MAX_IDE_BUS; i++) { + int i; + for (i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; char busname[] = "ide.0"; dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i], From patchwork Tue Nov 19 16:08:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197536 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.b="OWocVGEM"; 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 47HW494JdZz9s4Y for ; Wed, 20 Nov 2019 03:09:45 +1100 (AEDT) Received: from localhost ([::1]:46982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX64V-0001tQ-3R for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:09:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60697) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63o-0001ot-0j for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63n-00064Z-1L for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:59 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63m-000645-R9 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:08:58 -0500 Received: by mail-wm1-x343.google.com with SMTP id f3so4324703wmc.5 for ; Tue, 19 Nov 2019 08:08:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7UO6xeR8ytjGjoYuV7yLmVYHg1zyTHVjoP2SmInf7fQ=; b=OWocVGEMgTWyU5pwdAYmFzwvEj5BGT3M0NeZ9loh3+VZqBLluS3yVH1hbARUjl07YV W56cLRsCy4BgYNwcDZHzyZFw3jlKV2TYU/eqbtHDqogCA2WS2pH5ymQ4xRe0q/eWDCTl bspZ9no+PL9KP9zadBV0ksoIx0+Dv9aDVd5XIYiKIr4D95Spfqi/g1Fc/sbLUhuzO/yF Y2XvY/RoV3kXbc71IoaKDxvDicKWHCUXA4zOdTCGJlIOK/aeJNBEwe3JKe2G0uQu+iD8 GItEZhwdEQkobcKJcpfDFV1bHXC/tr01FQHa7RfHgN7OHoSG5mKeXFGnE5e7NM0duXdf W9kQ== 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=7UO6xeR8ytjGjoYuV7yLmVYHg1zyTHVjoP2SmInf7fQ=; b=WNXun65R53ywCNZaJmacmcVMwU9/qJCeV7PjNWvqTtOVf5HC2Kda1L0zUnTUpuOSDJ 4SQ2ab5pqXJg/J9xbcV6bIjPbX+pAsJfCIUn/kmyt5QT67Pjz+jmCop2JK+ZGoczDZ7p z1y7v87onl9npQZbvqCAegojgUdAKOhRdaraKelfQPGDLGan5KwCwPyu+avWZHHM/WZ3 yPCOhl5x1kwqiVXKgJJGPjA++NoqZDWOJBwxH3v/ic4QYMzFOWiddBW3Ke4+rbo8REaM RpBjoF9nlcrCsLSubZkD8HAKdqid/6FLaNgdUQOOWrNKuoDcyCh//JJYLFOG4QHTVmiw M7fA== X-Gm-Message-State: APjAAAXNRv7ZW+uW9qNF0I7KLwNFITYc2SAdTFqcuB/bC7LVUS2lv8qG EioOu6TCloh2Sb2DbshCcWonWI6f X-Google-Smtp-Source: APXvYqwZjv08OlvUE8whr5mIbwcV9Hn4mhS/5gUU6tmipw4019zPRhM6ac0MviEkFrNEe8lLF1/txQ== X-Received: by 2002:a1c:7c18:: with SMTP id x24mr6809211wmc.130.1574179737579; Tue, 19 Nov 2019 08:08:57 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:56 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/12] vfio: vfio-pci requires EDID Date: Tue, 19 Nov 2019 17:08:42 +0100 Message-Id: <1574179728-35535-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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" hw/vfio/display.c needs the EDID subsystem, select it. Cc: Alex Williamson Signed-off-by: Paolo Bonzini --- hw/vfio/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig index 34da2a3..f0eaa75 100644 --- a/hw/vfio/Kconfig +++ b/hw/vfio/Kconfig @@ -6,6 +6,7 @@ config VFIO_PCI bool default y select VFIO + select EDID depends on LINUX && PCI config VFIO_CCW From patchwork Tue Nov 19 16:08:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197539 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.b="vfJGUr+A"; 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 47HW7t1jvMz9sPn for ; Wed, 20 Nov 2019 03:12:58 +1100 (AEDT) Received: from localhost ([::1]:47028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX67b-0006rR-J9 for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:12:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60722) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63q-0001tO-KT for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63p-00066m-JJ for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:02 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63p-00065t-D6 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:01 -0500 Received: by mail-wm1-x32f.google.com with SMTP id q70so3803822wme.1 for ; Tue, 19 Nov 2019 08:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CTwwXQwwlbADAhtITpXxTkXx7WnAbK2L+Hoi9QvzJec=; b=vfJGUr+AF2qZ5xtiVbrHxp92JVMCWE3fHTQW37AhtCte0hEoLSt9MXm7W0nOpDYVyn kEA+F0cO/JBrluhWspDgegfb54ID1FW5qzVH03Ud8+84zZ1Go4ijNoZlgZIU5FzxovTP cRrlTAtKwabWQQylQVgIf13vQ1ur89Cja57RXHKYcKpHeQMy6QAjEjRqGKI9MSz3QM3r 2yxVtVHf6dbNoW+FZtxv3ciHuoJAJZj0a8YcsYeft2kcwjreSc5avE4he5hAvdCL0c1B D2+A0caqhLDSJCknfnjZcPlElNH0zgqV5dLtGRrjsyWlmDFZq9ZlJYLF0BPPUt8NxreR 3Qqg== 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=CTwwXQwwlbADAhtITpXxTkXx7WnAbK2L+Hoi9QvzJec=; b=pWz+wyB54wWPPNF4l5Tl993cX2lfs5mBOUn1DNwDFn1Ra892uI9/OoRpaQqVHLX709 05BwPz4J3e1ssTiTLWXO7yi6sJDdVTc/B1tpGg8Z7o3lSnmPTUKdcMnntdFm+SebPgnY b7NPULN1NWsQlch41vk7xKLa8R5U08nf3182jU4UWXn89+LBozIu0xFcfo55gco/2Grc 4K27b61M39J+F/UQHrHrPHo3pCDXgRRVs8WFwDN3rnJfI5x4BIda15aGq4MQ7XpTWQLo lJ8eoRnYn7pqEA24+knVqTmuZJUabH+kGbj88g6GPt0x9r1nWmju9l6PUnIURmho+RQv ErQA== X-Gm-Message-State: APjAAAXaQ5RHRezgFahdBvoCisZdscYdu9CY3O1ONL1EJ+BaSN5lNclO s/rfrV5s8L8oShcDcl2uF/Yf7ePy X-Google-Smtp-Source: APXvYqwjCQncQYK3InuYyRpo3Wm322hApFEDxoRIItzYCyaNOOx8eGrwbXsnE1HQOLa5tITzOjwGXg== X-Received: by 2002:a1c:4b18:: with SMTP id y24mr6412953wma.71.1574179738618; Tue, 19 Nov 2019 08:08:58 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.08.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:08:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/12] docs/microvm.rst: fix alignment in "Limitations" Date: Tue, 19 Nov 2019 17:08:43 +0100 Message-Id: <1574179728-35535-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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: Sergio Lopez Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sergio Lopez Fix the alignment of the items in the "Limitations" section. Signed-off-by: Sergio Lopez Message-Id: <20191115161338.42864-2-slp@redhat.com> Signed-off-by: Paolo Bonzini --- docs/microvm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/microvm.rst b/docs/microvm.rst index aae811a..4cf8474 100644 --- a/docs/microvm.rst +++ b/docs/microvm.rst @@ -33,9 +33,9 @@ Limitations Currently, microvm does *not* support the following features: - - PCI-only devices. - - Hotplug of any kind. - - Live migration across QEMU versions. +- PCI-only devices. +- Hotplug of any kind. +- Live migration across QEMU versions. Using the microvm machine type From patchwork Tue Nov 19 16:08:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197545 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.b="q34olN5e"; 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 47HWHt55kZz9s4Y for ; Wed, 20 Nov 2019 03:19:53 +1100 (AEDT) Received: from localhost ([::1]:47104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6EH-0004O3-Td for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:19:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63r-0001vI-Ph for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63q-00067T-Mm for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:03 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:34951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63q-00066y-Gb for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:02 -0500 Received: by mail-wm1-x334.google.com with SMTP id 8so4365327wmo.0 for ; Tue, 19 Nov 2019 08:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ep9NciRh5AxFxbZ8BVLC6AZ8AyyeFsDsKi2zTRHiEDs=; b=q34olN5e+B7fBP5OyGWSbN52OFQFEIUCQDHMnC5q4RYWebkTba4S6FVHqFqU/XLLl7 D5YVKGYdUjMeN8qoIU1BJXnBX2S0geCXRugaeDeTMAs5yCgZHkMNRppT0m30y1THlcVn 6zECr3NT+NhO4opw0DifKQd8CcpP0HGUZpQv2pIKqrdajAjvhHmyJVeVWHiAk7AZXd3L ffZmQPXhopTjXBPAnt6Q9a69BXBFZ+nwppkOUIQ8p0CqYuH1LTT83C/yS2wL2AIKupZv lYagvPEC7AD3FOK5rPTW03+1MMNnL7BOLoVrAJUCcuzRw1mcBS9HG3j9R8LmUH6b8IS/ 0odg== 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=ep9NciRh5AxFxbZ8BVLC6AZ8AyyeFsDsKi2zTRHiEDs=; b=tAKfl7o1RGni8Gg4jU4q2U0MVL+xxIEoK4iJX7XepjXf81xx6vxdoWAvUN5CHOD3Z1 MEYe0+eR64ATYAjwbGYl5nqni6YgaWn5tgAK/+F6Eki4OM2l9go41BiSHhHOhNB+EgxL ch5k6RY8VIaLAOCsQVU8rCT8D51C74HVq87YXzrjnJ9RN4rtEmKJEGSCMbLZ4xCmSFjq OSSyNT91lpUy3T38eitUXCRLwOvPJrHzxwX8+bWw4B9L5+QcQAESYCcXYj4pPTosiZKz gPKNn1u0cg0Ju8StcI9duqCySAMwBOF9Pxpko+xnDxagjJEJZE/JJmvRcIRouW/mR4r3 4iLQ== X-Gm-Message-State: APjAAAWnpM5dtJjciDd/oZS5d/61Xk6oCdLBR+qxHjj6aLvWHQaR/XLE CbeAGmqRJIHAEVVP9gOwe1DU0h2F X-Google-Smtp-Source: APXvYqwqvmvvn6lKZWrIrchwmY8QrF876Ief37m6UjixFm1q+1SHHwPrC0APaauYWQ77dIK2pHnOBQ== X-Received: by 2002:a1c:e157:: with SMTP id y84mr6275554wmg.59.1574179741090; Tue, 19 Nov 2019 08:09:01 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.09.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:09:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/12] docs/microvm.rst: add instructions for shutting down the guest Date: Tue, 19 Nov 2019 17:08:44 +0100 Message-Id: <1574179728-35535-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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::334 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: Sergio Lopez Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sergio Lopez Add a new section explaining the particularities of the microvm machine type for triggering a guest-initiated shut down. Signed-off-by: Sergio Lopez Message-Id: <20191115161338.42864-3-slp@redhat.com> Signed-off-by: Paolo Bonzini --- docs/microvm.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/microvm.rst b/docs/microvm.rst index 4cf8474..fcf41fc 100644 --- a/docs/microvm.rst +++ b/docs/microvm.rst @@ -106,3 +106,24 @@ disabled:: -device virtio-blk-device,drive=test \ -netdev tap,id=tap0,script=no,downscript=no \ -device virtio-net-device,netdev=tap0 + + +Triggering a guest-initiated shut down +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As the microvm machine type includes just a small set of system +devices, some x86 mechanisms for rebooting or shutting down the +system, like sending a key sequence to the keyboard or writing to an +ACPI register, doesn't have any effect in the VM. + +The recommended way to trigger a guest-initiated shut down is by +generating a ``triple-fault``, which will cause the VM to initiate a +reboot. Additionally, if the ``-no-reboot`` argument is present in the +command line, QEMU will detect this event and terminate its own +execution gracefully. + +Linux does support this mechanism, but by default will only be used +after other options have been tried and failed, causing the reboot to +be delayed by a small number of seconds. It's possible to instruct it +to try the triple-fault mechanism first, by adding ``reboot=t`` to the +kernel's command line. From patchwork Tue Nov 19 16:08:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197547 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.b="TCf3KC0q"; 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 47HWMM3Zlkz9sR8 for ; Wed, 20 Nov 2019 03:22:55 +1100 (AEDT) Received: from localhost ([::1]:47146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6HE-0007Yr-U0 for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:22:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60751) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63t-0001y2-88 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63r-00068B-U8 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:05 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:56265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63r-00067d-NS for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:03 -0500 Received: by mail-wm1-x335.google.com with SMTP id b11so3787858wmb.5 for ; Tue, 19 Nov 2019 08:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=x/7dL5GKaLKKTQGfreBczzCpIjJHYavx06Q35HIG390=; b=TCf3KC0qFWAh0xKFRO1aICnowVi48ggU3kqnGK086BL9n8CxtURNgl33MjgnWfcCfS 11IdGh/KNEzM1Ex2dcIEaJxlbMcgq94DL6fRsI93VYBQp29SsVCqKm/RIYmqi65CwYcF Pkre4xgIisl53+qcgLCjnsKunoVtr4lRYIq3wShUGaGdacc10ZwgNZHS2ZkHhIDGtEup 2VomiIS4/sOdDXppw4TkVFZdKp6ZvHTSb9kEkWSuYafZFJ/yZqEBY44QWSyUY8s1Qxir LT0lPQVB/prsSzp2wC9ov+lx55hLmBP2BNBBp0KDcCcVzMRNcZ1Fjx85Zc6kdTMwqZ4G quGA== 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=x/7dL5GKaLKKTQGfreBczzCpIjJHYavx06Q35HIG390=; b=OuezyzA277/kjf9YGpCu01E5rCblh0KeJra6v4jrPliu33UQBNaAs2o5AeAnytMid6 4kmPhVGolzcF7ipLJI0PJn3qDvTO8rIqhBxeiZrqQnc03FKfsxksXm23zpIgP4B7364n oSO378pcQ8tDE8oISMAxZY4nCurGvtMt9ON/tuzUmimeo6gDi8ZuA/f6B/AEx/8Zshe6 s2sXLhbrXQEfv1PVbNpyVcdXrE6duhaJYemuYC7biXyfuJ1H0tReIVNDpn95d53bdMGb S+mt3RqWed2xtUkd6/B7FP4MohUr+Ag2Noun7BN1x/7q3jnmSn2gaxDbp6DAm/1YH7rO o8gQ== X-Gm-Message-State: APjAAAUUWFT1cZzA5g5Jsv0vY2xBdFB7TQbgA0z3fiJCzECmjG8Brqus Ocm2dTWTIcpHwUo4lerQwXuzpPxa X-Google-Smtp-Source: APXvYqwQehVMicSYylTIpO1o1FBNKYcTaIYZYtkjBXfK9aqFrSoKcoEKuYZrZ6X04o21HnedQw/1Sg== X-Received: by 2002:a1c:1b86:: with SMTP id b128mr4551301wmb.127.1574179742270; Tue, 19 Nov 2019 08:09:02 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:09:01 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/12] hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass Date: Tue, 19 Nov 2019 17:08:45 +0100 Message-Id: <1574179728-35535-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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::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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Liam Merwick Attempting to migrate a VM using the microvm machine class results in the source QEMU aborting with the following message/backtrace: target/i386/machine.c:955:tsc_khz_needed: Object 0x555556608fa0 is not an instance of type generic-pc-machine abort() object_class_dynamic_cast_assert() vmstate_save_state_v() vmstate_save_state() vmstate_save() qemu_savevm_state_complete_precopy() migration_thread() migration_thread() migration_thread() qemu_thread_start() start_thread() clone() The access to the machine class returned by MACHINE_GET_CLASS() in tsc_khz_needed() is crashing as it is trying to dereference a different type of machine class object (TYPE_PC_MACHINE) to that of this microVM. This can be resolved by extending the changes in the following commit f0bb276bf8d5 ("hw/i386: split PCMachineState deriving X86MachineState from it") and moving the save_tsc_khz field in PCMachineClass to X86MachineClass. Fixes: f0bb276bf8d5 ("hw/i386: split PCMachineState deriving X86MachineState from it") Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Message-Id: <1574075605-25215-1-git-send-email-liam.merwick@oracle.com> Reviewed-by: Sergio Lopez Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 4 ++-- hw/i386/pc_q35.c | 4 ++-- hw/i386/x86.c | 1 + include/hw/i386/pc.h | 2 -- include/hw/i386/x86.h | 2 ++ target/i386/machine.c | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 96715f8..ac08e63 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2195,7 +2195,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported * to be used at the moment, 32K should be enough for a while. */ pcmc->acpi_data_size = 0x20000 + 0x8000; - pcmc->save_tsc_khz = true; pcmc->linuxboot_dma_enabled = true; pcmc->pvh_enabled = true; assert(!mc->get_hotplug_handler); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 849ee12..1bd70d1 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -567,10 +567,10 @@ DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", NULL, static void pc_i440fx_2_5_machine_options(MachineClass *m) { - PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + X86MachineClass *x86mc = X86_MACHINE_CLASS(m); pc_i440fx_2_6_machine_options(m); - pcmc->save_tsc_khz = false; + x86mc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; compat_props_add(m->compat_props, hw_compat_2_5, hw_compat_2_5_len); compat_props_add(m->compat_props, pc_compat_2_5, pc_compat_2_5_len); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index d51f524..385e5cf 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -508,10 +508,10 @@ DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL, static void pc_q35_2_5_machine_options(MachineClass *m) { - PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + X86MachineClass *x86mc = X86_MACHINE_CLASS(m); pc_q35_2_6_machine_options(m); - pcmc->save_tsc_khz = false; + x86mc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; compat_props_add(m->compat_props, hw_compat_2_5, hw_compat_2_5_len); compat_props_add(m->compat_props, pc_compat_2_5, pc_compat_2_5_len); diff --git a/hw/i386/x86.c b/hw/i386/x86.c index fd84b23..394edc2 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -763,6 +763,7 @@ static void x86_machine_class_init(ObjectClass *oc, void *data) mc->get_default_cpu_node_id = x86_get_default_cpu_node_id; mc->possible_cpu_arch_ids = x86_possible_cpu_arch_ids; x86mc->compat_apic_id_mode = false; + x86mc->save_tsc_khz = true; nc->nmi_monitor_handler = x86_nmi; object_class_property_add(oc, X86_MACHINE_MAX_RAM_BELOW_4G, "size", diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index e6fa841..1f86eba 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -116,8 +116,6 @@ typedef struct PCMachineClass { bool enforce_aligned_dimm; bool broken_reserved_end; - /* TSC rate migration: */ - bool save_tsc_khz; /* generate legacy CPU hotplug AML */ bool legacy_cpu_hotplug; diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 82d09fd..4b84917 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -30,6 +30,8 @@ typedef struct { /*< public >*/ + /* TSC rate migration: */ + bool save_tsc_khz; /* Enables contiguous-apic-ID mode */ bool compat_apic_id_mode; } X86MachineClass; diff --git a/target/i386/machine.c b/target/i386/machine.c index 6481f84..7bdeb78 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -988,8 +988,8 @@ static bool tsc_khz_needed(void *opaque) X86CPU *cpu = opaque; CPUX86State *env = &cpu->env; MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); - PCMachineClass *pcmc = PC_MACHINE_CLASS(mc); - return env->tsc_khz && pcmc->save_tsc_khz; + X86MachineClass *x86mc = X86_MACHINE_CLASS(mc); + return env->tsc_khz && x86mc->save_tsc_khz; } static const VMStateDescription vmstate_tsc_khz = { From patchwork Tue Nov 19 16:08:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197543 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.b="r9t7UvUh"; 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 47HWCB5cH2z9s4Y for ; Wed, 20 Nov 2019 03:15:50 +1100 (AEDT) Received: from localhost ([::1]:47078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6AO-0001Yw-97 for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:15:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60762) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63u-000207-DQ for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63t-00068v-4e for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:06 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:34951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63s-00068T-UQ for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:05 -0500 Received: by mail-wm1-x333.google.com with SMTP id 8so4365562wmo.0 for ; Tue, 19 Nov 2019 08:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=84AXGKd0a/dx96HO4dm8J3dMCUNzIh5I2fM2rW+So9Q=; b=r9t7UvUho1TLYTzhudNOQXO1MyL4i6b472qsm9NP4KyC8Qmel6V9mSn44HLQ3y+ad+ 9XUizctHpcdGPPM4+S3yAdgzVyGPNGXZyYJvQ0HomOUW7OH8YECbkYTnA0HZYSZU/VMX FwXy+OriSXo211ibrgvT5fD4Cy7IEgxMp+jNwo5cj4NIn95UMweX0do2SVHzWBB6bCH2 sWnIpWvlJTQ/U5w+PQmDk86XObyKmXetHqD0tRw0mIyM9WvZgUE6/kllPsg0lypSQQ8M 9lzlpBJIowd0LgqTpY5N25EU0xTN0tMKDpw0WvQlnHrSl6Zi+xL1mrJp7Ppq6keKkSFS Q+pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=84AXGKd0a/dx96HO4dm8J3dMCUNzIh5I2fM2rW+So9Q=; b=eqglkvCOS9rTGO8XTekxJdMkcYtC29uYHjolo02U8LJC7Qkyxhg7Sj7f4ZhnJ82ktH SPekfHwikV25ZQNcakriIzH+7WWS+9kEHWR6DWKdqdcdq+BxVh7S2hQGD3cIj7e/RlIY WWUvBZP3GiCuB4NfCwCj7kWyaZkPNauCXzZjWcS9nnQcaD4vEV/xh28cRottUgwSG7lG MiW0h2896/MyBjOJCPkK1JcWm/pi6GRoYjBj+OZu5HMk1eiUYw0DPlnxbfwg7MEhdCMh F1q6IKMyaAU5+FkNyZx0HBOT8ozK3tbhSFFM2grvtS0n1eJKcMtIIRG6z/4EWd7GjKju im/Q== X-Gm-Message-State: APjAAAUJmGhkLfgr1ivqf3DPotIDQj0lkDPDDoA6PdWZ9aSyxrJJUkk7 NXZYy27Lx/JPNr7XRIvhiA7WuBYX X-Google-Smtp-Source: APXvYqz7sECQOk7FW+4B8rlMM0MNLEtlzN10BBIM68Zd6gQxsMix+IIQmNDrQnn2ORhGp1YDbbE9wQ== X-Received: by 2002:a1c:7c18:: with SMTP id x24mr6809842wmc.130.1574179743560; Tue, 19 Nov 2019 08:09:03 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.09.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:09:02 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/12] scsi: deprecate scsi-disk Date: Tue, 19 Nov 2019 17:08:46 +0100 Message-Id: <1574179728-35535-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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" It's an old compatibility shim that just delegates to scsi-cd or scsi-hd. Just like ide-drive, we don't need this. Acked-by: Peter Krempa Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 12 +++++++++++- hw/scsi/scsi-disk.c | 3 +++ qemu-deprecated.texi | 5 +++++ tests/qemu-iotests/051.pc.out | 6 ++++-- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 359d50d..ad0e7f6 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -254,8 +254,18 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, char *name; DeviceState *dev; Error *err = NULL; + DriveInfo *dinfo; - driver = blk_is_sg(blk) ? "scsi-generic" : "scsi-disk"; + if (blk_is_sg(blk)) { + driver = "scsi-generic"; + } else { + dinfo = blk_legacy_dinfo(blk); + if (dinfo && dinfo->media_cd) { + driver = "scsi-cd"; + } else { + driver = "scsi-hd"; + } + } dev = qdev_create(&bus->qbus, driver); name = g_strdup_printf("legacy[%d]", unit); object_property_add_child(OBJECT(bus), name, OBJECT(dev), NULL); diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 07fb5eb..e44c61e 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2481,6 +2481,9 @@ static void scsi_disk_realize(SCSIDevice *dev, Error **errp) DriveInfo *dinfo; Error *local_err = NULL; + warn_report("'scsi-disk' is deprecated, " + "please use 'scsi-hd' or 'scsi-cd' instead"); + if (!dev->conf.blk) { scsi_realize(dev, &local_err); assert(local_err); diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 296bfc9..4b4b742 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -259,6 +259,11 @@ their usecases. The 'ide-drive' device is deprecated. Users should use 'ide-hd' or 'ide-cd' as appropriate to get an IDE hard disk or CD-ROM as needed. +@subsection scsi-disk (since 4.2) + +The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or +'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed. + @section System emulator machines @subsection pc-0.12, pc-0.13, pc-0.14 and pc-0.15 (since 4.0) diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index 34849dd..0ea80d3 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -167,7 +167,8 @@ QEMU X.Y.Z monitor - type 'help' for more information Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty +(qemu) QEMU_PROG: -device scsi-disk,drive=disk: warning: 'scsi-disk' is deprecated, please use 'scsi-hd' or 'scsi-cd' instead +QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk QEMU X.Y.Z monitor - type 'help' for more information @@ -238,7 +239,8 @@ QEMU X.Y.Z monitor - type 'help' for more information Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk QEMU X.Y.Z monitor - type 'help' for more information -(qemu) quit +(qemu) QEMU_PROG: -device scsi-disk,drive=disk: warning: 'scsi-disk' is deprecated, please use 'scsi-hd' or 'scsi-cd' instead +quit Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk QEMU X.Y.Z monitor - type 'help' for more information From patchwork Tue Nov 19 16:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197544 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.b="icVKQlmv"; 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 47HWCB6Vvdz9sQp for ; Wed, 20 Nov 2019 03:15:50 +1100 (AEDT) Received: from localhost ([::1]:47080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6AO-0001ZZ-7O for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:15:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60771) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63v-00021Y-AD for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63u-00069S-21 for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:07 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63t-000695-RW for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:06 -0500 Received: by mail-wm1-x32f.google.com with SMTP id z26so3791999wmi.4 for ; Tue, 19 Nov 2019 08:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=iIEhLJHGJyb/n0As6qSQK05whIAhohU7R9F3hYodbw0=; b=icVKQlmv2Y9HtY5+AT45kiySywerRLDixl1CG9V3SKDYtf//xFuaKxflsEk4qXmX+U LcLbedTX8RUpExn9RXIca0gX547aITz+oRR0qTNfTvXjsUZYmuPDxxcnAW5brk0bbKpd c1Gxx1jsE6hKJbXxfb4HiMKT4V42A2ierrt/++bB/oof2NEFFHfH6ylE49NU+2tobkJq A+U+TZ710YtAffh4wZ7hxNG5YwiTBs8vfwIMRZBKeXtV/ef5okLf4M+b4j7BHFvekCE+ s8JoI0eZ/KhacGBL+1/yfc7W7y9QXhlr/6T5JwhM3bRQNbfxKw9JvB0RVhW3+Jsyx8Mc odOQ== 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=iIEhLJHGJyb/n0As6qSQK05whIAhohU7R9F3hYodbw0=; b=HhgRVlzeAbhogxSJ5goaO2SjBRLXOa+zI1ETni7C0Sq3d3tZKrEb8guim6I2OQCbxU NAlud0cRNZTosFnciLw+/UcRDXl3kprjuSKHzBvQcPBCxZdMpGIcd3+evDfiUKa/LrDa TnqwWFhdE4siZH6Guq41DTWwPI+L8bGy0tseLJUcbYQo4mDq9UwONAYdsCvF6KCitWZM CywBdQlKFSLcV9OWeleB3WC64hZt3epQoU5+VtHj4NCHjMC+cKjPi8mDU0SZK6SRVYqj foXrOQOzVBBqESdDSXsDIlGmo259sQ/mfQ3L2gkaBPfdukRMQhg/nln9KVQDA2U1hQBE KhtA== X-Gm-Message-State: APjAAAUkMbC/R+D8nFb/HsTe2MwR/1JQluT0zHzvmtGhuhLTO8BZFfyC DZUl2pW3ZZA/3o9mKZE3Ip0gWSnt X-Google-Smtp-Source: APXvYqyqbarSik4UhQAnuYZwBlFyhLRn2+lXi0y+Mv6M6A4RD3Eaa6/1231M+eGZ/AIFDmSG8j7hnw== X-Received: by 2002:a1c:7905:: with SMTP id l5mr7040588wme.76.1574179744541; Tue, 19 Nov 2019 08:09:04 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.09.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:09:03 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/12] Revert "mc146818rtc: fix timer interrupt reinjection" Date: Tue, 19 Nov 2019 17:08:47 +0100 Message-Id: <1574179728-35535-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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 reverts commit b429de730174b388ea5760e3debb0d542ea3c261, except that the reversal of the outer "if (period)" is left in. Signed-off-by: Paolo Bonzini --- hw/rtc/mc146818rtc.c | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index ee6bf82..9869dc5 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -174,7 +174,6 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period) int64_t cur_clock, next_irq_clock, lost_clock = 0; period = rtc_periodic_clock_ticks(s); - if (!period) { s->irq_coalesced = 0; timer_del(s->periodic_timer); @@ -197,42 +196,42 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period) last_periodic_clock = next_periodic_clock - old_period; lost_clock = cur_clock - last_periodic_clock; assert(lost_clock >= 0); + } + /* + * s->irq_coalesced can change for two reasons: + * + * a) if one or more periodic timer interrupts have been lost, + * lost_clock will be more that a period. + * + * b) when the period may be reconfigured, we expect the OS to + * treat delayed tick as the new period. So, when switching + * from a shorter to a longer period, scale down the missing, + * because the OS will treat past delayed ticks as longer + * (leftovers are put back into lost_clock). When switching + * to a shorter period, scale up the missing ticks since the + * OS handler will treat past delayed ticks as shorter. + */ + if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) { + uint32_t old_irq_coalesced = s->irq_coalesced; + + s->period = period; + lost_clock += old_irq_coalesced * old_period; + s->irq_coalesced = lost_clock / s->period; + lost_clock %= s->period; + if (old_irq_coalesced != s->irq_coalesced || + old_period != s->period) { + DPRINTF_C("cmos: coalesced irqs scaled from %d to %d, " + "period scaled from %d to %d\n", old_irq_coalesced, + s->irq_coalesced, old_period, s->period); + rtc_coalesced_timer_update(s); + } + } else { /* - * s->irq_coalesced can change for two reasons: - * - * a) if one or more periodic timer interrupts have been lost, - * lost_clock will be more that a period. - * - * b) when the period may be reconfigured, we expect the OS to - * treat delayed tick as the new period. So, when switching - * from a shorter to a longer period, scale down the missing, - * because the OS will treat past delayed ticks as longer - * (leftovers are put back into lost_clock). When switching - * to a shorter period, scale up the missing ticks since the - * OS handler will treat past delayed ticks as shorter. + * no way to compensate the interrupt if LOST_TICK_POLICY_SLEW + * is not used, we should make the time progress anyway. */ - if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) { - uint32_t old_irq_coalesced = s->irq_coalesced; - - s->period = period; - lost_clock += old_irq_coalesced * old_period; - s->irq_coalesced = lost_clock / s->period; - lost_clock %= s->period; - if (old_irq_coalesced != s->irq_coalesced || - old_period != s->period) { - DPRINTF_C("cmos: coalesced irqs scaled from %d to %d, " - "period scaled from %d to %d\n", old_irq_coalesced, - s->irq_coalesced, old_period, s->period); - rtc_coalesced_timer_update(s); - } - } else { - /* - * no way to compensate the interrupt if LOST_TICK_POLICY_SLEW - * is not used, we should make the time progress anyway. - */ - lost_clock = MIN(lost_clock, period); - } + lost_clock = MIN(lost_clock, period); } assert(lost_clock >= 0 && lost_clock <= period); From patchwork Tue Nov 19 16:08:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1197546 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.b="ZW7VpqmJ"; 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 47HWJM32Szz9s4Y for ; Wed, 20 Nov 2019 03:20:19 +1100 (AEDT) Received: from localhost ([::1]:47110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6Ei-0004do-Kv for incoming@patchwork.ozlabs.org; Tue, 19 Nov 2019 11:20:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60791) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX63w-00023E-Be for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX63v-0006AC-2Q for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:08 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:38330) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX63u-00069n-SJ for qemu-devel@nongnu.org; Tue, 19 Nov 2019 11:09:07 -0500 Received: by mail-wm1-x343.google.com with SMTP id z19so4349990wmk.3 for ; Tue, 19 Nov 2019 08:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=qHpVdmqCzVmXoW2Mq3yTyYlL6lxGnPFe8HxZarA2NvA=; b=ZW7VpqmJUX59VfNJeCJiGIUD9wixFMg4enTEmxRx65a17JZmTVIXZEiKJqQY19c3ez TE/TKhkyHdETL283ydPNigupIzoeri33oUlwHsZ4BHYbK1xorhkJjlbtAMsvmljWwJwZ azY+BAKufb293JaSj2gWCkopSXNes/uzxoE2quqaMXEjjv6hW/k024i9f0dFO1cb+V2h A7rGUZS8W5Ai6+VycvN3icXanidg//QBic0K2M4nx67hjGonXqKzjf/ocO76WxgzfKwq hCDJ3TNfGRsz7FFjpHphvYLkcfIoZ5GGlnPc12XKkEJQyLoOB9IEbLZoeG5z3GCyNx4F Kl/Q== 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=qHpVdmqCzVmXoW2Mq3yTyYlL6lxGnPFe8HxZarA2NvA=; b=uAQX4HwuhN8nruTrZEnhLxW5lCb9O/pg9aN1Ch3AQIUwUUqQGAqlN85JZDC2qb341R PKNmKBuEbVk3cwF29yeJJ9WY+czsMFqnJwXXYCLosYmb0Ukyy4XjklZ1p4EuK0uohSk5 AZJSGZ3DkFODca0x/7+AJEAZCHj3dDi3vc5fflEuGdjdDGikzErVqkanbXaQuOqGL2oa wllGI+wxfH+XT0fs5btPOd1jbC0Kj6CvNNZ5HxSiaEOJaipCb9tBJlBSQrsSsjdbX72/ 4FshVBXle28BAkGDceM6mt2iG4ce8r1GOrfGWuGptC0MmZoUcEYRP8qXN6VhE1ptVohk NuCQ== X-Gm-Message-State: APjAAAVOBLksIr5q1xJPKES9D0Pw64Yxeq60qn2KIrHJc+Ftfw82igSl LQYVCNFMM/CslvrbjH/HxnIytQWv X-Google-Smtp-Source: APXvYqytz0VHqF0XISX51gSasBIAPPaFfiyd1x2B+B6LO5mhngt7itkC8n1VxtTYbyXWkHahmxY/Rw== X-Received: by 2002:a1c:720b:: with SMTP id n11mr6184568wmc.60.1574179745590; Tue, 19 Nov 2019 08:09:05 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n13sm3442203wmi.25.2019.11.19.08.09.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 08:09:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/12] mc146818rtc: fix timer interrupt reinjection again Date: Tue, 19 Nov 2019 17:08:48 +0100 Message-Id: <1574179728-35535-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com> References: <1574179728-35535-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 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" Commit 369b41359af46bded5799c9ef8be2b641d92e043 broke timer interrupt reinjection when there is no period change by the guest. In that case, old_period is 0, which ends up zeroing irq_coalesced (counter of reinjected interrupts). The consequence is Windows 7 is unable to synchronize time via NTP. Easily reproducible by playing a fullscreen video with cirrus and VNC. Fix by passing s->period when periodic_timer_update is called due to expiration of the timer. With this change, old_period == 0 only means that the periodic timer was off. Reported-by: Marcelo Tosatti Co-developed-by: Marcelo Tosatti Signed-off-by: Paolo Bonzini --- hw/rtc/mc146818rtc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 9869dc5..74ae74b 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -168,12 +168,14 @@ static uint32_t rtc_periodic_clock_ticks(RTCState *s) * is just due to period adjustment. */ static void -periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period) +periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period, bool period_change) { uint32_t period; int64_t cur_clock, next_irq_clock, lost_clock = 0; period = rtc_periodic_clock_ticks(s); + s->period = period; + if (!period) { s->irq_coalesced = 0; timer_del(s->periodic_timer); @@ -188,7 +190,7 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period) * if the periodic timer's update is due to period re-configuration, * we should count the clock since last interrupt. */ - if (old_period) { + if (old_period && period_change) { int64_t last_periodic_clock, next_periodic_clock; next_periodic_clock = muldiv64(s->next_periodic_time, @@ -215,7 +217,6 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period) if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW) { uint32_t old_irq_coalesced = s->irq_coalesced; - s->period = period; lost_clock += old_irq_coalesced * old_period; s->irq_coalesced = lost_clock / s->period; lost_clock %= s->period; @@ -245,7 +246,7 @@ static void rtc_periodic_timer(void *opaque) { RTCState *s = opaque; - periodic_timer_update(s, s->next_periodic_time, 0); + periodic_timer_update(s, s->next_periodic_time, s->period, false); s->cmos_data[RTC_REG_C] |= REG_C_PF; if (s->cmos_data[RTC_REG_B] & REG_B_PIE) { s->cmos_data[RTC_REG_C] |= REG_C_IRQF; @@ -511,7 +512,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr, if (update_periodic_timer) { periodic_timer_update(s, qemu_clock_get_ns(rtc_clock), - old_period); + old_period, true); } check_update_timer(s); @@ -550,7 +551,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr, if (update_periodic_timer) { periodic_timer_update(s, qemu_clock_get_ns(rtc_clock), - old_period); + old_period, true); } check_update_timer(s); @@ -794,6 +795,7 @@ static int rtc_post_load(void *opaque, int version_id) s->offset = 0; check_update_timer(s); } + s->period = rtc_periodic_clock_ticks(s); /* The periodic timer is deterministic in record/replay mode, * so there is no need to update it after loading the vmstate. @@ -803,7 +805,7 @@ static int rtc_post_load(void *opaque, int version_id) uint64_t now = qemu_clock_get_ns(rtc_clock); if (now < s->next_periodic_time || now > (s->next_periodic_time + get_max_clock_jump())) { - periodic_timer_update(s, qemu_clock_get_ns(rtc_clock), 0); + periodic_timer_update(s, qemu_clock_get_ns(rtc_clock), s->period, false); } }