Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-14 Thread Amit Shah
On (Wed) 15 May 2013 [13:59:29], Rusty Russell wrote:
> Pranavkumar Sawargaonkar  writes:
> > Hi Rusty,
> >
> > On 13 May 2013 08:22, Rusty Russell  wrote:
> >> Pranavkumar Sawargaonkar  writes:
> >>> Signed-off-by: Pranavkumar Sawargaonkar 
> >>> Signed-off-by: Anup Patel 
> >>> ---
> >>>  Documentation/virtual/virtio-spec.txt |8 +++-
> >>>  1 file changed, 7 insertions(+), 1 deletion(-)
> >>
> >> OK, I applied this to the lyx master, with three changes:
> >> 1) Changed "filed" to "field".
> >> 2) Added ", or even acknowledging the feature" after "without
> >>initializing virtio queues".
> >> 3) Added an initial point to the Device Initialization section:
> >>
> >>1. If the VIRTIO_CONSOLE_F_EMERG_WRITE feature is offered, the
> >>emerg_wr field of the configuration can be written at any time. Thus
> >>it should work for very early boot debugging output as well as
> >>catastophic OS failures (eg. virtio ring corruption).
> >
> > Thanks for applying this patch.
> > Have you also applied first patch ([PATCH V2 1/3] virtio: console: Add
> > emergency writeonly register to config space)
> > with this?  (https://lkml.org/lkml/2013/5/6/169)
> 
> Would like Amit's Ack, since he's de-facto console maintainer.

I've been away, and am reviewing the discussions here.  Expect a
response later today.

Thanks,

Amit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-14 Thread Rusty Russell
Pranavkumar Sawargaonkar  writes:
> Hi Rusty,
>
> On 13 May 2013 08:22, Rusty Russell  wrote:
>> Pranavkumar Sawargaonkar  writes:
>>> Signed-off-by: Pranavkumar Sawargaonkar 
>>> Signed-off-by: Anup Patel 
>>> ---
>>>  Documentation/virtual/virtio-spec.txt |8 +++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> OK, I applied this to the lyx master, with three changes:
>> 1) Changed "filed" to "field".
>> 2) Added ", or even acknowledging the feature" after "without
>>initializing virtio queues".
>> 3) Added an initial point to the Device Initialization section:
>>
>>1. If the VIRTIO_CONSOLE_F_EMERG_WRITE feature is offered, the
>>emerg_wr field of the configuration can be written at any time. Thus
>>it should work for very early boot debugging output as well as
>>catastophic OS failures (eg. virtio ring corruption).
>
> Thanks for applying this patch.
> Have you also applied first patch ([PATCH V2 1/3] virtio: console: Add
> emergency writeonly register to config space)
> with this?  (https://lkml.org/lkml/2013/5/6/169)

Would like Amit's Ack, since he's de-facto console maintainer.

I've reproduced it below.

Cheers,
Rusty.

Subject: [PATCH V2 1/3] virtio: console: Add emergency writeonly register to 
config space
Date: Mon,  6 May 2013 17:49:49 +0530
Message-Id: <1367842791-30285-2-git-send-email-pranavku...@linaro.org>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <1367842791-30285-1-git-send-email-pranavku...@linaro.org>
References: <1367842791-30285-1-git-send-email-pranavku...@linaro.org>
X-Gm-Message-State: 
ALoCoQmDOoCdPmDpT+VgLwYAlJHmkUTB8sEAHVSbrNxWBzYgPHFT9rQ2A9dR8fToM81cHDZDppGx

This patch adds an emerg_wr register (writeonly) in config space
of virtio console device which can be used for debugging.

Signed-off-by: Pranavkumar Sawargaonkar 
Signed-off-by: Anup Patel 
Signed-off-by: Rusty Russell 
---
 include/uapi/linux/virtio_console.h |3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/virtio_console.h 
b/include/uapi/linux/virtio_console.h
index ee13ab6..3fd0dce 100644
--- a/include/uapi/linux/virtio_console.h
+++ b/include/uapi/linux/virtio_console.h
@@ -38,6 +38,7 @@
 /* Feature bits */
 #define VIRTIO_CONSOLE_F_SIZE  0   /* Does host provide console size? */
 #define VIRTIO_CONSOLE_F_MULTIPORT 1   /* Does host provide multiple ports? */
+#define VIRTIO_CONSOLE_F_EMERG_WRITE 2 /* Does host support emergency write? */
 
 #define VIRTIO_CONSOLE_BAD_ID  (~(u32)0)
 
@@ -48,6 +49,8 @@ struct virtio_console_config {
__u16 rows;
/* max. number of ports this device can hold */
__u32 max_nr_ports;
+   /* emergency write register */
+   __u32 emerg_wr;
 } __attribute__((packed));
 
 /*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-13 Thread Christopher Covington
Hi Pranavkumar,

On 05/13/2013 02:56 AM, Pranavkumar Sawargaonkar wrote:
> Hi Rusty,
> 
> On 13 May 2013 08:22, Rusty Russell  wrote:
>> Pranavkumar Sawargaonkar  writes:
>>> Signed-off-by: Pranavkumar Sawargaonkar 
>>> Signed-off-by: Anup Patel 
>>> ---
>>>  Documentation/virtual/virtio-spec.txt |8 +++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> OK, I applied this to the lyx master, with three changes:
>> 1) Changed "filed" to "field".
>> 2) Added ", or even acknowledging the feature" after "without
>>initializing virtio queues".
>> 3) Added an initial point to the Device Initialization section:
>>
>>1. If the VIRTIO_CONSOLE_F_EMERG_WRITE feature is offered, the
>>emerg_wr field of the configuration can be written at any time. Thus
>>it should work for very early boot debugging output as well as
>>catastophic OS failures (eg. virtio ring corruption).
> 
> Thanks for applying this patch.
> Have you also applied first patch ([PATCH V2 1/3] virtio: console: Add
> emergency writeonly register to config space)
> with this?  (https://lkml.org/lkml/2013/5/6/169)

You seem to have omitted copying virtualizat...@lists.linux-foundation.org,
the mailing list documented in the MAINTAINERS file as appropriate for changes
relating to the virtio console driver.

[...]

Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-12 Thread Pranavkumar Sawargaonkar
Hi Rusty,

On 13 May 2013 08:22, Rusty Russell  wrote:
> Pranavkumar Sawargaonkar  writes:
>> Signed-off-by: Pranavkumar Sawargaonkar 
>> Signed-off-by: Anup Patel 
>> ---
>>  Documentation/virtual/virtio-spec.txt |8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> OK, I applied this to the lyx master, with three changes:
> 1) Changed "filed" to "field".
> 2) Added ", or even acknowledging the feature" after "without
>initializing virtio queues".
> 3) Added an initial point to the Device Initialization section:
>
>1. If the VIRTIO_CONSOLE_F_EMERG_WRITE feature is offered, the
>emerg_wr field of the configuration can be written at any time. Thus
>it should work for very early boot debugging output as well as
>catastophic OS failures (eg. virtio ring corruption).

Thanks for applying this patch.
Have you also applied first patch ([PATCH V2 1/3] virtio: console: Add
emergency writeonly register to config space)
with this?  (https://lkml.org/lkml/2013/5/6/169)

>
> Thanks,
> Rusty.

Thanks,
Pranav

>
>> diff --git a/Documentation/virtual/virtio-spec.txt 
>> b/Documentation/virtual/virtio-spec.txt
>> index 0d6ec85..3ca38f8 100644
>> --- a/Documentation/virtual/virtio-spec.txt
>> +++ b/Documentation/virtual/virtio-spec.txt
>> @@ -1927,11 +1927,16 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT 
>> is set
>>  ports; configuration fields nr_ports and max_nr_ports are
>>  valid and control virtqueues will be used.
>>
>> +  VIRTIO_CONSOLE_F_EMERG_WRITE(2) Device has support for emergency
>> +  write. Configuration filed emerg_wr is valid.
>> +
>>Device configuration layout The size of the console is supplied
>>in the configuration space if the VIRTIO_CONSOLE_F_SIZE feature
>>is set. Furthermore, if the VIRTIO_CONSOLE_F_MULTIPORT feature
>>is set, the maximum number of ports supported by the device can
>> -  be fetched.struct virtio_console_config {
>> +  be fetched. If VIRTIO_CONSOLE_F_EMERG_WRITE is set then one can
>> +  use emergency write to output single character without initializing
>> +  virtio queues. struct virtio_console_config {
>>
>>   u16 cols;
>>
>> @@ -1941,6 +1946,7 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is 
>> set
>>
>>   u32 max_nr_ports;
>>
>> + u32 emerg_wr;
>>  };
>>
>>Device Initialization
>> --
>> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-12 Thread Rusty Russell
Rob Landley  writes:
> On 05/06/2013 07:19:50 AM, Pranavkumar Sawargaonkar wrote:
>> Signed-off-by: Pranavkumar Sawargaonkar 
>> Signed-off-by: Anup Patel 
>> ---
>>  Documentation/virtual/virtio-spec.txt |8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/Documentation/virtual/virtio-spec.txt  
>> b/Documentation/virtual/virtio-spec.txt
>> index 0d6ec85..3ca38f8 100644
>> --- a/Documentation/virtual/virtio-spec.txt
>> +++ b/Documentation/virtual/virtio-spec.txt
>> @@ -1927,11 +1927,16 @@ Ports 2 onwards only if  
>> VIRTIO_CONSOLE_F_MULTIPORT is set
>>  ports; configuration fields nr_ports and max_nr_ports are
>>  valid and control virtqueues will be used.
>> 
>> +  VIRTIO_CONSOLE_F_EMERG_WRITE(2) Device has support for emergency
>> +  write. Configuration filed emerg_wr is valid.
>
> Emergency?
>
> Really?
>
> Out of morbid curiosity, what would constitute an _emergency_ in a  
> virtual machine logging context?

Usually, your console device is broken.  Or you can't set it up because
you can't allocate memory.  Or you oops before it is configured.

Terminology is a tricky thing, but the nuance here is that you don't
want to use this as your main console.  It may not do anything.  It may
drop characters.  It's definitely slow.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-12 Thread Rusty Russell
Pranavkumar Sawargaonkar  writes:
> Signed-off-by: Pranavkumar Sawargaonkar 
> Signed-off-by: Anup Patel 
> ---
>  Documentation/virtual/virtio-spec.txt |8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

OK, I applied this to the lyx master, with three changes:
1) Changed "filed" to "field".
2) Added ", or even acknowledging the feature" after "without
   initializing virtio queues".
3) Added an initial point to the Device Initialization section:

   1. If the VIRTIO_CONSOLE_F_EMERG_WRITE feature is offered, the
   emerg_wr field of the configuration can be written at any time. Thus
   it should work for very early boot debugging output as well as
   catastophic OS failures (eg. virtio ring corruption).

Thanks,
Rusty.

> diff --git a/Documentation/virtual/virtio-spec.txt 
> b/Documentation/virtual/virtio-spec.txt
> index 0d6ec85..3ca38f8 100644
> --- a/Documentation/virtual/virtio-spec.txt
> +++ b/Documentation/virtual/virtio-spec.txt
> @@ -1927,11 +1927,16 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is 
> set
>  ports; configuration fields nr_ports and max_nr_ports are
>  valid and control virtqueues will be used.
>  
> +  VIRTIO_CONSOLE_F_EMERG_WRITE(2) Device has support for emergency
> +  write. Configuration filed emerg_wr is valid.
> +
>Device configuration layout The size of the console is supplied
>in the configuration space if the VIRTIO_CONSOLE_F_SIZE feature
>is set. Furthermore, if the VIRTIO_CONSOLE_F_MULTIPORT feature
>is set, the maximum number of ports supported by the device can
> -  be fetched.struct virtio_console_config {
> +  be fetched. If VIRTIO_CONSOLE_F_EMERG_WRITE is set then one can
> +  use emergency write to output single character without initializing
> +  virtio queues. struct virtio_console_config {
>  
>   u16 cols;
>  
> @@ -1941,6 +1946,7 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is 
> set
>  
>   u32 max_nr_ports;
>  
> + u32 emerg_wr;
>  };
>  
>Device Initialization
> -- 
> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-07 Thread Rob Landley

On 05/06/2013 07:19:50 AM, Pranavkumar Sawargaonkar wrote:

Signed-off-by: Pranavkumar Sawargaonkar 
Signed-off-by: Anup Patel 
---
 Documentation/virtual/virtio-spec.txt |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/virtual/virtio-spec.txt  
b/Documentation/virtual/virtio-spec.txt

index 0d6ec85..3ca38f8 100644
--- a/Documentation/virtual/virtio-spec.txt
+++ b/Documentation/virtual/virtio-spec.txt
@@ -1927,11 +1927,16 @@ Ports 2 onwards only if  
VIRTIO_CONSOLE_F_MULTIPORT is set

 ports; configuration fields nr_ports and max_nr_ports are
 valid and control virtqueues will be used.

+  VIRTIO_CONSOLE_F_EMERG_WRITE(2) Device has support for emergency
+  write. Configuration filed emerg_wr is valid.


Emergency?

Really?

Out of morbid curiosity, what would constitute an _emergency_ in a  
virtual machine logging context?


Rob--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 2/3] Documentation: virtio: Add emergency write (emerg_wr) config register in virtio console.

2013-05-06 Thread Pranavkumar Sawargaonkar
Signed-off-by: Pranavkumar Sawargaonkar 
Signed-off-by: Anup Patel 
---
 Documentation/virtual/virtio-spec.txt |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/virtual/virtio-spec.txt 
b/Documentation/virtual/virtio-spec.txt
index 0d6ec85..3ca38f8 100644
--- a/Documentation/virtual/virtio-spec.txt
+++ b/Documentation/virtual/virtio-spec.txt
@@ -1927,11 +1927,16 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is 
set
 ports; configuration fields nr_ports and max_nr_ports are
 valid and control virtqueues will be used.
 
+  VIRTIO_CONSOLE_F_EMERG_WRITE(2) Device has support for emergency
+  write. Configuration filed emerg_wr is valid.
+
   Device configuration layout The size of the console is supplied
   in the configuration space if the VIRTIO_CONSOLE_F_SIZE feature
   is set. Furthermore, if the VIRTIO_CONSOLE_F_MULTIPORT feature
   is set, the maximum number of ports supported by the device can
-  be fetched.struct virtio_console_config {
+  be fetched. If VIRTIO_CONSOLE_F_EMERG_WRITE is set then one can
+  use emergency write to output single character without initializing
+  virtio queues. struct virtio_console_config {
 
u16 cols;
 
@@ -1941,6 +1946,7 @@ Ports 2 onwards only if VIRTIO_CONSOLE_F_MULTIPORT is set
 
u32 max_nr_ports;
 
+   u32 emerg_wr;
 };
 
   Device Initialization
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/