[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMz4kuKbo5NauhRW_UdSfL4m4q28B4=pcve=EvW5xDpZ_nyjeg@mail.gmail.com>
Date: Fri, 22 Sep 2017 11:00:58 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Liam Girdwood <lgirdwood@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Takashi Sakamoto <o-takashi@...amocchi.jp>,
SF Markus Elfring <elfring@...rs.sourceforge.net>,
Dan Carpenter <dan.carpenter@...cle.com>, jeeja.kp@...el.com,
Vinod Koul <vinod.koul@...el.com>, dharageswari.r@...el.com,
guneshwor.o.singh@...el.com, Bhumika Goyal <bhumirks@...il.com>,
gudishax.kranthikumar@...el.com, Naveen M <naveen.m@...el.com>,
hardik.t.shah@...el.com, Arvind Yadav <arvind.yadav.cs@...il.com>,
Fabian Frederick <fabf@...net.be>,
Mark Brown <broonie@...nel.org>,
Deepa Dinamani <deepa.kernel@...il.com>,
alsa-devel@...a-project.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 7/7] sound: core: Avoid using timespec for struct snd_timer_tread
On 21 September 2017 at 21:09, Arnd Bergmann <arnd@...db.de> wrote:
> On Thu, Sep 21, 2017 at 8:18 AM, Baolin Wang <baolin.wang@...aro.org> wrote:
>
>> +static int snd_timer_user_tread(void __user *argp, struct snd_timer_user *tu,
>> + unsigned int cmd)
>> +{
>> + int __user *p = argp;
>> + int xarg, old_tread;
>> +
>> + if (tu->timeri) /* too late */
>> + return -EBUSY;
>> + if (get_user(xarg, p))
>> + return -EFAULT;
>> +
>> + old_tread = tu->tread;
>> +#if __BITS_PER_LONG == 64
>> + tu->tread = xarg ? 2 : 0;
>> +#ifdef IA32_EMULATION
>> + tu->tread = xarg ? 3 : 0;
>> +#endif
>> +#else
>> + if (cmd == SNDRV_TIMER_IOCTL_TREAD64)
>> + tu->tread = xarg ? 2 : 0;
>> + else
>> + tu->tread = xarg ? 1 : 0;
>> +#endif
>
> The 64-bit case looks broken here:
>
> - The tread flag is different for compat and native mode, so you
> must pass a flag to identify whether you are called from
> __snd_timer_user_ioctl or from snd_timer_user_ioctl_compat().
I have some confusion here. For 64-bit, we will set tu->tread = 2 no
matter it is native mode or compat mode, only we will set tu->tread =
3 for x86_32 in compat mode, right?
So I think we do not need to identify whether called from native mode
or compat mode.
>
> - On x86, you have to check whether calling user space process uses
> the i386 or the x32 ABI by checking in_x32_syscall()
Make sense.
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists