Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp821972ybn; Wed, 2 Oct 2019 06:46:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNO7T9I629DH9rLt87xgJA2lOpnJiQSzJEgVXfOtIJnWN+m4ky0das81b7dkc8SbXw13A6 X-Received: by 2002:a50:8933:: with SMTP id e48mr3825225ede.51.1570023996728; Wed, 02 Oct 2019 06:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570023996; cv=none; d=google.com; s=arc-20160816; b=Cn4IojRoZhm+gvRrvgxU5spdycObNuUAWdOVP/reMOaBpBe8KtrnZ337EaPhkICAKM gRZePM4tSrF1fMjYkvVPHqcsuMXuHyWQgyCprFgzm6MMTv4qMwARWb0F/Mt5Dhm3MwNh 20w8Z357DgvVRDgeKBEaU2donyDmZci/TWoyfXlTWG4MiaW22CYXSU91vI+Bvukk2X96 wDIagDEVFJpmxXfsYQUI9VRyF/ssw5FU5/mZcnOiZeRZI9YqG4EIEPqwuSDp7mumA2q+ xLdeAMv0Jms9UoOkdhsKOO0PmZnNA3vQWj6prgeno3egst24rpnyFlOPdA3JAiZn+wd4 XYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qR10FZ8QGgJzwW9UJ0Wb3LG+D+QKa9Vl8gloTZTx+3Q=; b=aB5DMky4Qv8TC55P8GTU/T4UW/smVlz8UbdeLK2+Ra5zS1hvm6nd67S4V87IxRRCoa NrmdEwR+RDGXNIKKxAdu5Nz2c4XdEotvnArkJrilLfHFVwoCWYeaJf3FFqCA+c07R4yj b+nNsSwXf9kggsp8yKWLeHnIGbAyizE2Ul5pErS4PuL04IVDZxPUKs72lukv22j+RRbt Yd9ZZAWIECf/YY0q62pXEO6eOzWy2Y2HsNn++9oW0fXJmZJV8H462sxUBGZSQwuH1V4N AybbrPC9akuQVXe91+9J/Q7R6fpTG04CiEKFXvslZ63tq7rT4qAeVJYbLp86uW76Rcz9 E00g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si11134133edm.414.2019.10.02.06.46.12; Wed, 02 Oct 2019 06:46:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727264AbfJBNmV (ORCPT + 99 others); Wed, 2 Oct 2019 09:42:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:51522 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725917AbfJBNmV (ORCPT ); Wed, 2 Oct 2019 09:42:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C41EAACA4; Wed, 2 Oct 2019 13:42:19 +0000 (UTC) Subject: Re: [Xen-devel] [PATCH] x86/xen: Return from panic notifier To: Boris Ostrovsky Cc: james@dingwall.me.uk, xen-devel@lists.xenproject.org, Juergen Gross , linux-kernel@vger.kernel.org References: <20191001151633.1659-1-boris.ostrovsky@oracle.com> <9b3f955c-ad76-601f-2b58-fa9dc4608c72@suse.com> <924f41b2-7779-9c56-9b71-56523756ecdc@oracle.com> From: Jan Beulich Message-ID: <5650904d-b616-5ee7-216a-a0ac28d7426d@suse.com> Date: Wed, 2 Oct 2019 15:42:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <924f41b2-7779-9c56-9b71-56523756ecdc@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.10.2019 15:24, Boris Ostrovsky wrote: > On 10/2/19 3:40 AM, Jan Beulich wrote: >> On 01.10.2019 17:16, Boris Ostrovsky wrote: >>> Currently execution of panic() continues until Xen's panic notifier >>> (xen_panic_event()) is called at which point we make a hypercall that >>> never returns. >>> >>> This means that any notifier that is supposed to be called later as >>> well as significant part of panic() code (such as pstore writes from >>> kmsg_dump()) is never executed. >> Back at the time when this was introduced into the XenoLinux tree, >> I think this behavior was intentional for at least DomU-s. I wonder >> whether you wouldn't want your change to further distinguish Dom0 >> and DomU behavior. > > Do you remember what the reason for that was? I can only guess that the thinking probably was that e.g. external dumping (by the tool stack) would be more reliable (including but not limited to this meaning less change of state from when the original crash reason was detected) than having the domain dump itself. > I think having ability to call kmsg_dump() on a panic is a useful thing > to have for domUs as well. Besides, there may be other functionality > added post-notifiers in panic() in the future. Or another notifier may > be registered later with the same lowest priority. > > Is there a downside in allowing domUs to fall through panic() all the > way to emergency_restart()? See above. >>> There is no reason for xen_panic_event() to be this last point in >>> execution since panic()'s emergency_restart() will call into >>> xen_emergency_restart() from where we can perform our hypercall. >> Did you consider, as an alternative, to lower the notifier's >> priority? > > I didn't but that wouldn't help with the original problem that James > reported --- we'd still not get to kmsg_dump() call. True. I guess more control over the behavior needs to be given to the admin, as either approach has its up- and downsides Jan