From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356514; cv=none; d=zoho.com; s=zohoarc; b=h63IbsXag6f1tV/2k1NlQJfmYijWClP/a73bnGNZwiYzY8R7fXIUQo/VLPUBE2tkW3yzd9cKiE3GJcqk22YMAXnKmpWMCCdnB6PS7p6QpPR2lfExMZFJRGpf72VaGVjRuEw5f2/45VfAKifXdppbY3BWr0sD52aHSKkTqf+HN+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356514; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uj5oH2lIOzQhbVvPGa1CJyfr5Ywg7honDl46Ua9isOg=; b=L9OceXHRyQojaxOt3s483o/RrV2lGbRWMTNQcFRF3p8YwX0da1khy8bxsczc2lldkl1KuxLx77LqaDGUpURVtcQHDew4Qgq8nb3DIvYBwyYKeKAWwWlEuLlYZogYXJuY4R1Lmbl4gE+wOfMN0e3fDL7q05ZQ1KpSgf/TVpEQYFo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356514724209.05807908872282; Fri, 5 Jul 2019 12:55:14 -0700 (PDT) Received: from localhost ([::1]:55630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUIa-00029Y-Di for importer@patchew.org; Fri, 05 Jul 2019 15:55:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55576) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEJ-0005LB-IX for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEI-00045S-Ig for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:47 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44199) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEI-000443-9A for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:46 -0400 Received: by mail-wr1-x434.google.com with SMTP id b2so9732155wrx.11 for ; Fri, 05 Jul 2019 12:50:45 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=uj5oH2lIOzQhbVvPGa1CJyfr5Ywg7honDl46Ua9isOg=; b=e5pxmWZ2x/jzmd+RME9rArhSd0/w0Vi9e31BTWwALanK87fWMVEx3M0etf5vu5TDXN O2e8DaKadtltS0hO/WIPNUIVNvG5iamw0kUMVgotOf7KAwJAIDFmGZuMiWEIdeiyY1Tv un4XOoZ+6d2WNBL23xHXL8LzFOC4Pgdb6kQRfqqfnkcssvmYdch1xW+RjOhuuOWqJru4 rflbiofpPsnR0DRmT2R39evgVCvI5iJGOAj+0hRxcd4aohFzqmB2lFmf0j9QyuTMfxkR CkmquloIsvIn3CD7kDCRiTFUVHLQUsElGc0OGn++wjSUOHoHDHllwe+3jyn+Ht4LjFJS +MEg== 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=uj5oH2lIOzQhbVvPGa1CJyfr5Ywg7honDl46Ua9isOg=; b=f3qoEDJshqg01pPjqjO0L7RIHGu9Zpoujg7TqkLAO5MgNnahCPqV1Xd7T19VqoZAJn sPPfDlYSuoR57ckb/fZY1gG1ZGbcjyfRTbhza2kjcUoMu8cGaVio01tGTQ4AN3XqDhb+ wfxUJUQj19F4A0fb9EzsanZ3xIsDRm7wec7Nbz65xXrro5Ftiy4gE3dVBWwjMWg0AQWI kbVgT0Ef3o5Bv71OzOGa/WeXvBJGFA+VY5ytWQ13WwR+YGOWJMT+BhEKVK3TNGUsGuvv RVPYHZu9AhsYcUBYouiZGy8+limT73Xz7cRVnFQqcVoA+f90Ecmb54H4ocyDZBxgwgkX GYZw== X-Gm-Message-State: APjAAAUk/wDZA+w9ZI9HWrXULA4oAZyeS2vjwkx8dQBS6lvmvXppUcvl djKnlyFql8pn+nvjKBZGjpuEeOdl2ks= X-Google-Smtp-Source: APXvYqzmfCXV3CdgQICaUQf5wpuYRSPAtWCNBwDigJy94AGzPVD1r/sRcH7YFC2hSvdSwMRNkD3kGw== X-Received: by 2002:a5d:4a02:: with SMTP id m2mr322476wrq.193.1562356244178; Fri, 05 Jul 2019 12:50:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:28 +0200 Message-Id: <1562356239-19391-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-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::434 Subject: [Qemu-devel] [PULL 01/12] pc: fix possible NULL pointer dereference in pc_machine_get_device_memory_region_size() 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: Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov QEMU will crash when device-memory-region-size property is read if ms->devi= ce_memory wasn't initialized yet. Crash can be reproduced with: $QEMU -preconfig -qmp unix:qmp_socket,server,nowait & ./scripts/qmp/qom-get -s qmp_socket /machine.device-memory-region-size Instead of crashing return 0 if ms->device_memory hasn't been initialized. Signed-off-by: Igor Mammedov Message-Id: <1560174635-22602-1-git-send-email-imammedo@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e96360b..552f340 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2458,7 +2458,11 @@ pc_machine_get_device_memory_region_size(Object *obj= , Visitor *v, Error **errp) { MachineState *ms =3D MACHINE(obj); - int64_t value =3D memory_region_size(&ms->device_memory->mr); + int64_t value =3D 0; + + if (ms->device_memory) { + value =3D memory_region_size(&ms->device_memory->mr); + } =20 visit_type_int(v, name, &value, errp); } --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356376; cv=none; d=zoho.com; s=zohoarc; b=CRDMeYJJ2y7ojOyJTEtjBmR/Wc3TgvMO1KjOn7ucasCTWMcQ2sCL7gPihq+uwa3ljlzMVjN7NhcqvOZ4pOxyi8598CKnDuGVJ1is9EwSlBRgtNFMO8NEh+HFvn6bMj1KGV6bXDSr4UgNgV7Lv7c+R4UhGdB20JSWWQOwU5Tq2xY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356376; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2QJXgDdeciu+QM4e3C1K2WEVvDtyNAWGx3hRO2WruJ0=; b=b8qpspzqFSt1uzX9kWmFucuCY9iFLjoOxymAiXkhyaiJGau7ODK05FphjPSEfYMhr0VUFZBP+RG0i6UzwVzsj0CcLP/cpgJRHSN4UxFox4HdhsKfcFRZWuJiegsYLegfRTYDpfVTFMwNEVRouEuqutBFqOe6xg0t8Jg17k8LkXA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356376861524.7324184293082; Fri, 5 Jul 2019 12:52:56 -0700 (PDT) Received: from localhost ([::1]:55604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUGG-0007Dn-JD for importer@patchew.org; Fri, 05 Jul 2019 15:52:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55582) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEJ-0005Lo-PN for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEI-00045h-QP for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:47 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:40606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEI-00044v-JY for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:46 -0400 Received: by mail-wm1-x331.google.com with SMTP id v19so10720893wmj.5 for ; Fri, 05 Jul 2019 12:50:46 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=2QJXgDdeciu+QM4e3C1K2WEVvDtyNAWGx3hRO2WruJ0=; b=CkGFfgrWkeR0F5/L12QMTojPnvYcn1XgG+NGFGw7TwxeU3f23UxO7GGrJh9n3UieAc YMLV8SKzEEgDGk3NZ6XPPQnLLbCLGeQgwqhdaiXs9rqRUWk5a1HC+10s54vn5vN8XO0/ HnuVraVzo0RlFmkBxKhAI+E3MkU1aiX/swHsnm9F+cTweiQhXef5/o9r+ltDIIGZclET eM1T9XcC8ESpWORvPd/49patx2hrfEIpCc1K3cdXawhW9xScLq9RrcbTuWko7SQ5dpJt 1gPYOSQojKupG5uhG+E3ZCpC7Dksen++Lwj+DOyghfbZzEJzvOrWZCOHKJNqUgC9CtCm bLlw== 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=2QJXgDdeciu+QM4e3C1K2WEVvDtyNAWGx3hRO2WruJ0=; b=Wu33JwVqxZV3LD8/NyGnwlt0VcAR7wl9/tKGw/0VhyhmQPZe4oD06J7k9uwmnF6NyA 9iDI2WlX7BYZK9W8TGfVVy7cLK4bIj1EQfUn8Yl7LfIosbrw5BgxY8j8CHn1EJa5TS8X zfNwruNxY7+Y0aZQp+O9JRTyaUvI0ZjcilnCFzmhbCwtuIpauLjC3AGAPjxXopG9E7y9 QzZ4Sww1ostfJ+sOgUHrBRDhGrD3y8I0Vhvakj2Yfi005VF3aZwWWzbOOJ6wkPo3lVzL 5jkx2sNviEFP3trcD95IP/qPpi44LkbyPRFO+oQVO9RMc30SZouNSEWMcVVDQKYgsj3d UOLA== X-Gm-Message-State: APjAAAWGAE9NZVts6qzeDpNQeSh68HOapZntfAdG8s0nwSmF+MdNv4HP EYlpuY83tTAuSZZlMxpbhwkbQ8IuyLI= X-Google-Smtp-Source: APXvYqzWdlsqdj+6q4vWtPe1t8sXQw/xpmWrEkuSyfn8oIhF3fPC6LlPE3Y5vovo77AYKtRKMZDFzw== X-Received: by 2002:a1c:a8c9:: with SMTP id r192mr4681860wme.43.1562356245333; Fri, 05 Jul 2019 12:50:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:29 +0200 Message-Id: <1562356239-19391-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 Subject: [Qemu-devel] [PULL 02/12] checkpatch: do not warn for multiline parenthesized returned value 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" While indeed we do not want to have return (a); it is less clear that this applies to return (a && b); Some editors indent more nicely if you have parentheses, and some people's eyes may appreciate that as well. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Message-Id: <1561116534-21814-1-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c2aaf42..2f81371 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2296,7 +2296,8 @@ sub process { $value =3D~ s/\([^\(\)]*\)/1/) { } #print "value<$value>\n"; - if ($value =3D~ /^\s*(?:$Ident|-?$Constant)\s*$/) { + if ($value =3D~ /^\s*(?:$Ident|-?$Constant)\s*$/ && + $line =3D~ /;$/) { ERROR("return is not a function, parentheses are not required\n" . $he= recurr); =20 } elsif ($spacing !~ /\s+/) { --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356390; cv=none; d=zoho.com; s=zohoarc; b=BzX8Av0EsWp2flES57/8Pq+dzh3Gk1rzOt5RO0Nm2WIzpWEhWt1wxYtGJeNqP8WEKJnIRqdQveCT/vKgnKxoqkUGKmqouyLfJQpsYJvcwb6CHHceJyqZ54Wt+bAL1nKTSrGG4Ir+Jxb9jNriD54rPSj0TQ4n7h/1cvCo6eZBMJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356390; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=wzOpofdcurA5wsLNGyb10WqGKKid4Jy5IfhsoibOXrE=; b=OuFMbxoC9sajmu4FtkHLMFrXrDgL9ih+V9v0eJ3J4L0BDCm2426YF99tBxz9juUr/siEv33p8TqTIV/2zkIVjUnzYqGhpjsawC7AkfS1xBjLodmf94Ufi9AV2tcspPbStDAvHx7FSJTIYDiA0DkjhcT0oibinOdgudKXoa9N2gY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356390418119.99902235517675; Fri, 5 Jul 2019 12:53:10 -0700 (PDT) Received: from localhost ([::1]:55608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUGP-0007ST-6l for importer@patchew.org; Fri, 05 Jul 2019 15:52:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55603) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEK-0005MQ-TJ for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEJ-00046z-QP for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:48 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEJ-00045s-JK for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:47 -0400 Received: by mail-wm1-x344.google.com with SMTP id z23so10739997wma.4 for ; Fri, 05 Jul 2019 12:50:47 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wzOpofdcurA5wsLNGyb10WqGKKid4Jy5IfhsoibOXrE=; b=deLadFReWoQ+wOa5IMbrQ/6Q1t/6gkk1cgbBMoXNTUZETctEa5ePJFKmWcB/hCDZtQ Spc13rWheBLrgW5Xowg6AYeum15aje+sWHM/bC9jgR6NgGa3DM/OeYaXBUHfxgpkTPar XLTTHBsIRy+x+9PAZZ7nL/N2yzlYNv2DQAxN7Uo6fc51m+iQ34t3sj38ZAUQv8twAnXa tk04cEywYcEYH6s+9+9imVXEVYvmDMdp8MYZ8YYY50WIONdwN0KOs6ChH4o+vLO4t8Fx p3xR7M3LaYcVnILQvLKm7S1t5tT30df5Ox3b5I7mYt475vDo4HmM1MF7Z19EyoptB0wr L/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=wzOpofdcurA5wsLNGyb10WqGKKid4Jy5IfhsoibOXrE=; b=td8wUByxg4NhbAT1M1YHlROEDvyJp5jorxUhym4Qn0umDbowxLX7FsVjfk1fggvNhB pWevvsbBUp+1qyuqtsmmEzzswaZ7jiue8mkguWDLMckcPPRQtU5JVYOE7z74tMln/JAm hWG5dQV/26zYQXZNJwJEkoMaqtZej31D9aCPMQnY6MnKVqRYL2FYX53BfdrtTBngd4ie DKU1Z467fp26bl3bQC8sKRnOanwZSfYTwOYs8yfye3xZI52RumSkD0u2m3nMlplQiZN5 24V6DRvMMH7Q/hSx5pvTwcNVLKIlTqp0t/JHZbapEgtSKBd4pVGZbvaEtFWpJkAZnpz+ gDvA== X-Gm-Message-State: APjAAAVODNHPwJX81ULqfNFUBMxzhsGqOZe9bBnts7BNsTkictKVj4/B 5O+YU+GE8bskDPP/qF9qZ/qfeyQvdBg= X-Google-Smtp-Source: APXvYqzRuDOmuTU0rGU+QXKCB8FoGUa1e9/qhdc8/kEHw/fk+OSRvbt6jSUNwlpRoP+u2n23qV2zCg== X-Received: by 2002:a1c:4c1a:: with SMTP id z26mr4459640wmf.2.1562356246284; Fri, 05 Jul 2019 12:50:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:30 +0200 Message-Id: <1562356239-19391-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-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::344 Subject: [Qemu-devel] [PULL 03/12] i386/kvm: Fix build with -m32 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: Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz find_next_bit() takes a pointer of type "const unsigned long *", but the first argument passed here is a "uint64_t *". These types are incompatible when compiling qemu with -m32. Just use ctz64() instead. Fixes: c686193072a47032d83cb4e131dc49ae30f9e5d Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Message-Id: <20190624193913.28343-1-mreitz@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index e4b4f57..31490bf 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1043,14 +1043,15 @@ static int hv_cpuid_check_and_set(CPUState *cs, str= uct kvm_cpuid2 *cpuid, CPUX86State *env =3D &cpu->env; uint32_t r, fw, bits; uint64_t deps; - int i, dep_feat =3D 0; + int i, dep_feat; =20 if (!hyperv_feat_enabled(cpu, feature) && !cpu->hyperv_passthrough) { return 0; } =20 deps =3D kvm_hyperv_properties[feature].dependencies; - while ((dep_feat =3D find_next_bit(&deps, 64, dep_feat)) < 64) { + while (deps) { + dep_feat =3D ctz64(deps); if (!(hyperv_feat_enabled(cpu, dep_feat))) { fprintf(stderr, "Hyper-V %s requires Hyper-V %s\n", @@ -1058,7 +1059,7 @@ static int hv_cpuid_check_and_set(CPUState *cs, struc= t kvm_cpuid2 *cpuid, kvm_hyperv_properties[dep_feat].desc); return 1; } - dep_feat++; + deps &=3D ~(1ull << dep_feat); } =20 for (i =3D 0; i < ARRAY_SIZE(kvm_hyperv_properties[feature].flags); i+= +) { --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356662; cv=none; d=zoho.com; s=zohoarc; b=SS9lNkukxM4e4dviLKnVQQwOmD4R4aLM33TMKltDSBUu2ExAW6DR+Z1t2LVTIbBnMQFJ/Q4T5LUJMTvkFMkTErFZMpcDc4bIYMAFhb7yhW7Y99q9HFBR3V44Zi0FIvxb5n7ZK+d0DoKXk8twwO6Uq26v949Hzs8weqxoxABosvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356662; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6hb8qfyahz2ocOwlim+36bgUK6wk1cqH4qWGOP6ftsg=; b=OMH2fO2hImqs9Ij1WVn0KxMOzmetK0fv6a2vabIxWprKpCzR+I5Qj7/F6I6JSp1AZbo+j2VwRQd41SUamSbxzRjM/QZR6tV/2oj48fIIEI7CYpZbxh46m2nyblg7oGPrDvPy5h/J9oHueeC79lvVTBkKWmn4NocCncWNZ1uxpio= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356662631840.0635970367787; Fri, 5 Jul 2019 12:57:42 -0700 (PDT) Received: from localhost ([::1]:55658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUKz-0005Ya-JF for importer@patchew.org; Fri, 05 Jul 2019 15:57:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55616) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEL-0005MT-IP for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEK-00047d-JB for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:49 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:39337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEK-000474-Bj for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:48 -0400 Received: by mail-wm1-x331.google.com with SMTP id z23so10740026wma.4 for ; Fri, 05 Jul 2019 12:50:48 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6hb8qfyahz2ocOwlim+36bgUK6wk1cqH4qWGOP6ftsg=; b=rW3L7fRubvpVyJ/ynb3Q1h5xKG34MgHZ2fdUbY9ZWFxIHfb3wXqHjAeCEfKigIMel9 pncBY0xig6WO9ZDTDT280twf9HnpJMwW68glEr1mWSMugzzN+YNRSdCiBjjAjKmJsNKD NiYBNeCyJv51RkuCidfjb2BjoPESL+CS/CyCTdgeCGd+NrTt50BumIoVZQuf0we+BOQ5 oTTvftRPdPlLkjmiJNiO1f2h9WP1Ixq9qcm3GNtlWoN2rgFfN2UAbag6tNzSy+A4aeb1 0mjacAqnMt+2Ubg5XcV0Awooggv4BF2IdYtQcaG/v3aRyg2q6NJM8xTYlRdr2BBXOoZo SSkA== 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=6hb8qfyahz2ocOwlim+36bgUK6wk1cqH4qWGOP6ftsg=; b=LfsAHYsN52/I9+bXaanKnJHjAsRCcFxJhdAy61NGqL090H/1EMyfBvW5ATBUdf8EID 60ngMPJEzwYr7b1d7Ned4DN32UUtlAaD0Nkx8rbkOMqWCbkNIlM7wSk/ajIJT/63nhwD 7IOhXXcFrgAn3oCNeGEW9SIzATfYZoW61aY7rnde8HfY1f4mwgJTy51iZvH6zNEf7uas Blw5ftYB5rtFIGCETWgmIERwhZ64gTt08BXRGJn9X8s1njhoutgrHgFkDr0gOWuz283T YdJuJ9QYXc8GB9f/d4NO3zyPVu3cBeCEq58KGsgPa+E7dV4tel4Dv1KpHe0rvy321EbS Y0fw== X-Gm-Message-State: APjAAAVN+F0g+UL8xNbUynDkMcY1c/XAHMbbwcWNWk2MIJuIV2hz8pSy hjs6NwAcg1pkdqwcQ38W1/y3bDb5jO8= X-Google-Smtp-Source: APXvYqwfL1UWqriwB0vdH/n1KdL+XTAIsYbVV+KdYMEOSvhyFSrHSOOP3cmH77+YVFxlhmUTfMo4Rg== X-Received: by 2002:a7b:c7cb:: with SMTP id z11mr272229wmk.24.1562356247207; Fri, 05 Jul 2019 12:50:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:31 +0200 Message-Id: <1562356239-19391-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 Subject: [Qemu-devel] [PULL 04/12] intel_iommu: Fix incorrect "end" for vtd_address_space_unmap 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: Yan Zhao , Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yan Zhao IOMMUNotifier is with inclusive ranges, so we should check against (VTD_ADDRESS_SIZE(s->aw_bits) - 1). Signed-off-by: Yan Zhao [peterx: split from another bigger patch] Reviewed-by: Eric Auger Signed-off-by: Peter Xu Message-Id: <20190624091811.30412-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/intel_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 44b1231..719ce19 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3379,12 +3379,12 @@ static void vtd_address_space_unmap(VTDAddressSpace= *as, IOMMUNotifier *n) * VT-d spec), otherwise we need to consider overflow of 64 bits. */ =20 - if (end > VTD_ADDRESS_SIZE(s->aw_bits)) { + if (end > VTD_ADDRESS_SIZE(s->aw_bits) - 1) { /* * Don't need to unmap regions that is bigger than the whole * VT-d supported address space size */ - end =3D VTD_ADDRESS_SIZE(s->aw_bits); + end =3D VTD_ADDRESS_SIZE(s->aw_bits) - 1; } =20 assert(start <=3D end); --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356517; cv=none; d=zoho.com; s=zohoarc; b=JvDHz58kzyOwqVZpX+QL+lUHO04gMGVBVtq2jrInAveHdvfDLKNiKDppP0FBfEDl4oET0xCsWVFIVlt1KNs/Q0q2aulyMKgopQXRrk9zQQ29oyzbSC2kCW5WpFgci6froq02pKIN12VsNXJ2YWQckOvF5teOTUNj+hrI+BXvUm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356517; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=YbMFVYWCeviKweLwBNufDDcBIGFAoGlnFAeGpWGi3rw=; b=j/XEFCT0Kow9/f/qMRZg4yyuNodJcE+FblnMleVGwxT8UCV04cBQv2kBS7zktokSqTRtkqgjBygIhrSVoBlzj2ymtKnnLxw3Sw71Fdeh1q1q7rjTN+T3/JIAh9twzzzb6xW59Vslc8GB2L0BbCjaWRMGE/XR4RxQfI+HDZZ4AXg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356517209853.0920281298793; Fri, 5 Jul 2019 12:55:17 -0700 (PDT) Received: from localhost ([::1]:55632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUIe-0002HO-10 for importer@patchew.org; Fri, 05 Jul 2019 15:55:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55631) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEN-0005RV-7X for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEL-00049o-Tl for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:51 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:35417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEL-000485-Lx for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:49 -0400 Received: by mail-wm1-x330.google.com with SMTP id l2so3468596wmg.0 for ; Fri, 05 Jul 2019 12:50:49 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YbMFVYWCeviKweLwBNufDDcBIGFAoGlnFAeGpWGi3rw=; b=qE9W2cIL23CVTGW+X14b90rTfKOUhIlYYXjIAK8YD3iypSxlE82hInzAS1Znvz/o1e OPoiWMXtE9fJayXuphV0drkNMS+xKkDbUumidYBHuqsMKIC6S5/EgbAISWRdf4xDa42L yM6Pxslvny15/Awhl0MtyHhaP4umf1u+cSyu5q3v2ma15lFUGegRi5eNGQb3AqTzaoHj vRRKFhBiA4AeXEOeh2Pkw4VoG0oWt4T0TAXsoBtl2IKubot16wQ2QVGgFquPZW3H4hAb jdj02khXtZ/OL6evzY+Sl1fw6oLYfe5dXe1QV5yJNI/akI4VuQjR3x9F/HjUI0SfI2MV uXKw== 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=YbMFVYWCeviKweLwBNufDDcBIGFAoGlnFAeGpWGi3rw=; b=lLL763Qi813Vd9pzcw+djlBE4Ark4/yNt5lPRsbrRLFTC7wdQvltki6tg7I7EXMUXz wkwJ10MnPqVx2pvYgBYHgPwEvyieA6S5zVsYCqtAU1EaDJzKE6/2PsJ6F9udf7h4J/cQ LyL0wVYXZ+QWtD9yte0McsrA051d8vjHGx4ZYr3GmzWxYnAxBPIzWb77w1K/KI58iZ49 21vTwAyG6uqpKLho/M5Qjlgdfz/AZgmNQHO2KhiSBDAIVF7EcJJjho4PgO+lzNYXhicS HuzJbL7fWZ0MGTCk5Zm7tqGF/YukXdGShJxdF+WPMsqEH95r82OG+mrzyWboFuHlxiHD qrPQ== X-Gm-Message-State: APjAAAU22J70nCwKr2QNw1EODlyEuZq2TCYBMtw55nm/HetlSS+C8HEO /zpgZRJ8zZs/ZAsFpu3/E4Se3dicRb0= X-Google-Smtp-Source: APXvYqwEyitwbtNRDOID1X7VFatWnWuQRkvLRpu2pvbM+42pyKqc+olna+JN9w2y5HRLw6DhlavX6A== X-Received: by 2002:a1c:f519:: with SMTP id t25mr4633720wmh.58.1562356248249; Fri, 05 Jul 2019 12:50:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:32 +0200 Message-Id: <1562356239-19391-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-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::330 Subject: [Qemu-devel] [PULL 05/12] intel_iommu: Fix unexpected unmaps during global unmap 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 Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu This is an replacement work of Yan Zhao's patch: https://www.mail-archive.com/qemu-devel@nongnu.org/msg625340.html vtd_address_space_unmap() will do proper page mask alignment to make sure each IOTLB message will have correct masks for notification messages (2^N-1), but sometimes it can be expanded to even supercede the registered range. That could lead to unexpected UNMAP of already mapped regions in some other notifiers. Instead of doing mindless expension of the start address and address mask, we split the range into smaller ones and guarantee that each small range will have correct masks (2^N-1) and at the same time we should also try our best to generate as less IOTLB messages as possible. Reported-by: Yan Zhao Signed-off-by: Peter Xu Reviewed-by: Eric Auger Tested-by: Yan Zhao Message-Id: <20190624091811.30412-3-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/intel_iommu.c | 67 +++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 719ce19..de86f53 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3363,11 +3363,28 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s= , PCIBus *bus, int devfn) return vtd_dev_as; } =20 +static uint64_t get_naturally_aligned_size(uint64_t start, + uint64_t size, int gaw) +{ + uint64_t max_mask =3D 1ULL << gaw; + uint64_t alignment =3D start ? start & -start : max_mask; + + alignment =3D MIN(alignment, max_mask); + size =3D MIN(size, max_mask); + + if (alignment <=3D size) { + /* Increase the alignment of start */ + return alignment; + } else { + /* Find the largest page mask from size */ + return 1ULL << (63 - clz64(size)); + } +} + /* Unmap the whole range in the notifier's scope. */ static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n) { - IOMMUTLBEntry entry; - hwaddr size; + hwaddr size, remain; hwaddr start =3D n->start; hwaddr end =3D n->end; IntelIOMMUState *s =3D as->iommu_state; @@ -3388,39 +3405,37 @@ static void vtd_address_space_unmap(VTDAddressSpace= *as, IOMMUNotifier *n) } =20 assert(start <=3D end); - size =3D end - start; + size =3D remain =3D end - start + 1; =20 - if (ctpop64(size) !=3D 1) { - /* - * This size cannot format a correct mask. Let's enlarge it to - * suite the minimum available mask. - */ - int n =3D 64 - clz64(size); - if (n > s->aw_bits) { - /* should not happen, but in case it happens, limit it */ - n =3D s->aw_bits; - } - size =3D 1ULL << n; + while (remain >=3D VTD_PAGE_SIZE) { + IOMMUTLBEntry entry; + uint64_t mask =3D get_naturally_aligned_size(start, remain, s->aw_= bits); + + assert(mask); + + entry.iova =3D start; + entry.addr_mask =3D mask - 1; + entry.target_as =3D &address_space_memory; + entry.perm =3D IOMMU_NONE; + /* This field is meaningless for unmap */ + entry.translated_addr =3D 0; + + memory_region_notify_one(n, &entry); + + start +=3D mask; + remain -=3D mask; } =20 - entry.target_as =3D &address_space_memory; - /* Adjust iova for the size */ - entry.iova =3D n->start & ~(size - 1); - /* This field is meaningless for unmap */ - entry.translated_addr =3D 0; - entry.perm =3D IOMMU_NONE; - entry.addr_mask =3D size - 1; + assert(!remain); =20 trace_vtd_as_unmap_whole(pci_bus_num(as->bus), VTD_PCI_SLOT(as->devfn), VTD_PCI_FUNC(as->devfn), - entry.iova, size); + n->start, size); =20 - map.iova =3D entry.iova; - map.size =3D entry.addr_mask; + map.iova =3D n->start; + map.size =3D size; iova_tree_remove(as->iova_tree, &map); - - memory_region_notify_one(n, &entry); } =20 static void vtd_address_space_unmap_all(IntelIOMMUState *s) --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356386; cv=none; d=zoho.com; s=zohoarc; b=Qd517JwCb6iFY6GFUDsuTf6EKJFCsC+u5JAJhyd6wYnTIm+kHa+1mFO8mpkHr8iR9yMAv3pa85uPeUlQlg9uBNd71gEesg2xnB+bU+chree+A1wj1y+1E9XJ115QTAw7y+0hs0RvLQZ3GFcybp0xcSe9NRehEmhN0au0Hq3UD8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356386; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=yDJUvL9nWhLhts5GRxzh+3OuJBbBUiS1ssTSFuvIqR4=; b=L4Zn1qQlhkn6Y8/7OGzRswJXJznrkvv+4fch9fSqzTDb1j+7vMr9cE5Ir0aXNaqJzg02aEFDFb4cEbevHV7vG136pUm7q+e9/pVo1EmN/WU+cZ93rcqyvemWBS9GNJv57FstXzHVwt2hPtwn83OQpvkL23fK/g+iZMtTQdN2t08= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356386099776.9751710055731; Fri, 5 Jul 2019 12:53:06 -0700 (PDT) Received: from localhost ([::1]:55611 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUGR-0007af-R8 for importer@patchew.org; Fri, 05 Jul 2019 15:52:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55638) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEN-0005Sd-Pc for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEM-0004BJ-Kq for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:51 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEM-00049F-EZ for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:50 -0400 Received: by mail-wr1-x430.google.com with SMTP id g17so823217wrr.5 for ; Fri, 05 Jul 2019 12:50:50 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yDJUvL9nWhLhts5GRxzh+3OuJBbBUiS1ssTSFuvIqR4=; b=fxLeZO+7AFx4RLsW1Py7PqJ9GRusLAGI09wVD/k7KO9DRnwKEMl40K1xzy9VefrDl4 66O1sLDFLMFacqTaMAoFeSD0okyRXROEXmkr9wvd81i6P9hJPSQHwSdipKO+Il5XwYV8 k1321fQRfWhQHnDDDqmv5uDmcgGsIwMpft08hgxcdGULWfhgeD4LIiP6DdCKPZPO8Dye Se6ngm1ekbCdvhRelA762EMJs3pI5bGW3NfGl0wSifqOghqTHlDzEeMCAoBVSKuxJknn oN8Rm5Yd2bTQWkni3butBWHPV7Zv982kJ5wlo5m+dmM1sVOpr6pG+mGTOj1rB60nbjAx efrg== 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=yDJUvL9nWhLhts5GRxzh+3OuJBbBUiS1ssTSFuvIqR4=; b=iN59Vvqqtewcp7SvnzntG7z6UEh3UWxCAXDuLYXYVhlb8bPi/xbdBgBXvv/Jbh3JJD Fo+j8AgPW5twOpx4Fs7WmHmpvPv+9KseOUTF8AKvC/47pNXC79x+I8ljM0B9Lqep5K+d DWKt7EzxwWkZyRbBItW48C6udUUbuHpynVD8VktZ2bKmbYTAb2Mqbem4K6PQEIO+6Otg hQ60veaXljysMfyczB7dB/aV+kO6+X9++HDG3piLtS+8Aeq37X6UznFjvL4JY7LoWX8G /QyAT2FuwBf1PxKnkfVSK6PsvUpLICkbKe9B83nkEYh2eVMnIcqCVVc4rt6cZ7nHQlhN +vdg== X-Gm-Message-State: APjAAAVNcqKejSgPy/XBgPa6HaZmWHkJPN84I1jI6YVuD+1aTDPYoCv6 mki2XAXdJYXBU0zTgSWI6f7qpMnGC4U= X-Google-Smtp-Source: APXvYqwgbBF2ys4oZAz2MtCSLDPambQZM5LdOHxfNyK+PPz+dNjnNGhe0wmuxnLVtxytT4/1pJ0izw== X-Received: by 2002:a5d:438f:: with SMTP id i15mr5207861wrq.37.1562356249171; Fri, 05 Jul 2019 12:50:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:33 +0200 Message-Id: <1562356239-19391-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 Subject: [Qemu-devel] [PULL 06/12] ioapic: clear irq_eoi when updating the ioapic redirect table entry 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: Li Qiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Li Qiang irq_eoi is used to count the number of irq injected during eoi broadcast. It should be set to 0 when updating the ioapic's redirect table entry. Suggested-by: Peter Xu Signed-off-by: Li Qiang Reviewed-by: Peter Xu Message-Id: <20190624151635.22494-1-liq3ea@163.com> Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 7074489..db9e518 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t va= l, /* restore RO bits */ s->ioredtbl[index] &=3D IOAPIC_RW_BITS; s->ioredtbl[index] |=3D ro_bits; + s->irq_eoi[index] =3D 0; ioapic_fix_edge_remote_irr(&s->ioredtbl[index]); ioapic_service(s); } --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356667; cv=none; d=zoho.com; s=zohoarc; b=Vmx+cwB8jI3vFnusGyLyVH4EKhzhqrQ1nx2w8VYfR7Y8ZAsTXKdVNZFZYviKOrwvUxrHlV+UYutk3sIgz4sGFlu22LiOFVta66HhwIMNg8HgkVTqA6xvP9+w9+03ttjng+9EbAThOfrrUedKubmfMxxWpMGJkoNbe3WqEwVLqLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356667; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=NL1qamEi1SWCxCZDQ+Ft1vPKiyaKCd/QL3Bjak1vxXQ=; b=YkFid8DksYlCflRg094aryKFenb6AlaIb5yMktzJXHnBg+ROMTtYHJr4hESFtoAhZLlu5m6FgTvtag4hvjIwoSX89Pa7EgSur/a707xvUAziBz3LCWcNYh3gtqIX5JwGwqiefdfevZBbkjY3sMKpw/WV5rOZH9UMyugQSCZ4/Ao= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356667192409.9621768072184; Fri, 5 Jul 2019 12:57:47 -0700 (PDT) Received: from localhost ([::1]:55660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUL4-0005k3-4o for importer@patchew.org; Fri, 05 Jul 2019 15:57:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55652) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEO-0005Ur-Ja for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEN-0004By-Iz for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:52 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:39196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEN-0004BO-CY for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:51 -0400 Received: by mail-wm1-x342.google.com with SMTP id z23so10740108wma.4 for ; Fri, 05 Jul 2019 12:50:51 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NL1qamEi1SWCxCZDQ+Ft1vPKiyaKCd/QL3Bjak1vxXQ=; b=fxJZ3Yoqg8OHwz53erMfDvAHc5CGSxdzOcMQ+kT3NQyCpD5BmplEnSVWGgJZs5hSEc 15tBoG21dneEE+K24cQQ/qEdkEqqBicBHf46O+IeR9wzgdWKsJe0D7nIF5/g67Ze2DV1 OUbfVUdHbPXuBfWN70bKvNYMs3jlPL9TdBaw1ntdB2+Vb2sXPurSg9NlGrOlc7jc/Wgr if0nnkHUT2RDd5W16earw6sPNlUKA+IhZoCJNF4IN/2ihD3T7w9kSt7+EhqLxIZfj68B tI2Q5/5Up+XNQP8PWbK5fmztDkOcCAtlBxkiAIwkLG7lcqDWPtjZV6xiHYNt/vvJudSz 21GA== 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=NL1qamEi1SWCxCZDQ+Ft1vPKiyaKCd/QL3Bjak1vxXQ=; b=kI9ta6WI1N/yFrElgb9KJCebyAiDBlIS2tjpv9udTSvLwbJ4L7DMOro21hA29198S4 5edQo+Xo+/xLWhf9MbHEGy3wH2V3HTFJtihqK4J4BGK3wQQZFM7siEmB9ZFpzKQi5oS9 sRDfQ8HHLTmwVdTHVhd2lER1ZHDRTAuKs7snUqkFP5jY/yDhurbNdAtQZxMiaRjHqvT/ t0PVbY9Kbo0GZQQZci2KOjCW7QDCrLC8JfL9pBx/HTfTWfFqdGSxHMvL3IL36fWhCUw3 UVhxbYGG/PVqCeiOEdDM5WLC8PKaQPf1V5QcqQUI/ZCE+PtQ9FPedu6mqo6e6wqWuE9w QFnA== X-Gm-Message-State: APjAAAXmASaqhwLWV0CIiimY5gSat9WLucZdysQFJ7ewr9hE1wdae6CT koMSLRndG8YKLJgPRIddZMQS4tDkm1k= X-Google-Smtp-Source: APXvYqzdysGP6KWHtcfyiy+5CHe7kwFtrdzJ67i/12GsoyxT8it3L1g9cH3yJdMOXRBs9oJH9onegw== X-Received: by 2002:a1c:9dc5:: with SMTP id g188mr4670924wme.93.1562356250131; Fri, 05 Jul 2019 12:50:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:34 +0200 Message-Id: <1562356239-19391-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PULL 07/12] target/i386: fix feature check in hyperv-stub.c 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: Vitaly Kuznetsov , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Roman Kagan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Alex Benn=C3=A9e Commit 2d384d7c8 broken the build when built with: configure --without-default-devices --disable-user The reason was the conversion of cpu->hyperv_synic to cpu->hyperv_synic_kvm_only although the rest of the patch introduces a feature checking mechanism. So I've fixed the KVM_EXIT_HYPERV_SYNIC in hyperv-stub to do the same feature check as in the real hyperv.c Signed-off-by: Alex Benn=C3=A9e Cc: Vitaly Kuznetsov Cc: Paolo Bonzini Cc: Roman Kagan Message-Id: <20190624123835.28869-1-alex.bennee@linaro.org> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini --- target/i386/hyperv-stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv-stub.c b/target/i386/hyperv-stub.c index fe548cb..0028527 100644 --- a/target/i386/hyperv-stub.c +++ b/target/i386/hyperv-stub.c @@ -15,7 +15,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exi= t *exit) { switch (exit->type) { case KVM_EXIT_HYPERV_SYNIC: - if (!cpu->hyperv_synic) { + if (!hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) { return -1; } =20 --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356783; cv=none; d=zoho.com; s=zohoarc; b=el0d2zL457T/VSqa7KUmZcV9yvZX2058BR8Bfez9/mRhcE1Vtiz7dNFddP7a2tMypc9ppnnKRpm4KHBUAX74G97UV/M8qF5v7BjJJz97Q1afuPaG6Ln8odlwFs/okuzTDN7uOT1r4DFaSxPsw+BIpZ1Qf98SGphNK9LzNjtHcHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356783; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=hD3kbFvZZ3EzTHJ9PgPfFOKh05+UxEjCQiiQlxvG2pQ=; b=Tt6HUHI9Ys3PKvFNEFQekjNqZulTbsA7gS485ZW4nN6eHm5fqg5wsdIszTPhqU/E5NGq1Ezq0p+IFCqyaBFzJY1Bsh3rTxlb/5+JHRJOoMA9RYrSzxMGEDftrFyNzixzGSfwD6eS6pCs/dkWHOOyScW3Frbx2+Pi2SDRwrLUHgQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356783807253.68767048941515; Fri, 5 Jul 2019 12:59:43 -0700 (PDT) Received: from localhost ([::1]:55672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUMu-0007Vg-Ot for importer@patchew.org; Fri, 05 Jul 2019 15:59:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55663) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEP-0005Wx-DY for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEO-0004Cf-Eu for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:53 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:53116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEO-0004C4-8G for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:52 -0400 Received: by mail-wm1-x32f.google.com with SMTP id s3so10219422wms.2 for ; Fri, 05 Jul 2019 12:50:52 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=hD3kbFvZZ3EzTHJ9PgPfFOKh05+UxEjCQiiQlxvG2pQ=; b=L/GazzT1zkbF8TSIvZubIFTiW3kJakHnSA1vULketHlMfw8D+3r8kaK9Qy8tWRok+t H/5pMy/Ki9O4917VesFP4Loigy53kkRO6gA47VxT+cCHpsvpITLxjCJnHZP2dGO6PTmK c1gSE9FygVfN0P0i47Jd6TXKbVVH5+LBkEssUiFHYOptZf4vtUsbAfyZenCFaLSwH6Rb zIIvrygXu0l/Qeo+hXzj4I1DAApGq3OG6f3w2hveUU6vIJ9Gg2KYiTYUqfJvlzSY8dST Nu4PCWG3UDXXrddHtDFMEuok5BudXp+YK5dUIelLHnNWoDMzA4XjmqeiGEgcbHvtUG5t d2jQ== 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=hD3kbFvZZ3EzTHJ9PgPfFOKh05+UxEjCQiiQlxvG2pQ=; b=KRwvT64m1dIg1ztatUaptJF7+r4A8vi/c9ua3mk5hT5bDN/0ideln9+c5t6Vd/jHfs qihc37//zkOMv1dyGl+sx5fP3AZUJdFiGQWMLMNQcwhSOsLmaQwoVxC4EeNas/HBhH1D KDos9j/HK2sOxl7548onU3929BEoCpHdz/Rv71GSlnJkGe9tNqCfO32wLr1YyPXDkwDZ w/Ys6ZhhlP6oVZ7Lx+/pz8tItPL8AfJkQ5Hv2qGAWOfaskTX9vAXVdkOL7ZRydsTO2oJ GDv/Ql+9SBUT9ao+7uvMqffoUPK0IyDDhUAtF1b31/xfSVQyWl0LMu89DLTxaZjGHYij zOJw== X-Gm-Message-State: APjAAAXA6XuyJkfffKTmpamhYc9U3JNjiaxS894Q7D0OnZs+tbD9jqXS u00U45i+k+g6jvZUHvfofCzavPdOr4k= X-Google-Smtp-Source: APXvYqylYBEzGDQiSd2QkNJXu37b3cEiULeK6+TfCGuLRnhU13Bg5ZcGTTrwNY/A+lo6LNotYV+YMw== X-Received: by 2002:a1c:9c8a:: with SMTP id f132mr4516690wme.29.1562356250974; Fri, 05 Jul 2019 12:50:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:35 +0200 Message-Id: <1562356239-19391-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f Subject: [Qemu-devel] [PULL 08/12] minikconf: do not include variables from MINIKCONF_ARGS in config-all-devices.mak 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When minikconf writes config-devices.mak, it includes all variables includi= ng those from MINIKCONF_ARGS. This causes values from config-host.mak to "sti= ck" to the ones used in generating config-devices.mak, because config-devices.mak = is included after config-host.mak. Avoid this by omitting assignments coming from the command line in the output of minikconf. Reported-by: Christophe de Dinechin Reviewed-by: Christophe de Dinechin Tested-by: Christophe de Dinechin Signed-off-by: Paolo Bonzini --- scripts/minikconf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/minikconf.py b/scripts/minikconf.py index 0ffc6c3..3109a81 100644 --- a/scripts/minikconf.py +++ b/scripts/minikconf.py @@ -688,11 +688,13 @@ if __name__ =3D=3D '__main__': =20 data =3D KconfigData(mode) parser =3D KconfigParser(data) + external_vars =3D set() for arg in argv[3:]: m =3D re.match(r'^(CONFIG_[A-Z0-9_]+)=3D([yn]?)$', arg) if m is not None: name, value =3D m.groups() parser.do_assignment(name, value =3D=3D 'y') + external_vars.add(name[7:]) else: fp =3D open(arg, 'r') parser.parse_file(fp) @@ -700,7 +702,8 @@ if __name__ =3D=3D '__main__': =20 config =3D data.compute_config() for key in sorted(config.keys()): - print ('CONFIG_%s=3D%s' % (key, ('y' if config[key] else 'n'))) + if key not in external_vars: + print ('CONFIG_%s=3D%s' % (key, ('y' if config[key] else 'n'))) =20 deps =3D open(argv[2], 'w') for fname in data.previously_included: --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356520; cv=none; d=zoho.com; s=zohoarc; b=ccG6rjOHoh+yMIIvgfkq+vOD2nLqA1UgQJjQ4i2DTcj7Fc+qlURqnP1Z4E+ybucVxgu5ToUZQy3tTDJ6GZKcee72LA7YsE2VZqnrB289o/UQgU/XEg+jeqRL/Vc+Rtlu+VUln25MW3XEODg2fYin0MrBq3F2q0Cehj36KsRkKaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356520; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=nGP6eZIaEEL9ZLlHFLCaXkoGmlAr/CGBsahr5o33XQrngjB3wSva5t7NDAImZ6P8aIAT0DsSm9AWrq8GtSYlp7d+t7TnRxwhcdvu91aP8LkH7r5F5xXBwgeCGGdSn+MTpUhuY7XDHF50ctFuAYpFwfaNOz59KglpWpyd8N1fHbI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356520437885.6637983208848; Fri, 5 Jul 2019 12:55:20 -0700 (PDT) Received: from localhost ([::1]:55634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUIh-0002Re-AT for importer@patchew.org; Fri, 05 Jul 2019 15:55:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55674) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUEQ-0005ZP-A6 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEP-0004DB-D2 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:54 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEP-0004Cj-6U for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:53 -0400 Received: by mail-wr1-x441.google.com with SMTP id a10so9869667wrp.9 for ; Fri, 05 Jul 2019 12:50:53 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=uJrrVdOk7q43i0HZsmCIPUc/TBYmv9/RHoDKVZZoLoKvFfSlrGtrySIM0vfpPf2C4X IhNU/vw0drcBOHJNn4pINAdwlMa+DlDi7HjXS7kQlI0M9lcWQElLH9TOKi9KGeV4qpfl XOCRjqAYNQQ1DyncI0e9hU7y42G+T3Cs5/9/vBjRUpCM/1ODrQBrrB4jCWxw2RWuFbIv gjrEZdcY6Vxw2eiQWbAa8LjsTVTqg1RQ8OLLb80CT0Jspbwpb4MSuB5og31E21zMZ2Nj vVSpvOeRfcmWYc7g6gIoVyuLE5Jr3bZQcxZUpIYvsEARJ4dpYcIuuVLyQihwXngB7G3B nAoQ== 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=JvV1iVqyAdHF++s4qbNgPhXah3+qiDNHrezSixoPhkU=; b=hd6sqJZlC5D/JKiW9CyLbhPmle4fjazEJvt0UbKuq7toY4Mz2ABZLijS9rzF7eHLJx RA1XD48kJFm2rN8iq2GC6aZ5uz/XeKF4SGpVn/O1Ge9sNOf/yMcQVjr/OrZPIrOffVAy xGxnrvqNFlEPo7FFj1/Eh+9J5PQXj5O2A45Wj6yH8/QLlehDBbdX1guppIK834kdxYml DGtv7PtU66ogSzyFfAbO1lpIijbyo0Ta66hkntX8hPuIY0pVA8zwBgI59p/NHuDTY09U 4/9wKKxrhIoDuFjqY0gTosZ3Alm5Hjwvgoo6HhOYVOmrimE82cGByun0YHFQ9fMSI1ss drqA== X-Gm-Message-State: APjAAAVUj85fojgZenjmziDu6/i9xMjEaN3DP4WkUlaXFy9njrTPY6AI Rwedg3kp911Mwr8UU1y7z5Jjg+EeI20= X-Google-Smtp-Source: APXvYqy6aaKv2FTeR8AcrAMfDyJTfOPqmnt9qnEPkjb0hUjRQlgbkyHFVESRpa+i/c9QR6huE+NGrg== X-Received: by 2002:a5d:6949:: with SMTP id r9mr4903101wrw.73.1562356251921; Fri, 05 Jul 2019 12:50:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:36 +0200 Message-Id: <1562356239-19391-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-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 Subject: [Qemu-devel] [PULL 09/12] target/i386: kvm: Fix when nested state is needed for migration 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: Liran Alon Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liran Alon When vCPU is in VMX operation and enters SMM mode, it temporarily exits VMX operation but KVM maintained nested-state still stores the VMXON region physical address, i.e. even when the vCPU is in SMM mode then (nested_state->hdr.vmx.vmxon_pa !=3D -1ull). Therefore, there is no need to explicitly check for KVM_STATE_NESTED_SMM_VMXON to determine if it is necessary to save nested-state as part of migration stream. Reviewed-by: Karl Heubaum Signed-off-by: Liran Alon Message-Id: <20190624230514.53326-1-liran.alon@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/machine.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/i386/machine.c b/target/i386/machine.c index 851b249..704ba6d 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -997,9 +997,8 @@ static bool vmx_nested_state_needed(void *opaque) { struct kvm_nested_state *nested_state =3D opaque; =20 - return ((nested_state->format =3D=3D KVM_STATE_NESTED_FORMAT_VMX) && - ((nested_state->hdr.vmx.vmxon_pa !=3D -1ull) || - (nested_state->hdr.vmx.smm.flags & KVM_STATE_NESTED_SMM_VMXON= ))); + return (nested_state->format =3D=3D KVM_STATE_NESTED_FORMAT_VMX && + nested_state->hdr.vmx.vmxon_pa !=3D -1ull); } =20 static const VMStateDescription vmstate_vmx_nested_state =3D { --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562356669; cv=none; d=zoho.com; s=zohoarc; b=clwCT0qIKhqcKo6mzAZBg10g5loZy/pShgpP4CAgjDtAIEeRJJwnLOqx89xAd7froU6SBx5xOP7twgCoN7/0fBgefArtDYo7j+h30b+jmKcoDBc7dBIElW7+finxTkGhU9IxbFmq3pCbUi8LsDrTUC2kfuVv11uHma38RI0yRNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562356669; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=SPExf4yDsumfqyFIHIT50jMK4mdhNlTATWWdAQczcRU=; b=jIsvEWkvOuEqqTApXLHX+Qn1+VKX53w34nl2hWIbVqcpwV7EvqJePjPpU97N9FBQ2uGwKw0LMCcdIU7cU/a+I/FEwfl2C5WZ4bAxYVFjLxX9taW0eSkGvPIa3tILJhvw6SLaEOJZCQjjG2Us48fM7Nwqs94E3mbDClxLXFHRItE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562356669422822.5247200883942; Fri, 5 Jul 2019 12:57:49 -0700 (PDT) Received: from localhost ([::1]:55662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUL6-0005oA-AS for importer@patchew.org; Fri, 05 Jul 2019 15:57:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55687) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUER-0005ci-Fx for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUEQ-0004E4-FH for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:55 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEQ-0004DI-8l for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:54 -0400 Received: by mail-wr1-x42c.google.com with SMTP id n4so10988493wrs.3 for ; Fri, 05 Jul 2019 12:50:54 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SPExf4yDsumfqyFIHIT50jMK4mdhNlTATWWdAQczcRU=; b=r0EsWzym8DRq+tQDvJWeK2r8kpvG/HRHDBLLDnKc1no3EyQZPMyg1dU59vzc+KmH5I +7SlSow5GViq9pzZiqRp9fhhpqPVQrdWJIhfnjU/OmNAWmBKs5ZF2Vxe5QUIFq3bcm6+ Q3ZY5jDpQ0rPURMoLJDIC+ZQV27jQwuhP3/3I4Nd+vraClbaBfMALTucdPFWDeBAzDw6 YEsJZ0BBz0Y7QGC2rnbfNaFTazvYMyfPTSRqgpJ/24Pbty6PvrPJytfb6o6qSs+0rVOs 5lEhWmMHX1jTpG71tupu5eMlynEcl2tIGJ+Ugu73RJawqitm5rUOQRq2cW8KWw1ohAzP k1TQ== 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=SPExf4yDsumfqyFIHIT50jMK4mdhNlTATWWdAQczcRU=; b=UNxQSKtCLlBqzSvMXi2hZS9PRZn4S+xTJQVnh9litcCyFT1J6KRMVlkVlkRe/zH/7J t7CgYXUv5KrclPLYXFRez1Z7DNAPtes2xGG6c7pUvuJ2OaH2YahBPsZqmpYR3F0XQwy0 KSMonMexz8JjiTq2IlP+mCdf2ok17alCFIwgtZG2bSRxtfx2+zUGt9QsG02ZMON+gXRo As8QP8AT/07YVzTCXNyTBa7vhHWTbZMQRWPkiKqwxfG2GQG8WOJHrif4WrmemJEeDFGG 3QQUK1pfk/cpH03Q+kBAvJ0MapOPBwypQGBqONbWy8wTCT51+iGN11jggRjOccdp7DGd WDDw== X-Gm-Message-State: APjAAAWu1vgaaNvu7SPE1KI1gUUYnBMI66HeDnf96L+o+SMxwQUf9Eli vvgH1/3fLDsRzRqv/Nav5OStKMqDn/s= X-Google-Smtp-Source: APXvYqxWhQd3ByMpzrY+K5JmWRAaPZr86sPYmCKIxQbsLqu4pdxSHObrDkujHECafv7LkYZr22QO8g== X-Received: by 2002:adf:fb8d:: with SMTP id a13mr5226223wrr.273.1562356252789; Fri, 05 Jul 2019 12:50:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:37 +0200 Message-Id: <1562356239-19391-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL 10/12] Makefile: generate header file with the list of devices enabled 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: Julio Montes Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julio Montes v2: generate config-devices.h which contains the list of devices enabled Message-Id: <20190705143554.10295-1-julio.montes@intel.com> Signed-off-by: Paolo Bonzini --- Makefile.target | 5 +++++ scripts/clean-includes | 2 +- scripts/create_config | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.target b/Makefile.target index 72c267f..25383f5 100644 --- a/Makefile.target +++ b/Makefile.target @@ -45,6 +45,9 @@ include $(SRC_PATH)/tests/tcg/Makefile.include config-target.h: config-target.h-timestamp config-target.h-timestamp: config-target.mak =20 +config-devices.h: config-devices.h-timestamp +config-devices.h-timestamp: config-devices.mak + ifdef CONFIG_TRACE_SYSTEMTAP stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace= .stp $(QEMU_PROG)-log.stp =20 @@ -171,6 +174,8 @@ generated-files-y +=3D hmp-commands.h hmp-commands-info= .h =20 endif # CONFIG_SOFTMMU =20 +generated-files-y +=3D config-devices.h + dummy :=3D $(call unnest-vars,,obj-y) all-obj-y :=3D $(obj-y) =20 diff --git a/scripts/clean-includes b/scripts/clean-includes index dd938da..fb05a63 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -161,7 +161,7 @@ for f in "$@"; do # Remove includes that osdep.h already provides perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ || ! (grep { $_ eq $1 } qw ( - "config-host.h" "config-target.h" "qemu/compiler.h" + "config-host.h" "config-target.h" "config-devices.h" "qemu/comp= iler.h" diff --git a/scripts/create_config b/scripts/create_config index d727e5e..00e86c8 100755 --- a/scripts/create_config +++ b/scripts/create_config @@ -58,6 +58,8 @@ case $line in name=3D${line%=3D*} echo "#define $name 1" ;; + CONFIG_*=3Dn) # configuration + ;; CONFIG_*=3D*) # configuration name=3D${line%=3D*} value=3D${line#*=3D} --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562357058; cv=none; d=zoho.com; s=zohoarc; b=Bb6of/luGZfP/iD4vtC9znQ6x/0877yUjZhg8AoOqeCUKq2N4OgbeYsw+mmoLKUU6j4gDt6MKkza7lpycw9LAWQIKsv/s3Wkrv1TCEKP5igIzwIKtxISeM5pRC8TZVKdW+avnyUjIqZruXSE1UTKUeC6PYrdPoIVwrqIUjzRp1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562357058; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=f5eaHZEx4jvTLEPdXp22zQYyufBn4vXvsMxeTuvnmkU=; b=M66ddTmg9ci0k7VOg4EhNntRvZAKnRrOxugHiCNHjuXHsBVSbxBzoRE5gSJSfSH12URlhyrONQHUJBmwu8rJWVZzll4so5XM88ap4rFDE99BcxB2TwUoXV14An9qVvBl9X+dGI9qVt/Sxm51BaoyqUgC6fCn+zFESf89HmIJ2y0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562357058134741.1472659322974; Fri, 5 Jul 2019 13:04:18 -0700 (PDT) Received: from localhost ([::1]:55684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUQq-0000Rg-8R for importer@patchew.org; Fri, 05 Jul 2019 16:03:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55696) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUES-0005eR-3A for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUER-0004Eh-4Y for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:56 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:38350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUEQ-0004Dw-UK for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id g17so823366wrr.5 for ; Fri, 05 Jul 2019 12:50:54 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=f5eaHZEx4jvTLEPdXp22zQYyufBn4vXvsMxeTuvnmkU=; b=OANXjfVHxAtxucVZBDQSkmghfICiUPDWLlr7zZEL/RVjvLAARWW0SYC6IIX4eDv0tz NWBpgNcPBbHrhYSZMw1TlHKEgvRM3SlM9xzAglf6BSRuqeOWV4snFpOxPv4Y/RrbFqAl upqA9L8btvQzCYVK0zzk3A2NN/2ktt5rDybwKK2m5jn8J/WV4bIV0nYgJKEwYhHTAJay ILPTzZaRuEE8K2iLaZNdFS6SeRzJrnEDvtZiAJRoa+bNNxBwRIf00aFe/R2JQ+gvdm1b ikyEso+/k0IItAyAO7s1Ey9aVUGa8X4BwI7MHuXMyhEULrRvOrBZAkUsc8q95ziOU6LY +ekg== 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=f5eaHZEx4jvTLEPdXp22zQYyufBn4vXvsMxeTuvnmkU=; b=W6CxgsLOZWAoQGTT/2wf8m8RyFpouqG6vBFuXq7DYKyTUbVmT9lShlKGue7FQis+rD xZOcxsCDJW4hDfGA9ax5Em8liKKziGgmsVPxuGyIDtcb6r9TTyankCrUmx6ppmCf0eiD sNYSOKGEOVW559PcVfyfZplXWkY1hgOGasETyUNCea6NEQ7O4wpQZcFiZTli6A7/Epih 3xy/qriiPz7GUgdsfMtJiw6lKHkAg9Hok7Wy4Uz0qBPyIlK69kP3zmTDcaAtGMgFnnzW akz3JHZjxY6UlIdwTVnfKExIdOQWoxlDRny5q2jY3PIjfCNUNbYJM1LV71iEbNE1iHAp Kd7g== X-Gm-Message-State: APjAAAUowPqmwO4zLF0Mc2awSmQpC9gn8rZnaskuprWHmI3Q/vuB5u6y nHIXBcsm7lYmhbwbHwuLsuKVJFU+qZA= X-Google-Smtp-Source: APXvYqy0kMHB8DsKPyepyyVdj54ccmDJdpwr5U/WiLGnVDQ+FN2T3MxG3cAGfdaSjBgXQ/2sBhIiVg== X-Received: by 2002:a5d:5692:: with SMTP id f18mr5207631wrv.104.1562356253717; Fri, 05 Jul 2019 12:50:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:38 +0200 Message-Id: <1562356239-19391-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 Subject: [Qemu-devel] [PULL 11/12] hw/i386: Fix linker error when ISAPC is disabled 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: Julio Montes Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julio Montes v2: include config-devices.h to use CONFIG_IDE_ISA Message-Id: <20190705143554.10295-2-julio.montes@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index c07c4a5..cc04c01 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "config-devices.h" =20 #include "qemu/units.h" #include "hw/hw.h" @@ -61,9 +62,11 @@ =20 #define MAX_IDE_BUS 2 =20 +#ifdef CONFIG_IDE_ISA static const int ide_iobase[MAX_IDE_BUS] =3D { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] =3D { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] =3D { 14, 15 }; +#endif =20 /* PC hardware initialisation */ static void pc_init1(MachineState *machine, @@ -254,7 +257,10 @@ static void pc_init1(MachineState *machine, } idebus[0] =3D qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] =3D qdev_get_child_bus(&dev->qdev, "ide.1"); - } else { + pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); + } +#ifdef CONFIG_IDE_ISA +else { for(i =3D 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; char busname[] =3D "ide.0"; @@ -268,9 +274,9 @@ static void pc_init1(MachineState *machine, busname[4] =3D '0' + i; idebus[i] =3D qdev_get_child_bus(DEVICE(dev), busname); } + pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); } - - pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state); +#endif =20 if (pcmc->pci_enabled && machine_usb(machine)) { pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci"); --=20 1.8.3.1 From nobody Sun May 5 15:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562357175; cv=none; d=zoho.com; s=zohoarc; b=eZcikp+gfWHmwGueteNoZS+1pE72dmQnuzuszodvBJXe0pdlFekIVIADBr8j4OI4YszimZDO5WSmIZBCKGBZDgWNr2BZwwKT+pW4gUc50k04hMEmVQMoNz1O9XBV513nVjYTvhRQVaoHGVFwXYN+AMVh8S57nMtryA7e0DZY9ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562357175; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tkNz7uqIs0Rv1hq1F0XpRF7vtnO8a8dqtlBjE4VOmbk=; b=QZvXMjNXUda49/JQhRvF1lAT0iMLMrNllX3xZroubUdr9vUQoTD/2fiZ30okQAl22FLglRsB0apf19ymEoAOe/DzYvho7reOgAt2znQae0bATKl6QxCT+jmC3BaT+b0x84DpnAR4c95Uk3ZKBZ7bmWohY4RyhTlGFSVpHADpX7U= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562357175725807.3853337981232; Fri, 5 Jul 2019 13:06:15 -0700 (PDT) Received: from localhost ([::1]:55702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUTB-0001xF-Mn for importer@patchew.org; Fri, 05 Jul 2019 16:06:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55707) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUET-0005hN-1n for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUER-0004FT-VM for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:57 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjUER-0004Eq-Oo for qemu-devel@nongnu.org; Fri, 05 Jul 2019 15:50:55 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g17so823396wrr.5 for ; Fri, 05 Jul 2019 12:50:55 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d10sm11478625wro.18.2019.07.05.12.50.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 12:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=tkNz7uqIs0Rv1hq1F0XpRF7vtnO8a8dqtlBjE4VOmbk=; b=ayB9/1MfykCl/JVAlmCWJgwVaNt6oQvcxrCszw1WMFgM1fs3eX2cNVqQS1nYZOYZgZ f4IHozo8yBdjnHS3QKO1uYZQPLtfdKzntNzDTRSlJiBS6O5ZdFhmmrqwpH407b8wEgnX 3udzDKs9ayXoqzAlSHJes1wm4cq7wSwY+EjI9TPfMavh/b/KhzHJB7vtz9l/WzuX07Ka 0Ob2t4dLcaPf+aw+FVZdnb3K8mU/RWMNsbzu/7Y4YM0PjBZ5Ds//rIVI92/zQk/AVIjH tceJjhhcY3Ek/vpf4WgfYCVAJjg3Z7R55chm7u44p5quDBh+qUyyK/Ui5BL9vB/A0yGo WsIQ== 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=tkNz7uqIs0Rv1hq1F0XpRF7vtnO8a8dqtlBjE4VOmbk=; b=Qw8hwa86iYVabyLhAKcTzCXI9s97d92s7R3DjpcO+1+c52gAJhY2jYDznMuchJgH8U ut8+9b5PVZno/P2YPUdKtz8aWEZqAoPcuqUEVnyTYCZhZ47I5JQDkivrb8GH0FdD3HwS LPYtrUQuETPLF0/vqJbka503nN4lr/fT6bZH+3RBIFSQr0F+ci3jMpqHgygFkBn7Alwb f2hXXaT3g9IHyzzrSaGr9RsgDUJ8iWv1xeuvu1/lSw/N0hcCqKXd6dccva2sk8ipIeHa jHhLaZFXNe3VadUi2No358yNiIpOOoHfSq8ZMChDkq/szFasjnytwdCpRQLTo11oGLtP cBAQ== X-Gm-Message-State: APjAAAWk9rjCRjaQ6uGczVV0avJeiQkr/ITUXkUrF+gf0IRNE6TMcfOb SLCY4alMWmdeii8BS9C5xOxLlosBLOY= X-Google-Smtp-Source: APXvYqymSo4UXz6SeazuQXfw4fVlIl2pEQa22xzHHuHDz8vGCdxXO8B/o0SLHPXNzooeDdlHx9SuEA== X-Received: by 2002:a5d:6783:: with SMTP id v3mr5212040wru.318.1562356254606; Fri, 05 Jul 2019 12:50:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 21:50:39 +0200 Message-Id: <1562356239-19391-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> References: <1562356239-19391-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c Subject: [Qemu-devel] [PULL 12/12] ioapic: use irq number instead of vector in ioapic_eoi_broadcast 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: Li Qiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Li Qiang When emulating irqchip in qemu, such as following command: x86_64-softmmu/qemu-system-x86_64 -m 1024 -smp 4 -hda /home/test/test.img -machine kernel-irqchip=3Doff --enable-kvm -vnc :0 -device edu -monitor std= io We will get a crash with following asan output: (qemu) /home/test/qemu5/qemu/hw/intc/ioapic.c:266:27: runtime error: index = 35 out of bounds for type 'int [24]' =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D113504=3D=3DERROR: AddressSanitizer: heap-buffer-overflow on address = 0x61b000003114 at pc 0x5579e3c7a80f bp 0x7fd004bf8c10 sp 0x7fd004bf8c00 WRITE of size 4 at 0x61b000003114 thread T4 #0 0x5579e3c7a80e in ioapic_eoi_broadcast /home/test/qemu5/qemu/hw/intc= /ioapic.c:266 #1 0x5579e3c6f480 in apic_eoi /home/test/qemu5/qemu/hw/intc/apic.c:428 #2 0x5579e3c720a7 in apic_mem_write /home/test/qemu5/qemu/hw/intc/apic.= c:802 #3 0x5579e3b1e31a in memory_region_write_accessor /home/test/qemu5/qemu= /memory.c:503 #4 0x5579e3b1e6a2 in access_with_adjusted_size /home/test/qemu5/qemu/me= mory.c:569 #5 0x5579e3b28d77 in memory_region_dispatch_write /home/test/qemu5/qemu= /memory.c:1497 #6 0x5579e3a1b36b in flatview_write_continue /home/test/qemu5/qemu/exec= .c:3323 #7 0x5579e3a1b633 in flatview_write /home/test/qemu5/qemu/exec.c:3362 #8 0x5579e3a1bcb1 in address_space_write /home/test/qemu5/qemu/exec.c:3= 452 #9 0x5579e3a1bd03 in address_space_rw /home/test/qemu5/qemu/exec.c:3463 #10 0x5579e3b8b979 in kvm_cpu_exec /home/test/qemu5/qemu/accel/kvm/kvm-= all.c:2045 #11 0x5579e3ae4499 in qemu_kvm_cpu_thread_fn /home/test/qemu5/qemu/cpus= .c:1287 #12 0x5579e4cbdb9f in qemu_thread_start util/qemu-thread-posix.c:502 #13 0x7fd0146376da in start_thread (/lib/x86_64-linux-gnu/libpthread.so= .0+0x76da) #14 0x7fd01436088e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12188e This is because in ioapic_eoi_broadcast function, we uses 'vector' to index the 's->irq_eoi'. To fix this, we should uses the irq number. Signed-off-by: Li Qiang Reviewed-by: Peter Xu Message-Id: <20190622002119.126834-1-liq3ea@163.com> --- hw/intc/ioapic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index db9e518..c408749 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -245,8 +245,8 @@ void ioapic_eoi_broadcast(int vector) s->ioredtbl[n] =3D entry & ~IOAPIC_LVT_REMOTE_IRR; =20 if (!(entry & IOAPIC_LVT_MASKED) && (s->irr & (1 << n))) { - ++s->irq_eoi[vector]; - if (s->irq_eoi[vector] >=3D SUCCESSIVE_IRQ_MAX_COUNT) { + ++s->irq_eoi[n]; + if (s->irq_eoi[n] >=3D SUCCESSIVE_IRQ_MAX_COUNT) { /* * Real hardware does not deliver the interrupt immedi= ately * during eoi broadcast, and this lets a buggy guest m= ake @@ -254,16 +254,16 @@ void ioapic_eoi_broadcast(int vector) * level-triggered interrupt. Emulate this behavior if= we * detect an interrupt storm. */ - s->irq_eoi[vector] =3D 0; + s->irq_eoi[n] =3D 0; timer_mod_anticipate(s->delayed_ioapic_service_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRT= UAL) + NANOSECONDS_PER_SECOND / 100); - trace_ioapic_eoi_delayed_reassert(vector); + trace_ioapic_eoi_delayed_reassert(n); } else { ioapic_service(s); } } else { - s->irq_eoi[vector] =3D 0; + s->irq_eoi[n] =3D 0; } } } --=20 1.8.3.1