All of lore.kernel.org
 help / color / mirror / Atom feed
From: KY Srinivasan <kys@microsoft.com>
To: Sitsofe Wheeler <sitsofe@gmail.com>, Dexuan Cui <decui@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PANIC, hyperv] BUG: unable to handle kernel paging request at ffff880077800004 (hv_ringbuffer_write)
Date: Wed, 27 Aug 2014 18:45:55 +0000	[thread overview]
Message-ID: <51ae44fcae424365a6d78f3597175d77@BY2PR0301MB0711.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20140827161900.GA25326@sucs.org>



> -----Original Message-----
> From: Sitsofe Wheeler [mailto:sitsofe@gmail.com]
> Sent: Wednesday, August 27, 2014 9:19 AM
> To: Dexuan Cui
> Cc: KY Srinivasan; Greg Kroah-Hartman; Haiyang Zhang;
> devel@linuxdriverproject.org; linux-kernel@vger.kernel.org
> Subject: Re: [PANIC, hyperv] BUG: unable to handle kernel paging request at
> ffff880077800004 (hv_ringbuffer_write)
> 
> On Wed, Aug 27, 2014 at 02:14:02PM +0000, Dexuan Cui wrote:
> > > -----Original Message-----
> > > From: Sitsofe Wheeler
> > > Sent: Wednesday, August 27, 2014 20:16 PM
> >
> > > > I'm making a patch for this.
> > Please see the end of the mail for the inline patch and try it.
> > (the patch hasn't been rebased against KY's patchset)
> 
> <snip>
> 
> > BTW, with the patch below, hyperv_fb can work now, BUT,
> > *occasionally*,
> > storvsc_probe() -> ... -> vmbus_open() -> can fail due to
> > HV_STATUS_INVALID_ALIGNMENT...
> 
> I applied your new patch on top of KY's pieces (it applied cleanly) and while it
> doesn't blow up, one warning is printed out and the UP boot seemed to stall
> after input: TPPS/2 message (but pressing ctrl-alt-delete allows the system to
> reboot cleanly).

First let me thank you guys for looking into this issue. Looking at your dmesg, it looked like storvsc probe failed as Dexuan had seen. Since the failure appears to be alignment related, perhaps we could test with allocating a page all the time (and getting rid of the kmalloc). Sitsofe, here is a patch based on Dexuan's patch. If this works, I will probably minimize failure cases by pre-allocating per-cpu pages for this.:

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index edfc848..0ca0cba 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -217,25 +217,17 @@ int hv_post_message(union hv_connection_id connection_id,
                  enum hv_message_type message_type,
                  void *payload, size_t payload_size)
 {
-       struct aligned_input {
-               u64 alignment8;
-               struct hv_input_post_message msg;
-       };

        struct hv_input_post_message *aligned_msg;
        u16 status;
-       unsigned long addr;

        if (payload_size > HV_MESSAGE_PAYLOAD_BYTE_COUNT)
                return -EMSGSIZE;

-       addr = (unsigned long)kmalloc(sizeof(struct aligned_input), GFP_ATOMIC);
-       if (!addr)
+       aligned_msg = (struct hv_input_post_message *)get_zeroed_page(GFP_ATOMIC);
+       if (!aligned_msg)
                return -ENOMEM;

-       aligned_msg = (struct hv_input_post_message *)
-                       (ALIGN(addr, HV_HYPERCALL_PARAM_ALIGN));
-
        aligned_msg->connectionid = connection_id;
        aligned_msg->message_type = message_type;
        aligned_msg->payload_size = payload_size;
@@ -244,7 +236,7 @@ int hv_post_message(union hv_connection_id connection_id,
        status = do_hypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL)
                & 0xFFFF;

-       kfree((void *)addr);
+       free_page((unsigned long)aligned_msg);

        return status;
 }
--
1.7.4.1


  reply	other threads:[~2014-08-27 18:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20  9:26 [PANIC, hyperv] BUG: unable to handle kernel paging request at ffff880077800004 (hv_ringbuffer_write) Sitsofe Wheeler
2014-08-20 11:15 ` Dexuan Cui
2014-08-20 11:40   ` Sitsofe Wheeler
2014-08-20 13:42     ` Dexuan Cui
2014-08-25 14:02 ` Dexuan Cui
2014-08-25 17:41   ` Sitsofe Wheeler
2014-08-26 10:30     ` Dexuan Cui
2014-08-27 10:44       ` Sitsofe Wheeler
2014-08-27 11:30         ` Dexuan Cui
2014-08-27 12:15           ` Sitsofe Wheeler
2014-08-27 14:14             ` Dexuan Cui
2014-08-27 16:19               ` Sitsofe Wheeler
2014-08-27 18:45                 ` KY Srinivasan [this message]
2014-08-27 22:57                   ` Sitsofe Wheeler
2014-08-27 23:13                     ` KY Srinivasan
2014-08-28  3:21                       ` Dexuan Cui
2014-08-28  3:41                         ` KY Srinivasan
2014-08-28 12:48                         ` Sitsofe Wheeler
2014-08-29  3:39                           ` Dexuan Cui
2014-08-29  9:49                   ` Dan Carpenter
2014-08-29 10:16                     ` Dexuan Cui
2014-08-29 10:24                       ` Dan Carpenter
2014-08-29 11:20                         ` Sitsofe Wheeler
2014-08-29 14:48                           ` Dexuan Cui

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=51ae44fcae424365a6d78f3597175d77@BY2PR0301MB0711.namprd03.prod.outlook.com \
    --to=kys@microsoft.com \
    --cc=decui@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sitsofe@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.