From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754200AbdKFQq3 (ORCPT ); Mon, 6 Nov 2017 11:46:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33768 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752718AbdKFQq1 (ORCPT ); Mon, 6 Nov 2017 11:46:27 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 537A1A0B52 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Subject: Re: BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:LINE To: Paolo Bonzini , Nick Desaulniers Cc: syzbot , borntraeger@de.ibm.com, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, lstoakes@gmail.com, mhocko@suse.com, mingo@redhat.com, rkrcmar@redhat.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, x86@kernel.org References: <001a11447f06b06409055cd621ed@google.com> <367fa416-1adb-53db-4295-c25cec17b893@redhat.com> <12909e30-82ec-f39b-743e-5fb1426b1b89@redhat.com> <684fb5a3-c99f-f683-1a82-a8e116d6593e@redhat.com> <448b4fe1-0058-867c-e195-c77ed70718f4@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Mon, 6 Nov 2017 17:46:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <448b4fe1-0058-867c-e195-c77ed70718f4@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 06 Nov 2017 16:46:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.11.2017 17:37, Paolo Bonzini wrote: > On 06/11/2017 17:19, David Hildenbrand wrote: >> On 06.11.2017 17:14, Paolo Bonzini wrote: >>> On 06/11/2017 17:01, David Hildenbrand wrote: >>>> On 06.11.2017 16:10, Nick Desaulniers wrote: >>>>> Does it have to be stack allocated? >>>> >>>> We can't use kmalloc and friends in emulate.c. We would have to >>>> introduce new emulator callbacks. >>>> >>>> a) for malloc and free. hmmm. >>>> b) for carrying out the fxrstr/fixup. >>>> >>>> Paolo, what do you suggest? >>> >>> You can use kmalloc. Any userspace user of emulate.c would have to >>> write a wrapper. But I'm not sure it's useful... maybe the >>> asm_safe+memcpy could be moved to a separate noinline function, so that >>> segmented_read_std is invoked with a leaner stack. >> >> That's basically what we had before 9d643f63128b, however without the >> "noinline". > > Indeed. I do prefer the usage of __fxstate_size though that was > introduced by 9d643f63128b. > > Paolo > So I'll modify my patch to have that inside a static noinline function and resend. Thanks. -- Thanks, David / dhildenb