From: Namhyung Kim <namhyung@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
"Radim Kr??m????" <rkrcmar@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@kernel.org>, Minchan Kim <minchan@kernel.org>,
KVM <kvm@vger.kernel.org>, qemu-devel <qemu-devel@nongnu.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH 1/3] virtio: Basic implementation of virtio pstore driver
Date: Wed, 20 Jul 2016 00:32:57 +0900 [thread overview]
Message-ID: <CAM9d7cijGGXE0tJbzg1T2r8V44mGwB2rnbS+xW1fjmeafd6eMg@mail.gmail.com> (raw)
In-Reply-To: <20160719134303.GA20047@danjae.aot.lge.com>
On Tue, Jul 19, 2016 at 10:43 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> Hi Kees,
>
> On Mon, Jul 18, 2016 at 10:50:06AM -0700, Kees Cook wrote:
>> On Sun, Jul 17, 2016 at 10:50 PM, Namhyung Kim <namhyung@kernel.org> wrote:
>> > Hello,
>> >
>> > On Sun, Jul 17, 2016 at 10:12:26PM -0700, Kees Cook wrote:
>> >> On Sun, Jul 17, 2016 at 9:37 PM, Namhyung Kim <namhyung@kernel.org> wrote:
>> > [SNIP]
>> >> > +static u16 to_virtio_type(struct virtio_pstore *vps, enum pstore_type_id type)
>> >> > +{
>> >> > + u16 ret;
>> >> > +
>> >> > + switch (type) {
>> >> > + case PSTORE_TYPE_DMESG:
>> >> > + ret = cpu_to_virtio16(vps->vdev, VIRTIO_PSTORE_TYPE_DMESG);
>> >> > + break;
>> >> > + default:
>> >> > + ret = cpu_to_virtio16(vps->vdev, VIRTIO_PSTORE_TYPE_UNKNOWN);
>> >> > + break;
>> >> > + }
>> >>
>> >> I would love to see this support PSTORE_TYPE_CONSOLE too. It should be
>> >> relatively easy to add: I think it'd just be another virtio command?
>> >
>> > Do you want to append the data to the host file as guest does
>> > printk()? I think it needs some kind of buffer management, but it's
>> > not hard to add IMHO.
>>
>> Well, with most pstore backends, the buffer size is limited, so it
>> tends to be a circular buffer of some sort. I think whatever you
>> choose to do is fine (I saw the various mentions of resource limits in
>> the qemu part of this thread), as long as the last N bytes of console
>> can be seen on the host side, where N is some portion of the memory
>> set aside for the log. (I don't mind the idea of an unlimited console
>> log either, but I suspect that will not be accepted on the qemu
>> side...)
>
> I think it needs two kinds of buffer management.
>
> The first one is the psinfo->buf (or something similar). IIUC the
> PSTORE_TYPE_CONSOLE is different than PSTORE_TYPE_DMESG as it is
> emitted every time printk() sends messages to console. So I think the
> it should remain in async mode due to performance reason. To do that,
> the message should be copied to psinfo->buf and then sent via virtio.
> Then it needs to keep track of the available buffer position IMHO.
Looking at the code, I found myself confused with the PSTORE_TYPE_FTRACE
and PSTORE_TYPE_CONSOLE. It seems that handling of
PSTORE_TYPE_CONSOLE is basically same as PSTORE_TYPE_DMESG..
Thanks,
Namhyung
next prev parent reply other threads:[~2016-07-19 15:33 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 4:37 [RFC/PATCHSET 0/3] virtio-pstore: Implement virtio pstore device Namhyung Kim
2016-07-18 4:37 ` [PATCH 1/3] virtio: Basic implementation of virtio pstore driver Namhyung Kim
2016-07-18 5:12 ` Kees Cook
2016-07-18 5:50 ` Namhyung Kim
2016-07-18 17:50 ` Kees Cook
2016-07-19 13:43 ` Namhyung Kim
2016-07-19 15:32 ` Namhyung Kim [this message]
2016-07-20 12:56 ` Namhyung Kim
2016-07-18 7:54 ` Cornelia Huck
2016-07-18 8:29 ` Namhyung Kim
2016-07-18 9:02 ` Cornelia Huck
2016-07-18 4:37 ` [PATCH 2/3] qemu: Implement virtio-pstore device Namhyung Kim
2016-07-18 7:28 ` Christian Borntraeger
2016-07-18 8:33 ` Namhyung Kim
2016-07-18 10:03 ` Stefan Hajnoczi
2016-07-18 14:21 ` Namhyung Kim
2016-07-20 8:29 ` Stefan Hajnoczi
2016-07-20 12:46 ` Namhyung Kim
2016-07-19 15:48 ` Namhyung Kim
2016-07-20 8:21 ` Stefan Hajnoczi
2016-07-20 12:30 ` Namhyung Kim
2016-07-18 4:37 ` [PATCH 3/3] kvmtool: " Namhyung Kim
2016-08-20 8:07 [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3) Namhyung Kim
2016-08-20 8:07 ` [PATCH 1/3] virtio: Basic implementation of virtio pstore driver Namhyung Kim
2016-09-13 15:19 ` Michael S. Tsirkin
2016-09-16 9:05 ` Namhyung Kim
2016-11-10 16:39 ` Michael S. Tsirkin
2016-11-15 4:50 ` Namhyung Kim
2016-11-15 5:06 ` Michael S. Tsirkin
2016-11-15 5:50 ` Namhyung Kim
2016-11-15 14:35 ` Michael S. Tsirkin
2016-11-15 9:57 ` Paolo Bonzini
2016-11-15 14:36 ` Namhyung Kim
2016-11-15 14:38 ` Paolo Bonzini
2016-11-16 7:04 ` Namhyung Kim
2016-11-16 12:10 ` Paolo Bonzini
2016-11-18 3:32 ` Namhyung Kim
2016-11-18 4:07 ` Michael S. Tsirkin
2016-11-18 9:45 ` Paolo Bonzini
2016-08-31 8:07 [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v4) Namhyung Kim
2016-08-31 8:08 ` [PATCH 1/3] virtio: Basic implementation of virtio pstore driver Namhyung Kim
2016-08-31 14:54 ` Michael S. Tsirkin
2016-09-01 0:03 ` Namhyung Kim
2016-09-04 14:38 [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v5) Namhyung Kim
2016-09-04 14:38 ` [PATCH 1/3] virtio: Basic implementation of virtio pstore driver Namhyung Kim
2016-09-08 20:49 ` Kees Cook
2016-09-22 11:57 ` Stefan Hajnoczi
2016-09-23 5:48 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM9d7cijGGXE0tJbzg1T2r8V44mGwB2rnbS+xW1fjmeafd6eMg@mail.gmail.com \
--to=namhyung@kernel.org \
--cc=aliguori@amazon.com \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tony.luck@intel.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).