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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 A1C01C433E0 for ; Fri, 19 Feb 2021 13:38:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 43E0064EC7 for ; Fri, 19 Feb 2021 13:38:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43E0064EC7 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.86876.163369 (Exim 4.92) (envelope-from ) id 1lD5yt-00057E-9g; Fri, 19 Feb 2021 13:38:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 86876.163369; Fri, 19 Feb 2021 13:38:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lD5yt-000577-5Q; Fri, 19 Feb 2021 13:38:03 +0000 Received: by outflank-mailman (input) for mailman id 86876; Fri, 19 Feb 2021 13:38:01 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lD5yr-000572-G7 for xen-devel@lists.xenproject.org; Fri, 19 Feb 2021 13:38:01 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7d8b5c23-5a2c-437a-bd99-6c9a56526803; Fri, 19 Feb 2021 13:38:00 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8C314AC6E; Fri, 19 Feb 2021 13:37:59 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7d8b5c23-5a2c-437a-bd99-6c9a56526803 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613741879; h=from:from:reply-to: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=q0TbcnHmZj0mnHr+Mg1DCerYzlXHBvgyavb0cPKolgg=; b=n+TfXjnXZNWNZYv1QYw44vU8Mm6kCnKFmv3eIxM8usJSCTbtYJq3hLZpe22H/fT9LHxiDr lxG1moSlHK2uA6Y7x3WkjVhHDK7Ybt+f0weBwIeydNcY1zq63GXLVqWqLOL8jrVjii0Hw4 s2ns7LA3PZ3pI3xXAUxzOhu88gSK+Zk= Subject: Re: Linux PV/PVH domU crash on (guest) resume from suspend To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Cc: xen-devel , =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= References: <0b71a671-592a-53ab-6b4a-1fe15b9eb453@suse.com> <08117ed3-7e84-b233-4a74-248896e2a2d8@suse.com> <81dfdb6c-00bc-86c1-a27f-2f7b312b4360@suse.com> From: Jan Beulich Message-ID: Date: Fri, 19 Feb 2021 14:37:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <81dfdb6c-00bc-86c1-a27f-2f7b312b4360@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 19.02.2021 14:18, Jürgen Groß wrote: > On 19.02.21 14:10, Jan Beulich wrote: >> On 19.02.2021 13:48, Jürgen Groß wrote: >>> On 17.02.21 14:48, Marek Marczykowski-Górecki wrote: >>>> On Wed, Feb 17, 2021 at 07:51:42AM +0100, Jürgen Groß wrote: >>>>> On 17.02.21 06:12, Marek Marczykowski-Górecki wrote: >>>>>> Hi, >>>>>> >>>>>> I'm observing Linux PV/PVH guest crash when I resume it from sleep. I do >>>>>> this with: >>>>>> >>>>>> virsh -c xen dompmsuspend mem >>>>>> virsh -c xen dompmwakeup >>>>>> >>>>>> But it's possible to trigger it with plain xl too: >>>>>> >>>>>> xl save -c >>>>>> >>>>>> The same on HVM works fine. >>>>>> >>>>>> This is on Xen 4.14.1, and with guest kernel 5.4.90, the same happens >>>>>> with 5.4.98. Dom0 kernel is the same, but I'm not sure if that's >>>>>> relevant here. I can reliably reproduce it. >>>>> >>>>> This is already on my list of issues to look at. >>>>> >>>>> The problem seems to be related to the XSA-332 patches. You could try >>>>> the patches I've sent out recently addressing other fallout from XSA-332 >>>>> which _might_ fix this issue, too: >>>>> >>>>> https://patchew.org/Xen/20210211101616.13788-1-jgross@suse.com/ >>>> >>>> Thanks for the patches. Sadly it doesn't change anything - I get exactly >>>> the same crash. I applied that on top of 5.11-rc7 (that's what I had >>>> handy). If you think there may be a difference with the final 5.11 or >>>> another branch, please let me know. >>>> >>> >>> Some more tests reveal that this seems to be s hypervisor regression. >>> I can reproduce the very same problem with a 4.12 kernel from 2019. >>> >>> It seems as if the EVTCHNOP_init_control hypercall is returning >>> -EINVAL when the domain is continuing to run after the suspend >>> hypercall (in contrast to the case where a new domain has been created >>> when doing a "xl restore"). >> >> But when you resume the same domain, the kernel isn't supposed to >> call EVTCHNOP_init_control, as that's a one time operation (per >> vCPU, and unless EVTCHNOP_reset was called of course). In the >> hypervisor map_control_block() has (always had) as its first step >> >> if ( v->evtchn_fifo->control_block ) >> return -EINVAL; >> >> Re-setup is needed only when resuming in a new domain. > > But the same guest will not crash when doing the same on a 4.12 > hypervisor. Is the kernel perhaps not given the bit of information anymore that it needs to tell apart the two resume modes? Jan