LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, James Hogan <james.hogan@imgtec.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-mips@linux-mips.org, kvm@vger.kernel.org
Subject: [PATCH 3.14 45/96] KVM: MIPS: Fix trace event to save PC directly
Date: Mon, 16 Mar 2015 15:09:16 +0100	[thread overview]
Message-ID: <20150316140857.246507285@linuxfoundation.org> (raw)
In-Reply-To: <20150316140855.186617380@linuxfoundation.org>

3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: James Hogan <james.hogan@imgtec.com>

commit b3cffac04eca9af46e1e23560a8ee22b1bd36d43 upstream.

Currently the guest exit trace event saves the VCPU pointer to the
structure, and the guest PC is retrieved by dereferencing it when the
event is printed rather than directly from the trace record. This isn't
safe as the printing may occur long afterwards, after the PC has changed
and potentially after the VCPU has been freed. Usually this results in
the same (wrong) PC being printed for multiple trace events. It also
isn't portable as userland has no way to access the VCPU data structure
when interpreting the trace record itself.

Lets save the actual PC in the structure so that the correct value is
accessible later.

Fixes: 669e846e6c4e ("KVM/MIPS32: MIPS arch specific APIs for KVM")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kvm/trace.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/mips/kvm/trace.h
+++ b/arch/mips/kvm/trace.h
@@ -26,18 +26,18 @@ TRACE_EVENT(kvm_exit,
 	    TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
 	    TP_ARGS(vcpu, reason),
 	    TP_STRUCT__entry(
-			__field(struct kvm_vcpu *, vcpu)
+			__field(unsigned long, pc)
 			__field(unsigned int, reason)
 	    ),
 
 	    TP_fast_assign(
-			__entry->vcpu = vcpu;
+			__entry->pc = vcpu->arch.pc;
 			__entry->reason = reason;
 	    ),
 
 	    TP_printk("[%s]PC: 0x%08lx",
 		      kvm_mips_exit_types_str[__entry->reason],
-		      __entry->vcpu->arch.pc)
+		      __entry->pc)
 );
 
 #endif /* _TRACE_KVM_H */



  parent reply	other threads:[~2015-03-16 15:07 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 14:08 [PATCH 3.14 00/96] 3.14.36-stable review Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 01/96] pktgen: fix UDP checksum computation Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 02/96] rtnetlink: ifla_vf_policy: fix misuses of NLA_BINARY Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 03/96] ipv6: fix ipv6_cow_metrics for non DST_HOST case Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 04/96] rtnetlink: call ->dellink on failure when ->newlink exists Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 06/96] ipv4: ip_check_defrag should correctly check return value of skb_copy_bits Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 07/96] ipv4: ip_check_defrag should not assume that skb_network_offset is zero Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 08/96] net: phy: Fix verification of EEE support in phy_init_eee Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 10/96] net: reject creation of netdev names with colons Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 11/96] team: fix possible null pointer dereference in team_handle_frame Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 12/96] net: compat: Ignore MSG_CMSG_COMPAT in compat_sys_{send, recv}msg Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 13/96] macvtap: make sure neighbour code can push ethernet header Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 14/96] usb: plusb: Add support for National Instruments host-to-host cable Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 15/96] udp: only allow UFO for packets from SOCK_DGRAM sockets Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 16/96] net: ping: Return EAFNOSUPPORT when appropriate Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 17/96] team: dont traverse port list using rcu in team_set_mac_address Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 18/96] mm/hugetlb: add migration/hwpoisoned entry check in hugetlb_change_protection Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 19/96] mm/hugetlb: add migration entry check in __unmap_hugepage_range Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 20/96] mm: when stealing freepages, also take pages created by splitting buddy page Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 21/96] mm/mmap.c: fix arithmetic overflow in __vm_enough_memory() Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 22/96] mm/nommu.c: " Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 23/96] mm/compaction: fix wrong order check in compact_finished() Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 24/96] mm/memory.c: actually remap enough memory Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 27/96] drm/radeon: fix voltage setup on hawaii Greg Kroah-Hartman
2015-03-16 14:08 ` [PATCH 3.14 28/96] target: Fix PR_APTPL_BUF_LEN buffer size limitation Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 29/96] target: Add missing WRITE_SAME end-of-device sanity check Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 30/96] target: Check for LBA + sectors wrap-around in sbc_parse_cdb Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 31/96] x86/asm/entry/64: Remove a bogus ret_from_fork optimization Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 32/96] iio: mxs-lradc: fix iio channel map regression Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 33/96] iio: imu: adis16400: Fix sign extension Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 39/96] iio:adc:mcp3422 Fix incorrect scales table Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 40/96] mei: make device disabled on stop unconditionally Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 41/96] btrfs: fix lost return value due to variable shadowing Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 42/96] Btrfs: fix data loss in the fast fsync path Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 43/96] Btrfs:__add_inode_ref: out of bounds memory read when looking for extended ref Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 44/96] KVM: emulate: fix CMPXCHG8B on 32-bit hosts Greg Kroah-Hartman
2015-03-16 14:09 ` Greg Kroah-Hartman [this message]
2015-03-16 14:09 ` [PATCH 3.14 46/96] USB: serial: cp210x: Adding Seletek device ids Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 47/96] USB: mxuport: fix null deref when used as a console Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 48/96] USB: usbfs: dont leak kernel data in siginfo Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 49/96] USB: ftdi_sio: add PIDs for Actisense USB devices Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 50/96] usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 51/96] usb: dwc3: dwc3-omap: Fix disable IRQ Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 52/96] xhci: Allocate correct amount of scratchpad buffers Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 53/96] xhci: fix reporting of 0-sized URBs in control endpoint Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 54/96] mac80211: Send EAPOL frames at lowest rate Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 55/96] net: irda: fix wait_until_sent poll timeout Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 56/96] USB: serial: fix infinite wait_until_sent timeout Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 57/96] TTY: fix tty_wait_until_sent on 64-bit machines Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 58/96] USB: serial: fix potential use-after-free after failed probe Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 59/96] USB: serial: fix tty-device error handling at probe Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 60/96] autofs4 copy_dev_ioctl(): keep the value of ->size wed used for allocation Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 61/96] debugfs: leave freeing a symlink body until inode eviction Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 62/96] procfs: fix race between symlink removals and traversals Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 63/96] sunrpc: fix braino in ->poll() Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 64/96] ARC: Fix KSTK_ESP() Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 65/96] tty: fix up atime/mtime mess, take four Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 66/96] ALSA: pcm: Dont leave PREPARED state after draining Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 67/96] ALSA: hda - Add pin configs for ASUS mobo with IDT 92HD73XX codec Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 68/96] ALSA: hda - Disable runtime PM for Panther Point again Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 69/96] sg: fix read() error reporting Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 70/96] IB/qib: Do not write EEPROM Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 71/96] IB/mlx4: Fix wrong usage of IPv4 protocol for multicast attach/detach Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 72/96] IB/core: Fix deadlock on uverbs modify_qp error flow Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 73/96] IB/core: When marshaling ucma path from user-space, clear unused fields Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 74/96] nilfs2: fix potential memory overrun on inode Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 75/96] fixed invalid assignment of 64bit mask to host dma_boundary for scatter gather segment boundary limit Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 76/96] clk: zynq: Force CPU_2X clock to be ungated Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 77/96] sunxi: clk: Set sun6i-pll1 n_start = 1 Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 78/96] clk: sunxi: Support factor clocks with N factor starting not from 0 Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 79/96] staging: comedi: comedi_compat32.c: fix COMEDI_CMD copy back Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 80/96] dm mirror: do not degrade the mirror on discard error Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 81/96] dm io: reject unsupported DISCARD requests with EOPNOTSUPP Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 82/96] dm: fix a race condition in dm_get_md Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 83/96] dm snapshot: fix a possible invalid memory access on unload Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 84/96] staging: comedi: cb_pcidas64: fix incorrect AI range code handling Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 85/96] HID: input: fix confusion on conflicting mappings Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 86/96] HID: fixup the conflicting keyboard mappings quirk Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 87/96] HID: wacom: Report ABS_MISC event for Cintiq Companion Hybrid Greg Kroah-Hartman
2015-03-16 14:09 ` [PATCH 3.14 88/96] drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 89/96] drm/radeon: fix 1 RB harvest config setup for TN/RL Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 90/96] efi: Small leak on error in runtime map code Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 91/96] ACPI / video: Load the module even if ACPI is disabled Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 92/96] NFSv4: Dont call put_rpccred() under the rcu_read_lock() Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 93/96] ASoC: omap-pcm: Correct dma mask Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 94/96] ath5k: fix spontaneus AR5312 freezes Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 95/96] ath6kl: fix struct hif_scatter_req list handling Greg Kroah-Hartman
2015-03-16 14:10 ` [PATCH 3.14 96/96] clk-gate: fix bit # check in clk_register_gate() Greg Kroah-Hartman
2015-03-16 19:58 ` [PATCH 3.14 00/96] 3.14.36-stable review Guenter Roeck
     [not found] ` <20150316140856.907657028@linuxfoundation.org>
2015-03-18 23:36   ` [PATCH 3.14 37/96] iio: mxs-lradc: only update the buffer when its conversions have finished Kristina Martšenko
2015-03-19 13:15     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150316140857.246507285@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=gleb@kernel.org \
    --cc=james.hogan@imgtec.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH 3.14 45/96] KVM: MIPS: Fix trace event to save PC directly' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).