Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1456304ybg; Thu, 11 Jun 2020 10:16:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDu7dLWJfcZAHu6jxWYyx7xx+EEqnM1uAHAmELqashoAc9/ykrx3kluHnWCle7e+diNIaI X-Received: by 2002:aa7:c403:: with SMTP id j3mr7976983edq.294.1591895765090; Thu, 11 Jun 2020 10:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591895765; cv=none; d=google.com; s=arc-20160816; b=peFswhhZ555jMkYtea4WuFDsjptQ/x9YF8eUxv9KFj71MgXgrpvG2WWXQxjNkj55NV /pqIftRW+x8ZnZIboIIlpk4jubphgNgKlBu46zb0+C7t2EE5NZ6ceBGBhdD5fS4RvXXL ItkwFV9GEO9dERCOFBWnSR5jcEm4hBneoUfa0M5Fzdkm508WP2x3ifNIBStH/u5QyEXr YxaxikVtFLmjNdz0ljUGbq9mquMLPEbTOxPDQaDWjnmSkZZAyM4t5PwSGyBpyOpuDcU2 2TLJTBG3D40/bXY/sTMae2g5rzQ4aDeNt0W2L12JBvnJoZMyTnqUllkY5BhE3cpu+s4B dbPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=8UOagaiJNWpgBcHi3xgcy5nRYEP/qVrVNROSGf7CFMk=; b=WCuR+jEL5jJNr1VM7ukOcnAlInoBNptTSIeTsPgQwLvfNySPBZlgIdjJHjGPWUZSWW CJdNr/O9QTcUQ/KzKGAdGytmxVSWGXekY38X/at+o52ySZHn4vKShQCUqHjGEXeL8l1N EkU6APNMjD4LLW713EleRFmOMZJdFdhnsziTDPj0iIWOUmlgsfX5BZyK/NdYcL5PvsUe uZntW6rNTRnBygR/ihqZUQNItDafbAXJr0szH6i7M67Pm8sFaS0OZdkgHQQZaubTqrjz P5XTAAL48V/DQT6g3zpSbTmyiS8GEaXaiWz5gnl/KlVE7/b45bkUaVDJ6zitHzHOV9ty hBYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si1980661edn.389.2020.06.11.10.15.41; Thu, 11 Jun 2020 10:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgFKRLS (ORCPT + 99 others); Thu, 11 Jun 2020 13:11:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:36846 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726553AbgFKRLS (ORCPT ); Thu, 11 Jun 2020 13:11:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 783C5AE69; Thu, 11 Jun 2020 17:11:19 +0000 (UTC) Date: Thu, 11 Jun 2020 19:11:14 +0200 Message-ID: From: Takashi Iwai To: "Alex Xu (Hello71)" Cc: alsa-devel@alsa-project.org, bp@alien8.de, hch@infradead.org, Christoph Hellwig , hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, Pavel Machek , perex@perex.cz, rientjes@google.com, tglx@linutronix.de, tiwai@suse.com, x86@kernel.org Subject: Re: next-0519 on thinkpad x60: sound related? window manager crash In-Reply-To: <1591885264.uk6f214o4o.none@localhost> References: <20200520111136.GA3802@amd> <1591545088.74ii116nf2.none@localhost> <20200608061950.GA17476@lst.de> <1591624340.z01ejtod28.none@localhost> <20200609114733.GA1621@lst.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Jun 2020 16:51:55 +0200, Alex Xu (Hello71) wrote: > > Excerpts from Takashi Iwai's message of June 9, 2020 11:12 am: > > On Tue, 09 Jun 2020 13:47:33 +0200, > > Christoph Hellwig wrote: > >> > >> Alex, can you try this patch? > > > > Also could you check whether just papering over the memset() call > > alone avoids the crash like below? For PulseAudio and dmix/dsnoop, > > it's the only code path that accesses the vmapped buffer, I believe. > > > > If this works more or less, I'll cook a more comprehensive fix. > > > > > > thanks, > > > > Takashi > > > > --- a/sound/core/pcm_native.c > > +++ b/sound/core/pcm_native.c > > @@ -754,9 +754,11 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, > > while (runtime->boundary * 2 <= LONG_MAX - runtime->buffer_size) > > runtime->boundary *= 2; > > > > +#if 0 > > /* clear the buffer for avoiding possible kernel info leaks */ > > if (runtime->dma_area && !substream->ops->copy_user) > > memset(runtime->dma_area, 0, runtime->dma_bytes); > > +#endif > > > > snd_pcm_timer_resolution_change(substream); > > snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP); > > > > Sorry, this patch doesn't work for me with SME off using abfbb29297c2. > David's newest submitted patch works for me, which I already replied to > separately. Thanks, so something still missing in the mmap handling, I guess. I've worked on two different branches for potential fixes of your problems. Could you test topic/dma-fix and topic/dma-fix2 branches? git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git Just pull one of them onto Linus' git HEAD. I guess we'll go with David's new patch, but still it's interesting whether my changes do anything good actually. Takashi