From patchwork Fri May 3 15:36:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 794396 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp800749wrr; Fri, 3 May 2024 08:37:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXTIPKjoDDzjjid2lChl6JIroJy+eDJGbFH5V87CAQlDKvZ5GxtqTQxmiYLLsKjVmTLDUb8LSl6A6iP+P4dzhdp X-Google-Smtp-Source: AGHT+IGu7EwwSL9wAh+AHmfY5q4jb7tOFe2KDAY7xpf4hMse12/FD4CkPW0NkT9QrrBZ/9u8ktZZ X-Received: by 2002:a05:620a:81d:b0:78e:d6bb:8e59 with SMTP id s29-20020a05620a081d00b0078ed6bb8e59mr4535997qks.33.1714750661030; Fri, 03 May 2024 08:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714750661; cv=none; d=google.com; s=arc-20160816; b=kRKuzzF6RJQdPQcqIpNL2rDrB5Svt1+yqiQ3FJra1WikKVfQiZetiWG/a2qDQI1rid qCmIjvHB5UosQCgi7udBQ56C7D6lQ1ajHJLJ0GHn0ImMJpRbBVn7aVW4H4HfOOKdkL3+ DvQxn4Utq5gYX5RpF8b4UNOWahl9A6nCNCd570YJvb9ggoyJTPSQH0S1xi66HLL88h5g omTymCSWQaS98YBQxQoXcDfUFGNB25IBrf2ls4Jy9te6jT2rd0+7UrA79Cc4TB+RUc4v 66yePF0kxkIBNQxTE6kU7WQHsk0p118Gk63BERuXyUyQdInbagkdyiIxcIiuAcZlndH2 Jcww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wFd49aZe/euzrWDlHUHUg155F0vz6PnPtpjDws04jXo=; fh=DhboJXMA8RiOyOnXDTOJ2LpytVlFP9MzPKqZPfc6r3Y=; b=Dloy5XaFIh1cJmV2qJvcuzWaLPrkpj8PXyB3COWtmK5HO0vJByCaN/KxTMlLPy1tjK Mgel12JARPXdeOdnNa4WITyGiUb2o/xnR0nJxOJvXN4MEQAyGvXM/Tx/SxDajmKhA6M3 E2sBLErjclvEemlmDclFRpV+uWCM/b8STvXJIyi3d0ryplRjhPQV6hhlkUm1NOmVXbGZ PIvRf3oKXo0epXjhHEtbKf8zAIsJM53vv/rnAnn3FMf2xt6G4tzIKqiGu98A45kLVmV0 zg5R10U16V6jV9G5C+j3tsW/nPZk9u/XTqlU8v8KUtI0qV1uBa0SLGvvjM5Wn/4fb4x2 Fsjg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lS/lf9U/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a15-20020a05620a102f00b0079268bce274si2497173qkk.755.2024.05.03.08.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 08:37:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lS/lf9U/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2uxj-0002jw-7f; Fri, 03 May 2024 11:36:40 -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 1s2uxf-0002dh-EC for qemu-devel@nongnu.org; Fri, 03 May 2024 11:36:36 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2uxY-0002iW-5v for qemu-devel@nongnu.org; Fri, 03 May 2024 11:36:34 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a5544fd07easo1415802966b.0 for ; Fri, 03 May 2024 08:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714750586; x=1715355386; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wFd49aZe/euzrWDlHUHUg155F0vz6PnPtpjDws04jXo=; b=lS/lf9U/3LarHv/N0KnfdsehswvsngOToa+iTJRnVXHUyr6AiYvVbPw+yBsgiSE9L3 45H4bk9PUfnQJR70IPvA3RSp6BhUEF3mnE9r1uZBlFmSm6F9vA583So8vpvilBYC3gbI Z7o0thmPU/kmle5RI0JDDTQr0JISJplgoP5S8BfgWsdZ/dAT4eAUM3YaEPYQbBhKn6Bf OidCPn36x9Af7wTxDGAAISm4dvitWi/UEoAyxJmTNX9+8ZOIacavfrQBf8VtUzlS2lPN bh1KdUMZboD7MDh2Fr8j+QWUgi0zPdsROEXPTsTzJ0xsVarpcZE0wAr96kXESt+i5QXP uWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714750586; x=1715355386; 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=wFd49aZe/euzrWDlHUHUg155F0vz6PnPtpjDws04jXo=; b=L7Z88KN/2UQ9GtPEpX/m3soy/rm0ARFVPHSzCKfCFM5IfVFc+kBa3WaWEx5u/kGPSn 8RHduo0TGk78+4qw5tZF6/ecdW0Fbn1FFyO4tXuI9Neo7BvqiFv0uTEk4QCjF2UGeWud UPFjNelogcIrKNgkb/oiQoOZn5+OFl6fi4aMdlOMMfnUuddnpd+p+dLNPDM6o+2ahHrU dwBfdi9kirLxJ/6R+YbEL9uLt6LriCjDuWqrYUI4nFHzHmLyKW19WBp9UjppOIqRTW9z zvoCrzDNynRbsrRzaD5VuqQcJSMPd2mMXIRuxTtX5+VHTNGb8DZj0r7EJm8ncrtvMAFZ k1Qg== X-Gm-Message-State: AOJu0YyV1S0ZESvVKCuERdAFgV+W3QKPBlnX1XV7Z3Ox5eGSozXxb51F FAl5xLPjQjptS6e+E+SEkIktiqFrcaBU/wCgnWBnHYuyhsc7/6sL8dJe8tM2VOl3A0PBVeqHuCt 7 X-Received: by 2002:a17:906:6889:b0:a59:86a7:2785 with SMTP id n9-20020a170906688900b00a5986a72785mr1907271ejr.28.1714750586240; Fri, 03 May 2024 08:36:26 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id c17-20020a1709060fd100b00a526a992d82sm1810177ejk.4.2024.05.03.08.36.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 08:36:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?V?= =?utf-8?q?olker_R=C3=BCmelin?= , Richard Henderson Subject: [PULL 02/14] accel/whpx: Fix NULL dereference in whpx_init_vcpu() Date: Fri, 3 May 2024 17:36:01 +0200 Message-ID: <20240503153613.38709-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503153613.38709-1-philmd@linaro.org> References: <20240503153613.38709-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When mechanically moving the @dirty field to AccelCPUState in commit 9ad49538c7, we neglected cpu->accel is still NULL when we want to dereference it. Fixes: 9ad49538c7 ("accel/whpx: Use accel-specific per-vcpu @dirty field") Reported-by: Volker Rümelin Suggested-by: Volker Rümelin Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240429091918.27429-2-philmd@linaro.org> --- target/i386/whpx/whpx-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index b08e644517..a6674a826d 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2236,7 +2236,7 @@ int whpx_init_vcpu(CPUState *cpu) } vcpu->interruptable = true; - cpu->accel->dirty = true; + vcpu->dirty = true; cpu->accel = vcpu; max_vcpu_index = max(max_vcpu_index, cpu->cpu_index); qemu_add_vm_change_state_handler(whpx_cpu_update_state, env);