linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: gregkh@linuxfoundation.org
Cc: open list <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jan Beulich <jbeulich@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 4.14 102/115] x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
Date: Thu, 13 Sep 2018 10:55:08 -0400	[thread overview]
Message-ID: <CAKf6xpvseyNJtbr3fp=qH4kMeJReBd=fm5Kn-DpqoZL25moVqg@mail.gmail.com> (raw)
In-Reply-To: <20180913131829.659361485@linuxfoundation.org>

On Thu, Sep 13, 2018 at 9:48 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> 4.14-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Juergen Gross <jgross@suse.com>
>
> commit b2d7a075a1ccef2fb321d595802190c8e9b39004 upstream.
>
> Using only 32-bit writes for the pte will result in an intermediate
> L1TF vulnerable PTE. When running as a Xen PV guest this will at once
> switch the guest to shadow mode resulting in a loss of performance.
>
> Use arch_atomic64_xchg() instead which will perform the requested
> operation atomically with all 64 bits.
>
> Some performance considerations according to:
>
> https://software.intel.com/sites/default/files/managed/ad/dc/Intel-Xeon-Scalable-Processor-throughput-latency.pdf
>
> The main number should be the latency, as there is no tight loop around
> native_ptep_get_and_clear().
>
> "lock cmpxchg8b" has a latency of 20 cycles, while "lock xchg" (with a
> memory operand) isn't mentioned in that document. "lock xadd" (with xadd
> having 3 cycles less latency than xchg) has a latency of 11, so we can
> assume a latency of 14 for "lock xchg".
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Jason Andryuk <jandryuk@gmail.com>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
>  arch/x86/include/asm/pgtable-3level.h |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> --- a/arch/x86/include/asm/pgtable-3level.h
> +++ b/arch/x86/include/asm/pgtable-3level.h
> @@ -2,6 +2,8 @@
>  #ifndef _ASM_X86_PGTABLE_3LEVEL_H
>  #define _ASM_X86_PGTABLE_3LEVEL_H
>
> +#include <asm/atomic64_32.h>
> +
>  /*
>   * Intel Physical Address Extension (PAE) Mode - three-level page
>   * tables on PPro+ CPUs.
> @@ -147,10 +149,7 @@ static inline pte_t native_ptep_get_and_
>  {
>         pte_t res;
>
> -       /* xchg acts as a barrier before the setting of the high bits */
> -       res.pte_low = xchg(&ptep->pte_low, 0);
> -       res.pte_high = ptep->pte_high;
> -       ptep->pte_high = 0;
> +       res.pte = (pteval_t)arch_atomic64_xchg((atomic64_t *)ptep, 0);

For 4.14, I had to change this to atomic64_xchg since
arch_atomic64_xchg doesn't exist.

kernel-source/arch/x86/include/asm/pgtable-3level.h:152:22: error:
implicit declaration of function 'arch_atomic64_xchg'
[-Werror=implicit-function-declaration]

The same is probably needed for earlier versions as well.

Regards,
Jason

>
>         return res;
>  }
>
>

  reply	other threads:[~2018-09-13 14:55 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 13:30 [PATCH 4.14 000/115] 4.14.70-stable review Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 001/115] act_ife: fix a potential use-after-free Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 002/115] ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 003/115] net: bcmgenet: use MAC link status for fixed phy Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 004/115] net: macb: do not disable MDIO bus at open/close time Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 005/115] net: sched: Fix memory exposure from short TCA_U32_SEL Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 006/115] qlge: Fix netdev features configuration Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 007/115] r8169: add support for NCube 8168 network card Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 008/115] tcp: do not restart timewait timer on rst reception Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 009/115] vti6: remove !skb->ignore_df check from vti6_xmit() Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 010/115] net/sched: act_pedit: fix dump of extended layered op Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 011/115] tipc: fix a missing rhashtable_walk_exit() Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 012/115] nfp: wait for posted reconfigs when disabling the device Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 013/115] sctp: hold transport before accessing its asoc in sctp_transport_get_next Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 014/115] mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 015/115] vhost: correctly check the iova range when waking virtqueue Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 016/115] hv_netvsc: ignore devices that are not PCI Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 017/115] hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe() Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 018/115] act_ife: move tcfa_lock down to where necessary Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 019/115] act_ife: fix a potential deadlock Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 020/115] net: sched: action_ife: take reference to meta module Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 021/115] cifs: check if SMB2 PDU size has been padded and suppress the warning Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 022/115] hfsplus: dont return 0 when fill_super() failed Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 023/115] hfs: prevent crash on exit from failed search Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 024/115] sunrpc: Dont use stack buffer with scatterlist Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 025/115] fork: dont copy inconsistent signal handler state to child Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 026/115] reiserfs: change j_timestamp type to time64_t Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 027/115] hfsplus: fix NULL dereference in hfsplus_lookup() Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 028/115] fs/proc/kcore.c: use __pa_symbol() for KCORE_TEXT list entries Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 029/115] fat: validate ->i_start before using Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 030/115] scripts: modpost: check memory allocation results Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 031/115] virtio: pci-legacy: Validate queue pfn Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 032/115] x86/mce: Add notifier_block forward declaration Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 033/115] IB/hfi1: Invalid NUMA node information can cause a divide by zero Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 034/115] pwm: meson: Fix mux clock names Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 035/115] mm/fadvise.c: fix signed overflow UBSAN complaint Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 036/115] fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot() Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 037/115] platform/x86: intel_punit_ipc: fix build errors Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 038/115] netfilter: ip6t_rpfilter: set F_IFACE for linklocal addresses Greg Kroah-Hartman
2018-09-13 13:30 ` [PATCH 4.14 039/115] s390/kdump: Fix memleak in nt_vmcoreinfo Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 040/115] ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 041/115] mfd: sm501: Set coherent_dma_mask when creating subdevices Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 042/115] platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360 Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 043/115] netfilter: fix memory leaks on netlink_dump_start error Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 044/115] tcp, ulp: add alias for all ulp modules Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 045/115] RDMA/hns: Fix usage of bitmap allocation functions return values Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 046/115] net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 047/115] net: hns3: Fix for phy link issue when using marvell phy driver Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 048/115] perf tools: Check for null when copying nsinfo Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 049/115] irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 050/115] net/9p/trans_fd.c: fix race by holding the lock Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 051/115] net/9p: fix error path of p9_virtio_probe Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 052/115] f2fs: fix to clear PG_checked flag in set_page_dirty() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 053/115] powerpc/uaccess: Enable get_user(u64, *p) on 32-bit Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 054/115] powerpc: Fix size calculation using resource_size() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 055/115] perf probe powerpc: Fix trace event post-processing Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 056/115] block: bvec_nr_vecs() returns value for wrong slab Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 057/115] s390/dasd: fix hanging offline processing due to canceled worker Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 058/115] s390/dasd: fix panic for failed online processing Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 059/115] ACPI / scan: Initialize status to ACPI_STA_DEFAULT Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 060/115] scsi: aic94xx: fix an error code in aic94xx_init() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 061/115] NFSv4: Fix error handling in nfs4_sp4_select_mode() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 062/115] Input: do not use WARN() in input_alloc_absinfo() Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 063/115] xen/balloon: fix balloon initialization for PVH Dom0 Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 064/115] PCI: mvebu: Fix I/O space end address calculation Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 065/115] dm kcopyd: avoid softlockup in run_complete_job Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 066/115] staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 067/115] ASoC: rt5677: Fix initialization of rt5677_of_match.data Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 068/115] iommu/omap: Fix cache flushes on L2 table entries Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 069/115] selftests/powerpc: Kill child processes on SIGINT Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 070/115] RDS: IB: fix passing zero to ERR_PTR() warning Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 071/115] cfq: Suppress compiler warnings about comparisons Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 072/115] smb3: fix reset of bytes read and written stats Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 073/115] SMB3: Number of requests sent should be displayed for SMB3 not just CIFS Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 074/115] powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 075/115] powerpc/64s: Make rfi_flush_fallback a little more robust Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 076/115] powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 077/115] clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399 Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 078/115] KVM: vmx: track host_state.loaded using a loaded_vmcs pointer Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 079/115] kvm: nVMX: Fix fault vector for VMX operation at CPL > 0 Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 080/115] btrfs: Exit gracefully when chunk map cannot be inserted to the tree Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 081/115] btrfs: replace: Reset on-disk dev stats value after replace Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 082/115] btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 083/115] btrfs: Dont remove block group that still has pinned down bytes Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 084/115] arm64: rockchip: Force CONFIG_PM on Rockchip systems Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 085/115] ARM: " Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 086/115] drm/i915/lpe: Mark LPE audio runtime pm as "no callbacks" Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 087/115] drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 088/115] drm/amd/pp/Polaris12: Fix a chunk of registers missed to program Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 089/115] drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80 Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 090/115] drm/amdgpu: update tmr mc address Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 091/115] drm/amdgpu:add tmr mc address into amdgpu_firmware_info Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 092/115] drm/amdgpu:add new firmware id for VCN Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 093/115] drm/amdgpu:add VCN support in PSP driver Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 094/115] drm/amdgpu:add VCN booting with firmware loaded by PSP Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 095/115] uapi/linux/keyctl.h: dont use C++ reserved keyword as a struct member name Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 096/115] debugobjects: Make stack check warning more informative Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 097/115] sched/deadline: Fix switching to -deadline Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 098/115] lightnvm: pblk: free padded entries in write buffer Greg Kroah-Hartman
2018-09-13 13:31 ` [PATCH 4.14 099/115] mm: Fix devm_memremap_pages() collision handling Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 100/115] HID: add quirk for another PIXART OEM mouse used by HP Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 101/115] usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 102/115] x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear Greg Kroah-Hartman
2018-09-13 14:55   ` Jason Andryuk [this message]
2018-09-13 15:56     ` [PATCH 4.14] " Jason Andryuk
2018-09-13 17:17       ` Greg KH
2018-09-13 13:32 ` [PATCH 4.14 103/115] x86/xen: dont write ptes directly in 32-bit PV guests Greg Kroah-Hartman
2018-09-14 17:12   ` Eduardo Valentin
2018-09-14 18:19     ` Greg Kroah-Hartman
2018-09-14 18:57       ` Eduardo Valentin
2018-09-13 13:32 ` [PATCH 4.14 104/115] drm/i915: Increase LSPCON timeout Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 105/115] kbuild: make missing $DEPMOD a Warning instead of an Error Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 106/115] s390/lib: use expoline for all bcr instructions Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 107/115] irda: Fix memory leak caused by repeated binds of irda socket Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 108/115] irda: Only insert new objects into the global database via setsockopt Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 109/115] Revert "ARM: imx_v6_v7_defconfig: Select ULPI support" Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 110/115] kvm: x86: Set highest physical address bits in non-present/reserved SPTEs Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 111/115] x86: kvm: avoid unused variable warning Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 112/115] arm64: cpu_errata: include required headers Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 113/115] ASoC: wm8994: Fix missing break in switch Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 114/115] arm64: Fix mismatched cache line size detection Greg Kroah-Hartman
2018-09-13 13:32 ` [PATCH 4.14 115/115] arm64: Handle mismatched cache type Greg Kroah-Hartman
2018-09-13 19:10 ` [PATCH 4.14 000/115] 4.14.70-stable review Nathan Chancellor
2018-09-13 20:11   ` Greg Kroah-Hartman
2018-09-14 12:39 ` Naresh Kamboju
2018-09-14 14:54 ` Guenter Roeck
2018-09-14 22:47 ` Eduardo Valentin
2018-09-15  7: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='CAKf6xpvseyNJtbr3fp=qH4kMeJReBd=fm5Kn-DpqoZL25moVqg@mail.gmail.com' \
    --to=jandryuk@gmail.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).