From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F40EC433E0 for ; Tue, 16 Mar 2021 20:57:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 488FC64F8C for ; Tue, 16 Mar 2021 20:57:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 488FC64F8C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMGkX-0006p8-1L for qemu-devel@archiver.kernel.org; Tue, 16 Mar 2021 16:57:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMGjZ-0006OI-Hd for qemu-devel@nongnu.org; Tue, 16 Mar 2021 16:56:09 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:45520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMGjX-0002XU-De for qemu-devel@nongnu.org; Tue, 16 Mar 2021 16:56:09 -0400 Received: by mail-pl1-x630.google.com with SMTP id u18so17518463plc.12 for ; Tue, 16 Mar 2021 13:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dSoK/4/F0Ti89m/a5PETgU1SCukkqvF0a3L6A20r44Q=; b=IJMdXzabWRsEWyVwXrgMCuTTH2A+mAByZouKfDgvHSLi2ArJZDPtp7dvlZx5z9QXKW +iSvREnHa0lkZsfZDEQz5sW8p2KXDneubYwqkb63nc0RUWpSdFTsZcjRJBWCslYZjPnz Y1hsIZVWIT1PDnXlEq0g7NO+mXlvFr3HNmVRgecEadFFmLcNs1rKBIO7BCaqBqDFDKNN o9hy+77zaX0LHZxLs1bK8bGuDvzBy/pULIbJwePi2sJ3Gaw1NDe16HgCNHzgVyhDqNyv Bfb/9kON+/XUCQ8ytVgL675G7TlN09Bv5iIOTjTV7tOyTDk0s5CXAgkt6bmomrTwNkMw u98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dSoK/4/F0Ti89m/a5PETgU1SCukkqvF0a3L6A20r44Q=; b=a+MabOHMwao8i3OTfREXIxr2L+r+aDWa4q11TlxB3D+cJpkZVdgG0mfSej+VH48jfJ Q+bbF089GMrxXlgR8uenwICa9AZmZNtOwnYcf9itSiAt92ON4hsj5P0PtmAMpII5pb8a K74winsWOWfMQ62Y6F/PMFkdEgwLV4bE5evkYtuKOdHDL9fSh1fDtd20/hcmImk6ZDRt B0Bq8fJk6vZSdEUqi+5/sX7S6/eK9AMmS57pb7eaoM7XaKlHe4mcR/gMgH0BLIY1kCl5 d8Nn8cvRXYA1mC9VIyG6248s2Qrf2f56rvYC3YbyjP3C2I23peRjY7CWFAmUpVj+wI1A QubQ== X-Gm-Message-State: AOAM5333SdDSSTw+D+ORUzVZ5P6JbphBbjOLDDPqnM80F49gyBi0G0/J ci+Nih6vBpB4SD7QwIPGwfk= X-Google-Smtp-Source: ABdhPJxVr5tlbdhuYNj7ey3aI3XqgsIxVFGT/kOXzveh4NwY1iIwv6K5jJh261xcIUKkwyDE3N6O4Q== X-Received: by 2002:a17:90a:bb8d:: with SMTP id v13mr930664pjr.12.1615928165577; Tue, 16 Mar 2021 13:56:05 -0700 (PDT) Received: from localhost ([2601:647:4600:11e1:d2fd:ba5d:619c:c25d]) by smtp.gmail.com with ESMTPSA id u7sm16948072pfh.150.2021.03.16.13.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 13:56:05 -0700 (PDT) Date: Tue, 16 Mar 2021 13:56:03 -0700 From: Isaku Yamahata To: Igor Mammedov Subject: Re: [PATCH for-6.0] x86:acpi:piix4: reinitialize PM1.CNT on reset Message-ID: <20210316205603.GA1037316@private.email.ne.jp> References: <20210316202956.3041128-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210316202956.3041128-1-imammedo@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=isaku.yamahata@gmail.com; helo=mail-pl1-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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: isaku.yamahata@intel.com, berrange@redhat.com, mst@redhat.com, f4bug@amsat.org, qemu-devel@nongnu.org, reinoud@NetBSD.org, pbonzini@redhat.com, isaku.yamahata@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The fix itself looks good to me for the reported issue. Should more registers be reset in theory? But it would cause other issues. i.e. acpi_pm1_evt_reset(&s->ar); acpi_pm_tmr_reset(&s->ar); acpi_gpe_reset(&s->ar); Reviewed-by: Isaku Yamahata Thanks, On Tue, Mar 16, 2021 at 04:29:56PM -0400, Igor Mammedov wrote: > Commit 6be8cf56bc8b made sure that SCI is enabled in PM1.CNT > on reset in acpi_only mode by modifying acpi_pm1_cnt_reset() and > that worked for q35 as expected. > > The function was introduced by commit > eaba51c573a (acpi, acpi_piix, vt82c686: factor out PM1_CNT logic) > that forgot to actually call it at piix4 reset time and as result > SCI_EN wasn't set as was expected by 6be8cf56bc8b in acpi_only mode. > > So Windows crashes when it notices that SCI_EN is not set and FADT is > not providing information about how to enable it anymore. > Reproducer: > qemu-system-x86_64 -enable-kvm -M pc-i440fx-6.0,smm=off -cdrom any_windows_10x64.iso > > Fix it by calling acpi_pm1_cnt_reset() at piix4 reset time. > > Fixes: 6be8cf56bc8b (acpi/core: always set SCI_EN when SMM isn't supported) > Signed-off-by: Igor Mammedov > --- > CC: isaku.yamahata@intel.com > CC: mst@redhat.com > CC: reinoud@NetBSD.org > CC: isaku.yamahata@gmail.com > CC: berrange@redhat.com > CC: pbonzini@redhat.com > CC: f4bug@amsat.org > --- > hw/acpi/piix4.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index 1efc0ded9f..7cab438015 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi/piix4.c > @@ -325,6 +325,7 @@ static void piix4_pm_reset(DeviceState *dev) > /* Mark SMM as already inited (until KVM supports SMM). */ > pci_conf[0x5B] = 0x02; > } > + acpi_pm1_cnt_reset(&s->ar); > pm_io_space_update(s); > acpi_pcihp_reset(&s->acpi_pci_hotplug, !s->use_acpi_root_pci_hotplug); > } > -- > 2.27.0 > > -- Isaku Yamahata