Skip to content

Commit cb48b6a

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo-4.19-20180912' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix finding a symbol by name when multiple maps use the same backing DSO, so we must first see if that symbol name is in the DSO, then see if it is inside the range of addresses for that specific map (Adrian Hunter) - Update the tools copies of UAPI headers, which silences the warnings emitted when building the tools and in some cases, like for the new KVM ioctls, results in 'perf trace' being able to translate that ioctl number to a string (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 02e1844 + 03db8b5 commit cb48b6a

File tree

11 files changed

+132
-3
lines changed

11 files changed

+132
-3
lines changed

tools/arch/arm/include/uapi/asm/kvm.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define __KVM_HAVE_GUEST_DEBUG
2828
#define __KVM_HAVE_IRQ_LINE
2929
#define __KVM_HAVE_READONLY_MEM
30+
#define __KVM_HAVE_VCPU_EVENTS
3031

3132
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
3233

@@ -125,6 +126,18 @@ struct kvm_sync_regs {
125126
struct kvm_arch_memory_slot {
126127
};
127128

129+
/* for KVM_GET/SET_VCPU_EVENTS */
130+
struct kvm_vcpu_events {
131+
struct {
132+
__u8 serror_pending;
133+
__u8 serror_has_esr;
134+
/* Align it to 8 bytes */
135+
__u8 pad[6];
136+
__u64 serror_esr;
137+
} exception;
138+
__u32 reserved[12];
139+
};
140+
128141
/* If you need to interpret the index values, here is the key: */
129142
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
130143
#define KVM_REG_ARM_COPROC_SHIFT 16

tools/arch/arm64/include/uapi/asm/kvm.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define __KVM_HAVE_GUEST_DEBUG
4040
#define __KVM_HAVE_IRQ_LINE
4141
#define __KVM_HAVE_READONLY_MEM
42+
#define __KVM_HAVE_VCPU_EVENTS
4243

4344
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
4445

@@ -154,6 +155,18 @@ struct kvm_sync_regs {
154155
struct kvm_arch_memory_slot {
155156
};
156157

158+
/* for KVM_GET/SET_VCPU_EVENTS */
159+
struct kvm_vcpu_events {
160+
struct {
161+
__u8 serror_pending;
162+
__u8 serror_has_esr;
163+
/* Align it to 8 bytes */
164+
__u8 pad[6];
165+
__u64 serror_esr;
166+
} exception;
167+
__u32 reserved[12];
168+
};
169+
157170
/* If you need to interpret the index values, here is the key: */
158171
#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
159172
#define KVM_REG_ARM_COPROC_SHIFT 16

tools/arch/s390/include/uapi/asm/kvm.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
* KVM s390 specific structures and definitions
66
*
7-
* Copyright IBM Corp. 2008
7+
* Copyright IBM Corp. 2008, 2018
88
*
99
* Author(s): Carsten Otte <[email protected]>
1010
* Christian Borntraeger <[email protected]>
@@ -225,6 +225,7 @@ struct kvm_guest_debug_arch {
225225
#define KVM_SYNC_FPRS (1UL << 8)
226226
#define KVM_SYNC_GSCB (1UL << 9)
227227
#define KVM_SYNC_BPBC (1UL << 10)
228+
#define KVM_SYNC_ETOKEN (1UL << 11)
228229
/* length and alignment of the sdnx as a power of two */
229230
#define SDNXC 8
230231
#define SDNXL (1UL << SDNXC)
@@ -258,6 +259,8 @@ struct kvm_sync_regs {
258259
struct {
259260
__u64 reserved1[2];
260261
__u64 gscb[4];
262+
__u64 etoken;
263+
__u64 etoken_extension;
261264
};
262265
};
263266
};

tools/arch/x86/include/uapi/asm/kvm.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,41 @@ struct kvm_sync_regs {
378378
#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
379379
#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
380380

381+
#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
382+
#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
383+
384+
#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
385+
#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
386+
387+
struct kvm_vmx_nested_state {
388+
__u64 vmxon_pa;
389+
__u64 vmcs_pa;
390+
391+
struct {
392+
__u16 flags;
393+
} smm;
394+
};
395+
396+
/* for KVM_CAP_NESTED_STATE */
397+
struct kvm_nested_state {
398+
/* KVM_STATE_* flags */
399+
__u16 flags;
400+
401+
/* 0 for VMX, 1 for SVM. */
402+
__u16 format;
403+
404+
/* 128 for SVM, 128 + VMCS size for VMX. */
405+
__u32 size;
406+
407+
union {
408+
/* VMXON, VMCS */
409+
struct kvm_vmx_nested_state vmx;
410+
411+
/* Pad the header to 128 bytes. */
412+
__u8 pad[120];
413+
};
414+
415+
__u8 data[0];
416+
};
417+
381418
#endif /* _ASM_X86_KVM_H */

tools/include/uapi/asm-generic/unistd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,11 @@ __SYSCALL(__NR_pkey_free, sys_pkey_free)
734734
__SYSCALL(__NR_statx, sys_statx)
735735
#define __NR_io_pgetevents 292
736736
__SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
737+
#define __NR_rseq 293
738+
__SYSCALL(__NR_rseq, sys_rseq)
737739

738740
#undef __NR_syscalls
739-
#define __NR_syscalls 293
741+
#define __NR_syscalls 294
740742

741743
/*
742744
* 32 bit systems traditionally used different

tools/include/uapi/drm/drm.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,15 @@ struct drm_get_cap {
687687
*/
688688
#define DRM_CLIENT_CAP_ASPECT_RATIO 4
689689

690+
/**
691+
* DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
692+
*
693+
* If set to 1, the DRM core will expose special connectors to be used for
694+
* writing back to memory the scene setup in the commit. Depends on client
695+
* also supporting DRM_CLIENT_CAP_ATOMIC
696+
*/
697+
#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
698+
690699
/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
691700
struct drm_set_client_cap {
692701
__u64 capability;

tools/include/uapi/linux/if_link.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ enum {
164164
IFLA_CARRIER_UP_COUNT,
165165
IFLA_CARRIER_DOWN_COUNT,
166166
IFLA_NEW_IFINDEX,
167+
IFLA_MIN_MTU,
168+
IFLA_MAX_MTU,
167169
__IFLA_MAX
168170
};
169171

@@ -334,6 +336,7 @@ enum {
334336
IFLA_BRPORT_GROUP_FWD_MASK,
335337
IFLA_BRPORT_NEIGH_SUPPRESS,
336338
IFLA_BRPORT_ISOLATED,
339+
IFLA_BRPORT_BACKUP_PORT,
337340
__IFLA_BRPORT_MAX
338341
};
339342
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -459,6 +462,16 @@ enum {
459462

460463
#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
461464

465+
/* XFRM section */
466+
enum {
467+
IFLA_XFRM_UNSPEC,
468+
IFLA_XFRM_LINK,
469+
IFLA_XFRM_IF_ID,
470+
__IFLA_XFRM_MAX
471+
};
472+
473+
#define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
474+
462475
enum macsec_validation_type {
463476
MACSEC_VALIDATE_DISABLED = 0,
464477
MACSEC_VALIDATE_CHECK = 1,
@@ -920,6 +933,7 @@ enum {
920933
XDP_ATTACHED_DRV,
921934
XDP_ATTACHED_SKB,
922935
XDP_ATTACHED_HW,
936+
XDP_ATTACHED_MULTI,
923937
};
924938

925939
enum {
@@ -928,6 +942,9 @@ enum {
928942
IFLA_XDP_ATTACHED,
929943
IFLA_XDP_FLAGS,
930944
IFLA_XDP_PROG_ID,
945+
IFLA_XDP_DRV_PROG_ID,
946+
IFLA_XDP_SKB_PROG_ID,
947+
IFLA_XDP_HW_PROG_ID,
931948
__IFLA_XDP_MAX,
932949
};
933950

tools/include/uapi/linux/kvm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,9 @@ struct kvm_ppc_resize_hpt {
949949
#define KVM_CAP_GET_MSR_FEATURES 153
950950
#define KVM_CAP_HYPERV_EVENTFD 154
951951
#define KVM_CAP_HYPERV_TLBFLUSH 155
952+
#define KVM_CAP_S390_HPAGE_1M 156
953+
#define KVM_CAP_NESTED_STATE 157
954+
#define KVM_CAP_ARM_INJECT_SERROR_ESR 158
952955

953956
#ifdef KVM_CAP_IRQ_ROUTING
954957

@@ -1391,6 +1394,9 @@ struct kvm_enc_region {
13911394
/* Available with KVM_CAP_HYPERV_EVENTFD */
13921395
#define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd)
13931396

1397+
/* Available with KVM_CAP_NESTED_STATE */
1398+
#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)
1399+
#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)
13941400

13951401
/* Secure Encrypted Virtualization command */
13961402
enum sev_cmd_id {

tools/include/uapi/linux/perf_event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ enum perf_event_sample_format {
144144

145145
PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */
146146

147-
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63,
147+
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
148148
};
149149

150150
/*

tools/include/uapi/linux/vhost.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct vhost_iotlb_msg {
6565
};
6666

6767
#define VHOST_IOTLB_MSG 0x1
68+
#define VHOST_IOTLB_MSG_V2 0x2
6869

6970
struct vhost_msg {
7071
int type;
@@ -74,6 +75,15 @@ struct vhost_msg {
7475
};
7576
};
7677

78+
struct vhost_msg_v2 {
79+
__u32 type;
80+
__u32 reserved;
81+
union {
82+
struct vhost_iotlb_msg iotlb;
83+
__u8 padding[64];
84+
};
85+
};
86+
7787
struct vhost_memory_region {
7888
__u64 guest_phys_addr;
7989
__u64 memory_size; /* bytes */
@@ -160,6 +170,14 @@ struct vhost_memory {
160170
#define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \
161171
struct vhost_vring_state)
162172

173+
/* Set or get vhost backend capability */
174+
175+
/* Use message type V2 */
176+
#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
177+
178+
#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
179+
#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
180+
163181
/* VHOST_NET specific defines */
164182

165183
/* Attach virtio net ring to a raw socket, or tap device.

tools/perf/util/map.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,
576576
return NULL;
577577
}
578578

579+
static bool map__contains_symbol(struct map *map, struct symbol *sym)
580+
{
581+
u64 ip = map->unmap_ip(map, sym->start);
582+
583+
return ip >= map->start && ip < map->end;
584+
}
585+
579586
struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
580587
struct map **mapp)
581588
{
@@ -591,6 +598,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
591598

592599
if (sym == NULL)
593600
continue;
601+
if (!map__contains_symbol(pos, sym)) {
602+
sym = NULL;
603+
continue;
604+
}
594605
if (mapp != NULL)
595606
*mapp = pos;
596607
goto out;

0 commit comments

Comments
 (0)