From: Laurent Vivier <laurent@vivier.eu>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Filip Bozuta" <Filip.Bozuta@rt-rk.com>,
qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi
Subject: Re: [PATCH 00/12] linux-user: Add support for real time clock and
Date: Tue, 14 Jan 2020 13:47:41 +0100 [thread overview]
Message-ID: <92c7e27d-afb7-182d-e7ca-d20c8ff687b6@vivier.eu> (raw)
In-Reply-To: <399810c6-e1a8-463b-b762-afc8837517d4@redhat.com>
Le 14/01/2020 à 13:39, Philippe Mathieu-Daudé a écrit :
> Hi Filip,
>
> This is v5.
>
> On 1/9/20 1:59 PM, Filip Bozuta wrote:
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> This series covers following RTC and sound timer ioctls:
>>
>> RTC ioctls(22):
>>
>> * RTC_AIE_ON * RTC_ALM_SET * RTC_WKALM_SET
>> * RTC_AIE_OFF * RTC_ALM_READ * RTC_WKALM_RD
>> * RTC_UIE_ON * RTC_RD_TIME * RTC_PLL_GET
>> * RTC_UIE_OFF * RTC_SET_TIME * RTC_PLL_SET
>> * RTC_PIE_ON * RTC_IRQP_READ * RTC_VL_READ
>> * RTC_PIE_OFF * RTC_IRQP_SET * RTC_VL_CLR
>> * RTC_WIE_ON * RTC_EPOCH_READ
>> * RTC_WIE_OFF * RTC_EPOCH_SET
>>
>> Sound timer ioctls(14):
>>
>> * SNDRV_TIMER_IOCTL_PVERSION * SNDRV_TIMER_IOCTL_INFO
>> * SNDRV_TIMER_IOCTL_NEXT_DEVICE * SNDRV_TIMER_IOCTL_PARAMS
>> * SNDRV_TIMER_IOCTL_TREAD * SNDRV_TIMER_IOCTL_STATUS
>> * SNDRV_TIMER_IOCTL_GINFO * SNDRV_TIMER_IOCTL_START
>> * SNDRV_TIMER_IOCTL_GPARAMS * SNDRV_TIMER_IOCTL_STOP
>> * SNDRV_TIMER_IOCTL_GSTATUS * SNDRV_TIMER_IOCTL_CONTINUE
>> * SNDRV_TIMER_IOCTL_SELECT * SNDRV_TIMER_IOCTL_PAUSE
>>
>> The functionalities of individual ioctls were described in this series
>> patch commit messages.
>>
>> Testing method for RTC ioctls:
>>
>> Mini test programs were written for each ioctl. Those programs were
>> compiled (sometimes using cross-compilers) for the following
>> architectures:
>>
>> * Intel 64-bit (little endian)
>> * Power pc 32-bit (big endian)
>> * Power pc 64-bit (big endian)
>>
>> The corresponding native programs were executed without using
>> QEMU on following hosts:
>>
>> * Intel Core i7-4790K (x86_64 host)
>> * Power 7447A (ppc32 host)
>>
>> All applicable compiled programs were in turn executed through QEMU
>> and the results obtained were the same ones gotten for native
>> execution.
>>
>> Example of a test program:
>>
>> For ioctl RTC_RD_TIME the following test program was used:
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <linux/rtc.h>
>> #include <fcntl.h>
>> #include <linux/input.h>
>> #include <sys/types.h>
>> #include <unistd.h>
>>
>> #define ERROR -1
>>
>> int main()
>> {
>>
>> int fd = open("/dev/rtc", O_RDWR | O_NONBLOCK);
>>
>> if(fd == ERROR)
>> {
>> perror("open");
>> return -1;
>> }
>>
>> struct rtc_time cur_time;
>>
>> if(ioctl(fd, RTC_RD_TIME, &cur_time) < 0)
>> {
>> perror("ioctl");
>> return -1;
>> }
>>
>> printf("Second: %d, Minute: %d, Hour: %d, Day: %d, Month:
>> %d, Year: %d,",
>> cur_time.tm_sec, cur_time.tm_min, cur_time.tm_hour,
>> cur_time.tm_mday, cur_time.tm_mon, cur_time.tm_year);
>>
>> return 0;
>> }
>>
>> Limitations of testing:
>>
>> The test host pc that was used for testing (intel pc) has RTC
>> that doesn't support all RTC features that are accessible
>> through ioctls. This means that testing can't discover
>> functionality errors related to the third argument of ioctls
>> that are used for features which are not supported. For example,
>> running the test program for ioctl RTC_EPOCH_READ gives
>> the error output: inappropriate ioctl for device. As expected,
>> the same output was obtained through QEMU which means that this
>> ioctl is recognized in QEMU but doesn't really do anything
>> because it is not supported in the host computer's RTC.
>>
>> Conclusion: Some RTC ioctls need to be tested on computers
>> that support their functionalities so that it can be inferred
>> that they are really supported in QEMU. In absence of such
>> test hosts, the specifications of those ioctls need to be
>> carefully checked manually and the implementations should be
>> updated accordingly.
>
> We should be able to check if the host supports these features and run
> your different tests.
> Can you add them in the repository? Maybe under tests/tcg/multiarch/.
>
I agree with Philippe. If you provide the test we will also be able to
run non-regression tests. You can add them in a separate patch if it's
easier for you.
Thanks,
Laurent
next prev parent reply other threads:[~2020-01-14 12:49 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 12:59 [PATCH 00/12] linux-user: Add support for real time clock and Filip Bozuta
2020-01-09 12:59 ` [PATCH 01/12] linux-user: Add support for enabling/disabling RTC features using ioctls Filip Bozuta
2020-01-14 12:28 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 02/12] linux-user: Add support for getting/setting RTC time and alarm " Filip Bozuta
2020-01-14 12:30 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 03/12] linux-user: Add support for getting/setting RTC periodic interrupt and epoch " Filip Bozuta
2020-01-14 12:36 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 04/12] linux-user: Add support for getting/setting RTC wakeup alarm " Filip Bozuta
2020-01-14 12:37 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 05/12] linux-user: Add support for getting/setting RTC PLL correction " Filip Bozuta
2020-01-14 12:39 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 06/12] linux-user: Add support for read/clear RTC voltage low detector " Filip Bozuta
2020-01-14 12:40 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 07/12] linux-user: Add support for getting alsa timer version and id Filip Bozuta
2020-01-14 12:42 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 08/12] linux-user: Add support for setting alsa timer enhanced read using ioctl Filip Bozuta
2020-01-14 12:44 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 09/12] linux-user: Add support for getting/setting specified alsa timer parameters using ioctls Filip Bozuta
2020-01-14 12:52 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 10/12] linux-user: Add support for selecting alsa timer using ioctl Filip Bozuta
2020-01-14 12:53 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 11/12] linux-user: Add support for getting/setting selected alsa timer parameters using ioctls Filip Bozuta
2020-01-14 13:09 ` Laurent Vivier
2020-01-09 12:59 ` [PATCH 12/12] linux-user: Add support for selected alsa timer instructions " Filip Bozuta
2020-01-14 12:57 ` Laurent Vivier
2020-01-14 12:39 ` [PATCH 00/12] linux-user: Add support for real time clock and Philippe Mathieu-Daudé
2020-01-14 12:47 ` Laurent Vivier [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-01-15 15:53 Filip Bozuta
2020-01-15 16:35 ` Laurent Vivier
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=92c7e27d-afb7-182d-e7ca-d20c8ff687b6@vivier.eu \
--to=laurent@vivier.eu \
--cc=Filip.Bozuta@rt-rk.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).