VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMAll/IEMAllDbg.cpp@ 102867

Last change on this file since 102867 was 102867, checked in by vboxsync, 11 months ago

VMM/IEM: Logging for BIOS int 16h and VGABIOS int 10h. bugref:10371

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 71.6 KB
Line 
1/* $Id: IEMAllDbg.cpp 102867 2024-01-14 22:26:14Z vboxsync $ */
2/** @file
3 * IEM - Debug and Logging.
4 */
5
6/*
7 * Copyright (C) 2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28
29/*********************************************************************************************************************************
30* Header Files *
31*********************************************************************************************************************************/
32#define LOG_GROUP LOG_GROUP_IEM
33#define VMCPU_INCL_CPUM_GST_CTX
34#include <VBox/vmm/iem.h>
35#include <VBox/vmm/cpum.h>
36#include <VBox/vmm/dbgf.h>
37#include <VBox/vmm/pgm.h>
38#include "IEMInternal.h"
39#include <VBox/vmm/vmcc.h>
40#include <VBox/log.h>
41#include <iprt/errcore.h>
42#include <iprt/ctype.h>
43#include <iprt/string.h>
44
45
46/*********************************************************************************************************************************
47* Syscalls *
48*********************************************************************************************************************************/
49
50#ifdef LOG_ENABLED
51
52# undef LOG_GROUP
53# define LOG_GROUP LOG_GROUP_IEM_SYSCALL
54
55/**
56 * VIDEO.
57 */
58static void iemLogSyscallVgaBiosInt10h(PVMCPUCC pVCpu)
59{
60 const char *pszSimple;
61 switch (pVCpu->cpum.GstCtx.ah)
62 {
63 case 0x00:
64 Log(("VGABIOS INT 10h: AH=00h: set video mode: AL=%#x (BX=%#x)\n", pVCpu->cpum.GstCtx.al, pVCpu->cpum.GstCtx.bx));
65 return;
66 case 0x01: pszSimple = "set text-mode cursor shape"; break;
67 case 0x02: pszSimple = "set cursor position"; break;
68 case 0x03: pszSimple = "get cursor position"; break;
69 case 0x04: pszSimple = "get light pen position"; break;
70 case 0x05: pszSimple = "select active display page"; break;
71 case 0x06: pszSimple = "scroll up window"; break;
72 case 0x07: pszSimple = "scroll down window"; break;
73 case 0x08: pszSimple = "read char & attr at cursor"; break;
74 case 0x09: pszSimple = "write char & attr at cursor"; break;
75 case 0x0a: pszSimple = "write char only at cursor"; break;
76 case 0x0b:
77 switch (pVCpu->cpum.GstCtx.bh)
78 {
79 case 0: pszSimple = "set background/border color"; break;
80 case 1: pszSimple = "set palette"; break;
81 case 2: pszSimple = "set palette entry"; break;
82 default:
83 return;
84 }
85 break;
86 case 0x0c: pszSimple = "write graphics pixel"; break;
87 case 0x0d: pszSimple = "read graphics pixel"; break;
88 case 0x0e:
89 if (RT_C_IS_PRINT(pVCpu->cpum.GstCtx.al))
90 Log(("VGABIOS INT 10h: AH=0eh: teletype output: AL=%#04x '%c' BH=%#x (pg) BL=%#x\n",
91 pVCpu->cpum.GstCtx.al, pVCpu->cpum.GstCtx.al, pVCpu->cpum.GstCtx.bh, pVCpu->cpum.GstCtx.bl));
92 else
93 Log(("VGABIOS INT 10h: AH=0eh: teletype output: AL=%#04x %s BH=%#x (pg) BL=%#x\n", pVCpu->cpum.GstCtx.al,
94 pVCpu->cpum.GstCtx.al == '\n' ? "\\n "
95 : pVCpu->cpum.GstCtx.al == '\r' ? "\\r "
96 : pVCpu->cpum.GstCtx.al == '\t' ? "\\t " : " ? ",
97 pVCpu->cpum.GstCtx.bh, pVCpu->cpum.GstCtx.bl));
98 return;
99 case 0x13:
100 {
101 char szRaw[256] = {0};
102 unsigned const cbToRead = RT_MIN(RT_ELEMENTS(szRaw), pVCpu->cpum.GstCtx.cx);
103 PGMPhysSimpleReadGCPtr(pVCpu, szRaw, pVCpu->cpum.GstCtx.es.u64Base + pVCpu->cpum.GstCtx.bp, cbToRead);
104 char szChars[256+1];
105 if (pVCpu->cpum.GstCtx.al & RT_BIT_32(1))
106 {
107 for (unsigned i = 0; i < cbToRead; i += 2)
108 szChars[i / 2] = RT_C_IS_PRINT(szRaw[i]) ? szRaw[i] : '.';
109 szChars[cbToRead / 2] = '\0';
110 }
111 else
112 {
113 for (unsigned i = 0; i < cbToRead; i += 2)
114 szChars[i] = RT_C_IS_PRINT(szRaw[i]) ? szRaw[i] : '.';
115 szChars[cbToRead] = '\0';
116 }
117 Log(("VGABIOS INT 10h: AH=13h: write string: AL=%#x BH=%#x (pg) BL=%#x DH=%#x (row) DL=%#x (col) CX=%#x (len) ES:BP=%04x:%04x: '%s' (%.*Rhxs)\n",
118 pVCpu->cpum.GstCtx.al, pVCpu->cpum.GstCtx.bh, pVCpu->cpum.GstCtx.bl, pVCpu->cpum.GstCtx.dh, pVCpu->cpum.GstCtx.dl,
119 pVCpu->cpum.GstCtx.cx, pVCpu->cpum.GstCtx.es.Sel, pVCpu->cpum.GstCtx.bp, szChars, cbToRead, szRaw));
120 return;
121 }
122 default:
123 return;
124 }
125 Log(("VGABIOS INT 10h: AH=%02xh: %s - AL=%#x BX=%#x CX=%#x DX=%#x\n",
126 pVCpu->cpum.GstCtx.ah, pszSimple, pVCpu->cpum.GstCtx.al,
127 pVCpu->cpum.GstCtx.bx, pVCpu->cpum.GstCtx.cx, pVCpu->cpum.GstCtx.dx));
128}
129
130
131/**
132 * BIOS INT 16h.
133 */
134static void iemLogSyscallBiosInt16h(PVMCPUCC pVCpu)
135{
136 const char *pszSimple;
137 switch (pVCpu->cpum.GstCtx.ah)
138 {
139 case 0x00: pszSimple = "get keystroke"; break;
140 case 0x01: pszSimple = "check for keystroke"; break;
141 case 0x02: pszSimple = "get shift flags"; break;
142 case 0x03: pszSimple = "set typematic rate and delay"; break;
143 case 0x09: pszSimple = "get keyboard functionality"; break;
144 case 0x0a: pszSimple = "get keyboard id"; break;
145 case 0x10: pszSimple = "get enhanced keystroke"; break;
146 case 0x11: pszSimple = "check for enhanced keystroke"; break;
147 case 0x12: pszSimple = "get enhanced shift flags"; break;
148 default:
149 return;
150 }
151 Log(("BIOS INT 16h: AH=%02xh: %s - AL=%#x BX=%#x CX=%#x DX=%#x\n",
152 pVCpu->cpum.GstCtx.ah, pszSimple, pVCpu->cpum.GstCtx.al,
153 pVCpu->cpum.GstCtx.bx, pVCpu->cpum.GstCtx.cx, pVCpu->cpum.GstCtx.dx));
154}
155
156
157static void iemLogSyscallWinVxDCall(PVMCPUCC pVCpu, uint8_t cbInstr)
158{
159 /*
160 * Two double words follow the instruction:
161 * 1. Service number.
162 * 2. VxD identifier.
163 */
164 uint16_t auParams[2] = {0, 0};
165 RTGCPTR const GCPtrParams = pVCpu->cpum.GstCtx.cs.u64Base + pVCpu->cpum.GstCtx.rip + cbInstr;
166 int rc = PGMPhysSimpleReadGCPtr(pVCpu, auParams, GCPtrParams, sizeof(auParams));
167 if (RT_SUCCESS(rc))
168 {
169 const char *pszVxD = NULL;
170 const char *pszService = NULL;
171 uint16_t const idVxD = auParams[1];
172 uint16_t const idService = auParams[0];
173 switch (idVxD)
174 {
175 case 0x0001:
176 switch (idService)
177 {
178 case 0x0000: pszService = "get version"; break;
179 case 0x0001: pszService = "get current VM handle"; break;
180 case 0x0002: pszService = "test current VM handle"; break;
181 case 0x0003: pszService = "get system VM handle"; break;
182 case 0x0004: pszService = "test system VM handle"; break;
183 case 0x0005: pszService = "validate VM handle"; break;
184 case 0x0006: pszService = "get VMM reenter count"; break;
185 case 0x0007: pszService = "begin reentrant execution"; break;
186 case 0x0008: pszService = "end reentrant execution"; break;
187 case 0x0009: pszService = "install V86 breakpoint"; break;
188 case 0x000a: pszService = "remove V86 breakpoint"; break;
189 case 0x000b: pszService = "allocate V86 callback"; break;
190 case 0x000c: pszService = "allocation PM callback"; break;
191 case 0x000d: pszService = "call when VM returns"; break;
192 case 0x000e: pszService = "schedule global event"; break;
193 case 0x000f: pszService = "schedule VM event"; break;
194 case 0x0010: pszService = "call global event"; break;
195 case 0x0011: pszService = "call VM event"; break;
196 case 0x0012: pszService = "cancel global event"; break;
197 case 0x0013: pszService = "cancel VM event"; break;
198 case 0x0014: pszService = "call priority VM event"; break;
199 case 0x0015: pszService = "cancel priority VM event"; break;
200 case 0x0016: pszService = "get NMI handler address"; break;
201 case 0x0017: pszService = "set NMI handler address"; break;
202 case 0x0018: pszService = "hook NMI event"; break;
203 case 0x0019: pszService = "call when VM interrupts enabled"; break;
204 case 0x001a: pszService = "enable VM interrupts"; break;
205 case 0x001b: pszService = "disable VM interrupts"; break;
206 case 0x001c: pszService = "map flat"; break;
207 case 0x001d: pszService = "map linear to VM address"; break;
208 case 0x001e: pszService = "adjust execution priority"; break;
209 case 0x001f: pszService = "begin critical section"; break;
210 case 0x0020: pszService = "end critical section"; break;
211 case 0x0021: pszService = "end critical section and suspend"; break;
212 case 0x0022: pszService = "claim critical section"; break;
213 case 0x0023: pszService = "release critical section"; break;
214 case 0x0024: pszService = "call when not critical"; break;
215 case 0x0025: pszService = "create semaphore"; break;
216 case 0x0026: pszService = "destroy semaphore"; break;
217 case 0x0027: pszService = "wait on semaphore"; break;
218 case 0x0028: pszService = "signal semaphore"; break;
219 case 0x0029: pszService = "get critical section status"; break;
220 case 0x002a: pszService = "call when task switched"; break;
221 case 0x002b: pszService = "suspend VM"; break;
222 case 0x002c: pszService = "resume VM"; break;
223 case 0x002d: pszService = "no-fail resume VM"; break;
224 case 0x002e: pszService = "nuke VM"; break;
225 case 0x002f: pszService = "crash current VM"; break;
226 case 0x0030: pszService = "get execution focus"; break;
227 case 0x0031: pszService = "set execution focus"; break;
228 case 0x0032: pszService = "get time slice priority"; break;
229 case 0x0033: pszService = "set time slice priority"; break;
230 case 0x0034: pszService = "get time slice granularity"; break;
231 case 0x0035: pszService = "set time slice granularity"; break;
232 case 0x0036: pszService = "get time slice information"; break;
233 case 0x0037: pszService = "adjust execution time"; break;
234 case 0x0038: pszService = "release time slice"; break;
235 case 0x0039: pszService = "wake up VM"; break;
236 case 0x003a: pszService = "call when idle"; break;
237 case 0x003b: pszService = "get next VM handle"; break;
238 case 0x003c: pszService = "set global timeout"; break;
239 case 0x003d: pszService = "set VM timeout"; break;
240 case 0x003e: pszService = "cancel timeout"; break;
241 case 0x003f: pszService = "get system time"; break;
242 case 0x0040: pszService = "get VM execution time"; break;
243 case 0x0041: pszService = "hook V86 interrupt chain"; break;
244 case 0x0042: pszService = "get V86 interrupt vector"; break;
245 case 0x0043: pszService = "set V86 interrupt vector"; break;
246 case 0x0044: pszService = "get PM interrupt vector"; break;
247 case 0x0045: pszService = "set PM interrupt vector"; break;
248 case 0x0046: pszService = "simulate interrupt"; break;
249 case 0x0047: pszService = "simulate IRET"; break;
250 case 0x0048: pszService = "simulate far call"; break;
251 case 0x0049: pszService = "simulate far jump"; break;
252 case 0x004a: pszService = "simulate far RET"; break;
253 case 0x004b: pszService = "simulate far RET N"; break;
254 case 0x004c: pszService = "build interrupt stack frame"; break;
255 case 0x004d: pszService = "simulate push"; break;
256 case 0x004e: pszService = "simulate pop"; break;
257 case 0x004f: pszService = "HeapAllocate"; break;
258 case 0x0050: pszService = "HeapReAllocate"; break;
259 case 0x0051: pszService = "HeapFree"; break;
260 case 0x0052: pszService = "HeapGetSize"; break;
261 case 0x0053: pszService = "PageAllocate"; break;
262 case 0x0054: pszService = "PageReAllocate"; break;
263 case 0x0055: pszService = "PageFree"; break;
264 case 0x0056: pszService = "PageLock"; break;
265 case 0x0057: pszService = "PageUnLock"; break;
266 case 0x0058: pszService = "PageGetSizeAddr"; break;
267 case 0x0059: pszService = "PageGetAllocInfo"; break;
268 case 0x005a: pszService = "GetFreePageCount"; break;
269 case 0x005b: pszService = "GetSysPageCount"; break;
270 case 0x005c: pszService = "GetVMPgCount"; break;
271 case 0x005d: pszService = "MapIntoV86"; break;
272 case 0x005e: pszService = "PhysIntoV86"; break;
273 case 0x005f: pszService = "TestGlobalV86Mem"; break;
274 case 0x0060: pszService = "ModifyPageBits"; break;
275 case 0x0061: pszService = "copy page table"; break;
276 case 0x0062: pszService = "map linear into V86"; break;
277 case 0x0063: pszService = "linear page lock"; break;
278 case 0x0064: pszService = "linear page unlock"; break;
279 case 0x0065: pszService = "SetResetV86Pageabl"; break;
280 case 0x0066: pszService = "GetV86PageableArray"; break;
281 case 0x0067: pszService = "PageCheckLinRange"; break;
282 case 0x0068: pszService = "page out dirty pages"; break;
283 case 0x0069: pszService = "discard pages"; break;
284 case 0x006a: pszService = "GetNulPageHandle"; break;
285 case 0x006b: pszService = "get first V86 page"; break;
286 case 0x006c: pszService = "map physical address to linear address"; break;
287 case 0x006d: pszService = "GetAppFlatDSAlias"; break;
288 case 0x006e: pszService = "SelectorMapFlat"; break;
289 case 0x006f: pszService = "GetDemandPageInfo"; break;
290 case 0x0070: pszService = "GetSetPageOutCount"; break;
291 case 0x0071: pszService = "hook V86 page"; break;
292 case 0x0072: pszService = "assign device V86 pages"; break;
293 case 0x0073: pszService = "deassign device V86 pages"; break;
294 case 0x0074: pszService = "get array of V86 pages for device"; break;
295 case 0x0075: pszService = "SetNULPageAddr"; break;
296 case 0x0076: pszService = "allocate GDT selector"; break;
297 case 0x0077: pszService = "free GDT selector"; break;
298 case 0x0078: pszService = "allocate LDT selector"; break;
299 case 0x0079: pszService = "free LDT selector"; break;
300 case 0x007a: pszService = "BuildDescriptorDWORDs"; break;
301 case 0x007b: pszService = "get descriptor"; break;
302 case 0x007c: pszService = "set descriptor"; break;
303 case 0x007d: pszService = "toggle HMA"; break;
304 case 0x007e: pszService = "get fault hook addresses"; break;
305 case 0x007f: pszService = "hook V86 fault"; break;
306 case 0x0080: pszService = "hook PM fault"; break;
307 case 0x0081: pszService = "hook VMM fault"; break;
308 case 0x0082: pszService = "begin nested V86 execution"; break;
309 case 0x0083: pszService = "begin nested execution"; break;
310 case 0x0084: pszService = "execute V86-mode interrupt"; break;
311 case 0x0085: pszService = "resume execution"; break;
312 case 0x0086: pszService = "end nested execution"; break;
313 case 0x0087: pszService = "allocate PM application callback area"; break;
314 case 0x0088: pszService = "get current PM application callback area"; break;
315 case 0x0089: pszService = "set V86 execution mode"; break;
316 case 0x008a: pszService = "set PM execution mode"; break;
317 case 0x008b: pszService = "begin using locked PM stack"; break;
318 case 0x008c: pszService = "end using locked PM stack"; break;
319 case 0x008d: pszService = "save client state"; break;
320 case 0x008e: pszService = "restore client state"; break;
321 case 0x008f: pszService = "execute VxD interrupt"; break;
322 case 0x0090: pszService = "hook device service"; break;
323 case 0x0091: pszService = "hook device V86 API"; break;
324 case 0x0092: pszService = "hook device PM API"; break;
325 case 0x0093: pszService = "system control (see also #02657)"; break;
326 case 0x0094: pszService = "simulate I/O"; break;
327 case 0x0095: pszService = "install multiple I/O handlers"; break;
328 case 0x0096: pszService = "install I/O handler"; break;
329 case 0x0097: pszService = "enable global trapping"; break;
330 case 0x0098: pszService = "enable local trapping"; break;
331 case 0x0099: pszService = "disable global trapping"; break;
332 case 0x009a: pszService = "disable local trapping"; break;
333 case 0x009b: pszService = "create list"; break;
334 case 0x009c: pszService = "destroy list"; break;
335 case 0x009d: pszService = "allocate list"; break;
336 case 0x009e: pszService = "attach list"; break;
337 case 0x009f: pszService = "attach list tail"; break;
338 case 0x00a0: pszService = "insert into list"; break;
339 case 0x00a1: pszService = "remove from list"; break;
340 case 0x00a2: pszService = "deallocate list"; break;
341 case 0x00a3: pszService = "get first item in list"; break;
342 case 0x00a4: pszService = "get next item in list"; break;
343 case 0x00a5: pszService = "remove first item in list"; break;
344 case 0x00a6: pszService = "add instance item"; break;
345 case 0x00a7: pszService = "allocate device callback area"; break;
346 case 0x00a8: pszService = "allocate global V86 data area"; break;
347 case 0x00a9: pszService = "allocate temporary V86 data area"; break;
348 case 0x00aa: pszService = "free temporary V86 data area"; break;
349 case 0x00ab: pszService = "get decimal integer from profile"; break;
350 case 0x00ac: pszService = "convert decimal string to integer"; break;
351 case 0x00ad: pszService = "get fixed-point number from profile"; break;
352 case 0x00ae: pszService = "convert fixed-point string"; break;
353 case 0x00af: pszService = "get hex integer from profile"; break;
354 case 0x00b0: pszService = "convert hex string to integer"; break;
355 case 0x00b1: pszService = "get boolean value from profile"; break;
356 case 0x00b2: pszService = "convert boolean string"; break;
357 case 0x00b3: pszService = "get string from profile"; break;
358 case 0x00b4: pszService = "get next string from profile"; break;
359 case 0x00b5: pszService = "get environment string"; break;
360 case 0x00b6: pszService = "get exec path"; break;
361 case 0x00b7: pszService = "get configuration directory"; break;
362 case 0x00b8: pszService = "open file"; break;
363 case 0x00b9: pszService = "get PSP segment"; break;
364 case 0x00ba: pszService = "get DOS vectors"; break;
365 case 0x00bb: pszService = "get machine information"; break;
366 case 0x00bc: pszService = "get/set HMA information"; break;
367 case 0x00bd: pszService = "set system exit code"; break;
368 case 0x00be: pszService = "fatal error handler"; break;
369 case 0x00bf: pszService = "fatal memory error"; break;
370 case 0x00c0: pszService = "update system clock"; break;
371 case 0x00c1: pszService = "test if debugger installed"; break;
372 case 0x00c2: pszService = "output debugger string"; break;
373 case 0x00c3: pszService = "output debugger character"; break;
374 case 0x00c4: pszService = "input debugger character"; break;
375 case 0x00c5: pszService = "debugger convert hex to binary"; break;
376 case 0x00c6: pszService = "debugger convert hex to decimal"; break;
377 case 0x00c7: pszService = "debugger test if valid handle"; break;
378 case 0x00c8: pszService = "validate client pointer"; break;
379 case 0x00c9: pszService = "test reentry"; break;
380 case 0x00ca: pszService = "queue debugger string"; break;
381 case 0x00cb: pszService = "log procedure call"; break;
382 case 0x00cc: pszService = "debugger test current VM"; break;
383 case 0x00cd: pszService = "get PM interrupt type"; break;
384 case 0x00ce: pszService = "set PM interrupt type"; break;
385 case 0x00cf: pszService = "get last updated system time"; break;
386 case 0x00d0: pszService = "get last updated VM execution time"; break;
387 case 0x00d1: pszService = "test if double-byte character-set lead byte"; break;
388 case 0x00d2: pszService = "AddFreePhysPage"; break;
389 case 0x00d3: pszService = "PageResetHandlePAddr"; break;
390 case 0x00d4: pszService = "SetLastV86Page"; break;
391 case 0x00d5: pszService = "GetLastV86Page"; break;
392 case 0x00d6: pszService = "MapFreePhysReg"; break;
393 case 0x00d7: pszService = "UnmapFreePhysReg"; break;
394 case 0x00d8: pszService = "XchgFreePhysReg"; break;
395 case 0x00d9: pszService = "SetFreePhysRegCalBk"; break;
396 case 0x00da: pszService = "get next arena (MCB)"; break;
397 case 0x00db: pszService = "get name of ugly TSR"; break;
398 case 0x00dc: pszService = "get debug options"; break;
399 case 0x00dd: pszService = "set physical HMA alias"; break;
400 case 0x00de: pszService = "GetGlblRng0V86IntBase"; break;
401 case 0x00df: pszService = "add global V86 data area"; break;
402 case 0x00e0: pszService = "get/set detailed VM error"; break;
403 case 0x00e1: pszService = "Is_Debug_Chr"; break;
404 case 0x00e2: pszService = "clear monochrome screen"; break;
405 case 0x00e3: pszService = "output character to mono screen"; break;
406 case 0x00e4: pszService = "output string to mono screen"; break;
407 case 0x00e5: pszService = "set current position on mono screen"; break;
408 case 0x00e6: pszService = "get current position on mono screen"; break;
409 case 0x00e7: pszService = "get character from mono screen"; break;
410 case 0x00e8: pszService = "locate byte in ROM"; break;
411 case 0x00e9: pszService = "hook invalid page fault"; break;
412 case 0x00ea: pszService = "unhook invalid page fault"; break;
413 case 0x00eb: pszService = "set delete on exit file"; break;
414 case 0x00ec: pszService = "close VM"; break;
415 case 0x00ed: pszService = "Enable_Touch_1st_Meg"; break;
416 case 0x00ee: pszService = "Disable_Touch_1st_Meg"; break;
417 case 0x00ef: pszService = "install exception handler"; break;
418 case 0x00f0: pszService = "remove exception handler"; break;
419 case 0x00f1: pszService = "Get_Crit_Status_No_Block"; break;
420 case 0x00f2: pszService = "Schedule_VM_RTI_Event"; break;
421 case 0x00f3: pszService = "Trace_Out_Service"; break;
422 case 0x00f4: pszService = "Debug_Out_Service"; break;
423 case 0x00f5: pszService = "Debug_Flags_Service"; break;
424 case 0x00f6: pszService = "VMM add import module name"; break;
425 case 0x00f7: pszService = "VMM Add DDB"; break;
426 case 0x00f8: pszService = "VMM Remove DDB"; break;
427 case 0x00f9: pszService = "get thread time slice priority"; break;
428 case 0x00fa: pszService = "set thread time slice priority"; break;
429 case 0x00fb: pszService = "schedule thread event"; break;
430 case 0x00fc: pszService = "cancel thread event"; break;
431 case 0x00fd: pszService = "set thread timeout"; break;
432 case 0x00fe: pszService = "set asynchronous timeout"; break;
433 case 0x00ff: pszService = "AllocatreThreadDataSlot"; break;
434 case 0x0100: pszService = "FreeThreadDataSlot"; break;
435 case 0x0101: pszService = "create Mutex"; break;
436 case 0x0102: pszService = "destroy Mutex"; break;
437 case 0x0103: pszService = "get Mutex owner"; break;
438 case 0x0104: pszService = "call when thread switched"; break;
439 case 0x0105: pszService = "create thread"; break;
440 case 0x0106: pszService = "start thread"; break;
441 case 0x0107: pszService = "terminate thread"; break;
442 case 0x0108: pszService = "get current thread handle"; break;
443 case 0x0109: pszService = "test current thread handle"; break;
444 case 0x010a: pszService = "Get_Sys_Thread_Handle"; break;
445 case 0x010b: pszService = "Test_Sys_Thread_Handle"; break;
446 case 0x010c: pszService = "Validate_Thread_Handle"; break;
447 case 0x010d: pszService = "Get_Initial_Thread_Handle"; break;
448 case 0x010e: pszService = "Test_Initial_Thread_Handle"; break;
449 case 0x010f: pszService = "Debug_Test_Valid_Thread_Handle"; break;
450 case 0x0110: pszService = "Debug_Test_Cur_Thread"; break;
451 case 0x0111: pszService = "VMM_GetSystemInitState"; break;
452 case 0x0112: pszService = "Cancel_Call_When_Thread_Switched"; break;
453 case 0x0113: pszService = "Get_Next_Thread_Handle"; break;
454 case 0x0114: pszService = "Adjust_Thread_Exec_Priority"; break;
455 case 0x0115: pszService = "Deallocate_Device_CB_Area"; break;
456 case 0x0116: pszService = "Remove_IO_Handler"; break;
457 case 0x0117: pszService = "Remove_Mult_IO_Handlers"; break;
458 case 0x0118: pszService = "unhook V86 interrupt chain"; break;
459 case 0x0119: pszService = "unhook V86 fault handler"; break;
460 case 0x011a: pszService = "unhook PM fault handler"; break;
461 case 0x011b: pszService = "unhook VMM fault handler"; break;
462 case 0x011c: pszService = "unhook device service"; break;
463 case 0x011d: pszService = "PageReserve"; break;
464 case 0x011e: pszService = "PageCommit"; break;
465 case 0x011f: pszService = "PageDecommit"; break;
466 case 0x0120: pszService = "PagerRegister"; break;
467 case 0x0121: pszService = "PagerQuery"; break;
468 case 0x0122: pszService = "PagerDeregister"; break;
469 case 0x0123: pszService = "ContextCreate"; break;
470 case 0x0124: pszService = "ContextDestroy"; break;
471 case 0x0125: pszService = "PageAttach"; break;
472 case 0x0126: pszService = "PageFlush"; break;
473 case 0x0127: pszService = "SignalID"; break;
474 case 0x0128: pszService = "PageCommitPhys"; break;
475 case 0x0129: pszService = "Register_Win32_Services"; break;
476 case 0x012a: pszService = "Cancel_Call_When_Not_Critical"; break;
477 case 0x012b: pszService = "Cancel_Call_When_Idle"; break;
478 case 0x012c: pszService = "Cancel_Call_When_Task_Switched"; break;
479 case 0x012d: pszService = "Debug_Printf_Service"; break;
480 case 0x012e: pszService = "enter Mutex"; break;
481 case 0x012f: pszService = "leave Mutex"; break;
482 case 0x0130: pszService = "simulate VM I/O"; break;
483 case 0x0131: pszService = "Signal_Semaphore_No_Switch"; break;
484 case 0x0132: pszService = "MMSwitchContext"; break;
485 case 0x0133: pszService = "MMModifyPermissions"; break;
486 case 0x0134: pszService = "MMQuery"; break;
487 case 0x0135: pszService = "EnterMustComplete"; break;
488 case 0x0136: pszService = "LeaveMustComplete"; break;
489 case 0x0137: pszService = "ResumeExecMustComplete"; break;
490 case 0x0138: pszService = "get thread termination status"; break;
491 case 0x0139: pszService = "GetInstanceInfo"; break;
492 case 0x013a: pszService = "ExecIntMustComplete"; break;
493 case 0x013b: pszService = "ExecVxDIntMustComplete"; break;
494 case 0x013c: pszService = "begin V86 serialization"; break;
495 case 0x013d: pszService = "unhook V86 page"; break;
496 case 0x013e: pszService = "VMM_GetVxDLocationList"; break;
497 case 0x013f: pszService = "VMM_GetDDBList get start of VxD chain"; break;
498 case 0x0140: pszService = "unhook NMI event"; break;
499 case 0x0141: pszService = "Get_Instanced_V86_Int_Vector"; break;
500 case 0x0142: pszService = "get or set real DOS PSP"; break;
501 case 0x0143: pszService = "call priority thread event"; break;
502 case 0x0144: pszService = "Get_System_Time_Address"; break;
503 case 0x0145: pszService = "Get_Crit_Status_Thread"; break;
504 case 0x0146: pszService = "Get_DDB"; break;
505 case 0x0147: pszService = "Directed_Sys_Control"; break;
506 case 0x0148: pszService = "RegOpenKey"; break;
507 case 0x0149: pszService = "RegCloseKey"; break;
508 case 0x014a: pszService = "RegCreateKey"; break;
509 case 0x014b: pszService = "RegDeleteKey"; break;
510 case 0x014c: pszService = "RegEnumKey"; break;
511 case 0x014d: pszService = "RegQueryValue"; break;
512 case 0x014e: pszService = "RegSetValue"; break;
513 case 0x014f: pszService = "RegDeleteValue"; break;
514 case 0x0150: pszService = "RegEnumValue"; break;
515 case 0x0151: pszService = "RegQueryValueEx"; break;
516 case 0x0152: pszService = "RegSetValueEx"; break;
517 case 0x0153: pszService = "CallRing3"; break;
518 case 0x0154: pszService = "Exec_PM_Int"; break;
519 case 0x0155: pszService = "RegFlushKey"; break;
520 case 0x0156: pszService = "PageCommitContig"; break;
521 case 0x0157: pszService = "GetCurrentContext"; break;
522 case 0x0158: pszService = "LocalizeSprintf"; break;
523 case 0x0159: pszService = "LocalizeStackSprintf"; break;
524 case 0x015a: pszService = "Call_Restricted_Event"; break;
525 case 0x015b: pszService = "Cancel_Restricted_Event"; break;
526 case 0x015c: pszService = "Register_PEF_Provider"; break;
527 case 0x015d: pszService = "GetPhysPageInfo"; break;
528 case 0x015e: pszService = "RegQueryInfoKey"; break;
529 case 0x015f: pszService = "MemArb_Reserve_Pages"; break;
530 case 0x0160: pszService = "Time_Slice_Sys_VM_Idle"; break;
531 case 0x0161: pszService = "Time_Slice_Sleep"; break;
532 case 0x0162: pszService = "Boost_With_Decay"; break;
533 case 0x0163: pszService = "Set_Inversion_Pri"; break;
534 case 0x0164: pszService = "Reset_Inversion_Pri"; break;
535 case 0x0165: pszService = "Release_Inversion_Pri"; break;
536 case 0x0166: pszService = "Get_Thread_Win32_Pri"; break;
537 case 0x0167: pszService = "Set_Thread_Win32_Pri"; break;
538 case 0x0168: pszService = "Set_Thread_Static_Boost"; break;
539 case 0x0169: pszService = "Set_VM_Static_Boost"; break;
540 case 0x016a: pszService = "Release_Inversion_Pri_ID"; break;
541 case 0x016b: pszService = "Attach_Thread_To_Group"; break;
542 case 0x016c: pszService = "Detach_Thread_From_Group"; break;
543 case 0x016d: pszService = "Set_Group_Static_Boost"; break;
544 case 0x016e: pszService = "GetRegistryPath"; break;
545 case 0x016f: pszService = "GetRegistryKey"; break;
546 case 0x0170: pszService = "CleanupNestedExec"; break;
547 case 0x0171: pszService = "RegRemapPreDefKey"; break;
548 case 0x0172: pszService = "End_V86_Serialization"; break;
549 case 0x0173: pszService = "Assert_Range"; break;
550 case 0x0174: pszService = "Sprintf"; break;
551 case 0x0175: pszService = "PageChangePager"; break;
552 case 0x0176: pszService = "RegCreateDynKey"; break;
553 case 0x0177: pszService = "RegQMulti"; break;
554 case 0x0178: pszService = "Boost_Thread_With_VM"; break;
555 case 0x0179: pszService = "Get_Boot_Flags"; break;
556 case 0x017a: pszService = "Set_Boot_Flags"; break;
557 case 0x017b: pszService = "lstrcpyn"; break;
558 case 0x017c: pszService = "lstrlen"; break;
559 case 0x017d: pszService = "lmemcpy"; break;
560 case 0x017e: pszService = "GetVxDName"; break;
561 case 0x017f: pszService = "Force_Mutexes_Free"; break;
562 case 0x0180: pszService = "Restore_Forced_Mutexes"; break;
563 case 0x0181: pszService = "AddReclaimableItem"; break;
564 case 0x0182: pszService = "SetReclaimableItem"; break;
565 case 0x0183: pszService = "EnumReclaimableItem"; break;
566 case 0x0184: pszService = "Time_Slice_Wake_Sys_VM"; break;
567 case 0x0185: pszService = "VMM_Replace_Global_Environment"; break;
568 case 0x0186: pszService = "Begin_Non_Serial_Nest_V86_Exec"; break;
569 case 0x0187: pszService = "Get_Nest_Exec_Status"; break;
570 case 0x0188: pszService = "Open_Boot_Log"; break;
571 case 0x0189: pszService = "Write_Boot_Log"; break;
572 case 0x018a: pszService = "Close_Boot_Log"; break;
573 case 0x018b: pszService = "EnableDisable_Boot_Log"; break;
574 case 0x018c: pszService = "Call_On_My_Stack"; break;
575 case 0x018d: pszService = "Get_Inst_V86_Int_Vec_Base"; break;
576 case 0x018e: pszService = "lstrcmpi"; break;
577 case 0x018f: pszService = "strupr"; break;
578 case 0x0190: pszService = "Log_Fault_Call_Out"; break;
579 case 0x0191: pszService = "AtEventTime"; break;
580 }
581 pszVxD = "VMM";
582 break;
583 case 0x0002: pszVxD = "DEBUG"; break;
584 case 0x0003: pszVxD = "VPICD"; break;
585 case 0x0004: pszVxD = "VDMAD"; break;
586 case 0x0005: pszVxD = "VTD"; break;
587 case 0x0006: pszVxD = "V86MMGR"; break;
588 case 0x0007: pszVxD = "PageSwap"; break;
589 case 0x0009: pszVxD = "REBOOT"; break;
590 case 0x000A: pszVxD = "VDD"; break;
591 case 0x000B: pszVxD = "VSD"; break;
592 case 0x000C: pszVxD = "VMD / VMOUSE"; break;
593 case 0x000D: pszVxD = "VKD"; break;
594 case 0x000E: pszVxD = "VCD"; break;
595 case 0x0010: pszVxD = "BlockDev / IOS"; break;
596 case 0x0011: pszVxD = "VMCPD"; break;
597 case 0x0012: pszVxD = "EBIOS"; break;
598 case 0x0014: pszVxD = "VNETBIOS"; break;
599 case 0x0015: pszVxD = "DOSMGR"; break;
600 case 0x0017: pszVxD = "SHELL"; break;
601 case 0x0018: pszVxD = "VMPoll"; break;
602 case 0x001A: pszVxD = "DOSNET"; break;
603 case 0x001B: pszVxD = "VFD"; break;
604 case 0x001C: pszVxD = "LoadHi"; break;
605 case 0x0020: pszVxD = "Int13"; break;
606 case 0x0021: pszVxD = "PAGEFILE"; break;
607 case 0x0026: pszVxD = "VPOWERD"; break;
608 case 0x0027: pszVxD = "VXDLDR"; break;
609 case 0x0028: pszVxD = "NDIS"; break;
610 case 0x002A: pszVxD = "VWIN32"; break;
611 case 0x002B: pszVxD = "VCOMM"; break;
612 case 0x002C: pszVxD = "SPOOLER"; break;
613 case 0x0032: pszVxD = "VSERVER"; break;
614 case 0x0033: pszVxD = "CONFIGMG"; break;
615 case 0x0034: pszVxD = "DWCFGMG.SYS"; break;
616 case 0x0036: pszVxD = "VFBACKUP"; break;
617 case 0x0037: pszVxD = "VMINI / ENABLE"; break;
618 case 0x0038: pszVxD = "VCOND"; break;
619 case 0x003D: pszVxD = "BIOS"; break;
620 case 0x003E: pszVxD = "WSOCK"; break;
621 case 0x0040: pszVxD = "IFSMgr"; break;
622 case 0x0041: pszVxD = "VCDFSD"; break;
623 case 0x0048: pszVxD = "PERF"; break;
624 case 0x004A: pszVxD = "MTRR"; break;
625 case 0x004B: pszVxD = "NTKERN"; break;
626 case 0x011F: pszVxD = "VFLATD"; break;
627 case 0x0449: pszVxD = "vjoyd"; break;
628 case 0x044A: pszVxD = "mmdevldr"; break;
629 case 0x0480: pszVxD = "VNetSup"; break;
630 case 0x0481: pszVxD = "VREDIR"; break;
631 case 0x0483: pszVxD = "VSHARE"; break;
632 case 0x0487: pszVxD = "NWLINK"; break;
633 case 0x0488: pszVxD = "VTDI"; break;
634 case 0x0489: pszVxD = "VIP"; break;
635 case 0x048A: pszVxD = "MSTCP"; break;
636 case 0x048B: pszVxD = "VCACHE"; break;
637 case 0x048E: pszVxD = "NWREDIR"; break;
638 case 0x0491: pszVxD = "FILESEC"; break;
639 case 0x0492: pszVxD = "NWSERVER"; break;
640 case 0x0493: pszVxD = "MSSP / NWSP"; break;
641 case 0x0494: pszVxD = "NSCL"; break;
642 case 0x0495: pszVxD = "AFVXD"; break;
643 case 0x0496: pszVxD = "NDIS2SUP"; break;
644 case 0x0498: pszVxD = "Splitter"; break;
645 case 0x0499: pszVxD = "PPPMAC"; break;
646 case 0x049A: pszVxD = "VDHCP"; break;
647 case 0x049B: pszVxD = "VNBT"; break;
648 case 0x049D: pszVxD = "LOGGER"; break;
649 case 0x097C: pszVxD = "PCCARD"; break;
650 case 0x3098: pszVxD = "VstlthD"; break; /* QEMM */
651 case 0x30F6: pszVxD = "WSVV"; break;
652 case 0x33FC: pszVxD = "ASPIENUM"; break;
653 case 0x357E: pszVxD = "DSOUND"; break;
654 case 0x39E6: pszVxD = "A3D"; break;
655 case 0x3BFD: pszVxD = "CWCPROXY"; break;
656 case 0x3C78: pszVxD = "VGARTD"; break;
657
658 default:
659 {
660 uint8_t abOpcodes[16] = {0};
661 cbInstr = RT_MIN(cbInstr, 16);
662 rc = PGMPhysSimpleReadGCPtr(pVCpu, abOpcodes, GCPtrParams - cbInstr, cbInstr);
663 Log2(("VxD syscall: VxD=%#x Service=%#x - Unknown at %04x:%08RX64: %.*Rhxs - %.*Rhxs (%Rrc)\n",
664 idVxD, idService, pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.rip,
665 cbInstr, abOpcodes, sizeof(auParams), auParams, rc));
666 return;
667 }
668 }
669 if (pszService)
670 Log2(("VxD syscall: VxD=%#04x Service=%#04x - %s: %s\n", idVxD, idService, pszVxD, pszService));
671 else
672 Log2(("VxD syscall: VxD=%#04x Service=%#04x - %s\n", idVxD, idService, pszVxD));
673 }
674 else
675 Log2(("VxD syscall: unable to read parameters at %RGv: %Rrc\n", GCPtrParams, rc));
676}
677
678
679static void iemLogSyscallLinuxX86Int80(PVMCPUCC pVCpu)
680{
681 uint32_t fStrArgs = 0;
682 const char *pszName;
683 int cArgs;
684 uint32_t const uSysCall = pVCpu->cpum.GstCtx.eax;
685 switch (uSysCall)
686 {
687 case 0: cArgs = -1; pszName = "restart_syscall"; break;
688 case 1: cArgs = 1; pszName = "exit"; break;
689 case 2: cArgs = -1; pszName = "fork"; break;
690 case 3: cArgs = 3; pszName = "read"; break;
691 case 4: cArgs = 3; pszName = "write"; break;
692 case 5: cArgs = 3; pszName = "open"; fStrArgs = 1; break;
693 case 6: cArgs = 1; pszName = "close"; break;
694 case 7: cArgs = 3; pszName = "waitpid"; break;
695 case 8: cArgs = 2; pszName = "creat"; break;
696 case 9: cArgs = 2; pszName = "link"; fStrArgs = 1|2; break;
697 case 10: cArgs = 1; pszName = "unlink"; fStrArgs = 1; break;
698 case 11: cArgs = 3; pszName = "execve"; fStrArgs = 1; break;
699 case 12: cArgs = 1; pszName = "chdir"; fStrArgs = 1; break;
700 case 13: cArgs = 1; pszName = "time"; break;
701 case 14: cArgs = 3; pszName = "mknod"; fStrArgs = 1; break;
702 case 15: cArgs = 2; pszName = "chmod"; fStrArgs = 1; break;
703 case 16: cArgs = 3; pszName = "lchown"; fStrArgs = 1; break;
704 case 17: cArgs = -1; pszName = "break;"; break;
705 case 18: cArgs = 2; pszName = "oldstat"; fStrArgs = 1; break;
706 case 19: cArgs = 3; pszName = "lseek"; break;
707 case 20: cArgs = -1; pszName = "getpid"; break;
708 case 21: cArgs = 5; pszName = "mount"; fStrArgs = 1|2|4; break;
709 case 22: cArgs = 1; pszName = "umount"; fStrArgs = 1; break;
710 case 23: cArgs = 1; pszName = "setuid"; break;
711 case 24: cArgs = -1; pszName = "getuid"; break;
712 case 25: cArgs = 1; pszName = "stime"; break;
713 case 26: cArgs = 4; pszName = "ptrace"; break;
714 case 27: cArgs = 1; pszName = "alarm"; break;
715 case 28: cArgs = 2; pszName = "oldfstat"; break;
716 case 29: cArgs = -1; pszName = "pause"; break;
717 case 30: cArgs = 2; pszName = "utime"; fStrArgs = 1; break;
718 case 31: cArgs = -1; pszName = "stty"; break;
719 case 32: cArgs = -1; pszName = "gtty"; break;
720 case 33: cArgs = 2; pszName = "access"; fStrArgs = 1; break;
721 case 34: cArgs = 1; pszName = "nice"; break;
722 case 35: cArgs = -1; pszName = "ftime"; break;
723 case 36: cArgs = -1; pszName = "sync"; break;
724 case 37: cArgs = 2; pszName = "kill"; break;
725 case 38: cArgs = 2; pszName = "rename"; fStrArgs = 1|2; break;
726 case 39: cArgs = 2; pszName = "mkdir"; fStrArgs = 1; break;
727 case 40: cArgs = 1; pszName = "rmdir"; fStrArgs = 1; break;
728 case 41: cArgs = 1; pszName = "dup"; break;
729 case 42: cArgs = 1; pszName = "pipe"; break;
730 case 43: cArgs = 1; pszName = "times"; fStrArgs = 1; break;
731 case 44: cArgs = -1; pszName = "prof"; break;
732 case 45: cArgs = 1; pszName = "brk"; break;
733 case 46: cArgs = 1; pszName = "setgid"; break;
734 case 47: cArgs = -1; pszName = "getgid"; break;
735 case 48: cArgs = 2; pszName = "signal"; break;
736 case 49: cArgs = -1; pszName = "geteuid"; break;
737 case 50: cArgs = -1; pszName = "getegid"; break;
738 case 51: cArgs = 1; pszName = "acct"; break;
739 case 52: cArgs = 2; pszName = "umount2"; fStrArgs = 1; break;
740 case 53: cArgs = -1; pszName = "lock"; break;
741 case 54: cArgs = 3; pszName = "ioctl"; break;
742 case 55: cArgs = 3; pszName = "fcntl"; break;
743 case 56: cArgs = -1; pszName = "mpx"; break;
744 case 57: cArgs = 2; pszName = "setpgid"; break;
745 case 58: cArgs = -1; pszName = "ulimit"; break;
746 case 59: cArgs = 1; pszName = "oldolduname"; break;
747 case 60: cArgs = 1; pszName = "umask"; break;
748 case 61: cArgs = 1; pszName = "chroot"; fStrArgs = 1; break;
749 case 62: cArgs = 2; pszName = "ustat"; break;
750 case 63: cArgs = 2; pszName = "dup2"; break;
751 case 64: cArgs = -1; pszName = "getppid"; break;
752 case 65: cArgs = -1; pszName = "getpgrp"; break;
753 case 66: cArgs = -1; pszName = "setsid"; break;
754 case 67: cArgs = 3; pszName = "sigaction"; break;
755 case 68: cArgs = -1; pszName = "sgetmask"; break;
756 case 69: cArgs = 1; pszName = "ssetmask"; break;
757 case 70: cArgs = 2; pszName = "setreuid"; break;
758 case 71: cArgs = 2; pszName = "setregid"; break;
759 case 72: cArgs = 1; pszName = "sigsuspend"; break;
760 case 73: cArgs = 1; pszName = "sigpending"; break;
761 case 74: cArgs = 2; pszName = "sethostname"; fStrArgs = 1; break;
762 case 75: cArgs = 2; pszName = "setrlimit"; break;
763 case 76: cArgs = 2; pszName = "getrlimit"; break;
764 case 77: cArgs = 2; pszName = "getrusage"; break;
765 case 78: cArgs = 2; pszName = "gettimeofday"; break;
766 case 79: cArgs = 2; pszName = "settimeofday"; break;
767 case 80: cArgs = 2; pszName = "getgroups"; break;
768 case 81: cArgs = 2; pszName = "setgroups"; break;
769 case 82: cArgs = 1; pszName = "select"; break;
770 case 83: cArgs = 2; pszName = "symlink"; fStrArgs = 1|2; break;
771 case 84: cArgs = 2; pszName = "oldlstat"; fStrArgs = 1; break;
772 case 85: cArgs = 3; pszName = "readlink"; fStrArgs = 1; break;
773 case 86: cArgs = 1; pszName = "uselib"; break;
774 case 87: cArgs = 2; pszName = "swapon"; fStrArgs = 1; break;
775 case 88: cArgs = 4; pszName = "reboot"; break;
776 case 89: cArgs = 3; pszName = "readdir"; break;
777 case 90: cArgs = 1; pszName = "mmap"; break;
778 case 91: cArgs = 2; pszName = "munmap"; break;
779 case 92: cArgs = 2; pszName = "truncate"; fStrArgs = 1; break;
780 case 93: cArgs = 2; pszName = "ftruncate"; break;
781 case 94: cArgs = 2; pszName = "fchmod"; break;
782 case 95: cArgs = 3; pszName = "fchown"; break;
783 case 96: cArgs = 2; pszName = "getpriority"; break;
784 case 97: cArgs = 3; pszName = "setpriority"; break;
785 case 98: cArgs = -1; pszName = "profil"; break;
786 case 99: cArgs = 2; pszName = "statfs"; fStrArgs = 1; break;
787 case 100: cArgs = 2; pszName = "fstatfs"; break;
788 case 101: cArgs = 3; pszName = "ioperm"; break;
789 case 102: cArgs = 2; pszName = "socketcall"; break;
790 case 103: cArgs = 3; pszName = "syslog"; break;
791 case 104: cArgs = 3; pszName = "setitimer"; break;
792 case 105: cArgs = 2; pszName = "getitimer"; break;
793 case 106: cArgs = 2; pszName = "stat"; fStrArgs = 1; break;
794 case 107: cArgs = 2; pszName = "lstat"; fStrArgs = 1; break;
795 case 108: cArgs = 2; pszName = "fstat"; break;
796 case 109: cArgs = 1; pszName = "olduname"; break;
797 case 110: cArgs = 1; pszName = "iopl"; break;
798 case 111: cArgs = -1; pszName = "vhangup"; break;
799 case 112: cArgs = -1; pszName = "idle"; break;
800 case 113: cArgs = 1; pszName = "vm86old"; break;
801 case 114: cArgs = 4; pszName = "wait4"; break;
802 case 115: cArgs = 1; pszName = "swapoff"; fStrArgs = 1; break;
803 case 116: cArgs = 1; pszName = "sysinfo"; break;
804 case 117: cArgs = 6; pszName = "ipc"; break;
805 case 118: cArgs = 1; pszName = "fsync"; break;
806 case 119: cArgs = -1; pszName = "sigreturn"; break;
807 case 120: cArgs = 5; pszName = "clone"; break;
808 case 121: cArgs = 2; pszName = "setdomainname"; fStrArgs = 1; break;
809 case 122: cArgs = 1; pszName = "uname"; break;
810 case 123: cArgs = 3; pszName = "modify_ldt"; break;
811 case 124: cArgs = 1; pszName = "adjtimex"; break;
812 case 125: cArgs = 3; pszName = "mprotect"; break;
813 case 126: cArgs = 3; pszName = "sigprocmask"; break;
814 case 127: cArgs = -1; pszName = "create_module"; fStrArgs = 1; break;
815 case 128: cArgs = 3; pszName = "init_module"; break;
816 case 129: cArgs = 2; pszName = "delete_module"; fStrArgs = 1; break;
817 case 130: cArgs = -1; pszName = "get_kernel_syms"; break;
818 case 131: cArgs = 4; pszName = "quotactl"; break;
819 case 132: cArgs = 1; pszName = "getpgid"; break;
820 case 133: cArgs = 1; pszName = "fchdir"; break;
821 case 134: cArgs = -1; pszName = "bdflush"; break;
822 case 135: cArgs = 3; pszName = "sysfs"; break;
823 case 136: cArgs = 1; pszName = "personality"; break;
824 case 137: cArgs = -1; pszName = "afs_syscall"; break;
825 case 138: cArgs = 1; pszName = "setfsuid"; break;
826 case 139: cArgs = 1; pszName = "setfsgid"; break;
827 case 140: cArgs = 5; pszName = "_llseek"; break;
828 case 141: cArgs = 3; pszName = "getdents"; break;
829 case 142: cArgs = 5; pszName = "_newselect"; break;
830 case 143: cArgs = 2; pszName = "flock"; break;
831 case 144: cArgs = 3; pszName = "msync"; break;
832 case 145: cArgs = 3; pszName = "readv"; break;
833 case 146: cArgs = 3; pszName = "writev"; break;
834 case 147: cArgs = 1; pszName = "getsid"; break;
835 case 148: cArgs = 1; pszName = "fdatasync"; break;
836 case 149: cArgs = -1; pszName = "_sysctl"; break;
837 case 150: cArgs = 2; pszName = "mlock"; break;
838 case 151: cArgs = 2; pszName = "munlock"; break;
839 case 152: cArgs = 1; pszName = "mlockall"; break;
840 case 153: cArgs = -1; pszName = "munlockall"; break;
841 case 154: cArgs = 2; pszName = "sched_setparam"; break;
842 case 155: cArgs = 2; pszName = "sched_getparam"; break;
843 case 156: cArgs = 3; pszName = "sched_setscheduler"; break;
844 case 157: cArgs = 1; pszName = "sched_getscheduler"; break;
845 case 158: cArgs = -1; pszName = "sched_yield"; break;
846 case 159: cArgs = 1; pszName = "sched_get_priority_max"; break;
847 case 160: cArgs = 1; pszName = "sched_get_priority_min"; break;
848 case 161: cArgs = 2; pszName = "sched_rr_get_interval"; break;
849 case 162: cArgs = 2; pszName = "nanosleep"; break;
850 case 163: cArgs = 5; pszName = "mremap"; break;
851 case 164: cArgs = 3; pszName = "setresuid"; break;
852 case 165: cArgs = 3; pszName = "getresuid"; break;
853 case 166: cArgs = 2; pszName = "vm86"; break;
854 case 167: cArgs = -1; pszName = "query_module"; break;
855 case 168: cArgs = 3; pszName = "poll"; break;
856 case 169: cArgs = -1; pszName = "nfsservctl"; break;
857 case 170: cArgs = 3; pszName = "setresgid"; break;
858 case 171: cArgs = 3; pszName = "getresgid"; break;
859 case 172: cArgs = 5; pszName = "prctl"; break;
860 case 173: cArgs = -1; pszName = "rt_sigreturn"; break;
861 case 174: cArgs = 4; pszName = "rt_sigaction"; break;
862 case 175: cArgs = 4; pszName = "rt_sigprocmask"; break;
863 case 176: cArgs = 2; pszName = "rt_sigpending"; break;
864 case 177: cArgs = 4; pszName = "rt_sigtimedwait"; break;
865 case 178: cArgs = 3; pszName = "rt_sigqueueinfo"; break;
866 case 179: cArgs = 2; pszName = "rt_sigsuspend"; break;
867 case 180: cArgs = 5; pszName = "pread64"; break;
868 case 181: cArgs = 5; pszName = "pwrite64"; break;
869 case 182: cArgs = 3; pszName = "chown"; break;
870 case 183: cArgs = 2; pszName = "getcwd"; break;
871 case 184: cArgs = 2; pszName = "capget"; break;
872 case 185: cArgs = 2; pszName = "capset"; break;
873 case 186: cArgs = 2; pszName = "sigaltstack"; break;
874 case 187: cArgs = 4; pszName = "sendfile"; break;
875 case 188: cArgs = -1; pszName = "getpmsg"; break;
876 case 189: cArgs = -1; pszName = "putpmsg"; break;
877 case 190: cArgs = -1; pszName = "vfork"; break;
878 case 191: cArgs = 2; pszName = "ugetrlimit"; break;
879 case 192: cArgs = 6; pszName = "mmap2"; break;
880 case 193: cArgs = 3; pszName = "truncate64"; break;
881 case 194: cArgs = 3; pszName = "ftruncate64"; break;
882 case 195: cArgs = 2; pszName = "stat64"; break;
883 case 196: cArgs = 2; pszName = "lstat64"; break;
884 case 197: cArgs = 2; pszName = "fstat64"; break;
885 case 198: cArgs = 3; pszName = "lchown32"; break;
886 case 199: cArgs = -1; pszName = "getuid32"; break;
887 case 200: cArgs = -1; pszName = "getgid32"; break;
888 case 201: cArgs = -1; pszName = "geteuid32"; break;
889 case 202: cArgs = -1; pszName = "getegid32"; break;
890 case 203: cArgs = 2; pszName = "setreuid32"; break;
891 case 204: cArgs = 2; pszName = "setregid32"; break;
892 case 205: cArgs = 2; pszName = "getgroups32"; break;
893 case 206: cArgs = 2; pszName = "setgroups32"; break;
894 case 207: cArgs = 3; pszName = "fchown32"; break;
895 case 208: cArgs = 3; pszName = "setresuid32"; break;
896 case 209: cArgs = 3; pszName = "getresuid32"; break;
897 case 210: cArgs = 3; pszName = "setresgid32"; break;
898 case 211: cArgs = 3; pszName = "getresgid32"; break;
899 case 212: cArgs = 3; pszName = "chown32"; break;
900 case 213: cArgs = 1; pszName = "setuid32"; break;
901 case 214: cArgs = 1; pszName = "setgid32"; break;
902 case 215: cArgs = 1; pszName = "setfsuid32"; break;
903 case 216: cArgs = 1; pszName = "setfsgid32"; break;
904 case 217: cArgs = 2; pszName = "pivot_root"; break;
905 case 218: cArgs = 3; pszName = "mincore"; break;
906 case 219: cArgs = 3; pszName = "madvise"; break;
907 case 220: cArgs = 3; pszName = "getdents64"; break;
908 case 221: cArgs = 3; pszName = "fcntl64"; break;
909 case 224: cArgs = -1; pszName = "gettid"; break;
910 case 225: cArgs = 4; pszName = "readahead"; break;
911 case 226: cArgs = 5; pszName = "setxattr"; break;
912 case 227: cArgs = 5; pszName = "lsetxattr"; break;
913 case 228: cArgs = 5; pszName = "fsetxattr"; break;
914 case 229: cArgs = 4; pszName = "getxattr"; break;
915 case 230: cArgs = 4; pszName = "lgetxattr"; break;
916 case 231: cArgs = 4; pszName = "fgetxattr"; break;
917 case 232: cArgs = 3; pszName = "listxattr"; break;
918 case 233: cArgs = 3; pszName = "llistxattr"; break;
919 case 234: cArgs = 3; pszName = "flistxattr"; break;
920 case 235: cArgs = 2; pszName = "removexattr"; break;
921 case 236: cArgs = 2; pszName = "lremovexattr"; break;
922 case 237: cArgs = 2; pszName = "fremovexattr"; break;
923 case 238: cArgs = 2; pszName = "tkill"; break;
924 case 239: cArgs = 4; pszName = "sendfile64"; break;
925 case 240: cArgs = 6; pszName = "futex"; break;
926 case 241: cArgs = 3; pszName = "sched_setaffinity"; break;
927 case 242: cArgs = 3; pszName = "sched_getaffinity"; break;
928 case 243: cArgs = 1; pszName = "set_thread_area"; break;
929 case 244: cArgs = 1; pszName = "get_thread_area"; break;
930 case 245: cArgs = 2; pszName = "io_setup"; break;
931 case 246: cArgs = 1; pszName = "io_destroy"; break;
932 case 247: cArgs = 5; pszName = "io_getevents"; break;
933 case 248: cArgs = 3; pszName = "io_submit"; break;
934 case 249: cArgs = 3; pszName = "io_cancel"; break;
935 case 250: cArgs = 5; pszName = "fadvise64"; break;
936 case 252: cArgs = 1; pszName = "exit_group"; break;
937 case 253: cArgs = -1; pszName = "lookup_dcookie"; break;
938 case 254: cArgs = 1; pszName = "epoll_create"; break;
939 case 255: cArgs = 4; pszName = "epoll_ctl"; break;
940 case 256: cArgs = 4; pszName = "epoll_wait"; break;
941 case 257: cArgs = 5; pszName = "remap_file_pages"; break;
942 case 258: cArgs = 1; pszName = "set_tid_address"; break;
943 case 259: cArgs = 3; pszName = "timer_create"; break;
944 case 260: cArgs = 4; pszName = "timer_settime"; break;
945 case 261: cArgs = 2; pszName = "timer_gettime"; break;
946 case 262: cArgs = 1; pszName = "timer_getoverrun"; break;
947 case 263: cArgs = 1; pszName = "timer_delete"; break;
948 case 264: cArgs = 2; pszName = "clock_settime"; break;
949 case 265: cArgs = 2; pszName = "clock_gettime"; break;
950 case 266: cArgs = 2; pszName = "clock_getres"; break;
951 case 267: cArgs = 4; pszName = "clock_nanosleep"; break;
952 case 268: cArgs = 3; pszName = "statfs64"; break;
953 case 269: cArgs = 3; pszName = "fstatfs64"; break;
954 case 270: cArgs = 3; pszName = "tgkill"; break;
955 case 271: cArgs = 2; pszName = "utimes"; break;
956 case 272: cArgs = 6; pszName = "fadvise64_64"; break;
957 case 273: cArgs = -1; pszName = "vserver"; break;
958 case 274: cArgs = 6; pszName = "mbind"; break;
959 case 275: cArgs = 5; pszName = "get_mempolicy"; break;
960 case 276: cArgs = 3; pszName = "set_mempolicy"; break;
961 case 277: cArgs = 4; pszName = "mq_open"; break;
962 case 278: cArgs = 1; pszName = "mq_unlink"; break;
963 case 279: cArgs = 5; pszName = "mq_timedsend"; break;
964 case 280: cArgs = 5; pszName = "mq_timedreceive"; break;
965 case 281: cArgs = 2; pszName = "mq_notify"; break;
966 case 282: cArgs = 3; pszName = "mq_getsetattr"; break;
967 case 283: cArgs = 4; pszName = "kexec_load"; break;
968 case 284: cArgs = 5; pszName = "waitid"; break;
969 case 286: cArgs = 5; pszName = "add_key"; break;
970 case 287: cArgs = 4; pszName = "request_key"; break;
971 case 288: cArgs = 5; pszName = "keyctl"; break;
972 case 289: cArgs = 3; pszName = "ioprio_set"; break;
973 case 290: cArgs = 2; pszName = "ioprio_get"; break;
974 case 291: cArgs = -1; pszName = "inotify_init"; break;
975 case 292: cArgs = 3; pszName = "inotify_add_watch"; break;
976 case 293: cArgs = 2; pszName = "inotify_rm_watch"; break;
977 case 294: cArgs = 4; pszName = "migrate_pages"; break;
978 case 295: cArgs = 4; pszName = "openat"; break;
979 case 296: cArgs = 3; pszName = "mkdirat"; break;
980 case 297: cArgs = 4; pszName = "mknodat"; break;
981 case 298: cArgs = 5; pszName = "fchownat"; break;
982 case 299: cArgs = 3; pszName = "futimesat"; break;
983 case 300: cArgs = 4; pszName = "fstatat64"; break;
984 case 301: cArgs = 3; pszName = "unlinkat"; break;
985 case 302: cArgs = 4; pszName = "renameat"; break;
986 case 303: cArgs = 5; pszName = "linkat"; break;
987 case 304: cArgs = 3; pszName = "symlinkat"; break;
988 case 305: cArgs = 4; pszName = "readlinkat"; break;
989 case 306: cArgs = 3; pszName = "fchmodat"; break;
990 case 307: cArgs = 3; pszName = "faccessat"; break;
991 case 308: cArgs = 6; pszName = "pselect6"; break;
992 case 309: cArgs = 5; pszName = "ppoll"; break;
993 case 310: cArgs = 1; pszName = "unshare"; break;
994 case 311: cArgs = 2; pszName = "set_robust_list"; break;
995 case 312: cArgs = 3; pszName = "get_robust_list"; break;
996 case 313: cArgs = 6; pszName = "splice"; break;
997 case 314: cArgs = 6; pszName = "sync_file_range"; break;
998 case 315: cArgs = 4; pszName = "tee"; break;
999 case 316: cArgs = 4; pszName = "vmsplice"; break;
1000 case 317: cArgs = 6; pszName = "move_pages"; break;
1001 case 318: cArgs = 3; pszName = "getcpu"; break;
1002 case 319: cArgs = 6; pszName = "epoll_pwait"; break;
1003 case 320: cArgs = 4; pszName = "utimensat"; break;
1004 case 321: cArgs = 3; pszName = "signalfd"; break;
1005 case 322: cArgs = 2; pszName = "timerfd_create"; break;
1006 case 323: cArgs = 1; pszName = "eventfd"; break;
1007 case 324: cArgs = 6; pszName = "fallocate"; break;
1008 case 325: cArgs = 4; pszName = "timerfd_settime"; break;
1009 case 326: cArgs = 2; pszName = "timerfd_gettime"; break;
1010 case 327: cArgs = 4; pszName = "signalfd4"; break;
1011 case 328: cArgs = 2; pszName = "eventfd2"; break;
1012 case 329: cArgs = 1; pszName = "epoll_create1"; break;
1013 case 330: cArgs = 3; pszName = "dup3"; break;
1014 case 331: cArgs = 2; pszName = "pipe2"; break;
1015 case 332: cArgs = 1; pszName = "inotify_init1"; break;
1016 case 333: cArgs = 5; pszName = "preadv"; break;
1017 case 334: cArgs = 5; pszName = "pwritev"; break;
1018 case 335: cArgs = 4; pszName = "rt_tgsigqueueinfo"; break;
1019 case 336: cArgs = 5; pszName = "perf_event_open"; break;
1020 case 337: cArgs = 5; pszName = "recvmmsg"; break;
1021 case 338: cArgs = 2; pszName = "fanotify_init"; break;
1022 case 339: cArgs = 5; pszName = "fanotify_mark"; break;
1023 case 340: cArgs = 4; pszName = "prlimit64"; break;
1024 case 341: cArgs = 5; pszName = "name_to_handle_at"; break;
1025 case 342: cArgs = 3; pszName = "open_by_handle_at"; break;
1026 case 343: cArgs = 2; pszName = "clock_adjtime"; break;
1027 case 344: cArgs = 1; pszName = "syncfs"; break;
1028 case 345: cArgs = 4; pszName = "sendmmsg"; break;
1029 case 346: cArgs = 2; pszName = "setns"; break;
1030 case 347: cArgs = 6; pszName = "process_vm_readv"; break;
1031 case 348: cArgs = 6; pszName = "process_vm_writev"; break;
1032 case 349: cArgs = 5; pszName = "kcmp"; break;
1033 case 350: cArgs = 3; pszName = "finit_module"; break;
1034 case 351: cArgs = 3; pszName = "sched_setattr"; break;
1035 case 352: cArgs = 4; pszName = "sched_getattr"; break;
1036 case 353: cArgs = 5; pszName = "renameat2"; break;
1037 case 354: cArgs = 3; pszName = "seccomp"; break;
1038 case 355: cArgs = 3; pszName = "getrandom"; break;
1039 case 356: cArgs = 2; pszName = "memfd_create"; break;
1040 case 357: cArgs = 3; pszName = "bpf"; break;
1041 case 358: cArgs = 5; pszName = "execveat"; break;
1042 case 359: cArgs = 3; pszName = "socket"; break;
1043 case 360: cArgs = 4; pszName = "socketpair"; break;
1044 case 361: cArgs = 3; pszName = "bind"; break;
1045 case 362: cArgs = 3; pszName = "connect"; break;
1046 case 363: cArgs = 2; pszName = "listen"; break;
1047 case 364: cArgs = 4; pszName = "accept4"; break;
1048 case 365: cArgs = 5; pszName = "getsockopt"; break;
1049 case 366: cArgs = 5; pszName = "setsockopt"; break;
1050 case 367: cArgs = 3; pszName = "getsockname"; break;
1051 case 368: cArgs = 3; pszName = "getpeername"; break;
1052 case 369: cArgs = 6; pszName = "sendto"; break;
1053 case 370: cArgs = 3; pszName = "sendmsg"; break;
1054 case 371: cArgs = 6; pszName = "recvfrom"; break;
1055 case 372: cArgs = 3; pszName = "recvmsg"; break;
1056 case 373: cArgs = 2; pszName = "shutdown"; break;
1057 case 374: cArgs = 1; pszName = "userfaultfd"; break;
1058 case 375: cArgs = 3; pszName = "membarrier"; break;
1059 case 376: cArgs = 3; pszName = "mlock2"; break;
1060 case 377: cArgs = 6; pszName = "copy_file_range"; break;
1061 case 378: cArgs = 6; pszName = "preadv2"; break;
1062 case 379: cArgs = 6; pszName = "pwritev2"; break;
1063 case 380: cArgs = 4; pszName = "pkey_mprotect"; break;
1064 case 381: cArgs = 2; pszName = "pkey_alloc"; break;
1065 case 382: cArgs = 1; pszName = "pkey_free"; break;
1066 case 383: cArgs = 5; pszName = "statx"; break;
1067 case 384: cArgs = 2; pszName = "arch_prctl"; break;
1068 case 385: cArgs = 6; pszName = "io_pgetevents"; break;
1069 case 386: cArgs = 4; pszName = "rseq"; break;
1070 case 393: cArgs = 3; pszName = "semget"; break;
1071 case 394: cArgs = 4; pszName = "semctl"; break;
1072 case 395: cArgs = 3; pszName = "shmget"; break;
1073 case 396: cArgs = 3; pszName = "shmctl"; break;
1074 case 397: cArgs = 3; pszName = "shmat"; break;
1075 case 398: cArgs = 1; pszName = "shmdt"; break;
1076 case 399: cArgs = 2; pszName = "msgget"; break;
1077 case 400: cArgs = 4; pszName = "msgsnd"; break;
1078 case 401: cArgs = 5; pszName = "msgrcv"; break;
1079 case 402: cArgs = 3; pszName = "msgctl"; break;
1080 case 403: cArgs = 2; pszName = "clock_gettime64"; break;
1081 case 404: cArgs = 2; pszName = "clock_settime64"; break;
1082 case 405: cArgs = 2; pszName = "clock_adjtime64"; break;
1083 case 406: cArgs = 2; pszName = "clock_getres_time64"; break;
1084 case 407: cArgs = 4; pszName = "clock_nanosleep_time64"; break;
1085 case 408: cArgs = 2; pszName = "timer_gettime64"; break;
1086 case 409: cArgs = 4; pszName = "timer_settime64"; break;
1087 case 410: cArgs = 2; pszName = "timerfd_gettime64"; break;
1088 case 411: cArgs = 4; pszName = "timerfd_settime64"; break;
1089 case 412: cArgs = 4; pszName = "utimensat_time64"; break;
1090 case 413: cArgs = 6; pszName = "pselect6_time64"; break;
1091 case 414: cArgs = 5; pszName = "ppoll_time64"; break;
1092 case 416: cArgs = 6; pszName = "io_pgetevents_time64"; break;
1093 case 417: cArgs = 5; pszName = "recvmmsg_time64"; break;
1094 case 418: cArgs = 5; pszName = "mq_timedsend_time64"; break;
1095 case 419: cArgs = 5; pszName = "mq_timedreceive_time64"; break;
1096 case 420: cArgs = 4; pszName = "semtimedop_time64"; break;
1097 case 421: cArgs = 4; pszName = "rt_sigtimedwait_time64"; break;
1098 case 422: cArgs = 6; pszName = "futex_time64"; break;
1099 case 423: cArgs = 2; pszName = "sched_rr_get_interval_time64"; break;
1100 case 424: cArgs = 4; pszName = "pidfd_send_signal"; break;
1101 case 425: cArgs = 2; pszName = "io_uring_setup"; break;
1102 case 426: cArgs = 6; pszName = "io_uring_enter"; break;
1103 case 427: cArgs = 4; pszName = "io_uring_register"; break;
1104 case 428: cArgs = 3; pszName = "open_tree"; break;
1105 case 429: cArgs = 5; pszName = "move_mount"; break;
1106 case 430: cArgs = 2; pszName = "fsopen"; break;
1107 case 431: cArgs = 5; pszName = "fsconfig"; break;
1108 case 432: cArgs = 3; pszName = "fsmount"; break;
1109 case 433: cArgs = 3; pszName = "fspick"; break;
1110 case 434: cArgs = 2; pszName = "pidfd_open"; break;
1111 case 435: cArgs = 2; pszName = "clone3"; break;
1112 case 436: cArgs = 3; pszName = "close_range"; break;
1113 case 437: cArgs = 4; pszName = "openat2"; break;
1114 case 438: cArgs = 3; pszName = "pidfd_getfd"; break;
1115 case 439: cArgs = 4; pszName = "faccessat2"; break;
1116 case 440: cArgs = 5; pszName = "process_madvise"; break;
1117 case 441: cArgs = 6; pszName = "epoll_pwait2"; break;
1118 case 442: cArgs = 5; pszName = "mount_setattr"; break;
1119 case 443: cArgs = 4; pszName = "quotactl_fd"; break;
1120 case 444: cArgs = 3; pszName = "landlock_create_ruleset"; break;
1121 case 445: cArgs = 4; pszName = "landlock_add_rule"; break;
1122 case 446: cArgs = 2; pszName = "landlock_restrict_self"; break;
1123 case 447: cArgs = 1; pszName = "memfd_secret"; break;
1124 case 448: cArgs = 2; pszName = "process_mrelease"; break;
1125 case 449: cArgs = 5; pszName = "futex_waitv"; break;
1126 case 450: cArgs = 4; pszName = "set_mempolicy_home_node"; break;
1127 case 451: cArgs = 4; pszName = "cachestat"; break;
1128 case 452: cArgs = 4; pszName = "fchmodat2"; break;
1129
1130 default:
1131 pszName = "unknown!";
1132 cArgs = -1;
1133 break;;
1134 }
1135 Log3(("Linux syscall: %s (%#x) at %04x:%08x - cArgs=%d: ebx=%#x ecx=%#x edx=%#x esi=%#x edi=%#x ebp=%#x (esp=%#x eax=%#x efl=%#x)\n",
1136 pszName, uSysCall, pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.eip, cArgs, pVCpu->cpum.GstCtx.ebx,
1137 pVCpu->cpum.GstCtx.ecx, pVCpu->cpum.GstCtx.edx, pVCpu->cpum.GstCtx.esi, pVCpu->cpum.GstCtx.edi, pVCpu->cpum.GstCtx.ebp,
1138 pVCpu->cpum.GstCtx.esp, pVCpu->cpum.GstCtx.eax, pVCpu->cpum.GstCtx.eflags.uBoth));
1139
1140#ifdef IN_RING3
1141 /*
1142 * Log string arguments.
1143 */
1144 static const uint8_t s_aidxArgToGReg[] =
1145 { X86_GREG_xBX, X86_GREG_xCX, X86_GREG_xDX, X86_GREG_xSI, X86_GREG_xDI, X86_GREG_xBP };
1146 if (fStrArgs)
1147 {
1148 PUVM pUVM = pVCpu->pVMR3->pUVM;
1149 do
1150 {
1151 unsigned const iStrArg = ASMBitFirstSetU32(fStrArgs) - 1;
1152 fStrArgs &= ~RT_BIT_32(iStrArg);
1153 if (iStrArg < RT_ELEMENTS(s_aidxArgToGReg))
1154 {
1155 char szStr[1024];
1156 uint32_t const uAddr = pVCpu->cpum.GstCtx.aGRegs[s_aidxArgToGReg[iStrArg]].u32;
1157 DBGFADDRESS DbgAddr;
1158 int rc = DBGFR3MemReadString(pUVM, pVCpu->idCpu, DBGFR3AddrFromFlat(pUVM, &DbgAddr, uAddr), szStr, sizeof(szStr));
1159 if (RT_SUCCESS(rc))
1160 {
1161 rc = RTStrValidateEncoding(szStr);
1162 if (RT_SUCCESS(rc))
1163 Log3(("Linux syscall %x/arg #%u: %#x '%s'\n", uSysCall, iStrArg, uAddr, szStr));
1164 else
1165 Log3(("Linux syscall %x/arg #%u: %#x %.*Rhxs\n", uSysCall, iStrArg, uAddr, strlen(szStr), szStr));
1166 }
1167 }
1168
1169
1170 } while (fStrArgs);
1171 }
1172#else
1173 RT_NOREF(fStrArgs);
1174#endif
1175}
1176
1177
1178void iemLogSyscallRealModeInt(PVMCPUCC pVCpu, uint8_t u8Vector, uint8_t cbInstr)
1179{
1180 /* DOS & BIOS (V86 mode) */
1181 if (LogIsEnabled())
1182 {
1183 switch (u8Vector)
1184 {
1185 case 0x10:
1186 iemLogSyscallVgaBiosInt10h(pVCpu);
1187 break;
1188 case 0x16:
1189 iemLogSyscallBiosInt16h(pVCpu);
1190 break;
1191 }
1192 }
1193 RT_NOREF(cbInstr);
1194}
1195
1196
1197void iemLogSyscallProtModeInt(PVMCPUCC pVCpu, uint8_t u8Vector, uint8_t cbInstr)
1198{
1199 /* DOS & BIOS (V86 mode) */
1200 if ( LogIsEnabled()
1201 && pVCpu->cpum.GstCtx.eflags.Bits.u1VM /* v8086 mode */)
1202 {
1203 switch (u8Vector)
1204 {
1205 case 0x10:
1206 iemLogSyscallVgaBiosInt10h(pVCpu);
1207 break;
1208 case 0x16:
1209 iemLogSyscallBiosInt16h(pVCpu);
1210 break;
1211 }
1212 }
1213
1214 /* Windows 3.x */
1215 if (LogIs2Enabled())
1216 switch (u8Vector)
1217 {
1218 case 0x20: /* VxD call. */
1219 iemLogSyscallWinVxDCall(pVCpu, cbInstr);
1220 break;
1221 }
1222
1223 /* Linux */
1224 if (LogIs3Enabled() && u8Vector == 0x80)
1225 iemLogSyscallLinuxX86Int80(pVCpu);
1226}
1227
1228#endif /* LOG_ENABLED */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette