You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(3) |
Feb
(1) |
Mar
(62) |
Apr
(29) |
May
(4) |
Jun
|
Jul
(11) |
Aug
(30) |
Sep
(8) |
Oct
(31) |
Nov
(2) |
Dec
(13) |
| 2002 |
Jan
(4) |
Feb
(3) |
Mar
(12) |
Apr
(2) |
May
(7) |
Jun
(2) |
Jul
(7) |
Aug
(5) |
Sep
(4) |
Oct
(8) |
Nov
(5) |
Dec
(17) |
| 2003 |
Jan
(24) |
Feb
(19) |
Mar
(19) |
Apr
(22) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(48) |
Sep
(31) |
Oct
(45) |
Nov
(52) |
Dec
(54) |
| 2004 |
Jan
(71) |
Feb
(60) |
Mar
(54) |
Apr
(50) |
May
(88) |
Jun
(76) |
Jul
(62) |
Aug
(35) |
Sep
(20) |
Oct
(37) |
Nov
(66) |
Dec
(45) |
| 2005 |
Jan
(12) |
Feb
(5) |
Mar
(11) |
Apr
(6) |
May
(6) |
Jun
(6) |
Jul
(29) |
Aug
(61) |
Sep
(17) |
Oct
(45) |
Nov
(34) |
Dec
(17) |
| 2006 |
Jan
(13) |
Feb
(10) |
Mar
(15) |
Apr
(7) |
May
(13) |
Jun
(24) |
Jul
(12) |
Aug
(9) |
Sep
(17) |
Oct
(61) |
Nov
(58) |
Dec
(77) |
| 2007 |
Jan
(67) |
Feb
(61) |
Mar
(54) |
Apr
(93) |
May
(104) |
Jun
(131) |
Jul
(187) |
Aug
(116) |
Sep
(66) |
Oct
(41) |
Nov
(56) |
Dec
(19) |
| 2008 |
Jan
(19) |
Feb
(65) |
Mar
(127) |
Apr
(170) |
May
(137) |
Jun
(160) |
Jul
(168) |
Aug
(139) |
Sep
(104) |
Oct
(51) |
Nov
(69) |
Dec
(126) |
| 2009 |
Jan
(55) |
Feb
(148) |
Mar
(87) |
Apr
(74) |
May
(151) |
Jun
(121) |
Jul
(111) |
Aug
(97) |
Sep
(107) |
Oct
(177) |
Nov
(101) |
Dec
(84) |
| 2010 |
Jan
(55) |
Feb
(45) |
Mar
(114) |
Apr
(140) |
May
(152) |
Jun
(132) |
Jul
(115) |
Aug
(118) |
Sep
(105) |
Oct
(32) |
Nov
(26) |
Dec
(44) |
| 2011 |
Jan
(36) |
Feb
(138) |
Mar
(80) |
Apr
(34) |
May
(52) |
Jun
(72) |
Jul
(27) |
Aug
(119) |
Sep
(77) |
Oct
(71) |
Nov
(58) |
Dec
(50) |
| 2012 |
Jan
(59) |
Feb
(55) |
Mar
(82) |
Apr
(81) |
May
(31) |
Jun
(8) |
Jul
(13) |
Aug
(8) |
Sep
(10) |
Oct
(44) |
Nov
(13) |
Dec
(15) |
| 2013 |
Jan
(28) |
Feb
(72) |
Mar
(35) |
Apr
(14) |
May
(162) |
Jun
(55) |
Jul
(39) |
Aug
(20) |
Sep
(25) |
Oct
(15) |
Nov
(84) |
Dec
(14) |
| 2014 |
Jan
(31) |
Feb
(102) |
Mar
(112) |
Apr
(106) |
May
(105) |
Jun
(87) |
Jul
(36) |
Aug
(112) |
Sep
(31) |
Oct
(23) |
Nov
(68) |
Dec
(42) |
| 2015 |
Jan
(46) |
Feb
(131) |
Mar
(267) |
Apr
(48) |
May
(27) |
Jun
(42) |
Jul
(41) |
Aug
(41) |
Sep
(28) |
Oct
(22) |
Nov
(27) |
Dec
(45) |
| 2016 |
Jan
(55) |
Feb
(55) |
Mar
(363) |
Apr
(125) |
May
(173) |
Jun
(159) |
Jul
(69) |
Aug
(111) |
Sep
(130) |
Oct
(115) |
Nov
(26) |
Dec
(70) |
| 2017 |
Jan
(78) |
Feb
(43) |
Mar
(249) |
Apr
(130) |
May
(35) |
Jun
(436) |
Jul
(293) |
Aug
(423) |
Sep
(81) |
Oct
(16) |
Nov
(35) |
Dec
(110) |
| 2018 |
Jan
(67) |
Feb
(36) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:33:52
|
* s390.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
* linux/s390x/syscallent.h: Likewise.
* xlat/s390_sthyi_function_codes.in: New file.
---
Makefile.am | 1 +
linux/s390/syscallent.h | 1 +
linux/s390x/syscallent.h | 1 +
s390.c | 1033 +++++++++++++++++++++++++++++++++++++
xlat/s390_sthyi_function_codes.in | 1 +
5 files changed, 1037 insertions(+)
create mode 100644 s390.c
create mode 100644 xlat/s390_sthyi_function_codes.in
diff --git a/Makefile.am b/Makefile.am
index 2515876..02e2f3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -267,6 +267,7 @@ strace_SOURCES = \
rtnl_rule.c \
rtnl_tc.c \
rtnl_tc_action.c \
+ s390.c \
sched.c \
sched_attr.h \
scsi.c \
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index 5482c53..dd1fbb1 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -409,6 +409,7 @@
[377] = { 6, TD, SEN(pwritev2), "pwritev2" },
[378] = { 2, 0, SEN(printargs), "s390_guarded_storage" },
[379] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
+[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" },
#define SYS_socket_subcall 400
#include "subcall.h"
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index 36b1aef..fe5b252 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -393,6 +393,7 @@
[377] = { 6, TD, SEN(pwritev2), "pwritev2" },
[378] = { 2, 0, SEN(printargs), "s390_guarded_storage" },
[379] = { 5, TD|TF|TSTA, SEN(statx), "statx" },
+[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" },
#define SYS_socket_subcall 400
#include "subcall.h"
diff --git a/s390.c b/s390.c
new file mode 100644
index 0000000..daaf6a0
--- /dev/null
+++ b/s390.c
@@ -0,0 +1,1033 @@
+/*
+ * s390-specific syscalls decoders.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#if defined S390 || defined S390X
+
+#include <sys/user.h>
+
+#include "print_fields.h"
+
+#include "xlat/s390_sthyi_function_codes.h"
+
+/*
+ * Since, for some reason, kernel doesn't expose all these nice constants and
+ * structures in UAPI, we have to re-declare them ourselves.
+ */
+
+/**
+ * "The header section is placed at the beginning of the response buffer and
+ * identifies the location and length of all other sections. Valid sections have
+ * nonzero offset values in the header. Each section provides information about
+ * validity of fields within that section."
+ */
+struct sthyi_hdr {
+ /**
+ * Header Flag Byte 1 - These flag settings indicate the environment
+ * that the instruction was executed in and may influence the value of
+ * the validity bits. The validity bits, and not these flags, should be
+ * used to determine if a field is valid.
+ * - 0x80 - Global Performance Data unavailable
+ * - 0x40 - One or more hypervisor levels below this level does not
+ * support the STHYI instruction. When this flag is set the
+ * value of INFGPDU is not meaningful because the state of the
+ * Global Performance Data setting cannot be determined.
+ * - 0x20 - Virtualization stack is incomplete. This bit indicates one
+ * of two cases:
+ * - One or more hypervisor levels does not support the STHYI
+ * instruction. For this case, INFSTHYI will also be set.
+ * - There were more than three levels of guest/hypervisor information
+ * to report.
+ * - 0x10 - Execution environment is not within a logical partition.
+ */
+ uint8_t infhflg1;
+ uint8_t infhflg2; /**< Header Flag Byte 2 reserved for IBM(R) use */
+ uint8_t infhval1; /**< Header Validity Byte 1 reserved for IBM use */
+ uint8_t infhval2; /**< Header Validity Byte 2 reserved for IBM use */
+ char reserved_1__[3]; /**< Reserved for future IBM use */
+ uint8_t infhygct; /**< Count of Hypervisor and Guest Sections */
+ uint16_t infhtotl; /**< Total length of response buffer */
+ uint16_t infhdln; /**< Length of Header Section mapped by INF0HDR */
+ uint16_t infmoff; /**< Offset to Machine Section mapped by INF0MAC */
+ uint16_t infmlen; /**< Length of Machine Section */
+ uint16_t infpoff; /**< Offset to Partition Section mapped by INF0PAR */
+ uint16_t infplen; /**< Length of Partition Section */
+ uint16_t infhoff1; /**< Offset to Hypervisor Section1 mapped by INF0HYP */
+ uint16_t infhlen1; /**< Length of Hypervisor Section1 */
+ uint16_t infgoff1; /**< Offset to Guest Section1 mapped by INF0GST */
+ uint16_t infglen1; /**< Length of Guest Section1 */
+ uint16_t infhoff2; /**< Offset to Hypervisor Section2 mapped by INF0HYP */
+ uint16_t infhlen2; /**< Length of Hypervisor Section2 */
+ uint16_t infgoff2; /**< Offset to Guest Section2 mapped by INF0GST */
+ uint16_t infglen2; /**< Length of Guest Section2 */
+ uint16_t infhoff3; /**< Offset to Hypervisor Section3 mapped by INF0HYP */
+ uint16_t infhlen3; /**< Length of Hypervisor Section3 */
+ uint16_t infgoff3; /**< Offset to Guest Section3 mapped by INF0GST */
+ uint16_t infglen3; /**< Length of Guest Section3 */
+ /* 44 bytes in total */
+} ATTRIBUTE_PACKED;
+
+struct sthyi_machine {
+ uint8_t infmflg1; /**< Machine Flag Byte 1 reserved for IBM use */
+ uint8_t infmflg2; /**< Machine Flag Byte 2 reserved for IBM use */
+ /**
+ * Machine Validity Byte 1
+ * - 0x80 - Processor Count Validity. When this bit is on, it indicates
+ * that INFMSCPS, INFMDCPS, INFMSIFL, and INFMDIFL contain
+ * valid counts. The validity bit may be off when:
+ * - STHYI support is not available on a lower level hypervisor, or
+ * - Global Performance Data is not enabled.
+ * - 0x40 - Machine ID Validity. This bit being on indicates that a
+ * SYSIB 1.1.1 was obtained from STSI and information reported
+ * in the following fields is valid: INFMTYPE, INFMMANU,
+ * INFMSEQ, and INFMPMAN.
+ * - 0x20 - Machine Name Validity. This bit being on indicates that the
+ * INFMNAME field is valid.
+ */
+ uint8_t infmval1;
+ uint8_t infmval2; /**< Machine Validity Byte 2 reserved for IBM use */
+ /**
+ * Number of shared CPs configured in the machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmscps;
+ /**
+ * Number of dedicated CPs configured in this machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmdcps;
+ /**
+ * Number of shared IFLs configured in this machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmsifl;
+ /**
+ * Number of dedicated IFLs configured in this machine or in the
+ * physical partition if the system is physically partitioned.
+ */
+ uint16_t infmdifl;
+ char infmname[8]; /**< EBCDIC Machine Name */
+ char infmtype[4]; /**< EBCDIC Type */
+ char infmmanu[16]; /**< EBCDIC Manufacturer */
+ char infmseq[16]; /**< EBCDIC Sequence Code */
+ char infmpman[4]; /**< EBCDIC Plant of Manufacture */
+ /* 60 bytes in total*/
+} ATTRIBUTE_PACKED;
+
+struct sthyi_partition {
+ /**
+ * Partition Flag Byte 1
+ * - 0x80 - Multithreading (MT) is enabled.
+ */
+ uint8_t infpflg1;
+ /** Partition Flag Byte 2 reserved for IBM use */
+ uint8_t infpflg2;
+ /**
+ * Partition Validity Byte 1
+ * - 0x80 - Processor count validity. This bit being on indicates that
+ * INFPSCPS, INFPDCPS, INFPSIFL, and INFPDIFL contain valid
+ * counts.
+ * - 0x40 - Partition weight-based capped capacity validity. This bit
+ * being on indicates that INFPWBCP and INFPWBIF are valid
+ * - 0x20 - Partition absolute capped capacity validity. This bit being
+ * on indicates that INFPABCP and INFPABIF are valid.
+ * - 0x10 - Partition ID validity. This bit being on indicates that a
+ * SYSIB 2.2.2 was obtained from STSI and information reported
+ * in the following fields is valid: INFPPNUM and INFPPNAM.
+ * - 0x08 - LPAR group absolute capacity capping information validity.
+ * This bit being on indicates that INFPLGNM, INFPLGCP, and
+ * INFPLGIF are valid.
+ */
+ uint8_t infpval1;
+ /** Partition Validity Byte 2 reserved for IBM use */
+ uint8_t infpval2;
+ /** Logical partition number */
+ uint16_t infppnum;
+ /**
+ * Number of shared logical CPs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpscps;
+ /**
+ * Number of dedicated logical CPs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpdcps;
+ /**
+ * Number of shared logical IFLs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpsifl;
+ /**
+ * Number of dedicated logical IFLs configured for this partition.
+ * Count of cores when MT is enabled.
+ */
+ uint16_t infpdifl;
+ /** Reserved for future IBM use */
+ char reserved_1__[2];
+ /** EBCIDIC Logical partition name */
+ char infppnam[8];
+ /**
+ * Partition weight-based capped capacity for CPs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpwbcp;
+ /**
+ * Partition absolute capped capacity for CPs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpabcp;
+ /**
+ * Partition weight-based capped capacity for IFLs, a scaled number
+ * where 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpwbif;
+ /**
+ * Partition absolute capped capacity for IFLs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpabif;
+ /**
+ * EBCIDIC LPAR group name. Binary zeros when the partition is not in
+ * an LPAR group. EBCDIC and padded with blanks on the right when in a
+ * group. The group name is reported only when there is a group cap on
+ * CP or IFL CPU types and the partition has the capped CPU type.
+ */
+ char infplgnm[8];
+ /**
+ * LPAR group absolute capacity value for CP CPU type when nonzero. This
+ * field will be nonzero only when INFPLGNM is nonzero and a cap is
+ * defined for the LPAR group for the CP CPU type. When nonzero,
+ * contains a scaled number where 0x00010000 represents one core.
+ */
+ uint32_t infplgcp;
+ /**
+ * LPAR group absolute capacity value for IFL CPU type when nonzero.
+ * This field will be nonzero only when INFPLGNM is nonzero and a cap
+ * is defined for the LPAR group for the IFL CPU type. When nonzero,
+ * contains a scaled number where 0x00010000 represents one core.
+ */
+ uint32_t infplgif;
+ /* 56 bytes */
+} ATTRIBUTE_PACKED;
+
+struct sthyi_hypervisor {
+ /**
+ * Hypervisor Flag Byte 1
+ * - 0x80 - Guest CPU usage hard limiting is using the consumption
+ * method.
+ * - 0x40 - If on, LIMITHARD caps use prorated core time for capping.
+ * If off, raw CPU time is used.
+ */
+ uint8_t infyflg1;
+ uint8_t infyflg2; /**< Hypervisor Flag Byte 2 reserved for IBM use */
+ uint8_t infyval1; /**< Hypervisor Validity Byte 1 reserved for IBM use */
+ uint8_t infyval2; /**< Hypervisor Validity Byte 2 reserved for IBM use */
+ /**
+ * Hypervisor Type
+ * - 1 - z/VM is the hypervisor.
+ */
+ uint8_t infytype;
+ char reserved_1__[1]; /**< Reserved for future IBM use */
+ /**
+ * Threads in use per CP core. Only valid when MT enabled
+ * (INFPFLG1 0x80 is ON).
+ */
+ uint8_t infycpt;
+ /**
+ * Threads in use per IFL core. Only valid when MT enabled
+ * (INFPFLG1 0x80 is ON).
+ */
+ uint8_t infyiflt;
+ /**
+ * EBCID System Identifier. Left justified and padded with blanks.
+ * This field will be blanks if non-existent.
+ */
+ char infysyid[8];
+ /**
+ * EBCID Cluster Name. Left justified and padded with blanks. This is
+ * the name on the SSI statement in the system configuration file. This
+ * field will be blanks if nonexistent.
+ */
+ char infyclnm[8];
+ /**
+ * Total number of CPs shared among guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infyscps;
+ /**
+ * Total number of CPs dedicated to guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infydcps;
+ /**
+ * Total number of IFLs shared among guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infysifl;
+ /**
+ * Total number of IFLs dedicated to guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infydifl;
+ /* 32 bytes */
+} ATTRIBUTE_PACKED;
+
+struct sthyi_guest {
+ /**
+ * Guest Flag Byte 1
+ * - 0x80 - Guest is mobility enabled
+ * - 0x40 - Guest has multiple virtual CPU types
+ * - 0x20 - Guest CP dispatch type has LIMITHARD cap
+ * - 0x10 - Guest IFL dispatch type has LIMITHARD cap
+ * - 0x08 - Virtual CPs are thread dispatched
+ * - 0x04 - Virtual IFLs are thread dispatched
+ */
+ uint8_t infgflg1;
+ uint8_t infgflg2; /**< Guest Flag Byte 2 reserved for IBM use */
+ uint8_t infgval1; /**< Guest Validity Byte 1 reserved for IBM use */
+ uint8_t infgval2; /**< Guest Validity Byte 2 reserved for IBM use */
+ char infgusid[8]; /**< EBCDIC Userid */
+ uint16_t infgscps; /**< Number of guest shared CPs */
+ uint16_t infgdcps; /**< Number of guest dedicated CPs */
+ /**
+ * Dispatch type for guest CPs. This field is valid if INFGSCPS or
+ * INFGDCPS is greater than zero.
+ * - 0 - General Purpose (CP)
+ */
+ uint8_t infgcpdt;
+ char reserved_1__[3]; /**< Reserved for future IBM use */
+ /**
+ * Guest current capped capacity for shared virtual CPs, a scaled number
+ * where 0x00010000 represents one core. This field is zero to
+ * indicate not capped when:
+ * - There is no CP individual limit (that is, the "Guest CP dispatch
+ * type has LIMITHARD cap" bit in field INFGFLG1 is OFF).
+ * - There are no shared CPs on the system (that is, INFYSCPS = 0).
+ * If there is a CP limit but there are no shared CPs or virtual CPs,
+ * the limit is meaningless and does not apply to anything.
+ */
+ uint32_t infgcpcc;
+ uint16_t infgsifl; /**< Number of guest shared IFLs */
+ uint16_t infgdifl; /**< Number of guest dedicated IFLs */
+ /**
+ * Dispatch type for guest IFLs. This field is valid if INFGSIFL or
+ * INFGDIFL is greater than zero.
+ * - 0 - General Purpose (CP)
+ * - 3 - Integrated Facility for Linux (IFL)
+ */
+ uint8_t infgifdt;
+ char reserved_2__[3]; /**< Reserved for future IBM use */
+ /**
+ * Guest current capped capacity for shared virtual IFLs, a scaled
+ * number where 0x00010000 represents one core. This field is zero
+ * to indicate not capped with an IFL limit when:
+ * - There is no IFL individual limit (that is, the "Guest IFL dispatch
+ * type has LIMITHARD cap" bit in field INFGFLG1 is OFF).
+ * - The guest's IFLs are dispatched on CPs (that is, INFGIFDT = 00).
+ * When the guest's IFLs are dispatched on CPs, the CP individual
+ * limit (in INFGCPCC) is applied to the guest's virtual IFLs and
+ * virtual CPs.
+ */
+ uint32_t infgifcc;
+ /**
+ * CPU Pool Capping Flags
+ * - 0x80 - CPU Pool's CP virtual type has LIMITHARD cap
+ * - 0x40 - CPU Pool's CP virtual type has CAPACITY cap
+ * - 0x20 - CPU Pool's IFL virtual type has LIMITHARD cap
+ * - 0x10 - CPU Pool's IFL virtual type has CAPACITY cap
+ * - 0x08 - CPU Pool uses prorated core time.
+ */
+ uint8_t infgpflg;
+ char reserved_3__[3]; /**< Reserved for future IBM use */
+ /**
+ * EBCDIC CPU Pool Name. This field will be blanks if the guest is not
+ * in a CPU Pool.
+ */
+ char infgpnam[8];
+ /**
+ * CPU Pool capped capacity for shared virtual CPs, a scaled number
+ * where 0x00010000 represents one core. This field will be zero if
+ * not capped.
+ */
+ uint32_t infgpccc;
+ /**
+ * CPU Pool capped capacity for shared virtual IFLs, a scaled number
+ * where 0x00010000 represents one core. This field will be zero if
+ * not capped.
+ */
+ uint32_t infgpicc;
+ /* 56 bytes */
+} ATTRIBUTE_PACKED;
+
+
+static void
+decode_ebcdic(const char *ebcdic, char *ascii, size_t size)
+{
+ /*
+ * This is mostly Linux's EBCDIC-ASCII conversion table, except for
+ * various non-representable characters that are converted to spaces for
+ * readability purposes, as it is intended to be a hint for the string
+ * contents and not precise conversion.
+ */
+ static char conv_table[] =
+ "\0\1\2\3 \11 \177 \13\14\15\16\17"
+ "\20\21\22\23 \n\10 \30\31 \34\35\36\37"
+ " \34 \n\27\33 \5\6\7"
+ " \26 \4 \24\25 \32"
+ " " " .<(+|"
+ "& " "!$*);~"
+ "-/ " "|,%_>?"
+ " `" ":#@'=\""
+ " abcdefghi" " "
+ " jklmnopqr" " "
+ " ~stuvwxyz" " "
+ "^ " "[] "
+ "{ABCDEFGHI" " "
+ "}JKLMNOPQR" " "
+ "\\ STUVWXYZ" " "
+ "0123456789" " ";
+
+ while (size--)
+ *ascii++ = conv_table[(unsigned char) *ebcdic++];
+}
+
+#define DECODE_EBCDIC(ebcdic_, ascii_) \
+ decode_ebcdic((ebcdic_), (ascii_), \
+ sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_))
+#define PRINT_EBCDIC(ebcdic_) \
+ do { \
+ char ascii_str[sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_)]; \
+ \
+ DECODE_EBCDIC(ebcdic_, ascii_str); \
+ print_quoted_string(ascii_str, sizeof(ascii_str), \
+ QUOTE_EMIT_COMMENT); \
+ } while (0)
+
+#define PRINT_FIELD_EBCDIC(prefix_, where_, field_) \
+ do { \
+ PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_); \
+ PRINT_EBCDIC((where_).field_); \
+ } while (0)
+
+#define PRINT_FIELD_WEIGHT(prefix_, where_, field_) \
+ do { \
+ PRINT_FIELD_X(prefix_, where_, field_); \
+ if ((where_).field_) \
+ tprintf_comment("%u %u/65536 cores", \
+ (where_).field_ >> 16, \
+ (where_).field_ & 0xFFFF); \
+ else \
+ tprints_comment("unlimited"); \
+ } while (0)
+
+
+static bool
+is_filled(char *ptr, char fill, size_t size)
+{
+ while (size--)
+ if (*ptr++ != fill)
+ return false;
+
+ return true;
+}
+
+#define IS_ZERO(arr_) \
+ is_filled(arr_, '\0', sizeof(arr_) + MUST_BE_ARRAY(arr_))
+#define IS_BLANK(arr_) /* 0x40 is space in EBCDIC */ \
+ is_filled(arr_, '\x40', sizeof(arr_) + MUST_BE_ARRAY(arr_))
+
+#define CHECK_SIZE(hdr_, size_, name_, ...) \
+ do { \
+ if ((size_) < sizeof(*(hdr_))) { \
+ tprintf_comment("Invalid " name_ " with size " \
+ "%hu < %zu expected", \
+ ##__VA_ARGS__, \
+ (size_), sizeof(*(hdr_))); \
+ print_quoted_string((char *) (hdr_), (size_), \
+ QUOTE_FORCE_HEX); \
+ \
+ return; \
+ } \
+ } while (0)
+
+#define PRINT_UNKNOWN_TAIL(hdr_, size_) \
+ do { \
+ if ((size_) > sizeof(*(hdr_)) && \
+ !is_filled((char *) ((hdr_) + 1), '\0', \
+ (size_) - sizeof(*(hdr_)))) \
+ print_quoted_string((char *) ((hdr_) + 1), \
+ (size_) - sizeof(*(hdr_)), \
+ QUOTE_FORCE_HEX); \
+ } while (0)
+
+static void
+print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size,
+ bool *dummy)
+{
+ int cnt_val, name_val, id_val;
+
+ CHECK_SIZE(hdr, size, "machine structure");
+
+ tprints("/* machine */ {");
+ if (!abbrev(tcp)) {
+ if (hdr->infmflg1) { /* Reserved */
+ PRINT_FIELD_0X("", *hdr, infmflg1);
+ tprints(", ");
+ }
+ if (hdr->infmflg2) { /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infmflg2);
+ tprints(", ");
+ }
+ }
+
+ PRINT_FIELD_0X("", *hdr, infmval1);
+ cnt_val = !!(hdr->infmval1 & 0x80);
+ id_val = !!(hdr->infmval1 & 0x40);
+ name_val = !!(hdr->infmval1 & 0x20);
+
+ if (!abbrev(tcp)) {
+ if (hdr->infmval1)
+ tprintf_comment("processor count validity: %d, "
+ "machine ID validity: %d, "
+ "machine name validity: %d%s%#.0x%s",
+ cnt_val, id_val, name_val,
+ hdr->infmval1 & 0x1F ? ", " : "",
+ hdr->infmval1 & 0x1F,
+ hdr->infmval1 & 0x1F ? " - ???" : "");
+ if (hdr->infmval2)
+ PRINT_FIELD_0X(", ", *hdr, infmval2);
+ }
+
+ if (cnt_val || hdr->infmscps)
+ PRINT_FIELD_U(", ", *hdr, infmscps);
+ if (cnt_val || hdr->infmdcps)
+ PRINT_FIELD_U(", ", *hdr, infmdcps);
+ if (cnt_val || hdr->infmsifl)
+ PRINT_FIELD_U(", ", *hdr, infmsifl);
+ if (cnt_val || hdr->infmdifl)
+ PRINT_FIELD_U(", ", *hdr, infmdifl);
+
+ if (!abbrev(tcp)) {
+ if (name_val || hdr->infmname)
+ PRINT_FIELD_EBCDIC(", ", *hdr, infmname);
+
+ if (id_val || !IS_ZERO(hdr->infmtype))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infmtype);
+ if (id_val || !IS_ZERO(hdr->infmmanu))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infmmanu);
+ if (id_val || !IS_ZERO(hdr->infmseq))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infmseq);
+ if (id_val || !IS_ZERO(hdr->infmpman))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infmpman);
+
+ PRINT_UNKNOWN_TAIL(hdr, size);
+ } else {
+ tprints(", ...");
+ }
+
+ tprints("}");
+}
+
+static void
+print_sthyi_partition(struct tcb *tcp, struct sthyi_partition *hdr,
+ uint16_t size, bool *mt)
+{
+ int cnt_val, wcap_val, acap_val, id_val, lpar_val;
+
+ *mt = false;
+
+ CHECK_SIZE(hdr, size, "partition structure");
+
+ *mt = !!(hdr->infpflg1 & 0x80);
+
+ PRINT_FIELD_0X("/* partition */ {", *hdr, infpflg1);
+ if (!abbrev(tcp) && hdr->infpflg1)
+ tprintf_comment("%s%s%#.0x%s",
+ hdr->infpflg1 & 0x80 ?
+ "0x80 - multithreading is enabled" : "",
+ (hdr->infpflg1 & 0x80) && (hdr->infpflg1 & 0x7F) ?
+ ", " : "",
+ hdr->infpflg1 & 0x7F,
+ hdr->infpflg1 & 0x7F ? " - ???" : "");
+ if (!abbrev(tcp) && hdr->infpflg2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infpflg2);
+
+ PRINT_FIELD_0X(", ", *hdr, infpval1);
+ cnt_val = !!(hdr->infpval1 & 0x80);
+ wcap_val = !!(hdr->infpval1 & 0x40);
+ acap_val = !!(hdr->infpval1 & 0x20);
+ id_val = !!(hdr->infpval1 & 0x10);
+ lpar_val = !!(hdr->infpval1 & 0x08);
+
+ if (!abbrev(tcp) && hdr->infpval1)
+ tprintf_comment("processor count validity: %d, "
+ "partition weight-based capacity validity: %d, "
+ "partition absolute capacity validity: %d, "
+ "partition ID validity: %d, "
+ "LPAR group absolute capacity capping "
+ "information validity: %d%s%#.0x%s",
+ cnt_val, wcap_val, acap_val, id_val, lpar_val,
+ hdr->infpval1 & 0x07 ? ", " : "",
+ hdr->infpval1 & 0x07,
+ hdr->infpval1 & 0x07 ? " - ???" : "");
+ if (!abbrev(tcp) && hdr->infpval2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infpval2);
+
+ if (id_val || hdr->infppnum)
+ PRINT_FIELD_U(", ", *hdr, infppnum);
+
+ if (cnt_val || hdr->infpscps)
+ PRINT_FIELD_U(", ", *hdr, infpscps);
+ if (cnt_val || hdr->infpdcps)
+ PRINT_FIELD_U(", ", *hdr, infpdcps);
+ if (cnt_val || hdr->infpsifl)
+ PRINT_FIELD_U(", ", *hdr, infpsifl);
+ if (cnt_val || hdr->infpdifl)
+ PRINT_FIELD_U(", ", *hdr, infpdifl);
+
+ if (!abbrev(tcp) && !IS_ZERO(hdr->reserved_1__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__);
+
+ if (id_val || !IS_ZERO(hdr->infppnam))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infppnam);
+
+ if (!abbrev(tcp)) {
+ if (wcap_val || hdr->infpwbcp)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infpwbcp);
+ if (acap_val || hdr->infpabcp)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infpabcp);
+ if (wcap_val || hdr->infpwbif)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infpwbif);
+ if (acap_val || hdr->infpabif)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infpabif);
+
+ if (!IS_ZERO(hdr->infplgnm)) {
+ PRINT_FIELD_EBCDIC(", ", *hdr, infplgnm);
+
+ PRINT_FIELD_WEIGHT(", ", *hdr, infplgcp);
+ PRINT_FIELD_WEIGHT(", ", *hdr, infplgif);
+ } else {
+ if (lpar_val)
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, infplgnm);
+ if (hdr->infplgcp)
+ PRINT_FIELD_X(", ", *hdr, infplgcp);
+ if (hdr->infplgif)
+ PRINT_FIELD_X(", ", *hdr, infplgif);
+ }
+
+ PRINT_UNKNOWN_TAIL(hdr, size);
+ } else {
+ tprints(", ...");
+ }
+
+ tprints("}");
+}
+
+static void
+print_sthyi_hypervisor(struct tcb *tcp, struct sthyi_hypervisor *hdr,
+ uint16_t size, int num, bool mt)
+{
+ CHECK_SIZE(hdr, size, "hypervisor %d structure", num);
+
+ tprintf("/* hypervisor %d */ ", num);
+ PRINT_FIELD_0X("{", *hdr, infyflg1);
+ if (!abbrev(tcp) && hdr->infyflg1)
+ tprintf_comment("%s%s%s%s%#.0x%s",
+ hdr->infyflg1 & 0x80 ?
+ "0x80 - guest CPU usage had limiting is using "
+ "the consumption method" : "",
+ (hdr->infyflg1 & 0x80) && (hdr->infyflg1 & 0x40) ?
+ ", " : "",
+ hdr->infyflg1 & 0x40 ?
+ "0x40 - LIMITHARD caps use prorated core time "
+ "for capping" : "",
+ (hdr->infyflg1 & 0xC0) && (hdr->infyflg1 & 0x3F) ?
+ ", " : "",
+ hdr->infyflg1 & 0x3F,
+ hdr->infyflg1 & 0x3F ? " - ???" : "");
+
+ if (!abbrev(tcp)) {
+ if (hdr->infyflg2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infyflg2);
+ if (hdr->infyval1) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infyval1);
+ if (hdr->infyval2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infyval2);
+
+ PRINT_FIELD_U(", ", *hdr, infytype);
+ switch (hdr->infytype) {
+ case 1:
+ tprints_comment("z/VM is the hypervisor");
+ break;
+ default:
+ tprints_comment("unknown hypervisor type");
+ }
+
+ if (!IS_ZERO(hdr->reserved_1__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__);
+
+ if (mt || hdr->infycpt)
+ PRINT_FIELD_U(", ", *hdr, infycpt);
+ if (mt || hdr->infyiflt)
+ PRINT_FIELD_U(", ", *hdr, infyiflt);
+ }
+
+ if (!abbrev(tcp) || !IS_BLANK(hdr->infysyid))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infysyid);
+ if (!abbrev(tcp) || !IS_BLANK(hdr->infyclnm))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infyclnm);
+
+ if (!abbrev(tcp) || hdr->infyscps)
+ PRINT_FIELD_U(", ", *hdr, infyscps);
+ if (!abbrev(tcp) || hdr->infydcps)
+ PRINT_FIELD_U(", ", *hdr, infydcps);
+ if (!abbrev(tcp) || hdr->infysifl)
+ PRINT_FIELD_U(", ", *hdr, infysifl);
+ if (!abbrev(tcp) || hdr->infydifl)
+ PRINT_FIELD_U(", ", *hdr, infydifl);
+
+ if (!abbrev(tcp)) {
+ PRINT_UNKNOWN_TAIL(hdr, size);
+ } else {
+ tprints(", ...");
+ }
+
+ tprints("}");
+}
+
+static void
+print_sthyi_guest(struct tcb *tcp, struct sthyi_guest *hdr, uint16_t size,
+ int num, bool mt)
+{
+ CHECK_SIZE(hdr, size, "guest %d structure", num);
+
+ tprintf("/* guest %d */ ", num);
+ PRINT_FIELD_0X("{", *hdr, infgflg1);
+ if (!abbrev(tcp) && hdr->infgflg1)
+ tprintf_comment("%s%s%s%s%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infgflg1 & 0x80 ?
+ "0x80 - guest is mobility enabled" : "",
+ (hdr->infgflg1 & 0x80) && (hdr->infgflg1 & 0x40) ?
+ ", " : "",
+ hdr->infgflg1 & 0x40 ?
+ "0x40 - guest has multiple virtual CPU types" :
+ "",
+ (hdr->infgflg1 & 0xC0) && (hdr->infgflg1 & 0x20) ?
+ ", " : "",
+ hdr->infgflg1 & 0x20 ?
+ "0x20 - guest CP dispatch type has LIMITHARD "
+ "cap" : "",
+ (hdr->infgflg1 & 0xE0) && (hdr->infgflg1 & 0x10) ?
+ ", " : "",
+ hdr->infgflg1 & 0x10 ?
+ "0x10 - guest IFL dispatch type has LIMITHARD "
+ "cap" : "",
+ (hdr->infgflg1 & 0xF0) && (hdr->infgflg1 & 0x08) ?
+ ", " : "",
+ hdr->infgflg1 & 0x08 ?
+ "0x08 - virtual CPs are thread dispatched" :
+ "",
+ (hdr->infgflg1 & 0xF8) && (hdr->infgflg1 & 0x04) ?
+ ", " : "",
+ hdr->infgflg1 & 0x04 ?
+ "0x04 - virtual IFLs are thread dispatched" :
+ "",
+ (hdr->infgflg1 & 0xFC) && (hdr->infgflg1 & 0x03) ?
+ ", " : "",
+ hdr->infgflg1 & 0x03,
+ hdr->infgflg1 & 0x03 ? " - ???" : "");
+ if (!abbrev(tcp)) {
+ if (hdr->infgflg2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infgflg2);
+ if (hdr->infgval1) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infgval1);
+ if (hdr->infgval2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infgval2);
+ }
+
+ PRINT_FIELD_EBCDIC(", ", *hdr, infgusid);
+
+ if (!abbrev(tcp) || hdr->infgscps)
+ PRINT_FIELD_U(", ", *hdr, infgscps);
+ if (!abbrev(tcp) || hdr->infgdcps)
+ PRINT_FIELD_U(", ", *hdr, infgdcps);
+
+ if (!abbrev(tcp)) {
+ PRINT_FIELD_U(", ", *hdr, infgcpdt);
+ switch (hdr->infgcpdt) {
+ case 0:
+ tprints_comment("General Purpose (CP)");
+ break;
+ default:
+ tprints_comment("unknown");
+ }
+
+ if (!IS_ZERO(hdr->reserved_1__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__);
+ }
+
+ if (!abbrev(tcp) || hdr->infgcpcc)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infgcpcc);
+
+ if (!abbrev(tcp) || hdr->infgsifl)
+ PRINT_FIELD_U(", ", *hdr, infgsifl);
+ if (!abbrev(tcp) || hdr->infgdifl)
+ PRINT_FIELD_U(", ", *hdr, infgdifl);
+
+ if (!abbrev(tcp)) {
+ PRINT_FIELD_U(", ", *hdr, infgifdt);
+ switch (hdr->infgifdt) {
+ case 0:
+ tprints_comment("General Purpose (CP)");
+ break;
+ case 3:
+ tprints_comment("Integrated Facility for Linux (IFL)");
+ break;
+ default:
+ tprints_comment("unknown");
+ }
+
+ if (!IS_ZERO(hdr->reserved_2__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_2__);
+ }
+
+ if (!abbrev(tcp) || hdr->infgifcc)
+ PRINT_FIELD_WEIGHT(", ", *hdr, infgifcc);
+
+ PRINT_FIELD_0X(", ", *hdr, infgpflg);
+ if (!abbrev(tcp) && hdr->infgpflg)
+ tprintf_comment("%s%s%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infgpflg & 0x80 ?
+ "0x80 - CPU pool's CP virtual type has "
+ "LIMITHARD cap" : "",
+ (hdr->infgpflg & 0x80) && (hdr->infgpflg & 0x40) ?
+ ", " : "",
+ hdr->infgpflg & 0x40 ?
+ "0x40 - CPU pool's CP virtual type has "
+ "CAPACITY cap" : "",
+ (hdr->infgpflg & 0xC0) && (hdr->infgpflg & 0x20) ?
+ ", " : "",
+ hdr->infgpflg & 0x20 ?
+ "0x20 - CPU pool's IFL virtual type has "
+ "LIMITHARD cap" : "",
+ (hdr->infgpflg & 0xE0) && (hdr->infgpflg & 0x10) ?
+ ", " : "",
+ hdr->infgpflg & 0x10 ?
+ "0x10 - CPU pool's IFL virtual type has "
+ "CAPACITY cap" : "",
+ (hdr->infgpflg & 0xF0) && (hdr->infgpflg & 0x08) ?
+ ", " : "",
+ hdr->infgpflg & 0x08 ?
+ "0x08 - CPU pool uses prorated core time" : "",
+ (hdr->infgpflg & 0xF8) && (hdr->infgpflg & 0x07) ?
+ ", " : "",
+ hdr->infgpflg & 0x07,
+ hdr->infgpflg & 0x07 ? " - ???" : "");
+
+ if (!abbrev(tcp)) {
+ if (!IS_ZERO(hdr->reserved_3__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_3__);
+
+ if (!IS_BLANK(hdr->infgpnam))
+ PRINT_FIELD_EBCDIC(", ", *hdr, infgpnam);
+
+ PRINT_FIELD_WEIGHT(", ", *hdr, infgpccc);
+ PRINT_FIELD_WEIGHT(", ", *hdr, infgpicc);
+
+ PRINT_UNKNOWN_TAIL(hdr, size);
+ } else {
+ tprints(", ...");
+ }
+
+ tprints("}");
+}
+
+#define STHYI_PRINT_STRUCT(l_, name_) \
+ do { \
+ if (hdr->inf ##l_## off && hdr->inf ##l_## off + \
+ hdr->inf ##l_## len <= sizeof(data)) { \
+ tprints(", "); \
+ print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \
+ (data + hdr->inf ##l_## off), \
+ hdr->inf ##l_## len, &mt); \
+ } \
+ } while (0)
+
+#define STHYI_PRINT_HV_STRUCT(l_, n_, name_) \
+ do { \
+ if (hdr->inf ##l_## off ##n_ && hdr->inf ##l_## off ##n_ + \
+ hdr->inf ##l_## len ##n_ <= sizeof(data)) { \
+ tprints(", "); \
+ print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \
+ (data + hdr->inf ##l_## off ##n_), \
+ hdr->inf ##l_## len ##n_, n_, mt); \
+ } \
+ } while (0)
+
+static void
+print_sthyi_buf(struct tcb *tcp, kernel_ulong_t ptr)
+{
+ char data[PAGE_SIZE];
+ struct sthyi_hdr *hdr = (struct sthyi_hdr *) data;
+ bool mt = false;
+
+ if (umove_or_printaddr(tcp, ptr, &data))
+ return;
+
+ tprints("{");
+
+ /* Header */
+ PRINT_FIELD_0X("/* header */ {", *hdr, infhflg1);
+
+ if (abbrev(tcp)) {
+ tprints(", ...");
+ goto sthyi_sections;
+ }
+
+ if (hdr->infhflg1)
+ tprintf_comment("%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infhflg1 & 0x80 ?
+ "0x80 - Global Performance Data unavailable" :
+ "",
+ (hdr->infhflg1 & 0x80) && (hdr->infhflg1 & 0x40) ?
+ ", " : "",
+ hdr->infhflg1 & 0x40 ?
+ "0x40 - One or more hypervisor levels below "
+ "this level does not support the STHYI "
+ "instruction" : "",
+ (hdr->infhflg1 & 0xC0) && (hdr->infhflg1 & 0x20) ?
+ ", " : "",
+ hdr->infhflg1 & 0x20 ?
+ "0x20 - Virtualization stack is incomplete" :
+ "",
+ (hdr->infhflg1 & 0xE0) && (hdr->infhflg1 & 0x10) ?
+ ", " : "",
+ hdr->infhflg1 & 0x10 ?
+ "0x10 - Execution environment is not within "
+ "a logical partition" : "",
+ (hdr->infhflg1 & 0xF0) && (hdr->infhflg1 & 0x0F) ?
+ ", " : "",
+ hdr->infhflg1 & 0x0F,
+ hdr->infhflg1 & 0x0F ? " - ???" : "");
+ if (hdr->infhflg2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infhflg2);
+ if (hdr->infhval1) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infhval1);
+ if (hdr->infhval2) /* Reserved */
+ PRINT_FIELD_0X(", ", *hdr, infhval2);
+
+ if (!IS_ZERO(hdr->reserved_1__))
+ PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__);
+
+ PRINT_FIELD_U(", ", *hdr, infhygct);
+ PRINT_FIELD_U(", ", *hdr, infhtotl);
+
+ PRINT_FIELD_U(", ", *hdr, infhdln);
+ PRINT_FIELD_U(", ", *hdr, infmoff);
+ PRINT_FIELD_U(", ", *hdr, infmlen);
+ PRINT_FIELD_U(", ", *hdr, infpoff);
+ PRINT_FIELD_U(", ", *hdr, infplen);
+
+ PRINT_FIELD_U(", ", *hdr, infhoff1);
+ PRINT_FIELD_U(", ", *hdr, infhlen1);
+ PRINT_FIELD_U(", ", *hdr, infgoff1);
+ PRINT_FIELD_U(", ", *hdr, infglen1);
+ PRINT_FIELD_U(", ", *hdr, infhoff2);
+ PRINT_FIELD_U(", ", *hdr, infhlen2);
+ PRINT_FIELD_U(", ", *hdr, infgoff2);
+ PRINT_FIELD_U(", ", *hdr, infglen2);
+ PRINT_FIELD_U(", ", *hdr, infhoff3);
+ PRINT_FIELD_U(", ", *hdr, infhlen3);
+ PRINT_FIELD_U(", ", *hdr, infgoff3);
+ PRINT_FIELD_U(", ", *hdr, infglen3);
+
+ PRINT_UNKNOWN_TAIL(hdr, hdr->infhdln);
+
+sthyi_sections:
+ tprints("}");
+
+ STHYI_PRINT_STRUCT(m, machine);
+ STHYI_PRINT_STRUCT(p, partition);
+
+ STHYI_PRINT_HV_STRUCT(h, 1, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 1, guest);
+ STHYI_PRINT_HV_STRUCT(h, 2, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 2, guest);
+ STHYI_PRINT_HV_STRUCT(h, 3, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 3, guest);
+
+ tprints("}");
+}
+
+/**
+ * Wrapper for the s390 STHYI instruction that provides hypervisor information.
+ *
+ * See https://www.ibm.com/support/knowledgecenter/SSB27U_6.3.0/com.ibm.zvm.v630.hcpb4/hcpb4sth.htm
+ * for the instruction documentation.
+ *
+ * The difference in the kernel wrapper is that it doesn't require the 4K
+ * alignment for the resp_buffer page (as it just copies from the internal
+ * cache).
+ */
+SYS_FUNC(s390_sthyi)
+{
+ /* in, function ID from s390_sthyi_function_codes */
+ kernel_ulong_t function_code = tcp->u_arg[0];
+ /* out, pointer to page-sized buffer */
+ kernel_ulong_t resp_buffer_ptr = tcp->u_arg[1];
+ /* out, pointer to u64 containing function result */
+ kernel_ulong_t return_code_ptr = tcp->u_arg[2];
+ /* in, should be 0, at the moment */
+ kernel_ulong_t flags = tcp->u_arg[3];
+
+ if (entering(tcp)) {
+ printxval64(s390_sthyi_function_codes, function_code,
+ "STHYI_FC_???");
+ tprints(", ");
+ } else {
+ switch (function_code) {
+ case STHYI_FC_CP_IFL_CAP:
+ print_sthyi_buf(tcp, resp_buffer_ptr);
+ break;
+
+ default:
+ printaddr(resp_buffer_ptr);
+ }
+
+ tprints(", ");
+ printnum_int64(tcp, return_code_ptr, "%" PRIu64);
+ tprintf(", %#" PRI_klx, flags);
+ }
+
+ return 0;
+}
+
+#endif /* defined S390 || defined S390X */
diff --git a/xlat/s390_sthyi_function_codes.in b/xlat/s390_sthyi_function_codes.in
new file mode 100644
index 0000000..380cd7f
--- /dev/null
+++ b/xlat/s390_sthyi_function_codes.in
@@ -0,0 +1 @@
+STHYI_FC_CP_IFL_CAP 0
--
2.1.4
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:33:50
|
* print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
array with QUOTE_FORCE_HEX.
---
print_fields.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/print_fields.h b/print_fields.h
index 0af087a..b2c6a30 100644
--- a/print_fields.h
+++ b/print_fields.h
@@ -107,6 +107,15 @@
sizeof((where_).field_)); \
} while (0)
+#define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_) \
+ do { \
+ STRACE_PRINTF("%s%s=", (prefix_), #field_); \
+ print_quoted_string((const char *)(where_).field_, \
+ sizeof((where_).field_) + \
+ MUST_BE_ARRAY((where_).field_), \
+ QUOTE_FORCE_HEX); \
+ } while (0)
+
#define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_) \
do { \
STRACE_PRINTF(prefix_); \
--
2.1.4
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:32:48
|
* tests/s390_pci_mmio_read_write.c: New file.
* tests/.gitignore: Add s390_pci_mmio_read_write.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_pci_mmio_read_write): New test.
---
tests/.gitignore | 1 +
tests/gen_tests.in | 1 +
tests/pure_executables.list | 1 +
tests/s390_pci_mmio_read_write.c | 159 +++++++++++++++++++++++++++++++++++++++
4 files changed, 162 insertions(+)
create mode 100644 tests/s390_pci_mmio_read_write.c
diff --git a/tests/.gitignore b/tests/.gitignore
index eaa1141..7dbd84d 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -359,6 +359,7 @@ rt_tgsigqueueinfo
run_expect_termsig
s390_guarded_storage
s390_guarded_storage-v
+s390_pci_mmio_read_write
s390_runtime_instr
s390_sthyi
s390_sthyi-v
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index a6dea9f..ae9ba63 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -305,6 +305,7 @@ rt_sigtimedwait -a38
rt_tgsigqueueinfo -esignal=none
s390_guarded_storage -a32
s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
+s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30
s390_runtime_instr -a50
s390_sthyi -a47
s390_sthyi-v -e trace=s390_sthyi -a47 -v
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index 9c61da2..77a29b0 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -298,6 +298,7 @@ rt_sigtimedwait
rt_tgsigqueueinfo
s390_guarded_storage
s390_guarded_storage-v
+s390_pci_mmio_read_write
s390_runtime_instr
s390_sthyi
s390_sthyi-v
diff --git a/tests/s390_pci_mmio_read_write.c b/tests/s390_pci_mmio_read_write.c
new file mode 100644
index 0000000..8968d4e
--- /dev/null
+++ b/tests/s390_pci_mmio_read_write.c
@@ -0,0 +1,159 @@
+/*
+ * Check decoding of s390_pci_mmio_read and s390_pci_mmio_write syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <asm/unistd.h>
+
+#if defined __NR_s390_pci_mmio_read && defined __NR_s390_pci_mmio_write
+
+# include <errno.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <unistd.h>
+
+# ifndef MIN
+# define MIN(a, b) ((a) < (b) ? (a) : (b))
+# endif
+
+static void
+do_call(bool wr, kernel_ulong_t mmio_addr, kernel_ulong_t buf,
+ kernel_ulong_t len, bool buf_valid, const char *buf_str)
+{
+ long saved_errno = 0;
+ long rc = 0;
+
+ printf("s390_pci_mmio_%s(%#llx, ", wr ? "write" : "read",
+ (unsigned long long) mmio_addr);
+
+ if (!wr) {
+ rc = syscall(__NR_s390_pci_mmio_read, mmio_addr, buf, len);
+ saved_errno = errno;
+ }
+
+ if (buf_valid && !rc) {
+ char *buf_ptr = (char *) (uintptr_t) buf;
+
+ print_quoted_hex(buf_ptr,
+ len > DEFAULT_STRLEN ? DEFAULT_STRLEN : len);
+
+ if (len > DEFAULT_STRLEN)
+ printf("...");
+ } else {
+ if (buf_str)
+ printf("%s", buf_str);
+ else
+ printf("%#llx", (unsigned long long) buf);
+ }
+
+ printf(", %llu) = ", (unsigned long long) len);
+
+ if (wr)
+ rc = syscall(__NR_s390_pci_mmio_write, mmio_addr, buf, len);
+ else
+ errno = saved_errno;
+
+ puts(sprintrc(rc));
+}
+
+int
+main(void)
+{
+ static const size_t buf_size = DEFAULT_STRLEN + 10;
+
+ char *buf = tail_alloc(buf_size);
+
+ bool bools[] = { true, false };
+
+ kernel_ulong_t addrs[] = {
+ 0,
+ (kernel_ulong_t) 0xdeafbeefdeadc0deULL,
+ };
+
+ struct {
+ kernel_ulong_t buf;
+ const char *str;
+ size_t size;
+ } bufs[] = {
+ { (kernel_ulong_t) ARG_STR(NULL), 0 },
+ { (kernel_ulong_t) (buf + buf_size), NULL, 0 },
+ { (kernel_ulong_t) (buf), NULL, buf_size },
+ { (kernel_ulong_t) (buf + 9), NULL, buf_size - 9 },
+ { (kernel_ulong_t) (buf + 10), NULL, buf_size - 10 },
+ { (kernel_ulong_t) (buf + 16), NULL, buf_size - 16 },
+ { (kernel_ulong_t) (buf + 26), NULL, buf_size - 26 },
+ { (kernel_ulong_t) (buf + 28), NULL, buf_size - 28 },
+ };
+
+ kernel_ulong_t sizes[] = {
+ 0,
+ DEFAULT_STRLEN / 2,
+ DEFAULT_STRLEN - 10,
+ DEFAULT_STRLEN,
+ DEFAULT_STRLEN + 1,
+ buf_size,
+ buf_size + 10,
+ (kernel_ulong_t) 0xfacefeedac0ffeedULL,
+ };
+
+ unsigned int i, j, k, l;
+ unsigned int ctr = 0;
+
+ for (i = 0; i < ARRAY_SIZE(addrs); i++) {
+ for (j = 0; j < ARRAY_SIZE(bufs); j++) {
+ for (k = 0; k < ARRAY_SIZE(sizes); k++) {
+ for (l = 0; l < ARRAY_SIZE(bools); l++) {
+ bool valid = bufs[j].buf &&
+ bufs[j].size >=
+ MIN(sizes[k],
+ DEFAULT_STRLEN + 1);
+
+ if (bufs[j].size && bools[l])
+ fill_memory_ex((char *) buf,
+ bufs[j].size,
+ 0xC0 + ctr, 255);
+
+ do_call(bools[l], addrs[i], bufs[j].buf,
+ sizes[k], valid, bufs[j].str);
+
+ ctr++;
+ }
+ }
+ }
+ }
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_s390_pci_mmio_read && __NR_s390_pci_mmio_write");
+
+#endif
--
2.1.4
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:32:29
|
* tests/s390_runtime_instr.c: New file.
* tests/.gitignore: Add s390_runtime_instr.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_runtime_instr): New test.
---
tests/.gitignore | 1 +
tests/gen_tests.in | 1 +
tests/pure_executables.list | 1 +
tests/s390_runtime_instr.c | 99 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 102 insertions(+)
create mode 100644 tests/s390_runtime_instr.c
diff --git a/tests/.gitignore b/tests/.gitignore
index 379d8c1..eaa1141 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -359,6 +359,7 @@ rt_tgsigqueueinfo
run_expect_termsig
s390_guarded_storage
s390_guarded_storage-v
+s390_runtime_instr
s390_sthyi
s390_sthyi-v
sched_get_priority_mxx
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 5a9e4ed..a6dea9f 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -305,6 +305,7 @@ rt_sigtimedwait -a38
rt_tgsigqueueinfo -esignal=none
s390_guarded_storage -a32
s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
+s390_runtime_instr -a50
s390_sthyi -a47
s390_sthyi-v -e trace=s390_sthyi -a47 -v
sched test_trace_expr times -e/sched
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index dc43a93..9c61da2 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -298,6 +298,7 @@ rt_sigtimedwait
rt_tgsigqueueinfo
s390_guarded_storage
s390_guarded_storage-v
+s390_runtime_instr
s390_sthyi
s390_sthyi-v
sched_get_priority_mxx
diff --git a/tests/s390_runtime_instr.c b/tests/s390_runtime_instr.c
new file mode 100644
index 0000000..861bbd4
--- /dev/null
+++ b/tests/s390_runtime_instr.c
@@ -0,0 +1,99 @@
+/*
+ * Check decoding of s390_runtime_instr syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <asm/unistd.h>
+
+#if defined __NR_s390_runtime_instr
+
+# include <errno.h>
+# include <signal.h>
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+ static struct {
+ kernel_ulong_t cmd;
+ const char * cmd_str;
+ } cmd_args[] = {
+ { 0, "???" },
+ { 4, "???" },
+ { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, "???" },
+ { 2, "STOP", },
+ };
+
+ static struct {
+ kernel_ulong_t sig;
+ const char * sig_str;
+ } start_sig_args[] = {
+ { 0, "SIG_0" },
+ { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL },
+ { ARG_STR(SIGALRM) },
+ { 33, "SIGRT_1" },
+ { 63, "SIGRT_31" },
+ };
+
+ unsigned int i;
+ long rc;
+
+ for (i = 0; i < ARRAY_SIZE(cmd_args); i++) {
+ rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead);
+ printf("s390_runtime_instr(%d /* S390_RUNTIME_INSTR_%s */) = "
+ "%s\n",
+ (int) cmd_args[i].cmd, cmd_args[i].cmd_str,
+ sprintrc(rc));
+ }
+
+ for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) {
+ long saved_errno;
+
+ rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig);
+ saved_errno = errno;
+ printf("s390_runtime_instr(1 /* S390_RUNTIME_INSTR_START */, ");
+
+ if (start_sig_args[i].sig_str)
+ printf("%s", start_sig_args[i].sig_str);
+ else
+ printf("%d", (int) start_sig_args[i].sig);
+
+ errno = saved_errno;
+ printf(") = %s\n", sprintrc(rc));
+ }
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_s390_runtime_instr")
+
+#endif
--
2.1.4
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:32:29
|
* linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
([353]): Change decoder to s390_pci_mmio_read.
* linux/s390x/syscallent.h: Likewise.
* s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
New function.
---
linux/s390/syscallent.h | 4 ++--
linux/s390x/syscallent.h | 4 ++--
s390.c | 33 +++++++++++++++++++++++++++++++++
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index a807c95..d34cd42 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -381,8 +381,8 @@
[349] = { 3, 0, SEN(getrandom), "getrandom" },
[350] = { 2, TD, SEN(memfd_create), "memfd_create" },
[351] = { 3, TD, SEN(bpf), "bpf" },
-[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" },
-[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" },
+[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
+[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
[354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" },
[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[356] = { 2, 0, SEN(membarrier), "membarrier" },
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index c4a770d..0c84274 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -365,8 +365,8 @@
[349] = { 3, 0, SEN(getrandom), "getrandom" },
[350] = { 2, TD, SEN(memfd_create), "memfd_create" },
[351] = { 3, TD, SEN(bpf), "bpf" },
-[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" },
-[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" },
+[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
+[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
[354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" },
[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[356] = { 2, 0, SEN(membarrier), "membarrier" },
diff --git a/s390.c b/s390.c
index dc7bf36..4b23e7a 100644
--- a/s390.c
+++ b/s390.c
@@ -1241,4 +1241,37 @@ SYS_FUNC(s390_runtime_instr)
return RVAL_DECODED;
}
+SYS_FUNC(s390_pci_mmio_write)
+{
+ kernel_ulong_t mmio_addr = tcp->u_arg[0];
+ kernel_ulong_t user_buf = tcp->u_arg[1];
+ kernel_ulong_t length = tcp->u_arg[2];
+
+ tprintf("%#" PRI_klx ", ", mmio_addr);
+ printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+ tprintf(", %" PRI_klu, length);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_pci_mmio_read)
+{
+ kernel_ulong_t mmio_addr = tcp->u_arg[0];
+ kernel_ulong_t user_buf = tcp->u_arg[1];
+ kernel_ulong_t length = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ tprintf("%#" PRI_klx ", ", mmio_addr);
+ } else {
+ if (!syserror(tcp))
+ printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+ else
+ printaddr(user_buf);
+
+ tprintf(", %" PRI_klu, length);
+ }
+
+ return 0;
+}
+
#endif /* defined S390 || defined S390X */
--
2.1.4
|
|
From: Eugene S. <ev...@gm...> - 2018-01-18 06:32:21
|
* configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h.
* tests/s390_guarded_storage-v.c: New file.
* tests/s390_guarded_storage.c: Likewise.
* tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v):
New tests.
---
configure.ac | 1 +
tests/.gitignore | 2 +
tests/gen_tests.in | 4 +-
tests/pure_executables.list | 2 +
tests/s390_guarded_storage-v.c | 2 +
tests/s390_guarded_storage.c | 229 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 239 insertions(+), 1 deletion(-)
create mode 100644 tests/s390_guarded_storage-v.c
create mode 100644 tests/s390_guarded_storage.c
diff --git a/configure.ac b/configure.ac
index 63595ce..fc164c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -392,6 +392,7 @@ AC_CHECK_MEMBERS(m4_normalize([
AC_CHECK_HEADERS(m4_normalize([
asm/cachectl.h
+ asm/guarded_storage.h
asm/sysmips.h
bluetooth/bluetooth.h
elf.h
diff --git a/tests/.gitignore b/tests/.gitignore
index 19aa493..379d8c1 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -357,6 +357,8 @@ rt_sigsuspend
rt_sigtimedwait
rt_tgsigqueueinfo
run_expect_termsig
+s390_guarded_storage
+s390_guarded_storage-v
s390_sthyi
s390_sthyi-v
sched_get_priority_mxx
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 968f6e4..5a9e4ed 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -303,8 +303,10 @@ rt_sigreturn -esignal='!USR1'
rt_sigsuspend -a20 -esignal=none
rt_sigtimedwait -a38
rt_tgsigqueueinfo -esignal=none
+s390_guarded_storage -a32
+s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
s390_sthyi -a47
-s390_sthyi-v -e trace=s390_sthyi -a47
+s390_sthyi-v -e trace=s390_sthyi -a47 -v
sched test_trace_expr times -e/sched
sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max
sched_rr_get_interval -a31
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index d8b997d..dc43a93 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -296,6 +296,8 @@ rt_sigreturn
rt_sigsuspend
rt_sigtimedwait
rt_tgsigqueueinfo
+s390_guarded_storage
+s390_guarded_storage-v
s390_sthyi
s390_sthyi-v
sched_get_priority_mxx
diff --git a/tests/s390_guarded_storage-v.c b/tests/s390_guarded_storage-v.c
new file mode 100644
index 0000000..05afd9f
--- /dev/null
+++ b/tests/s390_guarded_storage-v.c
@@ -0,0 +1,2 @@
+#define VERBOSE 1
+#include "s390_guarded_storage.c"
diff --git a/tests/s390_guarded_storage.c b/tests/s390_guarded_storage.c
new file mode 100644
index 0000000..ab67c15
--- /dev/null
+++ b/tests/s390_guarded_storage.c
@@ -0,0 +1,229 @@
+/*
+ * Check decoding of s390_guarded_storage syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include <asm/unistd.h>
+
+#if defined __NR_s390_guarded_storage && defined HAVE_ASM_GUARDED_STORAGE_H
+
+# include <inttypes.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <unistd.h>
+
+# include <asm/guarded_storage.h>
+
+# ifndef VERBOSE
+# define VERBOSE 0
+# endif
+
+static void
+gs_no_arg(kernel_ulong_t val, const char *val_str)
+{
+ static const kernel_ulong_t bogus_addr =
+ (kernel_ulong_t) 0xcaffeedadeadbed5ULL;
+ static const kernel_ulong_t bogus_cmd_mask =
+ (kernel_ulong_t) 0xbadc0ded00000000ULL;
+ long rc;
+
+ rc = syscall(__NR_s390_guarded_storage, val | bogus_cmd_mask,
+ bogus_addr);
+ printf("s390_guarded_storage(%s) = %s\n", val_str, sprintrc(rc));
+}
+
+static void
+gs_print_epl(uint64_t addr, bool valid, const char *str)
+{
+ if (!valid) {
+ if (str)
+ printf("%s", str);
+ else
+ printf("%#" PRIx64, addr);
+
+ return;
+ }
+
+ struct gs_epl *gsepl = (struct gs_epl *) (uintptr_t) addr;
+
+ printf("[{");
+
+# if VERBOSE
+ if (gsepl->pad1)
+ printf("pad1=%#02x, ", gsepl->pad1);
+
+ printf("gs_eam=%#02x /* extended addressing mode: %u, "
+ "basic addressing mode: %u */"
+ ", gs_eci=%#02x /* CPU in TX: %u, CPU in CX: %u, "
+ "instruction: %s */"
+ ", gs_eai=%#02x /* DAT: %u, address space indication: %u, "
+ "AR number: %u */, ",
+ gsepl->gs_eam, gsepl->e, gsepl->b,
+ gsepl->gs_eci, gsepl->tx, gsepl->cx,
+ gsepl->in ? "LLGFGS": "LGG",
+ gsepl->gs_eai, gsepl->t, gsepl->as, gsepl->ar);
+
+ if (gsepl->pad2)
+ printf("pad2=%#08x, ", gsepl->pad2);
+# endif /* VERBOSE */
+
+ printf("gs_eha=%#llx, ", (unsigned long long) gsepl->gs_eha);
+
+# if VERBOSE
+ printf("gs_eia=%#llx, gs_eoa=%#llx, gs_eir=%#llx, gs_era=%#llx",
+ (unsigned long long) gsepl->gs_eia,
+ (unsigned long long) gsepl->gs_eoa,
+ (unsigned long long) gsepl->gs_eir,
+ (unsigned long long) gsepl->gs_era);
+# else /* !VERBOSE */
+ printf("...");
+# endif /* VERBOSE */
+
+ printf("}]");
+}
+
+static void
+gs_set_cb(kernel_ulong_t addr, bool valid, bool epl_valid,
+ const char *bc_str, const char *epl_str)
+{
+ static const kernel_ulong_t bogus_cmd_mask =
+ (kernel_ulong_t) 0xda7a105700000000ULL;
+
+ long rc;
+
+ printf("s390_guarded_storage(GS_SET_BC_CB, ");
+
+ if (valid) {
+ struct gs_cb *gscb = (struct gs_cb *) (uintptr_t) addr;
+
+ printf("{");
+
+ if (gscb->reserved)
+ printf("reserved=%#016llx, ",
+ (unsigned long long) gscb->reserved);
+
+ printf("gsd=%#16llx",
+ (unsigned long long) gscb->gsd);
+# if VERBOSE
+ printf(" /* GS origin: ");
+
+ unsigned int gsc = gscb->gsd & 0x3F;
+ unsigned int gls = (gscb->gsd >> 8) & 7;
+ bool gsc_valid = gsc >= 25 && gsc <= 56;
+
+ if (gsc_valid) {
+ uint64_t gls = gscb->gsd >> gsc;
+ int field_size = 2 + (67 - gsc) / 4;
+
+ printf("%#0*" PRIx64, field_size, gls);
+ } else {
+ printf("[invalid]");
+ }
+
+ printf(", guard load shift: %u, GS characteristic: %u */",
+ gls, gsc);
+# endif /* VERBOSE */
+
+ printf(", gssm=%#016llx, gs_epl_a=",
+ (unsigned long long) gscb->gssm);
+
+ gs_print_epl(gscb->gs_epl_a, epl_valid, epl_str);
+
+ printf("}");
+ } else {
+ if (bc_str)
+ printf("%s", bc_str);
+ else
+ printf("%#llx", (unsigned long long) addr);
+ }
+
+ rc = syscall(__NR_s390_guarded_storage,
+ GS_SET_BC_CB | bogus_cmd_mask, addr);
+ printf(") = %s\n", sprintrc(rc));
+}
+
+int
+main(void)
+{
+ static const kernel_ulong_t bogus_cmd =
+ (kernel_ulong_t) 0xdeafbeefdeadc0deULL;
+ static const kernel_ulong_t bogus_addr =
+ (kernel_ulong_t) 0xfacefeedac0ffeedULL;
+
+ struct gs_cb *gscb = tail_alloc(sizeof(*gscb));
+ struct gs_epl *gsepl = tail_alloc(sizeof(*gsepl));
+
+ long rc;
+
+ rc = syscall(__NR_s390_guarded_storage, 5, 0);
+ printf("s390_guarded_storage(0x5 /* GS_??? */, NULL) = %s\n",
+ sprintrc(rc));
+
+ rc = syscall(__NR_s390_guarded_storage, bogus_cmd, bogus_addr);
+ printf("s390_guarded_storage(%#x /* GS_??? */, %#lx) = %s\n",
+ (unsigned) bogus_cmd, (unsigned long) bogus_addr, sprintrc(rc));
+
+ gs_no_arg(ARG_STR(GS_BROADCAST));
+ gs_no_arg(ARG_STR(GS_CLEAR_BC_CB));
+ gs_no_arg(ARG_STR(GS_DISABLE));
+ gs_no_arg(ARG_STR(GS_ENABLE));
+
+ fill_memory(gscb, sizeof(*gscb));
+ fill_memory_ex(gsepl, sizeof(*gsepl), 0xA5, 0x5A);
+
+ gs_set_cb(0, false, false, "NULL", NULL);
+ gs_set_cb((uintptr_t) (gscb + 1), false, false, NULL, NULL);
+
+ gscb->gs_epl_a = 0;
+ gs_set_cb((uintptr_t) gscb, true, false, NULL, "NULL");
+
+ fill_memory_ex(gscb, sizeof(*gscb), 0x5A, 0xA5);
+ gscb->gs_epl_a = (uintptr_t) (gsepl + 1) |
+ (sizeof(kernel_ulong_t) < sizeof(uint64_t) ?
+ 0xc0debad000000000ULL : 0);
+ gs_set_cb((uintptr_t) gscb, true, false, NULL, NULL);
+
+ fill_memory_ex(gscb, sizeof(*gscb), 0xA7, 0xA5);
+ gscb->gs_epl_a = (uintptr_t) gsepl;
+ gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL);
+
+ fill_memory_ex(gscb, sizeof(*gscb), 0x55, 0xAA);
+ fill_memory_ex(gsepl, sizeof(*gsepl), 0x5A, 0xA5);
+ gscb->gs_epl_a = (uintptr_t) gsepl;
+ gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL);
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_s390_guarded_storage && HAVE_ASM_GUARDED_STORAGE_H")
+
+#endif
--
2.1.4
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-11 20:33:50
|
On Thu, Jan 11, 2018 at 10:03:34PM +0300, Gleb Fotengauer-Malinovskiy wrote: > * linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh. > * linux/32/ioctls_inc_align32.h: Likewise. > * linux/32/ioctls_inc_align64.h: Likewise. > * linux/64/ioctls_inc.h: Likewise. > * linux/x32/ioctls_inc0.h: Likewise. > * NEWS: Mention this. Applied, thanks! -- ldv |
|
From: Gleb Fotengauer-M. <gl...@al...> - 2018-01-11 19:07:04
|
* linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* linux/64/ioctls_inc.h: Likewise.
* linux/x32/ioctls_inc0.h: Likewise.
* NEWS: Mention this.
---
NEWS | 1 +
linux/32/ioctls_inc_align16.h | 21 ++++++++++++++++++---
linux/32/ioctls_inc_align32.h | 21 ++++++++++++++++++---
linux/32/ioctls_inc_align64.h | 19 +++++++++++++++++--
linux/64/ioctls_inc.h | 19 +++++++++++++++++--
linux/x32/ioctls_inc0.h | 19 +++++++++++++++++--
6 files changed, 88 insertions(+), 12 deletions(-)
diff --git a/NEWS b/NEWS
index 448a9cb..298d6ba 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Noteworthy changes in release ?.?? (????-??-??)
* Enhanced decoding of BPF_MAP_CREATE command of bpf syscall.
* Updated lists of MSG_* and SHM_* constants.
* Added manual page for the strace-log-merge command.
+ * Updated lists of ioctl commands from Linux 4.15.
* Bug fixes
* Fixed multi-personality support in cross builds.
diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
index 175f85f..1994589 100644
--- a/linux/32/ioctls_inc_align16.h
+++ b/linux/32/ioctls_inc_align16.h
@@ -85,6 +85,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4a },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -302,9 +312,11 @@
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
index 165912a..e8ee3f0 100644
--- a/linux/32/ioctls_inc_align32.h
+++ b/linux/32/ioctls_inc_align32.h
@@ -85,6 +85,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -302,9 +312,11 @@
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
index 25de6ba..fd8f575 100644
--- a/linux/32/ioctls_inc_align64.h
+++ b/linux/32/ioctls_inc_align64.h
@@ -85,6 +85,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -304,7 +314,9 @@
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
index 691b6ea..0bc1c76 100644
--- a/linux/64/ioctls_inc.h
+++ b/linux/64/ioctls_inc.h
@@ -85,6 +85,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -304,7 +314,9 @@
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h
index 9d4041b..87870e6 100644
--- a/linux/x32/ioctls_inc0.h
+++ b/linux/x32/ioctls_inc0.h
@@ -85,6 +85,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -304,7 +314,9 @@
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
--
glebfm
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-10 03:17:04
|
On Tue, Jan 09, 2018 at 01:49:36AM +0530, Harsha Sharma wrote:
> * defs.h (decode_netlink_kobject_uevent): New prototype.
> * netlink.c (decode_netlink): Decode family kobject_uevent.
> * netlink_kobject_uevent.h: New file.
> * netlink_object_uevent.c: New file.
> * Makefile.am (strace_SOURCES): Add them.
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
> Changes in v4:
> * Minor changes in decode_netlink_kobject_uevent
>
> Changes in v3:
> * Change changelog
> * minor changes in decode_netlink_kobject_uevent
> * omit irrelevant comments in netlink_kobject_uevent.h
>
> Changes in v2:
> * New file netlink_kobject_uevent.c
> * change location of netlink_kobject_uevent.h
> * add comments in netlink_kobject_uevent.h
> * add new files in Makefile.am
> * add func decode_netlink_kobject_uevent in defs.h
> * Use macros from print_fields.h instead of tprintf
> * minor changes in decode_netlink_kobject_uevent (including name)
>
> Makefile.am | 2 ++
> defs.h | 3 +++
> netlink.c | 2 +-
> netlink_kobject_uevent.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
> netlink_kobject_uevent.h | 17 +++++++++++++
> 5 files changed, 87 insertions(+), 1 deletion(-)
> create mode 100644 netlink_kobject_uevent.c
> create mode 100644 netlink_kobject_uevent.h
>
> diff --git a/Makefile.am b/Makefile.am
> index 670046a5..719516e1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -194,6 +194,8 @@ strace_SOURCES = \
> netlink.c \
> netlink.h \
> netlink_crypto.c \
> + netlink_kobject_uevent.c \
> + netlink_kobject_uevent.h \
> netlink_sock_diag.h \
> netlink_inet_diag.c \
> netlink_netlink_diag.c \
> diff --git a/defs.h b/defs.h
> index e7d7b2df..6aafeb28 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -694,6 +694,9 @@ DECL_NETLINK(route);
> DECL_NETLINK(selinux);
> DECL_NETLINK(sock_diag);
>
> +extern void
> +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
> + kernel_ulong_t len);
> extern int tv_nz(const struct timeval *);
> extern int tv_cmp(const struct timeval *, const struct timeval *);
> extern double tv_float(const struct timeval *);
> diff --git a/netlink.c b/netlink.c
> index beb6ea4a..a714d29a 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -629,7 +629,7 @@ decode_netlink(struct tcb *const tcp,
> const int family = get_fd_nl_family(tcp, fd);
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> - printstrn(tcp, addr, len);
> + decode_netlink_kobject_uevent(tcp, addr, len);
> return;
> }
>
> diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
> new file mode 100644
> index 00000000..813638da
> --- /dev/null
> +++ b/netlink_kobject_uevent.c
> @@ -0,0 +1,64 @@
> +/*
> + * Copyright (c) 2018 Harsha Sharma <har...@gm...>
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in the
> + * documentation and/or other materials provided with the distribution.
> + * 3. The name of the author may not be used to endorse or promote products
> + * derived from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "defs.h"
> +#include "print_fields.h"
> +#include "netlink_kobject_uevent.h"
> +
> +#include <arpa/inet.h>
> +
> +void
> +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (len >= sizeof(uh)) {
> + if (!umove_or_printaddr(tcp, addr, &uh)) {
> + if (strcmp(uh.prefix, prefix) == 0) {
> + PRINT_FIELD_CSTRING("{", uh, prefix);
> + tprintf(", magic=htonl(%#x)", ntohl(uh.magic));
> + PRINT_FIELD_U(", ", uh, header_size);
> + PRINT_FIELD_U(", ", uh, properties_off);
> + PRINT_FIELD_U(", ", uh, properties_len);
> + PRINT_FIELD_X(", ", uh, filter_subsystem_hash);
> + PRINT_FIELD_X(", ", uh, filter_devtype_hash);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_hi);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_lo);
Sorry but you must have missed my comment:
all these filter_* fields are hashes stored in network byte order.
> + tprints("}");
> + printstrn(tcp, addr - sizeof(uh),
> + len - sizeof(uh));
This would print {...}"..." which is not a correct output.
I think it's time to add a test for this new parser.
--
ldv
|
|
From: Harsha S. <har...@gm...> - 2018-01-08 20:20:02
|
* defs.h (decode_netlink_kobject_uevent): New prototype.
* netlink.c (decode_netlink): Decode family kobject_uevent.
* netlink_kobject_uevent.h: New file.
* netlink_object_uevent.c: New file.
* Makefile.am (strace_SOURCES): Add them.
Signed-off-by: Harsha Sharma <har...@gm...>
---
Changes in v4:
* Minor changes in decode_netlink_kobject_uevent
Changes in v3:
* Change changelog
* minor changes in decode_netlink_kobject_uevent
* omit irrelevant comments in netlink_kobject_uevent.h
Changes in v2:
* New file netlink_kobject_uevent.c
* change location of netlink_kobject_uevent.h
* add comments in netlink_kobject_uevent.h
* add new files in Makefile.am
* add func decode_netlink_kobject_uevent in defs.h
* Use macros from print_fields.h instead of tprintf
* minor changes in decode_netlink_kobject_uevent (including name)
Makefile.am | 2 ++
defs.h | 3 +++
netlink.c | 2 +-
netlink_kobject_uevent.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
netlink_kobject_uevent.h | 17 +++++++++++++
5 files changed, 87 insertions(+), 1 deletion(-)
create mode 100644 netlink_kobject_uevent.c
create mode 100644 netlink_kobject_uevent.h
diff --git a/Makefile.am b/Makefile.am
index 670046a5..719516e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -194,6 +194,8 @@ strace_SOURCES = \
netlink.c \
netlink.h \
netlink_crypto.c \
+ netlink_kobject_uevent.c \
+ netlink_kobject_uevent.h \
netlink_sock_diag.h \
netlink_inet_diag.c \
netlink_netlink_diag.c \
diff --git a/defs.h b/defs.h
index e7d7b2df..6aafeb28 100644
--- a/defs.h
+++ b/defs.h
@@ -694,6 +694,9 @@ DECL_NETLINK(route);
DECL_NETLINK(selinux);
DECL_NETLINK(sock_diag);
+extern void
+decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
+ kernel_ulong_t len);
extern int tv_nz(const struct timeval *);
extern int tv_cmp(const struct timeval *, const struct timeval *);
extern double tv_float(const struct timeval *);
diff --git a/netlink.c b/netlink.c
index beb6ea4a..a714d29a 100644
--- a/netlink.c
+++ b/netlink.c
@@ -629,7 +629,7 @@ decode_netlink(struct tcb *const tcp,
const int family = get_fd_nl_family(tcp, fd);
if (family == NETLINK_KOBJECT_UEVENT) {
- printstrn(tcp, addr, len);
+ decode_netlink_kobject_uevent(tcp, addr, len);
return;
}
diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
new file mode 100644
index 00000000..813638da
--- /dev/null
+++ b/netlink_kobject_uevent.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018 Harsha Sharma <har...@gm...>
+ * Copyright (c) 2017 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+#include "print_fields.h"
+#include "netlink_kobject_uevent.h"
+
+#include <arpa/inet.h>
+
+void
+decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
+ kernel_ulong_t len)
+{
+ struct udev_monitor_netlink_header uh;
+ const char *prefix = "libudev";
+
+ if (len >= sizeof(uh)) {
+ if (!umove_or_printaddr(tcp, addr, &uh)) {
+ if (strcmp(uh.prefix, prefix) == 0) {
+ PRINT_FIELD_CSTRING("{", uh, prefix);
+ tprintf(", magic=htonl(%#x)", ntohl(uh.magic));
+ PRINT_FIELD_U(", ", uh, header_size);
+ PRINT_FIELD_U(", ", uh, properties_off);
+ PRINT_FIELD_U(", ", uh, properties_len);
+ PRINT_FIELD_X(", ", uh, filter_subsystem_hash);
+ PRINT_FIELD_X(", ", uh, filter_devtype_hash);
+ PRINT_FIELD_X(", ", uh, filter_tag_bloom_hi);
+ PRINT_FIELD_X(", ", uh, filter_tag_bloom_lo);
+ tprints("}");
+ printstrn(tcp, addr - sizeof(uh),
+ len - sizeof(uh));
+ } else {
+ printstrn(tcp, addr, len);
+ }
+ }
+ } else {
+ printstrn(tcp, addr, len);
+ }
+}
diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h
new file mode 100644
index 00000000..5ac57cae
--- /dev/null
+++ b/netlink_kobject_uevent.h
@@ -0,0 +1,17 @@
+#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
+#define STRACE_NETLINK_KOBJECT_UEVENT_H
+
+struct udev_monitor_netlink_header {
+ /* "libudev" prefix to distinguish libudev and kernel messages */
+ char prefix[8];
+ unsigned int magic;
+ unsigned int header_size;
+ unsigned int properties_off;
+ unsigned int properties_len;
+ unsigned int filter_subsystem_hash;
+ unsigned int filter_devtype_hash;
+ unsigned int filter_tag_bloom_hi;
+ unsigned int filter_tag_bloom_lo;
+};
+
+#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
--
2.11.0
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-08 01:27:19
|
On Sat, Jan 06, 2018 at 08:13:00PM +0530, Harsha Sharma wrote:
> * defs.h (decode_netlink_kobject_uevent): New prototype.
> * netlink.c (decode_netlink): Decode family kobject_uevent.
> * netlink_kobject_uevent.h: New file.
> * netlink_object_uevent.c: New file.
> * Makefile.am (strace_SOURCES): Add them.
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
> Changes in v3:
> * Change changelog
> * minor changes in decode_netlink_kobject_uevent
> * omit irrelevant comments in netlink_kobject_uevent.h
>
> Changes in v2:
> * New file netlink_kobject_uevent.c
> * change location of netlink_kobject_uevent.h
> * add comments in netlink_kobject_uevent.h
> * add new files in Makefile.am
> * add func decode_netlink_kobject_uevent in defs.h
> * Use macros from print_fields.h instead of tprintf
> * minor changes in decode_netlink_kobject_uevent (including name)
>
> Makefile.am | 2 ++
> defs.h | 3 +++
> netlink.c | 2 +-
> netlink_kobject_uevent.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
> netlink_kobject_uevent.h | 17 ++++++++++++++
> 5 files changed, 83 insertions(+), 1 deletion(-)
> create mode 100644 netlink_kobject_uevent.c
> create mode 100644 netlink_kobject_uevent.h
>
> diff --git a/Makefile.am b/Makefile.am
> index 670046a5..719516e1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -194,6 +194,8 @@ strace_SOURCES = \
> netlink.c \
> netlink.h \
> netlink_crypto.c \
> + netlink_kobject_uevent.c \
> + netlink_kobject_uevent.h \
> netlink_sock_diag.h \
> netlink_inet_diag.c \
> netlink_netlink_diag.c \
> diff --git a/defs.h b/defs.h
> index d38565bb..a5aed334 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -687,6 +687,9 @@ DECL_NETLINK(route);
> DECL_NETLINK(selinux);
> DECL_NETLINK(sock_diag);
>
> +extern void
> +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
> + kernel_ulong_t len);
> extern int tv_nz(const struct timeval *);
> extern int tv_cmp(const struct timeval *, const struct timeval *);
> extern double tv_float(const struct timeval *);
> diff --git a/netlink.c b/netlink.c
> index 6b9a1f5c..a686b1f1 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp,
> const int family = get_fd_nl_family(tcp, fd);
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> - printstrn(tcp, addr, len);
> + decode_netlink_kobject_uevent(tcp, addr, len);
> return;
> }
>
> diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
> new file mode 100644
> index 00000000..51967fda
> --- /dev/null
> +++ b/netlink_kobject_uevent.c
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright (c) 2018 Harsha Sharma <har...@gm...>
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in the
> + * documentation and/or other materials provided with the distribution.
> + * 3. The name of the author may not be used to endorse or promote products
> + * derived from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "defs.h"
> +#include "print_fields.h"
> +#include "netlink_kobject_uevent.h"
> +
> +void
> +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (len >= sizeof(uh)) {
> + if (!umove_or_printaddr(tcp, addr, &uh)) {
> + if (strcmp(uh.prefix, prefix) == 0) {
> + PRINT_FIELD_CSTRING("{", uh, prefix);
> + PRINT_FIELD_X(", ", uh, magic);
I've had a look at libudev-monitor.c where all this stuff is defined,
and found that "magic" field is stored in network byte order.
The tradition is to print it this way:
tprintf(", magic=htonl(%#x)", ntohl(uh.magic));
> + PRINT_FIELD_U(", ", uh, header_size);
> + PRINT_FIELD_U(", ", uh, properties_off);
> + PRINT_FIELD_U(", ", uh, properties_len);
> + PRINT_FIELD_U(", ", uh, filter_subsystem_hash);
> + PRINT_FIELD_U(", ", uh, filter_devtype_hash);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_hi);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_lo);
Likewise, all these filter_* fields are hashes (thus have to be printed
in hex) stored in network byte order.
If len > sizeof(uh), there is some data left beyond struct
udev_monitor_netlink_header, you might want to print it, too.
--
ldv
|
|
From: Chen J. <che...@gm...> - 2018-01-08 01:10:13
|
On 01/06 08:13, Harsha Sharma wrote:
> * defs.h (decode_netlink_kobject_uevent): New prototype.
> * netlink.c (decode_netlink): Decode family kobject_uevent.
> * netlink_kobject_uevent.h: New file.
> * netlink_object_uevent.c: New file.
> * Makefile.am (strace_SOURCES): Add them.
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
> Changes in v3:
> * Change changelog
> * minor changes in decode_netlink_kobject_uevent
> * omit irrelevant comments in netlink_kobject_uevent.h
>
> Changes in v2:
> * New file netlink_kobject_uevent.c
> * change location of netlink_kobject_uevent.h
> * add comments in netlink_kobject_uevent.h
> * add new files in Makefile.am
> * add func decode_netlink_kobject_uevent in defs.h
> * Use macros from print_fields.h instead of tprintf
> * minor changes in decode_netlink_kobject_uevent (including name)
>
> Makefile.am | 2 ++
> defs.h | 3 +++
> netlink.c | 2 +-
> netlink_kobject_uevent.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
> netlink_kobject_uevent.h | 17 ++++++++++++++
> 5 files changed, 83 insertions(+), 1 deletion(-)
> create mode 100644 netlink_kobject_uevent.c
> create mode 100644 netlink_kobject_uevent.h
>
> diff --git a/Makefile.am b/Makefile.am
> index 670046a5..719516e1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -194,6 +194,8 @@ strace_SOURCES = \
> netlink.c \
> netlink.h \
> netlink_crypto.c \
> + netlink_kobject_uevent.c \
> + netlink_kobject_uevent.h \
> netlink_sock_diag.h \
> netlink_inet_diag.c \
> netlink_netlink_diag.c \
> diff --git a/defs.h b/defs.h
> index d38565bb..a5aed334 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -687,6 +687,9 @@ DECL_NETLINK(route);
> DECL_NETLINK(selinux);
> DECL_NETLINK(sock_diag);
>
> +extern void
> +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
> + kernel_ulong_t len);
> extern int tv_nz(const struct timeval *);
> extern int tv_cmp(const struct timeval *, const struct timeval *);
> extern double tv_float(const struct timeval *);
> diff --git a/netlink.c b/netlink.c
> index 6b9a1f5c..a686b1f1 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp,
> const int family = get_fd_nl_family(tcp, fd);
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> - printstrn(tcp, addr, len);
> + decode_netlink_kobject_uevent(tcp, addr, len);
> return;
> }
>
> diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
> new file mode 100644
> index 00000000..51967fda
> --- /dev/null
> +++ b/netlink_kobject_uevent.c
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright (c) 2018 Harsha Sharma <har...@gm...>
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in the
> + * documentation and/or other materials provided with the distribution.
> + * 3. The name of the author may not be used to endorse or promote products
> + * derived from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "defs.h"
> +#include "print_fields.h"
> +#include "netlink_kobject_uevent.h"
> +
> +void
> +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (len >= sizeof(uh)) {
> + if (!umove_or_printaddr(tcp, addr, &uh)) {
> + if (strcmp(uh.prefix, prefix) == 0) {
> + PRINT_FIELD_CSTRING("{", uh, prefix);
> + PRINT_FIELD_X(", ", uh, magic);
> + PRINT_FIELD_U(", ", uh, header_size);
> + PRINT_FIELD_U(", ", uh, properties_off);
> + PRINT_FIELD_U(", ", uh, properties_len);
> + PRINT_FIELD_U(", ", uh, filter_subsystem_hash);
> + PRINT_FIELD_U(", ", uh, filter_devtype_hash);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_hi);
> + PRINT_FIELD_X(", ", uh, filter_tag_bloom_lo);
> + tprints("}");
After the header have other messages.
> + } else {
> + printstrn(tcp, addr, len);
> + }
> + }
> + } else {
> + printstrn(tcp, addr, len);
> + }
> +}
> diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h
> new file mode 100644
> index 00000000..5ac57cae
> --- /dev/null
> +++ b/netlink_kobject_uevent.h
> @@ -0,0 +1,17 @@
> +#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
> +#define STRACE_NETLINK_KOBJECT_UEVENT_H
> +
> +struct udev_monitor_netlink_header {
> + /* "libudev" prefix to distinguish libudev and kernel messages */
> + char prefix[8];
> + unsigned int magic;
> + unsigned int header_size;
> + unsigned int properties_off;
> + unsigned int properties_len;
> + unsigned int filter_subsystem_hash;
> + unsigned int filter_devtype_hash;
> + unsigned int filter_tag_bloom_hi;
> + unsigned int filter_tag_bloom_lo;
> +};
> +
> +#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
> --
> 2.11.0
>
--
Chen Jingpiao
|
|
From: Harsha S. <har...@gm...> - 2018-01-06 14:43:33
|
* defs.h (decode_netlink_kobject_uevent): New prototype.
* netlink.c (decode_netlink): Decode family kobject_uevent.
* netlink_kobject_uevent.h: New file.
* netlink_object_uevent.c: New file.
* Makefile.am (strace_SOURCES): Add them.
Signed-off-by: Harsha Sharma <har...@gm...>
---
Changes in v3:
* Change changelog
* minor changes in decode_netlink_kobject_uevent
* omit irrelevant comments in netlink_kobject_uevent.h
Changes in v2:
* New file netlink_kobject_uevent.c
* change location of netlink_kobject_uevent.h
* add comments in netlink_kobject_uevent.h
* add new files in Makefile.am
* add func decode_netlink_kobject_uevent in defs.h
* Use macros from print_fields.h instead of tprintf
* minor changes in decode_netlink_kobject_uevent (including name)
Makefile.am | 2 ++
defs.h | 3 +++
netlink.c | 2 +-
netlink_kobject_uevent.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
netlink_kobject_uevent.h | 17 ++++++++++++++
5 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 netlink_kobject_uevent.c
create mode 100644 netlink_kobject_uevent.h
diff --git a/Makefile.am b/Makefile.am
index 670046a5..719516e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -194,6 +194,8 @@ strace_SOURCES = \
netlink.c \
netlink.h \
netlink_crypto.c \
+ netlink_kobject_uevent.c \
+ netlink_kobject_uevent.h \
netlink_sock_diag.h \
netlink_inet_diag.c \
netlink_netlink_diag.c \
diff --git a/defs.h b/defs.h
index d38565bb..a5aed334 100644
--- a/defs.h
+++ b/defs.h
@@ -687,6 +687,9 @@ DECL_NETLINK(route);
DECL_NETLINK(selinux);
DECL_NETLINK(sock_diag);
+extern void
+decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
+ kernel_ulong_t len);
extern int tv_nz(const struct timeval *);
extern int tv_cmp(const struct timeval *, const struct timeval *);
extern double tv_float(const struct timeval *);
diff --git a/netlink.c b/netlink.c
index 6b9a1f5c..a686b1f1 100644
--- a/netlink.c
+++ b/netlink.c
@@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp,
const int family = get_fd_nl_family(tcp, fd);
if (family == NETLINK_KOBJECT_UEVENT) {
- printstrn(tcp, addr, len);
+ decode_netlink_kobject_uevent(tcp, addr, len);
return;
}
diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
new file mode 100644
index 00000000..51967fda
--- /dev/null
+++ b/netlink_kobject_uevent.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2018 Harsha Sharma <har...@gm...>
+ * Copyright (c) 2017 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+#include "print_fields.h"
+#include "netlink_kobject_uevent.h"
+
+void
+decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
+ kernel_ulong_t len)
+{
+ struct udev_monitor_netlink_header uh;
+ const char *prefix = "libudev";
+
+ if (len >= sizeof(uh)) {
+ if (!umove_or_printaddr(tcp, addr, &uh)) {
+ if (strcmp(uh.prefix, prefix) == 0) {
+ PRINT_FIELD_CSTRING("{", uh, prefix);
+ PRINT_FIELD_X(", ", uh, magic);
+ PRINT_FIELD_U(", ", uh, header_size);
+ PRINT_FIELD_U(", ", uh, properties_off);
+ PRINT_FIELD_U(", ", uh, properties_len);
+ PRINT_FIELD_U(", ", uh, filter_subsystem_hash);
+ PRINT_FIELD_U(", ", uh, filter_devtype_hash);
+ PRINT_FIELD_X(", ", uh, filter_tag_bloom_hi);
+ PRINT_FIELD_X(", ", uh, filter_tag_bloom_lo);
+ tprints("}");
+ } else {
+ printstrn(tcp, addr, len);
+ }
+ }
+ } else {
+ printstrn(tcp, addr, len);
+ }
+}
diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h
new file mode 100644
index 00000000..5ac57cae
--- /dev/null
+++ b/netlink_kobject_uevent.h
@@ -0,0 +1,17 @@
+#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
+#define STRACE_NETLINK_KOBJECT_UEVENT_H
+
+struct udev_monitor_netlink_header {
+ /* "libudev" prefix to distinguish libudev and kernel messages */
+ char prefix[8];
+ unsigned int magic;
+ unsigned int header_size;
+ unsigned int properties_off;
+ unsigned int properties_len;
+ unsigned int filter_subsystem_hash;
+ unsigned int filter_devtype_hash;
+ unsigned int filter_tag_bloom_hi;
+ unsigned int filter_tag_bloom_lo;
+};
+
+#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
--
2.11.0
|
|
From: Chen J. <che...@gm...> - 2018-01-06 04:13:10
|
On Fri, 5 Jan 2018 20:49:28 +0530 Harsha Sharma wrote:
> * netlink.c: decode family NETLINK_KOBJECT_UEVENT
> * netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header)
> * netlink_kobject_uevent.c: New file
> * Makefile.am (strace_SOURCES): Add it
> * defs.h: Add decode_netlink_kobject_uevent func
We are prefer:
* defs.h (decode_netlink_kobject_uevent): ...
* netlink.c (decode_netlink): ...
* netlink_kobject_uevent.h: New file.
* netlink_kobject_uevent.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
>
> Changes in v2:
> * New file netlink_kobject_uevent.c
> * change location of netlink_kobject_uevent.h
> * add comments in netlink_kobject_uevent.h
> * add new files in Makefile.am
> * add func decode_netlink_kobject_uevent in defs.h
> * Use macros from print_fields.h instead of tprintf
> * minor changes in decode_netlink_kobject_uevent (including name)
Move patch changelog ...
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
... here.
> Makefile.am | 2 ++
> defs.h | 3 +++
> netlink.c | 2 +-
> netlink_kobject_uevent.c | 58
++++++++++++++++++++++++++++++++++++++++++++++++
> netlink_kobject_uevent.h | 29 ++++++++++++++++++++++++
> 5 files changed, 93 insertions(+), 1 deletion(-)
> create mode 100644 netlink_kobject_uevent.c
> create mode 100644 netlink_kobject_uevent.h
>
> diff --git a/Makefile.am b/Makefile.am
> index 34da3372..9dace776 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -194,6 +194,8 @@ strace_SOURCES = \
> netlink.c \
> netlink.h \
> netlink_crypto.c \
> + netlink_kobject_uevent.c \
> + netlink_kobject_uevent.h \
> netlink_sock_diag.h \
> netlink_inet_diag.c \
> netlink_netlink_diag.c \
> diff --git a/defs.h b/defs.h
> index bd4267b3..98d04dd5 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -687,6 +687,9 @@ DECL_NETLINK(route);
> DECL_NETLINK(selinux);
> DECL_NETLINK(sock_diag);
>
> +extern void
> +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
> + kernel_ulong_t len, const void *);
> extern int tv_nz(const struct timeval *);
> extern int tv_cmp(const struct timeval *, const struct timeval *);
> extern double tv_float(const struct timeval *);
> diff --git a/netlink.c b/netlink.c
> index 6b9a1f5c..e62e37d9 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp,
> const int family = get_fd_nl_family(tcp, fd);
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> - printstrn(tcp, addr, len);
> + decode_netlink_kobject_uevent(tcp, addr, len, NULL);
The last argument is useless.
> return;
> }
>
> diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
> new file mode 100644
> index 00000000..5b0e018d
> --- /dev/null
> +++ b/netlink_kobject_uevent.c
> @@ -0,0 +1,58 @@
> +/*
> + * Copyright (c) 2018 Harsha Sharma <har...@gm...>
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in the
> + * documentation and/or other materials provided with the
distribution.
> + * 3. The name of the author may not be used to endorse or promote
products
> + * derived from this software without specific prior written
permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "defs.h"
> +#include "netlink.h"
No need include "netlink.h".
> +#include "print_fields.h"
> +#include "netlink_kobject_uevent.h"
> +
> +
To more empty line.
> +void
> +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len,
> + const void *const opaque_data)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (!umove_or_printaddr(tcp, addr, &uh) &&
> + strcmp(uh.prefix, prefix) == 0) {
> + PRINT_FIELD_CSTRING("{", uh, prefix);
> + PRINT_FIELD_U(", ", uh, magic);
> + PRINT_FIELD_U(", ", uh, header_size);
> + PRINT_FIELD_U(", ", uh, properties_off);
> + PRINT_FIELD_U(", ", uh, properties_len);
> + PRINT_FIELD_U(", ", uh, filter_subsystem_hash);
> + PRINT_FIELD_U(", ", uh, filter_devtype_hash);
> + PRINT_FIELD_U(", ", uh, filter_tag_bloom_hi);
> + PRINT_FIELD_U(", ", uh, filter_tag_bloom_lo);
> + tprints("}");
Do not ignore the messages after the header.
> + } else {
> + printstrn(tcp, addr, len);
> + }
> +}
> diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h
> new file mode 100644
> index 00000000..8b7c5970
> --- /dev/null
> +++ b/netlink_kobject_uevent.h
> @@ -0,0 +1,29 @@
> +#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
> +#define STRACE_NETLINK_KOBJECT_UEVENT_H
> +
> +struct udev_monitor_netlink_header {
> + /* "libudev" prefix to distinguish libudev and kernel messages */
> + char prefix[8];
> + /*
> + * magic to protect against daemon <-> library message format mismatch
> + * used in the kernel from socket filter rules;
> + * needs to be stored in network order
> + */
> + unsigned int magic;
> + /* total length of header structure known to the sender */
> + unsigned int header_size;
> + /* properties string buffer */
> + unsigned int properties_off;
> + unsigned int properties_len;
> + /*
> + * hashes of primary device properties strings,
> + * to let libudev subscribers use in-kernel socket filters;
> + * values need to be stored in network order
> + */
> + unsigned int filter_subsystem_hash;
> + unsigned int filter_devtype_hash;
> + unsigned int filter_tag_bloom_hi;
> + unsigned int filter_tag_bloom_lo;
> +};
I think only the comment of "prefix" is useful.
> +
> +#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
> --
> 2.11.0
Without a test.
--
Chen Jingpiao
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-06 03:31:45
|
On Fri, Jan 05, 2018 at 09:41:50PM +0530, Harsha Sharma wrote: [...] > Hello, > I have sent a patch v2 for the changes requested. Thanks! > Is it ok if I add the tests for this in next patch ? Yes, a test for this decoder could be submitted in a separate patch. -- ldv |
|
From: Dmitry V. L. <ld...@al...> - 2018-01-06 03:30:04
|
On Fri, Jan 05, 2018 at 08:49:28PM +0530, Harsha Sharma wrote: > * netlink.c: decode family NETLINK_KOBJECT_UEVENT > * netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header) > * netlink_kobject_uevent.c: New file > * Makefile.am (strace_SOURCES): Add it > * defs.h: Add decode_netlink_kobject_uevent func This is expected to be a GNU style ChangeLog record, please have a look at https://www.gnu.org/prep/standards/html_node/Change-Logs.html > diff --git a/Makefile.am b/Makefile.am > index 34da3372..9dace776 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -194,6 +194,8 @@ strace_SOURCES = \ > netlink.c \ > netlink.h \ > netlink_crypto.c \ > + netlink_kobject_uevent.c \ > + netlink_kobject_uevent.h \ > netlink_sock_diag.h \ > netlink_inet_diag.c \ > netlink_netlink_diag.c \ OK > diff --git a/defs.h b/defs.h > index bd4267b3..98d04dd5 100644 > --- a/defs.h > +++ b/defs.h > @@ -687,6 +687,9 @@ DECL_NETLINK(route); > DECL_NETLINK(selinux); > DECL_NETLINK(sock_diag); > > +extern void > +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr, > + kernel_ulong_t len, const void *); > extern int tv_nz(const struct timeval *); > extern int tv_cmp(const struct timeval *, const struct timeval *); > extern double tv_float(const struct timeval *); See the comment about decode_netlink_kobject_uevent below. > diff --git a/netlink.c b/netlink.c > index 6b9a1f5c..e62e37d9 100644 > --- a/netlink.c > +++ b/netlink.c > @@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp, > const int family = get_fd_nl_family(tcp, fd); > > if (family == NETLINK_KOBJECT_UEVENT) { > - printstrn(tcp, addr, len); > + decode_netlink_kobject_uevent(tcp, addr, len, NULL); > return; > } > See the comment about decode_netlink_kobject_uevent below. > diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c > new file mode 100644 > index 00000000..5b0e018d > --- /dev/null > +++ b/netlink_kobject_uevent.c > @@ -0,0 +1,58 @@ > +/* > + * Copyright (c) 2018 Harsha Sharma <har...@gm...> > + * Copyright (c) 2017 The strace developers. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * 3. The name of the author may not be used to endorse or promote products > + * derived from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include "defs.h" > +#include "netlink.h" > +#include "print_fields.h" > +#include "netlink_kobject_uevent.h" > + > + > +void > +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr, > + kernel_ulong_t len, > + const void *const opaque_data) Do you really need the last argument? It seems to be unused. > +{ > + struct udev_monitor_netlink_header uh; > + const char *prefix = "libudev"; > + > + if (!umove_or_printaddr(tcp, addr, &uh) && This will attempt to fetch sizeof(uh) bytes regardless of "len" argument. Hint: do not invoke umove_or_printaddr when len < sizeof(uh). > + strcmp(uh.prefix, prefix) == 0) { > + PRINT_FIELD_CSTRING("{", uh, prefix); > + PRINT_FIELD_U(", ", uh, magic); > + PRINT_FIELD_U(", ", uh, header_size); > + PRINT_FIELD_U(", ", uh, properties_off); > + PRINT_FIELD_U(", ", uh, properties_len); > + PRINT_FIELD_U(", ", uh, filter_subsystem_hash); > + PRINT_FIELD_U(", ", uh, filter_devtype_hash); > + PRINT_FIELD_U(", ", uh, filter_tag_bloom_hi); > + PRINT_FIELD_U(", ", uh, filter_tag_bloom_lo); Please consider printing some of these bits in hex using PRINT_FIELD_X. > + tprints("}"); > + } else { > + printstrn(tcp, addr, len); If umove_or_printaddr returned non-zero (and printed the address), this will print a string, resulting to incorrect output. Hint: do not invoke printstrn when umove_or_printaddr returned non-zero. > + } > +} > diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h > new file mode 100644 > index 00000000..8b7c5970 > --- /dev/null > +++ b/netlink_kobject_uevent.h > @@ -0,0 +1,29 @@ > +#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H > +#define STRACE_NETLINK_KOBJECT_UEVENT_H > + > +struct udev_monitor_netlink_header { > + /* "libudev" prefix to distinguish libudev and kernel messages */ > + char prefix[8]; > + /* > + * magic to protect against daemon <-> library message format mismatch > + * used in the kernel from socket filter rules; > + * needs to be stored in network order > + */ > + unsigned int magic; > + /* total length of header structure known to the sender */ > + unsigned int header_size; > + /* properties string buffer */ > + unsigned int properties_off; > + unsigned int properties_len; > + /* > + * hashes of primary device properties strings, > + * to let libudev subscribers use in-kernel socket filters; > + * values need to be stored in network order > + */ > + unsigned int filter_subsystem_hash; > + unsigned int filter_devtype_hash; > + unsigned int filter_tag_bloom_hi; > + unsigned int filter_tag_bloom_lo; > +}; > + > +#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */ As most of these comments are irrelevant to strace, I suggest omitting them. In fact, only prefix is going to be treated in a special way by strace. -- ldv |
|
From: DJ D. <dj...@re...> - 2018-01-05 21:15:18
|
"Dmitry V. Levin" <ld...@al...> writes: > checking whether mpers.sh -m32 works... gawk: ./mpers.awk:42: array_return = array[array_idx][array_member] > gawk: ./mpers.awk:42: ^ syntax error > ... > no > > which I wouldn't call "silently ignored". Well, ignored then. The build continues but builds an strace without mpers support. >> If not, shouldn't configure check for >> multi-dimensional array support and fail if it's not found? > > Do you suggest failing the build in this case? If the target defaults to running mpers, yeah, I think a test for [][] support in configure would be appropriate (or making the mpers.sh test fatal), perhaps with an --disable-mpers to work around it. Building an strace that doesn't do what you expect is worse than not building an strace until you change your expectations ;-) Or if mpers is not built, at least strace should refuse to trace binaries that would have required the other personalities. At the moment, it traces them but produces incorrect output. |
|
From: Dmitry V. L. <ld...@al...> - 2018-01-05 20:58:47
|
On Fri, Jan 05, 2018 at 03:35:29PM -0500, DJ Delorie wrote: > I recently tried to build strace on a system with gawk 3 (RHEL 6, > specifically). Configure tested for gawk, found it, ran mpers.awk, > which failed... and silently ignored the failure. The expected configure output in this case is checking whether mpers.sh -m32 works... gawk: ./mpers.awk:42: array_return = array[array_idx][array_member] gawk: ./mpers.awk:42: ^ syntax error ... no which I wouldn't call "silently ignored". > The resulting > strace was built but didn't function correctly. Yes, if mpers.sh doesn't work for any reason, mpers support won't be compiled and output of 64-bit strace for 32-bit processes will likely be incorrect. > The core problem is that gawk 3 doesn't support [][] multi-dimensional > arrays at all. > > Should gawk 3 be supported? Given that gawk 4 is getting more widespread every year, nobody is working on adding gawk 3 support to mpers.awk. > If not, shouldn't configure check for > multi-dimensional array support and fail if it's not found? Do you suggest failing the build in this case? -- ldv |
|
From: DJ D. <dj...@re...> - 2018-01-05 20:35:39
|
I recently tried to build strace on a system with gawk 3 (RHEL 6, specifically). Configure tested for gawk, found it, ran mpers.awk, which failed... and silently ignored the failure. The resulting strace was built but didn't function correctly. The core problem is that gawk 3 doesn't support [][] multi-dimensional arrays at all. Should gawk 3 be supported? If not, shouldn't configure check for multi-dimensional array support and fail if it's not found? |
|
From: Harsha S. <har...@gm...> - 2018-01-05 16:11:58
|
On Thu, Jan 4, 2018 at 7:09 AM, Chen Jingpiao <che...@gm...> wrote:
> On Wed, 3 Jan 2018 18:33:46 +0530, Harsha Sharma wrote:
>> * netlink.c: decode family NETLINK_KOBJECT_UEVENT if prefix is libudev
>> * linux/netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header)
>
> I think this header should not in linux directory.
> When adding a new file, we should add it in Makefile.am.
>
>>
>> Signed-off-by: Harsha Sharma <har...@gm...>
>> ---
>> linux/netlink_kobject_uevent.h | 16 ++++++++++++++++
>> netlink.c | 27 ++++++++++++++++++++++++++-
>> 2 files changed, 42 insertions(+), 1 deletion(-)
>> create mode 100644 linux/netlink_kobject_uevent.h
>>
>> diff --git a/linux/netlink_kobject_uevent.h
>> b/linux/netlink_kobject_uevent.h
>> new file mode 100644
>> index 00000000..d83ccad5
>> --- /dev/null
>> +++ b/linux/netlink_kobject_uevent.h
>> @@ -0,0 +1,16 @@
>> +#ifndef STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
>> +#define STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
>> +
>> +struct udev_monitor_netlink_header {
>> + char prefix[8];
>
> Reserve useful comment.
>
>> + unsigned int magic;
>> + unsigned int header_size;
>> + unsigned int properties_off;
>> + unsigned int properties_len;
>> + unsigned int filter_subsystem_hash;
>> + unsigned int filter_devtype_hash;
>> + unsigned int filter_tag_bloom_hi;
>> + unsigned int filter_tag_bloom_lo;
>> +};
>> +
>> +#endif /* !STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H */
>> diff --git a/netlink.c b/netlink.c
>> index 6b9a1f5c..e991ed86 100644
>> --- a/netlink.c
>> +++ b/netlink.c
>> @@ -32,6 +32,7 @@
>> #include "nlattr.h"
>> #include <linux/audit.h>
>> #include <linux/rtnetlink.h>
>> +#include <linux/netlink_kobject_uevent.h>
>> #include <linux/xfrm.h>
>> #include "xlat/netlink_ack_flags.h"
>> #include "xlat/netlink_delete_flags.h"
>> @@ -183,6 +184,29 @@ decode_nlmsg_type_netfilter(const struct xlat *const
>> xlat,
>> tprintf("%#x", msg_type);
>> }
>>
>> +static bool
>> +decode_nlmsg_type_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
>> + kernel_ulong_t len,
>> + const void *const opaque_data)
>> +{
>> + struct udev_monitor_netlink_header uh;
>> + const char *prefix = "libudev";
>> +
>> + if (len < sizeof(uh))
>> + return false;
>> + if (!umove_or_printaddr(tcp, addr, &uh) &&
>> + strcmp(uh.prefix, prefix) == 0) {
>> + tprintf("{prefix=%s, magic=%u, header_size=%u, properties_off=%u,
>> properties_len=%u, filter_subsystem_hash=%u, filter_devtype_hash=%u,
>> filter_tag_bloom_hi=%u, filter_tag_bloom_lo=%u}", uh.prefix,
>
> More than 80 character.
>
>> + uh.magic, uh.header_size, uh.properties_off,
>> + uh.properties_len, uh.filter_subsystem_hash,
>> + uh.filter_devtype_hash, uh.filter_tag_bloom_hi,
>> + uh.filter_tag_bloom_lo);
>
> We can use macros in print_fields.h.
> I think magic, filter_tag_bloom_hi and filter_tag_bloom_lo sholud use other
> format.
>
> After the header have other messages.
>
>> + return true;
>> + }
>> + return false;
>
> If umove_or_printaddr return -1, you print address and string.
> If prefix is not "libudev", address addr to (addr + sizeof(uh)) will call
> umove
> again, we should reduce call syscall.
>
>> +}
>
> I think this function should separate into a single file.
>
>> +
>> +
>
> To more empty line.
>
>> typedef void (*nlmsg_types_decoder_t)(const struct xlat *,
>> uint16_t type,
>> const char *dflt);
>> @@ -628,7 +652,8 @@ decode_netlink(struct tcb *const tcp,
>> const int family = get_fd_nl_family(tcp, fd);
>>
>> if (family == NETLINK_KOBJECT_UEVENT) {
>> - printstrn(tcp, addr, len);
>> + if (!decode_nlmsg_type_kobject_uevent(tcp, addr, len, NULL))
>
> I think this should be named decode_netlink_kobject_uevent, then ...
>
>> + printstrn(tcp, addr, len);
>
> ... this problem handle in this function.
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> decode_netlink_kobject_uevent(tcp, addr, len);
> return;
> }
>
>> return;
>> }
>>
>> --
>> 2.11.0
>>
>
> Without a test.
>
Hello,
I have sent a patch v2 for the changes requested. Is it ok if I add
the tests for this in next patch ?
Thanks a lot for your review.
Regards,
Harsha Sharma
> --
> Chen Jingpiao
|
|
From: Harsha S. <har...@gm...> - 2018-01-05 15:20:02
|
* netlink.c: decode family NETLINK_KOBJECT_UEVENT
* netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header)
* netlink_kobject_uevent.c: New file
* Makefile.am (strace_SOURCES): Add it
* defs.h: Add decode_netlink_kobject_uevent func
Changes in v2:
* New file netlink_kobject_uevent.c
* change location of netlink_kobject_uevent.h
* add comments in netlink_kobject_uevent.h
* add new files in Makefile.am
* add func decode_netlink_kobject_uevent in defs.h
* Use macros from print_fields.h instead of tprintf
* minor changes in decode_netlink_kobject_uevent (including name)
Signed-off-by: Harsha Sharma <har...@gm...>
---
Makefile.am | 2 ++
defs.h | 3 +++
netlink.c | 2 +-
netlink_kobject_uevent.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
netlink_kobject_uevent.h | 29 ++++++++++++++++++++++++
5 files changed, 93 insertions(+), 1 deletion(-)
create mode 100644 netlink_kobject_uevent.c
create mode 100644 netlink_kobject_uevent.h
diff --git a/Makefile.am b/Makefile.am
index 34da3372..9dace776 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -194,6 +194,8 @@ strace_SOURCES = \
netlink.c \
netlink.h \
netlink_crypto.c \
+ netlink_kobject_uevent.c \
+ netlink_kobject_uevent.h \
netlink_sock_diag.h \
netlink_inet_diag.c \
netlink_netlink_diag.c \
diff --git a/defs.h b/defs.h
index bd4267b3..98d04dd5 100644
--- a/defs.h
+++ b/defs.h
@@ -687,6 +687,9 @@ DECL_NETLINK(route);
DECL_NETLINK(selinux);
DECL_NETLINK(sock_diag);
+extern void
+decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
+ kernel_ulong_t len, const void *);
extern int tv_nz(const struct timeval *);
extern int tv_cmp(const struct timeval *, const struct timeval *);
extern double tv_float(const struct timeval *);
diff --git a/netlink.c b/netlink.c
index 6b9a1f5c..e62e37d9 100644
--- a/netlink.c
+++ b/netlink.c
@@ -628,7 +628,7 @@ decode_netlink(struct tcb *const tcp,
const int family = get_fd_nl_family(tcp, fd);
if (family == NETLINK_KOBJECT_UEVENT) {
- printstrn(tcp, addr, len);
+ decode_netlink_kobject_uevent(tcp, addr, len, NULL);
return;
}
diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c
new file mode 100644
index 00000000..5b0e018d
--- /dev/null
+++ b/netlink_kobject_uevent.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018 Harsha Sharma <har...@gm...>
+ * Copyright (c) 2017 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "print_fields.h"
+#include "netlink_kobject_uevent.h"
+
+
+void
+decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
+ kernel_ulong_t len,
+ const void *const opaque_data)
+{
+ struct udev_monitor_netlink_header uh;
+ const char *prefix = "libudev";
+
+ if (!umove_or_printaddr(tcp, addr, &uh) &&
+ strcmp(uh.prefix, prefix) == 0) {
+ PRINT_FIELD_CSTRING("{", uh, prefix);
+ PRINT_FIELD_U(", ", uh, magic);
+ PRINT_FIELD_U(", ", uh, header_size);
+ PRINT_FIELD_U(", ", uh, properties_off);
+ PRINT_FIELD_U(", ", uh, properties_len);
+ PRINT_FIELD_U(", ", uh, filter_subsystem_hash);
+ PRINT_FIELD_U(", ", uh, filter_devtype_hash);
+ PRINT_FIELD_U(", ", uh, filter_tag_bloom_hi);
+ PRINT_FIELD_U(", ", uh, filter_tag_bloom_lo);
+ tprints("}");
+ } else {
+ printstrn(tcp, addr, len);
+ }
+}
diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h
new file mode 100644
index 00000000..8b7c5970
--- /dev/null
+++ b/netlink_kobject_uevent.h
@@ -0,0 +1,29 @@
+#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
+#define STRACE_NETLINK_KOBJECT_UEVENT_H
+
+struct udev_monitor_netlink_header {
+ /* "libudev" prefix to distinguish libudev and kernel messages */
+ char prefix[8];
+ /*
+ * magic to protect against daemon <-> library message format mismatch
+ * used in the kernel from socket filter rules;
+ * needs to be stored in network order
+ */
+ unsigned int magic;
+ /* total length of header structure known to the sender */
+ unsigned int header_size;
+ /* properties string buffer */
+ unsigned int properties_off;
+ unsigned int properties_len;
+ /*
+ * hashes of primary device properties strings,
+ * to let libudev subscribers use in-kernel socket filters;
+ * values need to be stored in network order
+ */
+ unsigned int filter_subsystem_hash;
+ unsigned int filter_devtype_hash;
+ unsigned int filter_tag_bloom_hi;
+ unsigned int filter_tag_bloom_lo;
+};
+
+#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
--
2.11.0
|
|
From: Kommuru j. s. r. <kom...@gm...> - 2018-01-05 12:31:47
|
On git grep -l RVAL_IOCTL_DECODED, i got
block.c
btrfs.c
defs.h
dm.c
evdev.c
file_ioctl.c
fs_x_ioctl.c
hdio.c
ioctl.c
kvm.c
loop.c
mtd.c
nsfs.c
print_sg_req_info.c
ptp.c
rtc.c
scsi.c
sg_io_v3.c
sg_io_v4.c
sock.c
term.c
ubi.c
userfaultfd.c
v4l2.c
With which one, should i start adding tests ?
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-04 02:15:13
|
On Thu, Dec 28, 2017 at 07:49:23PM +0530, Kommuru jai shankar reddy wrote: > I have a doubt: > There are three files file_ioctl.c, fs_x_ioctl.c and ioctl.c in > the https://codecov.io/github/strace/strace with their code coverages. Firstly, most of ioctl decoders are not in these three files, see e.g. the output of "git grep -l RVAL_IOCTL_DECODED". > Now > I have to find the corresponding test files in the strace/tests/ and modify > them to increase the code coverage right ? Secondly, the least covered ioctl decoders have zero coverage, that is, there are no test files that cover them. -- ldv |
|
From: Chen J. <che...@gm...> - 2018-01-04 01:39:40
|
On Wed, 3 Jan 2018 18:33:46 +0530, Harsha Sharma wrote:
> * netlink.c: decode family NETLINK_KOBJECT_UEVENT if prefix is libudev
> * linux/netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header)
I think this header should not in linux directory.
When adding a new file, we should add it in Makefile.am.
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
> linux/netlink_kobject_uevent.h | 16 ++++++++++++++++
> netlink.c | 27 ++++++++++++++++++++++++++-
> 2 files changed, 42 insertions(+), 1 deletion(-)
> create mode 100644 linux/netlink_kobject_uevent.h
>
> diff --git a/linux/netlink_kobject_uevent.h
b/linux/netlink_kobject_uevent.h
> new file mode 100644
> index 00000000..d83ccad5
> --- /dev/null
> +++ b/linux/netlink_kobject_uevent.h
> @@ -0,0 +1,16 @@
> +#ifndef STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
> +#define STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
> +
> +struct udev_monitor_netlink_header {
> + char prefix[8];
Reserve useful comment.
> + unsigned int magic;
> + unsigned int header_size;
> + unsigned int properties_off;
> + unsigned int properties_len;
> + unsigned int filter_subsystem_hash;
> + unsigned int filter_devtype_hash;
> + unsigned int filter_tag_bloom_hi;
> + unsigned int filter_tag_bloom_lo;
> +};
> +
> +#endif /* !STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H */
> diff --git a/netlink.c b/netlink.c
> index 6b9a1f5c..e991ed86 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -32,6 +32,7 @@
> #include "nlattr.h"
> #include <linux/audit.h>
> #include <linux/rtnetlink.h>
> +#include <linux/netlink_kobject_uevent.h>
> #include <linux/xfrm.h>
> #include "xlat/netlink_ack_flags.h"
> #include "xlat/netlink_delete_flags.h"
> @@ -183,6 +184,29 @@ decode_nlmsg_type_netfilter(const struct xlat *const
xlat,
> tprintf("%#x", msg_type);
> }
>
> +static bool
> +decode_nlmsg_type_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len,
> + const void *const opaque_data)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (len < sizeof(uh))
> + return false;
> + if (!umove_or_printaddr(tcp, addr, &uh) &&
> + strcmp(uh.prefix, prefix) == 0) {
> + tprintf("{prefix=%s, magic=%u, header_size=%u, properties_off=%u,
properties_len=%u, filter_subsystem_hash=%u, filter_devtype_hash=%u,
filter_tag_bloom_hi=%u, filter_tag_bloom_lo=%u}", uh.prefix,
More than 80 character.
> + uh.magic, uh.header_size, uh.properties_off,
> + uh.properties_len, uh.filter_subsystem_hash,
> + uh.filter_devtype_hash, uh.filter_tag_bloom_hi,
> + uh.filter_tag_bloom_lo);
We can use macros in print_fields.h.
I think magic, filter_tag_bloom_hi and filter_tag_bloom_lo sholud use other
format.
After the header have other messages.
> + return true;
> + }
> + return false;
If umove_or_printaddr return -1, you print address and string.
If prefix is not "libudev", address addr to (addr + sizeof(uh)) will call
umove
again, we should reduce call syscall.
> +}
I think this function should separate into a single file.
> +
> +
To more empty line.
> typedef void (*nlmsg_types_decoder_t)(const struct xlat *,
> uint16_t type,
> const char *dflt);
> @@ -628,7 +652,8 @@ decode_netlink(struct tcb *const tcp,
> const int family = get_fd_nl_family(tcp, fd);
>
> if (family == NETLINK_KOBJECT_UEVENT) {
> - printstrn(tcp, addr, len);
> + if (!decode_nlmsg_type_kobject_uevent(tcp, addr, len, NULL))
I think this should be named decode_netlink_kobject_uevent, then ...
> + printstrn(tcp, addr, len);
... this problem handle in this function.
if (family == NETLINK_KOBJECT_UEVENT) {
decode_netlink_kobject_uevent(tcp, addr, len);
return;
}
> return;
> }
>
> --
> 2.11.0
>
Without a test.
--
Chen Jingpiao
|
|
From: Dmitry V. L. <ld...@al...> - 2018-01-04 00:02:49
|
On Wed, Jan 03, 2018 at 06:33:46PM +0530, Harsha Sharma wrote:
> * netlink.c: decode family NETLINK_KOBJECT_UEVENT if prefix is libudev
> * linux/netlink_kobject_uevent.h: New struct (udev_monitor_netlink_header)
>
> Signed-off-by: Harsha Sharma <har...@gm...>
> ---
> linux/netlink_kobject_uevent.h | 16 ++++++++++++++++
> netlink.c | 27 ++++++++++++++++++++++++++-
> 2 files changed, 42 insertions(+), 1 deletion(-)
> create mode 100644 linux/netlink_kobject_uevent.h
>
> diff --git a/linux/netlink_kobject_uevent.h b/linux/netlink_kobject_uevent.h
> new file mode 100644
> index 00000000..d83ccad5
> --- /dev/null
> +++ b/linux/netlink_kobject_uevent.h
> @@ -0,0 +1,16 @@
> +#ifndef STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
> +#define STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H
> +
> +struct udev_monitor_netlink_header {
> + char prefix[8];
> + unsigned int magic;
> + unsigned int header_size;
> + unsigned int properties_off;
> + unsigned int properties_len;
> + unsigned int filter_subsystem_hash;
> + unsigned int filter_devtype_hash;
> + unsigned int filter_tag_bloom_hi;
> + unsigned int filter_tag_bloom_lo;
> +};
> +
> +#endif /* !STRACE_LINUX_NETLINK_KOBJECT_UEVENT_H */
> diff --git a/netlink.c b/netlink.c
> index 6b9a1f5c..e991ed86 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -32,6 +32,7 @@
> #include "nlattr.h"
> #include <linux/audit.h>
> #include <linux/rtnetlink.h>
> +#include <linux/netlink_kobject_uevent.h>
> #include <linux/xfrm.h>
> #include "xlat/netlink_ack_flags.h"
> #include "xlat/netlink_delete_flags.h"
> @@ -183,6 +184,29 @@ decode_nlmsg_type_netfilter(const struct xlat *const xlat,
> tprintf("%#x", msg_type);
> }
>
> +static bool
> +decode_nlmsg_type_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
> + kernel_ulong_t len,
> + const void *const opaque_data)
> +{
> + struct udev_monitor_netlink_header uh;
> + const char *prefix = "libudev";
> +
> + if (len < sizeof(uh))
> + return false;
> + if (!umove_or_printaddr(tcp, addr, &uh) &&
> + strcmp(uh.prefix, prefix) == 0) {
> + tprintf("{prefix=%s, magic=%u, header_size=%u, properties_off=%u, properties_len=%u, filter_subsystem_hash=%u, filter_devtype_hash=%u, filter_tag_bloom_hi=%u, filter_tag_bloom_lo=%u}", uh.prefix,
> + uh.magic, uh.header_size, uh.properties_off,
> + uh.properties_len, uh.filter_subsystem_hash,
> + uh.filter_devtype_hash, uh.filter_tag_bloom_hi,
> + uh.filter_tag_bloom_lo);
Could you rewrite this tprintf using PRINT_FIELD_U and PRINT_FIELD_CSTRING
primitives defined in print_fields.h, please?
--
ldv
|