From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933508AbdDSIUC (ORCPT ); Wed, 19 Apr 2017 04:20:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38152 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760863AbdDSIT6 (ORCPT ); Wed, 19 Apr 2017 04:19:58 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F3F9C05AA52 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0F3F9C05AA52 Date: Wed, 19 Apr 2017 04:19:54 -0400 (EDT) From: Paolo Bonzini To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: open list , keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony luck , Ladi Prosek Message-ID: <1713017371.14449324.1492589994822.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: pstore to save vmcoreinfo for hypervisors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.4.164.1, 10.4.195.3] Thread-Topic: pstore to save vmcoreinfo for hypervisors Thread-Index: HZCFO0KrFLuiiQunZks7gPBvRp40qQ== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 19 Apr 2017 08:19:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > It would be interesting to have this information during early kernel boot, > but which mechanism should be used? pstore seems like an option. There > could be a new PSTORE_TYPE_VMCOREINFO with the same content as > /sys/kernel/vmcoreinfo. During boot, the kernel could remove older entries > if any and add the up to date info (if it detects a VM). qemu or other > hypervisor could then retrieve it for the dump, likely from an ACPI ERST > space (EFI var shouldn't be accessed from host according to some > developpers). I think that pstore would not be saved by dump-guest-memory in general (it would with ramoops, but not in general). I think we need to save the dump info in an out-of-band channel. For example, we could have a simple device consisting of a single 4-byte I/O port, with the following protocol: - writing zero to the I/O port resets the information - writing nonzero to the I/O port sets the "type" of the dump information, e.g. 1 for Linux vmcoreinfo and 2 for Windows KeInitializeCrashDumpHeader. - after writing the type, you write the base of the dump header and then the length - if all three values have been written, dump-guest-memory copies the data to an ELF note, whose name depends on the "type" value (e.g. "VMCOREINFO" for type 1, ".QEMU.WindowsCrashDumpHeader" for type 2). The three values are also migrated of course. The device can be discovered via ACPI like pvpanic. Paolo