From nobody Tue Feb 10 18:54:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666359482; cv=none; d=zohomail.com; s=zohoarc; b=dD6ldDIk+rSaL4IaQsyZO4y1G9ciXAqlz+5DrdcqtupaFHqoBb+TzpJ1pbJmaQ+vgphfyv3mydSW2VFoSEQukfKnRlDQbTpxBwtnXPVo80ZIRBOJYIURENQGRhVJwGlhGldRZdDbaZNVGQDqPI9TtBREU3Ig91ZSFZ+EpIDRRik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666359482; 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; bh=3y6uBtQ/zA2SdT/qrNkOEOIaXH4LO+St7na1j07ASJU=; b=e0UzIw30sQ1HIxzi8liOHRl5/EKoHa0tlwVSxO/nv/Ms4C7gNCnQFDEho6tRvaaGkCLwgfKQ2HBm27QjuXtUd98UIslCAkd/n2baPFqJ/zYzEaQeYaBASJ3H1vWnGRogEPDrgWpNf4SwD78jxETgMfD6QJf9i//RH9cCWLZ86gk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666359482109799.1080405523816; Fri, 21 Oct 2022 06:38:02 -0700 (PDT) Received: from localhost ([::1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olsDp-0008Ez-0T for importer@patchew.org; Fri, 21 Oct 2022 09:38:01 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olrkX-00062J-BH for importer@patchew.org; Fri, 21 Oct 2022 09:07:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olrkQ-0005x9-SF for qemu-devel@nongnu.org; Fri, 21 Oct 2022 09:07:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olrkN-0008Kg-Fr for qemu-devel@nongnu.org; Fri, 21 Oct 2022 09:07:38 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-BNa4rkpUNHq3NPVHwK7fVA-1; Fri, 21 Oct 2022 09:07:31 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BBC7929AB40E; Fri, 21 Oct 2022 13:07:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8801D2166B2D; Fri, 21 Oct 2022 13:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666357654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3y6uBtQ/zA2SdT/qrNkOEOIaXH4LO+St7na1j07ASJU=; b=Jkz2GqkZCKoeysFOEITb6f4y5QNBmNeeKvadTIDt27hHkQYSopxKK6pYsXVu7ddIqVZemv NWSWCcWYKonb8p9i5i6zY4oyu8bfsJiBWuOh66HXJGFTXCNuVUmfi+U9gLG3Wzlby+sxjI IXNpW6owJbu/ex9stE8G2XjjQcW98I0= X-MC-Unique: BNa4rkpUNHq3NPVHwK7fVA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Cornelia Huck , Thomas Huth , Christian Borntraeger , David Hildenbrand , Eric Farman , Halil Pasic , Richard Henderson , Viktor Prutyanov Subject: [PULL 11/11] dump/win_dump: limit number of processed PRCBs Date: Fri, 21 Oct 2022 17:05:49 +0400 Message-Id: <20221021130549.111864-12-marcandre.lureau@redhat.com> In-Reply-To: <20221021130549.111864-1-marcandre.lureau@redhat.com> References: <20221021130549.111864-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666359482390100001 From: Viktor Prutyanov When number of CPUs utilized by guest Windows is less than defined in QEMU (i.e., desktop versions of Windows severely limits number of CPU sockets), patch_and_save_context routine accesses non-existent PRCB and fails. So, limit number of processed PRCBs by NumberProcessors taken from guest Windows driver. Signed-off-by: Viktor Prutyanov Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20221019235948.656411-1-viktor.prutyanov@redhat.com> --- dump/win_dump.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dump/win_dump.c b/dump/win_dump.c index fd91350fbb..f20b6051b6 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -273,6 +273,13 @@ static void patch_and_save_context(WinDumpHeader *h, b= ool x64, uint64_t Context; WinContext ctx; =20 + if (i >=3D WIN_DUMP_FIELD(NumberProcessors)) { + warn_report("win-dump: number of QEMU CPUs is bigger than" + " NumberProcessors (%u) in guest Windows", + WIN_DUMP_FIELD(NumberProcessors)); + return; + } + if (cpu_read_ptr(x64, first_cpu, KiProcessorBlock + i * win_dump_ptr_size(x64), &Prcb)) { --=20 2.37.3