From nobody Tue Feb 10 05:45:27 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=1666687175; cv=none; d=zohomail.com; s=zohoarc; b=ADdBki6aTJAGb6wDtSCFGI55BikfVRwsDE5wOy/lblKQfcjmuqgRNHB/+DJdsTofLx1cDejlIziUzcnpXK4PJebwk0PpCZN/OMbApegGZj0TAT0UN2I78VYFU6jd8nQGBSLa9sg4/bpfcsckeNzH3BqFiHoPfpHhWXek+IS0JQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666687175; 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=JfTZLI7O+eE8E9Be9gb+vnoQgaipx/g56XT+cJADXm4EJVNCiDAqUljNp6xSKEGYfbJJ+/dNmxy47vt22eezDIOxWojtwHMiQgxojZA642eIxGWfLgIilcfIWxRUsK0dVJ5ZrHOhShw4smj8dQBi1zgMyMa/KjYvdUpE00q050w= 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 166668717523326.201572943726887; Tue, 25 Oct 2022 01:39:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onFRJ-0004hv-Hz; Tue, 25 Oct 2022 04:37:37 -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 1onEid-0003U7-W1 for qemu-devel@nongnu.org; Tue, 25 Oct 2022 03:51:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onEiS-0005ik-7u for qemu-devel@nongnu.org; Tue, 25 Oct 2022 03:51:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-466-OKxvT4tuOa2CtG3fy7q65A-1; Tue, 25 Oct 2022 03:51:12 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C1A14101A528; Tue, 25 Oct 2022 07:51:11 +0000 (UTC) Received: from localhost (unknown [10.39.208.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E1C3492CA4; Tue, 25 Oct 2022 07:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666684275; 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=LdS6x6u4ay2jL5tYhj1eCvm6xiyQT3Nc8JxtqEPEU6Q7Apxmr4k10GymAFdIYNizuDw98k xIzSTlNAOENIRAWrXQFx/vRHSNISg2pGA5oaksHLX9KJPmhvJBbwPt9V75AMRcY2SLLE/T ReryDyx9Wi7QFzM0pz3jG4HRt23k5Iw= X-MC-Unique: OKxvT4tuOa2CtG3fy7q65A-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Halil Pasic , qemu-s390x@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Richard Henderson , Cornelia Huck , David Hildenbrand , Eric Farman , Christian Borntraeger , Thomas Huth , Viktor Prutyanov Subject: [PULL v2 11/11] dump/win_dump: limit number of processed PRCBs Date: Tue, 25 Oct 2022 11:50:03 +0400 Message-Id: <20221025075003.18161-12-marcandre.lureau@redhat.com> In-Reply-To: <20221025075003.18161-1-marcandre.lureau@redhat.com> References: <20221025075003.18161-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.9 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.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.503, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666687175514100001 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