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=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 0779DC433E0 for ; Wed, 13 May 2020 15:02:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07314207DA for ; Wed, 13 May 2020 15:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589382124; bh=5DbunmbKdhhIoLuDovWgUiQubs9jRyWUKOYRVFYPVPs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=K2siKNjnw9VT/8IwfEPe8bD98T4WJrPruJkat/oZyf+TnyPVxQyCywCGL7bHzUYt8 UE3XuC4Dl3qrVceaSTc4578Ug17EshT3nRg4a4ir4GzkXpKJHlt89anspJdz6MSCOs VFqiDrzgKQGHN1lnCLSpr1KROyzvPFZDP5Vr15V4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389375AbgEMPB7 (ORCPT ); Wed, 13 May 2020 11:01:59 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44347 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389054AbgEMPB6 (ORCPT ); Wed, 13 May 2020 11:01:58 -0400 Received: by mail-wr1-f65.google.com with SMTP id 50so20766386wrc.11; Wed, 13 May 2020 08:01:56 -0700 (PDT) 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=ySQYNCFJieFw49hebY3MJRxVr5zT7izYFnFzCl37LtQ=; b=ukoJt9BWtiaSr+NEzfjybj9b4MErjJAgb8nUVyNDbzC8uDPL7csNpDS5DjiMPOK6r/ uM7+A+RMBf8nupqkzmxFOFtcyyton1BaSom4eqnWqJMo/l6PsxqMP4NIZD/J18TjLakn fS4NwDlU5TXwwX5DRBA2L94a208OP1MwxWdGDxk78KG/x4cjlz0u+LmZOZZsn3ivUAA/ jSFQVs7AsPGz7et5kUV/tnwOEjVLzLe2LhoeWVKJEew0NPCDw4ZrOw+F5AHJgBa8GHQa o011hVUFQTviWTibkrmVA9lMDBHlgMRPg15oHebaeI9urXBIiCmfbgUwvxET6CdVwqED BFVw== X-Gm-Message-State: AGi0PuYsqTDNKAv+GGejJ0YvIn8PMN7mcuCnFbvMpj4jNGsumnSjtpNA CnjB25RhodowmpbjXdPPj/U= X-Google-Smtp-Source: APiQypJgZBp+xJJRlLfto0u7+TAJ63AvPCwqvbP8TiD3U2a/e+i8K84AM43rOUVJ7f2Lh/Wjf6YJ1g== X-Received: by 2002:a5d:6841:: with SMTP id o1mr31448481wrw.412.1589382115833; Wed, 13 May 2020 08:01:55 -0700 (PDT) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id b2sm25334319wrm.30.2020.05.13.08.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 08:01:55 -0700 (PDT) Date: Wed, 13 May 2020 15:01:53 +0000 From: Wei Liu To: Vitaly Kuznetsov Cc: linux-hyperv@vger.kernel.org, Wei Liu , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Michael Kelley , Dexuan Cui , Tianyu Lan Subject: Re: [PATCH] x86/hyperv: Properly suspend/resume reenlightenment notifications Message-ID: <20200513150153.2xi4v2ekpv7zmofo@liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net> References: <20200512160153.134467-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512160153.134467-1-vkuznets@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-hyperv-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Tue, May 12, 2020 at 06:01:53PM +0200, Vitaly Kuznetsov wrote: > Errors during hibernation with reenlightenment notifications enabled were > reported: > > [ 51.730435] PM: hibernation entry > [ 51.737435] PM: Syncing filesystems ... > ... > [ 54.102216] Disabling non-boot CPUs ... > [ 54.106633] smpboot: CPU 1 is now offline > [ 54.110006] unchecked MSR access error: WRMSR to 0x40000106 (tried to > write 0x47c72780000100ee) at rIP: 0xffffffff90062f24 > native_write_msr+0x4/0x20) > [ 54.110006] Call Trace: > [ 54.110006] hv_cpu_die+0xd9/0xf0 > ... > > Normally, hv_cpu_die() just reassigns reenlightenment notifications to some > other CPU when the CPU receiving them goes offline. Upon hibernation, there > is no other CPU which is still online so cpumask_any_but(cpu_online_mask) > returns >= nr_cpu_ids and using it as hv_vp_index index is incorrect. > Disable the feature when cpumask_any_but() fails. > > Also, as we now disable reenlightenment notifications upon hibernation we > need to restore them on resume. Check if hv_reenlightenment_cb was > previously set and restore from hv_resume(). > > Signed-off-by: Vitaly Kuznetsov Applied to hyperv-fixes. Thank you all. Wei.