Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 302012 Details for
Bug 427707
i686 io_getevents syscalls clobbers registers it shouldn't
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
io_getevents_bug.c
io_getevents_bug.c (text/plain), 2.55 KB, created by
Jakub Jelinek
on 2008-04-10 15:47:08 UTC
(
hide
)
Description:
io_getevents_bug.c
Filename:
MIME Type:
Creator:
Jakub Jelinek
Created:
2008-04-10 15:47:08 UTC
Size:
2.55 KB
patch
obsolete
>/* Compile with: > gcc -m32 -O2 -o io_getevents_bug{,.c} > It should print Correct - ... message, but on F8/F9 i686 kernels > prints > Bug - %esi modified by io_getevents syscall, N * sizeof (struct kio_event) has been added > */ >#define _GNU_SOURCE >#include <sys/syscall.h> >#include <error.h> >#include <errno.h> >#include <fcntl.h> >#include <unistd.h> >#include <stdio.h> >#include <stdint.h> >#include <stdlib.h> >#include <string.h> > >typedef unsigned long kctx_t; > >enum >{ > IO_CMD_PREAD, > IO_CMD_PWRITE, > IO_CMD_FSYNC, > IO_CMD_FDSYNC, > IO_CMD_PREADX, > IO_CMD_POLL >}; > >struct kiocb >{ > uint64_t kiocb_data; > uint64_t kiocb_key; > uint16_t kiocb_lio_opcode; > int16_t kiocb_req_prio; > uint32_t kiocb_fildes; > uint64_t kiocb_buf; > uint64_t kiocb_nbytes; > int64_t kiocb_offset; > int64_t __pad3, __pad4; >}; > >struct kio_event >{ > uint64_t kioe_data; > uint64_t kioe_obj; > int64_t kioe_res; > int64_t kioe_res2; >}; > >char buf[20 * 4096] __attribute__((aligned (4096))); > >static void __attribute__((noinline)) >do_getevents (kctx_t ctx) >{ > struct kio_event ev[10]; >#ifndef __i386__ > int ret = syscall (SYS_io_getevents, ctx, 1, 10, ev); >#else > int ret, ebx; > struct kio_event *esi; > asm volatile ("movl %%ebx, %4\n\tmovl %3, %%ebx\n\tmovl %2, %%eax\n\tint $0x80\n\tmovl %4, %%ebx" > : "=a" (ret), "=S" (esi) > : "i" (SYS_io_getevents), "0" (ctx), "m" (ebx), "c" (1), "d" (10), "1" (ev), "D" (0) > : "memory"); > if (esi == ev) > puts ("Correct, %esi hasn't been changed by io_getevents syscall"); > else if (esi == &ev[ret]) > printf ("Bug - %%esi modified by io_getevents syscall, %d * sizeof (struct kio_event) has been added\n", ret); > else > printf ("Bug - %esi modified by io_getevents syscall"); >#endif >} > >int >main (void) >{ > kctx_t ctx = 0; > int i; > struct kiocb iocbs[20]; > struct kiocb *iocbp[20]; > int fd = open ("/etc/services", O_RDONLY | O_DIRECT); > > if (syscall (SYS_io_setup, 1024, &ctx)) > error (EXIT_FAILURE, errno, "io_setup failed"); > memset (iocbs, 0, sizeof (iocbs)); > for (i = 0; i < 20; i++) > { > iocbs[i].kiocb_data = 0xdeadbeef + i; > iocbs[i].kiocb_lio_opcode = IO_CMD_PREAD; > iocbs[i].kiocb_fildes = fd; > iocbs[i].kiocb_buf = (uintptr_t) &buf[i * 4096]; > iocbs[i].kiocb_nbytes = 4096; > iocbs[i].kiocb_offset = i * 4096; > iocbp[i] = &iocbs[i]; > } > if (syscall (SYS_io_submit, ctx, 20, iocbp) < 0) > error (EXIT_FAILURE, errno, "io_submit failed"); > do_getevents (ctx); > if (syscall (SYS_io_destroy, ctx)) > error (EXIT_FAILURE, errno, "io_destroy failed"); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 427707
:
290923
|
297377
| 302012