From nobody Sat Nov 23 14:25:39 2024 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=1732087755; cv=none; d=zohomail.com; s=zohoarc; b=JUq7BsInDmj72LoTpTg0ZrEbqq60VD1ZjGpNQLrmgrVIEipM6DZXDMcGqXi0dwfoPRVLM6Qod2CqPjtQgRAaO185LRHEMrsxrhPxjMs4ADk15UW8H1GGobUE9NXzRYm5/HDbWGsRqy19XsGpcbIDIwz2wGKkW5XhQDeybDOPdSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732087755; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a9gy6dA9pZyQbx//Xc1zrgngdyVqqly2dozo3VuB5MA=; b=ZX5vWE0gr7T+subXopK43iWwgymYUI9qi4ssAjBXcAJj1/nMyCR7kW7q0v0V6p+USxbVVs3vNMlwm1I+SUMBEl84IAgKxvDDSJXSP5VHFb3qlEioE6uHVX+s09rO2o3ILhHc/hL13airGoA0qAlBa3eH+zvpCfTirDT9SNlT5fU= 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 173208775520562.32855635445242; Tue, 19 Nov 2024 23:29:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDf7g-0001yD-Mp; Wed, 20 Nov 2024 02:27:36 -0500 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 1tDf7d-0001xV-9A for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:33 -0500 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 1tDf7b-00080C-O7 for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:33 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-Ynmeb4u0OIq19Ng4IuaMPw-1; Wed, 20 Nov 2024 02:27:29 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4314c6ca114so37949845e9.1 for ; Tue, 19 Nov 2024 23:27:29 -0800 (PST) Received: from [192.168.10.3] ([151.49.84.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b463ad1fsm9021245e9.38.2024.11.19.23.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 23:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732087650; 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=a9gy6dA9pZyQbx//Xc1zrgngdyVqqly2dozo3VuB5MA=; b=PUDZ6+2fgCcI5zbRhFWd+/l7lYNCvl/m3qdJJwk/7ji0sMDKOpktCQ3S7SXaktKlXuIZxr s08dph5+RlUrr+y8y9mrRuvEDFaUCWnTB69K0r7B/M8pBP4j44EOBOc1fGTj5qQzqJBxgx sdWFjbmy+VWtDuhLWiiS5MEo4CTFnDw= X-MC-Unique: Ynmeb4u0OIq19Ng4IuaMPw-1 X-Mimecast-MFC-AGG-ID: Ynmeb4u0OIq19Ng4IuaMPw X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732087647; x=1732692447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a9gy6dA9pZyQbx//Xc1zrgngdyVqqly2dozo3VuB5MA=; b=BPo+pcCrPgholzytyGIgiFB/vBFzBz/KCUrWCDXb9fNHwuKHhGWUHoiZBPHf5KgE01 LxWu+iFdvA0vPwZQVxFoKh8FgGFQCd86Q+v68zI9Asx7jnT9JtsZKGirSoYtsCTpN/gG o2LcyAxgnkBjptmVuUdqUvfjvxp0ocRg8tnkzcxsIuZn+BeJaQPk9w0DZQDohyIIE4/9 TI8hiHFElQmnDDdWmi2RDr2NePzlkAwPDzGOdtsF4nsc+0W3Jb1v1nslNz07ZHL9/Wiq lyuLYwI0B5lQW0J3oMWTrJHeOYLJ4ETLRd2mkjcgE99cv/8AtFGwL7fVKXB3+Dxko+mI oH4g== X-Gm-Message-State: AOJu0YyMXUwSObp/jF32ZZp6MfwZZLyxhzD0dVx7SPJXutsqFFaWI74m C+LQYQ4UyVD7HhaUHK4QUfJg9Xhim3mlwIhrsGhzjlVHHRHnlxpsR6uDV5o7HR+D07IQwBHVXfO A9KY5iv+qVbUrc3wgERfH/y3SYoQ4n92XdL0qBcftga4ZV4miDBkmnbjPDBozFiC5bajTiCZ8Ox MVSbGbByKuJu+Y5aWm2t+nw9zHScesY48BoRS4 X-Received: by 2002:a05:600c:3d18:b0:431:58bc:ad5e with SMTP id 5b1f17b1804b1-4334f025ee8mr11883175e9.28.1732087647495; Tue, 19 Nov 2024 23:27:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYmWqdBsaQnqwGJr8X6vac5RxZSoaXjkTdy5HeFad9rUVDvLop9QacpENgNvYauoDldsjVnA== X-Received: by 2002:a05:600c:3d18:b0:431:58bc:ad5e with SMTP id 5b1f17b1804b1-4334f025ee8mr11883065e9.28.1732087647165; Tue, 19 Nov 2024 23:27:27 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Kamil=20Szcz=C4=99k?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/5] hw/i386/pc: Remove vmport value assertion Date: Wed, 20 Nov 2024 08:27:19 +0100 Message-ID: <20241120072723.103477-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241120072723.103477-1-pbonzini@redhat.com> References: <20241120072723.103477-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732087756675116600 From: Kamil Szcz=C4=99k There is no need for this assertion here, as we only use vmport value for equality/inequality checks. This was originally prompted by the following Coverity report: >>> CID 1559533: Integer handling issues (CONSTANT_EXPRESSION_RESULT) >>> "pcms->vmport >=3D 0" is always true regardless of the values of >>> its operands. This occurs as the logical first operand of "&&". Signed-off-by: Kamil Szcz=C4=99k Reported-By: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/r/ZwF9ZexNs1h-uC0MrbkgGtMtdyLinROjVSmMNVzNftj= GVWgOiuzdD1dSXEtzNH7OHbBFY6GVDYVFIDBgc3lhGqCOb7kaNZolSBkVyl3rNr4=3D@szczek.= dev Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f9147fecbdc..317aaca25a0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1228,7 +1228,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal); } =20 - assert(pcms->vmport >=3D 0 && pcms->vmport < ON_OFF_AUTO__MAX); if (pcms->vmport =3D=3D ON_OFF_AUTO_AUTO) { pcms->vmport =3D (xen_enabled() || !pcms->i8042_enabled) ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON; --=20 2.47.0 From nobody Sat Nov 23 14:25:39 2024 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=1732087735; cv=none; d=zohomail.com; s=zohoarc; b=FAzhq8pKWTq55M9UkqjRXMBL2W0+Ko8AiVK+3/S6ltjPie1KPkapvxC0yZMP4H2p1GfEDxjLRdCdX+fhTvCXpdRKT1DvXH28NANTng3n+xKhsblnDzyzfnapMFQeKpAOOItd7jYCZ2NaR2kEWx/SfhDlPxMLRCd3C+k5394/oGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732087735; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4+dgNF2S08viF1uCuG5gYKqJhsXnzXUAgn0oEVa0luo=; b=fpdObGZ9yyFSQ09S6J8tB8qsOSmnKhJ0WDBfnbdiliLXflaP4IN8vPV6/jokckfAQRn7EGWA9O6uFaOsxXOTORreTuFlk9vuLN5a+47UVw4C0EKscLsk3xKWAHLo6H47g8vkpDrTKMYGPr0Jhi6p5m0zX0N8mmqY3lJDxdhYsw8= 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 1732087735459529.0030322254731; Tue, 19 Nov 2024 23:28:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDf7k-0001yb-74; Wed, 20 Nov 2024 02:27:40 -0500 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 1tDf7i-0001yQ-PH for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:38 -0500 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 1tDf7h-00080d-44 for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:38 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-DWQrROmfNvK2MW4h1xbUHA-1; Wed, 20 Nov 2024 02:27:32 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-382341057e6so2088870f8f.2 for ; Tue, 19 Nov 2024 23:27:31 -0800 (PST) Received: from [192.168.10.3] ([151.49.84.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825490ca19sm1253766f8f.39.2024.11.19.23.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 23:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732087656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4+dgNF2S08viF1uCuG5gYKqJhsXnzXUAgn0oEVa0luo=; b=MpsRCFqdzRjVMtV82Cj/yAO7ZtJEBX1CfuXI+X6MNxCbTpIx1fOlVndMqcusgGNFdVbczk D9xOxoqf55NggIKNUYIrem8XG4zxZj65fHjcm1D2M5CmLKeVwnbHSbfOBRT6KRqO5gj2L1 dyezDjIfGYfh2jGN4j166znFbjk9jBQ= X-MC-Unique: DWQrROmfNvK2MW4h1xbUHA-1 X-Mimecast-MFC-AGG-ID: DWQrROmfNvK2MW4h1xbUHA X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732087650; x=1732692450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4+dgNF2S08viF1uCuG5gYKqJhsXnzXUAgn0oEVa0luo=; b=cpR2ztegtz/sXlcQbMExAX+Ktp0H+tx9g0VuSfRKfm93TpsdKGuzkU7BdZ68nhX6VH mOYbcABGKmPnO1jIJl0nGye6OtaeCQtlLC+A2p61elOBVRo30lsy5cimSfaUUAhK0n42 TT7a26C5Mbb6UaP3Yd28lz4dAriR4ivJmOwfOONMEkt5oxCPTDkE1ecMXNnrvFu+aWOZ jRPGNX7PMn56aO/Ob9KEKglYzIuda450GRYD5yepMAANToavqxmmSs5TL4G8H9friZ03 ajrMchfJCpai0IbUXHnWTUMUvpNCjhn4XCS9gaEM3M2c+t5pvUZC/vZs4ZHt6i++lRwT R6Jw== X-Gm-Message-State: AOJu0YzaDWHzDlHP/WPubTigj9L2hNjLtiSFpR5yoshiw9D3+VF6AZED hiBE+XXRGQFCum5gN35tNb7sagAXJQqcoNIAlOFQHNeL7m8x2gvKWl5z1/5/hrBSqadYB86Juul gh7POTdcFyjmk3GCOd0b5WxjeifoWnVnjHv4xowkTQ+XXuRO+SRI491cMKTv4JIJFwKBv0pagsH H/p0cIxhqlns7A+9/US4TDeAgXavt41emjS0fe X-Received: by 2002:a5d:47a9:0:b0:382:372a:5719 with SMTP id ffacd0b85a97d-38254b2744emr994227f8f.59.1732087650051; Tue, 19 Nov 2024 23:27:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/L57m8jyDZkOngQdFSRFHf7T+DLi1tQ3RnIXlVbcaIY6wdZenT6+uJESPo8RXVhW8aRtyIQ== X-Received: by 2002:a5d:47a9:0:b0:382:372a:5719 with SMTP id ffacd0b85a97d-38254b2744emr994211f8f.59.1732087649641; Tue, 19 Nov 2024 23:27:29 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 2/5] hvf: remove unused but set variable Date: Wed, 20 Nov 2024 08:27:20 +0100 Message-ID: <20241120072723.103477-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241120072723.103477-1-pbonzini@redhat.com> References: <20241120072723.103477-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732087736623116600 Content-Type: text/plain; charset="utf-8" From: Pierrick Bouvier fixes associated warning when building on MacOS. Signed-off-by: Pierrick Bouvier Link: https://lore.kernel.org/r/20241023182922.1040964-1-pierrick.bouvier@l= inaro.org Signed-off-by: Paolo Bonzini --- target/i386/hvf/x86_task.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c index f09bfbdda5b..cdea2ea69d9 100644 --- a/target/i386/hvf/x86_task.c +++ b/target/i386/hvf/x86_task.c @@ -122,7 +122,6 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segment_= selector tss_sel, int rea load_regs(cpu); =20 struct x86_segment_descriptor curr_tss_desc, next_tss_desc; - int ret; x68_segment_selector old_tss_sel =3D vmx_read_segment_selector(cpu, R_= TR); uint64_t old_tss_base =3D vmx_read_segment_base(cpu, R_TR); uint32_t desc_limit; @@ -138,7 +137,7 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segment_= selector tss_sel, int rea if (reason =3D=3D TSR_IDT_GATE && gate_valid) { int dpl; =20 - ret =3D x86_read_call_gate(cpu, &task_gate_desc, gate); + x86_read_call_gate(cpu, &task_gate_desc, gate); =20 dpl =3D task_gate_desc.dpl; x68_segment_selector cs =3D vmx_read_segment_selector(cpu, R_CS); @@ -167,11 +166,12 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segmen= t_selector tss_sel, int rea x86_write_segment_descriptor(cpu, &next_tss_desc, tss_sel); } =20 - if (next_tss_desc.type & 8) - ret =3D task_switch_32(cpu, tss_sel, old_tss_sel, old_tss_base, &n= ext_tss_desc); - else + if (next_tss_desc.type & 8) { + task_switch_32(cpu, tss_sel, old_tss_sel, old_tss_base, &next_tss_= desc); + } else { //ret =3D task_switch_16(cpu, tss_sel, old_tss_sel, old_tss_base, = &next_tss_desc); VM_PANIC("task_switch_16"); + } =20 macvm_set_cr0(cpu->accel->fd, rvmcs(cpu->accel->fd, VMCS_GUEST_CR0) | CR0_TS_MASK); --=20 2.47.0 From nobody Sat Nov 23 14:25:39 2024 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=1732087735; cv=none; d=zohomail.com; s=zohoarc; b=GCMHydaL0dytNkHElYv0XSqES2wG0Cf6oXHyDJytAmhU/S+GmWh3OQRarV7R+QXPT9lzArrXAl0dNjOjpOZ5UUedaYZhm11xuJIZlP7FxY0tFyCZbPQ3wi6PWKwTQfGKc+oZ7z8v4JqnR7yVVOhRqhHE4wdtNkFZ0/eKsnt7KDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732087735; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7QhVwK8/JBtJbmVWE6jCktqNly/2uKTJAV30daTqWZY=; b=huuv8Hp96XaY8d6GohB/sFSjZoQ3FMIVPtsr0pb4pyPIJgMILrieDI0hCy4Ln57T4mi5P3nyhDxltqm6VJn+SeVQx1AH+X0fsqnRzWksdLIXUpiD4GAk2aGndHmTt6B+kfj+dGzNIe6/om9J3Zf3ri37wYdqSviT/RmRQcVWIGY= 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 1732087735708348.1537847487547; Tue, 19 Nov 2024 23:28:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDf7l-0001zE-Mf; Wed, 20 Nov 2024 02:27:41 -0500 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 1tDf7k-0001yr-If for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:40 -0500 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 1tDf7i-00080s-UV for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:40 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-VdPXurZlMkWHAbva8vSVeQ-1; Wed, 20 Nov 2024 02:27:34 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4316e2dde9eso38319965e9.2 for ; Tue, 19 Nov 2024 23:27:34 -0800 (PST) Received: from [192.168.10.3] ([151.49.84.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b46021e6sm9029675e9.17.2024.11.19.23.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 23:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732087658; 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=7QhVwK8/JBtJbmVWE6jCktqNly/2uKTJAV30daTqWZY=; b=LMhAn6S1gjQqSJJs/SYFWQot926M4GJsIM53goZzaeHr64DRpKVE5q2TitaLVXfvbherUl Je+1KpKzRpIyqB1i/SUm17q/IcNJP7uJ/E2w8tT08qBr3Wc3TRrYZhqDbZS6/oIyWLAY1+ OuR4ZDyQTFcJmq3o+3TXyulD8zvUcmI= X-MC-Unique: VdPXurZlMkWHAbva8vSVeQ-1 X-Mimecast-MFC-AGG-ID: VdPXurZlMkWHAbva8vSVeQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732087653; x=1732692453; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7QhVwK8/JBtJbmVWE6jCktqNly/2uKTJAV30daTqWZY=; b=lN9QQqn3H5IWrRCcoXh7BWt+WxVXzyKvpLxvYU5Du9bvFvE2kCZZHYzR8r+Eyy+DAS HAEbH1F8BUo9TYFLPzWLi/v4ouPQvGjZPvFymiwXyPn217TNllNUe5AWdjZLyVJJ3NcL uOxkaKInQDfsQQvYeKVa5KOaLMYL7W6TYs86pTnDgOXVgSZ3HDlwqaTQe+jqkbKSibag hDwq/3keRjXC+Z8pA/nSnu0xqmigbL/515LMosjwRKxfp/fz8nklVEesIo51XSNkyjn5 C/hW8Lu2usKdR/F+FNqVuRS4WLoXa7xLv3+uhbh2LI6rTzpSTk5ZFxvRxAnb2tnmyiYp obSg== X-Gm-Message-State: AOJu0YzJssqtRLGXKxSRMsizDurpcXVi5GnPUSpmIz4SMw4Zxf3gU4Mf wczrU+e0/5qah2FE0bo+lOdXJuFyp8mExaYlehnspWT1SXgy+jLUwkSLAlOx5rgt890gddK9t+h ssDaxT46ht9q0iPstLxTkIxkCX4TZEommS8uaWh7hfaY/toDUKE2Z1Ua0xi3c/KE4ah2upLioyc zjwEX5g5BlwA5Z7j+8jvlI0PCDe8+sqxM+0Nzz X-Received: by 2002:a05:600c:3b12:b0:431:4b88:d407 with SMTP id 5b1f17b1804b1-433489819c0mr15946545e9.5.1732087652784; Tue, 19 Nov 2024 23:27:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4giHHmLrdNjug2Oj7rqWbaNUbzwk1D+IJsuCrjfhCkw+AxKYpWsbP0ddsAWwwEPB5YUuvcA== X-Received: by 2002:a05:600c:3b12:b0:431:4b88:d407 with SMTP id 5b1f17b1804b1-433489819c0mr15946385e9.5.1732087652368; Tue, 19 Nov 2024 23:27:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/5] hw/core/machine-smp: Initialize caches_bitmap before reading Date: Wed, 20 Nov 2024 08:27:21 +0100 Message-ID: <20241120072723.103477-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241120072723.103477-1-pbonzini@redhat.com> References: <20241120072723.103477-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732087736611116600 From: Zhao Liu The caches_bitmap is defined in machine_parse_smp_cache(), but it was not initialized. Initialize caches_bitmap by clearing all its bits to zero. Resolves: Coverity CID 1565389 Fixes: 4e88e7e3403d ("qapi/qom: Define cache enumeration and properties for= machine") Reported-by: Peter Maydell Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/r/20241110150901.130647-2-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/core/machine-smp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 640b2114b42..b87637c78f6 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -290,6 +290,7 @@ bool machine_parse_smp_cache(MachineState *ms, const SmpCachePropertiesList *node; DECLARE_BITMAP(caches_bitmap, CACHE_LEVEL_AND_TYPE__MAX); =20 + bitmap_zero(caches_bitmap, CACHE_LEVEL_AND_TYPE__MAX); for (node =3D caches; node; node =3D node->next) { /* Prohibit users from repeating settings. */ if (test_bit(node->value->cache, caches_bitmap)) { --=20 2.47.0 From nobody Sat Nov 23 14:25:39 2024 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=1732087735; cv=none; d=zohomail.com; s=zohoarc; b=Hz1xWO82tXjXkIQWesAV+joxOaWNOIkIsmXj42ZxOeehIIPLz1XKSlWP0EgnSKFG/IthciUBCTvpwxSQ0HL0yioHQl1eIihD5J0eHJ+Aw31nW9qLvQ/sTtE98c+YMxyTqhi+6OFJ84ZjrtRgc8bM3hO7PFqbAzj6fIv9DVxkrDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732087735; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N2F9E4mEmEirmkyQv404Dyo179Nuu2p/DO/bYOMpAzw=; b=oH/nMf5CTXxuMGn1iCBQPBnwJUUaKc5U/gCRsEBPxC8z9HitbyjyqGpoVOQsk4An5vwMDYDe9CllGZWAIqTanR5PgbtWeE7S7CMW7udIcYCYkf5kyoSS9A1dqmzUwU4ibB57VQ44ivrA+m7ucRMrsuo/Uu/1zmirU6UZjior6Y4= 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 1732087735582321.4045900791848; Tue, 19 Nov 2024 23:28:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDf7p-00020L-I9; Wed, 20 Nov 2024 02:27:45 -0500 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 1tDf7l-0001zH-RA for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:42 -0500 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 1tDf7k-00081l-7a for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:41 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-j5vmsjoWOUe7OG-nwjAAYA-1; Wed, 20 Nov 2024 02:27:37 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4315ad4938fso13809195e9.0 for ; Tue, 19 Nov 2024 23:27:37 -0800 (PST) Received: from [192.168.10.3] ([151.49.84.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b45d4c68sm9007665e9.22.2024.11.19.23.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 23:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732087659; 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=N2F9E4mEmEirmkyQv404Dyo179Nuu2p/DO/bYOMpAzw=; b=SRITF/itIjqJx2D8VrfzTdhQUJ7EslUYa+NQLB3xsMzoJlTo5dwNR9KQ46gagJ6tbk/0Ct u0jUk4z1LAipik98xEX1Lyaw3qmg+x0d5lhTVK8A9aIbROG/gEHGH20IP3QdjW3L0pi5EF mVubkRpI+C1018pvDkpDmBwZNqVO54E= X-MC-Unique: j5vmsjoWOUe7OG-nwjAAYA-1 X-Mimecast-MFC-AGG-ID: j5vmsjoWOUe7OG-nwjAAYA X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732087655; x=1732692455; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N2F9E4mEmEirmkyQv404Dyo179Nuu2p/DO/bYOMpAzw=; b=VCXj/d+EN6P6PnS0CSkFZnWmUf+5/ts/07jCr6zKUMmtGdgw2TPksVLzoftyA7YN4X lQnkA1sXiRxAwfbwCl/2iaKgSynH4wfORpHi+MNtjCKDVPcXvKyA6bMDi2cGpQr3aB8x wWOLgATek7aJvOBBns7U5K0PH3MRK7I7RYSSl9Gat0d3L3U2EjbWpK/OVcwYrjmJsOz9 eKuYrCZ3woNe31eJ3RqQNcdmyJkt518CMZZsiErPV0lSFAHQmeLEPFdXQEwFfIu8Vp8X Z9YmaRCj3mgOOSA+OKaT9aGc5WcFbdZR2leEj5/ykeMOdqrgX2SxFfQkRoqYis3Xy4mN hnPw== X-Gm-Message-State: AOJu0YwXmbrVSfy1ps6EtNzI4IfwHCcVe3mwwlbXRwhtUJzTR6z/Orqx wZ4FtNBCVYbnNRdUezQmpU4mH2n+xq5VdIq2sota14f/sI1val+flUkuT8Qx/I6RB3jNtq44ntz eCg4OVbzd0DJi37m7Xkp3On2+tIUoZdygwYICOUU0gVp6sMHGvXkiDaQbTtGB4bSEOggsYuUBr3 HOAOB3vtaGgGC9qOmp4xUAlQTxD7rczdWVcw9e X-Received: by 2002:a5d:64c6:0:b0:382:5206:8b5d with SMTP id ffacd0b85a97d-38254b21ac8mr976270f8f.42.1732087655183; Tue, 19 Nov 2024 23:27:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGtjKu0P42Vwo06TAVfnN7ZEI6Gu+a7HawNXdaZ81ykKy1gTB52/PeupQA/RjI90nuuPLGhg== X-Received: by 2002:a5d:64c6:0:b0:382:5206:8b5d with SMTP id ffacd0b85a97d-38254b21ac8mr976258f8f.42.1732087654777; Tue, 19 Nov 2024 23:27:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 4/5] hw/core/machine-smp: Fix error message parameter Date: Wed, 20 Nov 2024 08:27:22 +0100 Message-ID: <20241120072723.103477-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241120072723.103477-1-pbonzini@redhat.com> References: <20241120072723.103477-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732087736609116601 From: Zhao Liu In the loop checking smp cache support, the error message should report the current cache level and type. Fix the parameter of error_setg() to ensure it reports the correct cache level and type. Resolves: Coverity CID 1565391 Fixes: f35c0221fef8 ("hw/core: Check smp cache topology support for machine= ") Reported-by: Peter Maydell Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Link: https://lore.kernel.org/r/20241110150901.130647-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- hw/core/machine-smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index b87637c78f6..b954eb84902 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -317,7 +317,7 @@ bool machine_parse_smp_cache(MachineState *ms, !mc->smp_props.cache_supported[props->cache]) { error_setg(errp, "%s cache topology not supported by this machine", - CacheLevelAndType_str(node->value->cache)); + CacheLevelAndType_str(props->cache)); return false; } =20 --=20 2.47.0 From nobody Sat Nov 23 14:25:39 2024 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=1732087769; cv=none; d=zohomail.com; s=zohoarc; b=Y+Dhc9eRTLx+YZzKwb8oBIctCeeHZYgomZy3TENgXn4jeOn5UggZMTaDjmD96CgsBytkPoemU5x1ZCKybhbpfsaWf6MM5trVZ5hVMSHG4YgQn/Dfbgi8g7L9L34QENCJ7p873rmYzA0y1iLa2uRWXlLRW/6n1vbr/iVzo4I9Nm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732087769; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2rLHa2lhaD4JkWUbp9sIMcNrBEmDkALIbWpGkF72WqY=; b=noxq03gQR0tvZdgue6bDtlJJuNRV5vCs68iKS0pbjTbyH3o+xplINTnqodWAh6uYRV1zZjSbMXguuuKm0aGRZhZTrAA1Uutj4ehLFPcmGNMjg84GCdlPlEH8/pgOgtsgCvEE8devwTyDnulTwffEAyBQVR5bAVedVjKVamUBM1k= 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 1732087769946672.7218408822314; Tue, 19 Nov 2024 23:29:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDf7q-000215-6j; Wed, 20 Nov 2024 02:27:46 -0500 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 1tDf7n-0001zt-Ty for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:43 -0500 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 1tDf7m-00086V-7v for qemu-devel@nongnu.org; Wed, 20 Nov 2024 02:27:43 -0500 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-g2th1MNmO3ueSzxoG51GWg-1; Wed, 20 Nov 2024 02:27:40 -0500 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-539e294566dso3838879e87.3 for ; Tue, 19 Nov 2024 23:27:40 -0800 (PST) Received: from [192.168.10.3] ([151.49.84.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b45d4ce6sm9161925e9.25.2024.11.19.23.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 23:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732087661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2rLHa2lhaD4JkWUbp9sIMcNrBEmDkALIbWpGkF72WqY=; b=Yrh/eaL+hqMOYLlRd6sH5d0OuNsQztgsVL3YYx1A+py1oB/5OYO5rMzSCoXcDvdw4pmL9C PnTfdHyozVLOBWFbeTFVEWyE56w5rMQhXcAyfJLZwvdSG85p/kT+SE09vXBhNlHoAdFHxf rZuez9ypkXKV+HfHvSOXdNUhzZHJS80= X-MC-Unique: g2th1MNmO3ueSzxoG51GWg-1 X-Mimecast-MFC-AGG-ID: g2th1MNmO3ueSzxoG51GWg X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732087658; x=1732692458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2rLHa2lhaD4JkWUbp9sIMcNrBEmDkALIbWpGkF72WqY=; b=v3z/NaQCYpem0qTUYB2exOg4PpV6xvvUGgshfHN9FnNfu0WxR0U8803Z1vEaUNSE7q mWHMJyUzzSW6LzSUF4Hg3qh377ElEoK8Fe47yhh4xA2/nVTQr1ztSYWlD8IBEOAYinb4 L64B9epdV3Zx1um+pj6AUSYzAH7KT+gRuwDaxIFeXUZjpbaUSVKUuL9FPLrJHEuoeBoU Aez7BUNXcnwj5UOFKN5WOlRjhBQENa+GU4hTonzIZ44Ln/gl3/HivIQ00mQLkRcd+6ES uwUyl2RaXNEf31lioCZ/8Bct4hwaNT3HlS6mQrjmQvNBnaxqoE9c7NYKxdFmO51aN/WJ Oiuw== X-Gm-Message-State: AOJu0YzIvYJkDtxN9SFWwuRSTnl8Ba29LOH+a3ncBhB1eaftwhD8Yz5a 2D134hiotaGY+RzmVWifElEWKkdOzvJYOww8rZbapYehQfxoaUGzEC9Ie6hUCShQ0JRDrwKdQBL NrNVpT94ZiBDt2chxPfLkprdrhRAeHBvEWxtph+wFY6kkH7tNbZO5UhApAvO+BDPpt5PPlpRGGm jdxjYHWGlKxFfKjQcBa5dLTWmKKdij//9Yyiav X-Received: by 2002:ac2:5b01:0:b0:539:f26f:d285 with SMTP id 2adb3069b0e04-53dc1323503mr633172e87.3.1732087658047; Tue, 19 Nov 2024 23:27:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhRVz9VYZsZd/AYl+/XTvilrzQiVez0TUuzzSwRNqUHj6o+oMnUPEX6uqNrjfjUJasZ4LH9w== X-Received: by 2002:ac2:5b01:0:b0:539:f26f:d285 with SMTP id 2adb3069b0e04-53dc1323503mr633154e87.3.1732087657623; Tue, 19 Nov 2024 23:27:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: jrossi@linux.ibm.com, thuth@redhat.com Subject: [PULL 5/5] scsi: fix allocation for s390x loadparm Date: Wed, 20 Nov 2024 08:27:23 +0100 Message-ID: <20241120072723.103477-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241120072723.103477-1-pbonzini@redhat.com> References: <20241120072723.103477-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732087770490116600 Content-Type: text/plain; charset="utf-8" Coverity reports a possible buffer overrun due to a non-NUL-terminated string in scsi_property_set_loadparm(). While things are not so easy, because qdev_prop_sanitize_s390x_loadparm is designed to operate on a buffer that is not NUL-terminated, in this case the string *does* have to be NUL-terminated because it is read by scsi_property_get_loadparm and s390_build_iplb. Reviewed-by: jrossi@linux.ibm.com Cc: thuth@redhat.com Fixes: 429442e52d9 ("hw: Add "loadparm" property to scsi disk devices for b= ooting on s390x", 2024-11-18) Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 8e553487d50..7f13b0588f2 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -3152,7 +3152,7 @@ static void scsi_property_set_loadparm(Object *obj, c= onst char *value, return; } =20 - lp_str =3D g_malloc0(strlen(value)); + lp_str =3D g_malloc0(strlen(value) + 1); if (!qdev_prop_sanitize_s390x_loadparm(lp_str, value, errp)) { g_free(lp_str); return; --=20 2.47.0