* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
@ 2014-11-27 3:13 Boris Ostrovsky
2014-11-27 9:12 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-27 3:13 UTC (permalink / raw)
To: bp
Cc: konrad.wilk, x86, gregkh, david.vrabel, stable, rshendershot,
linux-kernel
----- bp@suse.de wrote:
> On Wed, Nov 26, 2014 at 07:39:26AM -0500, boris ostrovsky wrote:
> > https://lkml.org/lkml/2014/11/25/973 is all I have right now.
>
> Ok, so the Code: section from this splat says:
>
> 25: 55 push %ebp
> 26: 89 e5 mov %esp,%ebp
> 28: 83 ec 08 sub $0x8,%esp
> 2b:* 80 3d c0 ee 97 01 00 cmpb $0x0,0x197eec0 <--
> trapping instruction
> 32: 89 1c 24 mov %ebx,(%esp)
> 35: 89 74 24 04 mov %esi,0x4(%esp)
> 39: 74 12 je 0x4d
> 3b: 8b 1c 24 mov (%esp),%ebx
> 3e: 8b .byte 0x8b
> 3f: 74 .byte 0x74
>
> which I can correlate to the dis_ucode_ldr test here:
>
> .loc 1 134 0
> .loc 1 137 0
> cmpb $0, dis_ucode_ldr+1073741824 #, *_11
> je .L46 #,
>
>
> so we must be faulting when accessing that dis_ucode_ldr thing. But
> you
> said that accessing it through its virtual address doesn't fix the
> issue
> either. Which is very very strange...
I was confusing you: accessing dis_ucode_ldr by virtual address does work on PV. But we then fail later, in load_ucode_intel_ap(), because it also tries to use __pa_nodebug() which can't be used by PV.
So if accessing dis_ucode_ldr by virtual address is acceptable (although I don't think it is?) then we can stick dis_ucode_ldr=1 into xen_start_kernel() and then things look OK.
A better solution may be to replace cpuid in x86_guest() with 'return pv_info.paravirt_enabled' (or paravirt_enabled(), I guess). I gave it a quick spin (32-bit only) and it seems to work. I'll see how my overnight tests behave.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-27 3:13 [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit Boris Ostrovsky
@ 2014-11-27 9:12 ` Borislav Petkov
2014-11-27 16:21 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-27 9:12 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: konrad.wilk, x86, gregkh, david.vrabel, stable, rshendershot,
linux-kernel
On Wed, Nov 26, 2014 at 07:13:02PM -0800, Boris Ostrovsky wrote:
> I was confusing you: accessing dis_ucode_ldr by virtual address does
> work on PV. But we then fail later, in load_ucode_intel_ap(), because
> it also tries to use __pa_nodebug() which can't be used by PV.
>
> So if accessing dis_ucode_ldr by virtual address is acceptable
> (although I don't think it is?) then we can stick dis_ucode_ldr=1 into
> xen_start_kernel() and then things look OK.
>
> A better solution may be to replace cpuid in x86_guest() with 'return
> pv_info.paravirt_enabled' (or paravirt_enabled(), I guess). I gave
> it a quick spin (32-bit only) and it seems to work. I'll see how my
> overnight tests behave.
Ok, but let's have a clean design: maybe have a weak default stub which
returns false when PARAVIRT is not enabled in the .config and then add
an override in, say, arch/x86/kernel/paravirt.c which returns true when
running as a guest. Something like that, at least.
I can imagine other stuff wanting to use the dynamic checking at runtime
too...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-27 9:12 ` Borislav Petkov
@ 2014-11-27 16:21 ` Konrad Rzeszutek Wilk
2014-11-27 16:36 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-11-27 16:21 UTC (permalink / raw)
To: Borislav Petkov
Cc: Boris Ostrovsky, x86, gregkh, david.vrabel, stable, rshendershot,
linux-kernel
On Thu, Nov 27, 2014 at 10:12:28AM +0100, Borislav Petkov wrote:
> On Wed, Nov 26, 2014 at 07:13:02PM -0800, Boris Ostrovsky wrote:
> > I was confusing you: accessing dis_ucode_ldr by virtual address does
> > work on PV. But we then fail later, in load_ucode_intel_ap(), because
> > it also tries to use __pa_nodebug() which can't be used by PV.
> >
> > So if accessing dis_ucode_ldr by virtual address is acceptable
> > (although I don't think it is?) then we can stick dis_ucode_ldr=1 into
> > xen_start_kernel() and then things look OK.
> >
> > A better solution may be to replace cpuid in x86_guest() with 'return
> > pv_info.paravirt_enabled' (or paravirt_enabled(), I guess). I gave
> > it a quick spin (32-bit only) and it seems to work. I'll see how my
> > overnight tests behave.
>
> Ok, but let's have a clean design: maybe have a weak default stub which
> returns false when PARAVIRT is not enabled in the .config and then add
> an override in, say, arch/x86/kernel/paravirt.c which returns true when
> running as a guest. Something like that, at least.
You are describing 'paravirt_enabled()' :-)
>
> I can imagine other stuff wanting to use the dynamic checking at runtime
> too...
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-27 16:21 ` Konrad Rzeszutek Wilk
@ 2014-11-27 16:36 ` Borislav Petkov
0 siblings, 0 replies; 29+ messages in thread
From: Borislav Petkov @ 2014-11-27 16:36 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Boris Ostrovsky, x86, gregkh, david.vrabel, stable, rshendershot,
linux-kernel
On Thu, Nov 27, 2014 at 11:21:19AM -0500, Konrad Rzeszutek Wilk wrote:
> > Ok, but let's have a clean design: maybe have a weak default stub which
> > returns false when PARAVIRT is not enabled in the .config and then add
> > an override in, say, arch/x86/kernel/paravirt.c which returns true when
> > running as a guest. Something like that, at least.
>
> You are describing 'paravirt_enabled()' :-)
Haha.
Although I have a suspicion this won't work either because we're loading
microcode very early on 32-bit, before paging has been enabled, and
accessing pv_info.paravirt_enabled will probably go boom. AFAICT, from a
quick glance.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
@ 2014-11-27 23:33 Boris Ostrovsky
0 siblings, 0 replies; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-27 23:33 UTC (permalink / raw)
To: bp
Cc: konrad.wilk, x86, gregkh, david.vrabel, stable, rshendershot,
linux-kernel
----- bp@suse.de wrote:
> On Thu, Nov 27, 2014 at 09:14:11AM -0800, Boris Ostrovsky wrote:
> > The overnight tests passed. This includes baremetal, HVM and PV(H),
> > 32- and 64-bit.
>
> Cool. Want to send a proper patch for 3.18 and CC: stable?
>
So I am not convinced that we actually update microcode on baremetal now.
I will look into this but it would have to wait until Monday.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
@ 2014-11-27 17:14 Boris Ostrovsky
2014-11-27 17:20 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-27 17:14 UTC (permalink / raw)
To: bp
Cc: konrad.wilk, x86, gregkh, stable, david.vrabel, rshendershot,
linux-kernel
----- bp@suse.de wrote:
> On Thu, Nov 27, 2014 at 11:21:19AM -0500, Konrad Rzeszutek Wilk
> wrote:
> > > Ok, but let's have a clean design: maybe have a weak default stub
> which
> > > returns false when PARAVIRT is not enabled in the .config and then
> add
> > > an override in, say, arch/x86/kernel/paravirt.c which returns true
> when
> > > running as a guest. Something like that, at least.
> >
> > You are describing 'paravirt_enabled()' :-)
>
> Haha.
>
> Although I have a suspicion this won't work either because we're
> loading
> microcode very early on 32-bit, before paging has been enabled, and
> accessing pv_info.paravirt_enabled will probably go boom. AFAICT, from
> a
> quick glance.
The overnight tests passed. This includes baremetal, HVM and PV(H), 32- and 64-bit.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-27 17:14 Boris Ostrovsky
@ 2014-11-27 17:20 ` Borislav Petkov
0 siblings, 0 replies; 29+ messages in thread
From: Borislav Petkov @ 2014-11-27 17:20 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: konrad.wilk, x86, gregkh, stable, david.vrabel, rshendershot,
linux-kernel
On Thu, Nov 27, 2014 at 09:14:11AM -0800, Boris Ostrovsky wrote:
> The overnight tests passed. This includes baremetal, HVM and PV(H),
> 32- and 64-bit.
Cool. Want to send a proper patch for 3.18 and CC: stable?
Thanks.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH 3.17 000/141] 3.17.4-stable review
@ 2014-11-19 20:50 Greg Kroah-Hartman
2014-11-19 20:52 ` [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit Greg Kroah-Hartman
0 siblings, 1 reply; 29+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-19 20:50 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, torvalds, akpm, linux, satoru.takeuchi,
shuah.kh, stable
This is the start of the stable review cycle for the 3.17.4 release.
There are 141 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri Nov 21 20:51:28 UTC 2014.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.17.4-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 3.17.4-rc1
Emmanuel Grumbach <emmanuel.grumbach@intel.com>
iwlwifi: fix RFkill while calibrating
David Howells <dhowells@redhat.com>
KEYS: Reinstate EPERM for a key type name beginning with a '.'
Stanislaw Gruszka <sgruszka@redhat.com>
asus-nb-wmi: Add wapf4 quirk for the X550VB
Daniel Borkmann <dborkman@redhat.com>
net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks
Daniel Borkmann <dborkman@redhat.com>
net: sctp: fix panic on duplicate ASCONF chunks
Daniel Borkmann <dborkman@redhat.com>
net: sctp: fix remote memory pressure from excessive queueing
Stephan Mueller <smueller@chronox.de>
quirk for Lenovo Yoga 3: no rfkill switch
Nadav Amit <namit@cs.technion.ac.il>
KVM: x86: Don't report guest userspace emulation error to userspace
David Rientjes <rientjes@google.com>
mm, thp: fix collapsing of hugepages on madvise
Joe Perches <joe@perches.com>
checkpatch: remove unnecessary + after {8,8}
Michal Marek <mmarek@suse.cz>
builddeb: put the dbg files into the correct directory
Pali Rohár <pali.rohar@gmail.com>
dell-wmi: Fix access out of memory
Pranith Kumar <bobby.prani@gmail.com>
rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads
Bob Peterson <rpeterso@redhat.com>
GFS2: Make rename not save dirent location
Pablo Neira <pablo@netfilter.org>
netfilter: xt_bpf: add mising opaque struct sk_filter definition
Arturo Borrero <arturo.borrero.glez@gmail.com>
netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()
Houcheng Lin <houcheng@gmail.com>
netfilter: nf_log: release skbuff on nlmsg put failure
Florian Westphal <fw@strlen.de>
netfilter: nfnetlink_log: fix maximum packet length logged to userspace
Florian Westphal <fw@strlen.de>
netfilter: nf_log: account for size of NLMSG_DONE attribute
Sabrina Dubroca <sd@queasysnail.net>
netfilter: nf_tables: check for NULL in nf_tables_newchain pcpu stats allocation
Dan Carpenter <dan.carpenter@oracle.com>
netfilter: ipset: off by one in ip_set_nfnl_get_byindex()
Andrey Vagin <avagin@openvz.org>
ipc: always handle a new value of auto_msgmni
Devesh Sharma <devesh.sharma@emulex.com>
IB/core: Clear AH attr variable to prevent garbage data
Geert Uytterhoeven <geert+renesas@glider.be>
pwm: Fix uninitialized warnings in pwm_get()
Bjorn Helgaas <bhelgaas@google.com>
clocksource: Remove "weak" from clocksource_default_clock() declaration
Bjorn Helgaas <bhelgaas@google.com>
kgdb: Remove "weak" from kgdb_arch_pc() declaration
Bjorn Helgaas <bhelgaas@google.com>
vmcore: Remove "weak" from function declarations
Bjorn Helgaas <bhelgaas@google.com>
memory-hotplug: Remove "weak" from memory_block_size_bytes() declaration
Florian Fainelli <f.fainelli@gmail.com>
net: systemport: reset UniMAC coming out of a suspend cycle
Florian Fainelli <f.fainelli@gmail.com>
net: systemport: enable RX interrupts after NAPI
Anish Bhatt <anish@chelsio.com>
cxgb4 : Handle dcb enable correctly
Dan Carpenter <dan.carpenter@oracle.com>
media: ttusb-dec: buffer overflow in ioctl
Trond Myklebust <trond.myklebust@primarydata.com>
NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE
Trond Myklebust <trond.myklebust@primarydata.com>
NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return
Jan Kara <jack@suse.cz>
nfs: Fix use of uninitialized variable in nfs_getattr()
Trond Myklebust <trond.myklebust@primarydata.com>
NFS: Don't try to reclaim delegation open state if recovery failed
Trond Myklebust <trond.myklebust@primarydata.com>
NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked
Trond Myklebust <trond.myklebust@primarydata.com>
NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired
NeilBrown <neilb@suse.de>
md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN
Junjie Mao <eternal.n08@gmail.com>
x86, kaslr: Prevent .bss from overlaping initrd
Borislav Petkov <bp@suse.de>
x86, microcode, AMD: Fix ucode patch stashing on 32-bit
Borislav Petkov <bp@suse.de>
x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
Borislav Petkov <bp@suse.de>
x86, microcode, AMD: Fix early ucode loading on 32-bit
Krzysztof Kozlowski <k.kozlowski@samsung.com>
power: bq2415x_charger: Fix memory leak on DTS parsing error
Krzysztof Kozlowski <k.kozlowski@samsung.com>
power: bq2415x_charger: Properly handle ENODEV from power_supply_get_by_phandle
Krzysztof Kozlowski <k.kozlowski@samsung.com>
power: charger-manager: Fix accessing invalidated power supply after charger unbind
Krzysztof Kozlowski <k.kozlowski@samsung.com>
power: charger-manager: Fix accessing invalidated power supply after fuel gauge unbind
Jeff Layton <jlayton@primarydata.com>
sunrpc: fix sleeping under rcu_read_lock in gss_stringify_acceptor
Geert Uytterhoeven <geert+renesas@glider.be>
cpufreq: Avoid crash in resume on SMP without OPP
Pali Rohár <pali.rohar@gmail.com>
Input: alps - ignore bad data on Dell Latitudes E6440 and E7440
Pali Rohár <pali.rohar@gmail.com>
Input: alps - allow up to 2 invalid packets without resetting device
Pali Rohár <pali.rohar@gmail.com>
Input: alps - ignore potential bare packets when device is out of sync
Takashi Iwai <tiwai@suse.de>
Input: synaptics - add min/max quirk for Lenovo T440s
Heinz Mauelshagen <heinzm@redhat.com>
dm raid: ensure superblock's size matches device's logical block size
Joe Thornber <ejt@redhat.com>
dm btree: fix a recursion depth bug in btree walking code
Mikulas Patocka <mpatocka@redhat.com>
dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
Jan Kara <jack@suse.cz>
block: Fix computation of merged request priority
Helge Deller <deller@gmx.de>
parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls
Christoph Hellwig <hch@lst.de>
scsi: only re-lock door after EH on devices that were reset
William Cohen <wcohen@redhat.com>
Correct the race condition in aarch64_insn_patch_text_sync()
Peng Tao <tao.peng@primarydata.com>
nfs: fix pnfs direct write memory leak
Simon Horman <horms+renesas@verge.net.au>
ata: sata_rcar: Disable DIPM mode for r8a7790 ES1
Stefan Richter <stefanr@s5r6.in-berlin.de>
firewire: cdev: prevent kernel stack leaking into ioctl arguments
Mark Rutland <mark.rutland@arm.com>
arm64: efi: Fix stub cache maintenance
Kyle McMartin <kyle@redhat.com>
arm64: __clear_user: handle exceptions on strb
Joe Thornber <ejt@redhat.com>
dm thin: grab a virtual cell before looking up the mapping
Paul Mackerras <paulus@samba.org>
Fix thinko in iov_iter_single_seg_count
Roger Quadros <rogerq@ti.com>
pinctrl: dra: dt-bindings: Fix output pull up/down
Andrew Lunn <andrew@lunn.ch>
ARM: mvebu: armada xp: Generalize use of i2c quirk
Roger Quadros <rogerq@ti.com>
ARM: dts: am335x-evm: Fix 5th NAND partition's name
Will Deacon <will.deacon@arm.com>
ARM: 8191/1: decompressor: ensure I-side picks up relocated code
Nathan Lynch <nathan_lynch@mentor.com>
ARM: 8198/1: make kuser helpers depend on MMU
Dave Airlie <airlied@redhat.com>
drm/radeon: add locking around atombios scratch space usage
Alex Deucher <alexander.deucher@amd.com>
drm/radeon: add missing crtc unlock when setting up the MC
Alex Deucher <alexander.deucher@amd.com>
drm/radeon: use gart for DMA IB tests
Alex Deucher <alexander.deucher@amd.com>
drm/radeon: make sure mode init is complete in bandwidth_update
Jammy Zhou <Jammy.Zhou@amd.com>
drm/radeon: set correct CE ram size for CIK
Jani Nikula <jani.nikula@intel.com>
drm/i915/dp: only use training pattern 3 on platforms that support it
Rodrigo Vivi <rodrigo.vivi@intel.com>
drm/i915: Disable caches for Global GTT.
Jani Nikula <jani.nikula@intel.com>
drm/i915: safeguard against too high minimum brightness
Johannes Berg <johannes.berg@intel.com>
mac80211: fix use-after-free in defragmentation
Luciano Coelho <luciano.coelho@intel.com>
mac80211: schedule the actual switch of the station before CSA count 0
Luciano Coelho <luciano.coelho@intel.com>
mac80211: use secondary channel offset IE also beacons during CSA
Johannes Berg <johannes@sipsolutions.net>
mac80211: properly flush delayed scan work on interface removal
Junjie Mao <eternal.n08@gmail.com>
mac80211_hwsim: release driver when ieee80211_register_hw fails
Herbert Xu <herbert@gondor.apana.org.au>
macvtap: Fix csum_start when VLAN tags are present
Ilya Dryomov <idryomov@redhat.com>
libceph: do not crash on large auth tickets
Max Filippov <jcmvbkbc@gmail.com>
xtensa: re-wire umount syscall to sys_oldumount
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix memory leak in FTU quirk
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Add mute LED control for Lenovo Ideapad Z560
Tejun Heo <tj@kernel.org>
ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks
Antoine Tenart <antoine.tenart@free-electrons.com>
ahci: fix AHCI parameters not taken into account
James Ralston <james.d.ralston@intel.com>
ahci: Add Device IDs for Intel Sunrise Point PCH
Daniel Thompson <daniel.thompson@linaro.org>
param: fix crash on bad kernel arguments
Rabin Vincent <rabin@rab.in>
tracing: Do not busy wait in buffer splice
Miklos Szeredi <mszeredi@suse.cz>
audit: keep inode pinned
Richard Guy Briggs <rgb@redhat.com>
audit: AUDIT_FEATURE_CHANGE message format missing delimiting space
Richard Guy Briggs <rgb@redhat.com>
audit: correct AUDIT_GET_FEATURE return message type
Andy Lutomirski <luto@amacapital.net>
x86, x32, audit: Fix x32's AUDIT_ARCH wrt audit
Herbert Xu <herbert@gondor.apana.org.au>
tun: Fix csum_start with VLAN acceleration
Nadav Amit <namit@cs.technion.ac.il>
KVM: x86: Fix uninitialized op->type for some immediate values
Tang Chen <tangchen@cn.fujitsu.com>
mem-hotplug: reset node present pages when hot-adding a new pgdat
Tang Chen <tangchen@cn.fujitsu.com>
mem-hotplug: reset node managed pages when hot-adding a new pgdat
Greg Kurz <gkurz@linux.vnet.ibm.com>
hwrng: pseries - port to new read API and fix stack corruption
Krzysztof Kozlowski <k.kozlowski@samsung.com>
mfd: max77693: Fix always masked MUIC interrupts
Krzysztof Kozlowski <k.kozlowski@samsung.com>
mfd: max77693: Use proper regmap for handling MUIC interrupts
Tony Lindgren <tony@atomide.com>
mfd: twl4030-power: Fix poweroff with PM configuration enabled
Cristian Stoica <cristian.stoica@freescale.com>
crypto: caam - remove duplicated sg copy functions
Tadeusz Struk <tadeusz.struk@intel.com>
crypto: qat - Enforce valid numa configuration
Tadeusz Struk <tadeusz.struk@intel.com>
crypto: qat - Prevent dma mapping zero length assoc data
Cristian Stoica <cristian.stoica@freescale.com>
crypto: caam - fix missing dma unmap on error path
Joonsoo Kim <iamjoonsoo.kim@lge.com>
mm/page_alloc: restrict max order of merging on isolated pageblock
Joonsoo Kim <iamjoonsoo.kim@lge.com>
mm/page_alloc: move freepage counting logic to __free_one_page()
Joonsoo Kim <iamjoonsoo.kim@lge.com>
mm/page_alloc: add freepage on isolate pageblock to correct buddy list
Joonsoo Kim <iamjoonsoo.kim@lge.com>
mm/page_alloc: fix incorrect isolation behavior by rechecking migratetype
Weijie Yang <weijie.yang@samsung.com>
zram: avoid kunmap_atomic() of a NULL pointer
Andreas Larsson <andreas@gaisler.com>
sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks
David S. Miller <davem@davemloft.net>
sparc64: Do irq_{enter,exit}() around generic_smp_call_function*().
David S. Miller <davem@davemloft.net>
sparc64: Fix crashes in schizo_pcierr_intr_other().
Dwight Engen <dwight.engen@oracle.com>
sunvdc: don't call VD_OP_GET_VTOC
Dwight Engen <dwight.engen@oracle.com>
vio: fix reuse of vio_dring slot
Dwight Engen <dwight.engen@oracle.com>
sunvdc: limit each sg segment to a page
Allen Pais <allen.pais@oracle.com>
sunvdc: compute vdisk geometry from capacity
Allen Pais <allen.pais@oracle.com>
sunvdc: add cdrom and v1.1 protocol support
Enric Balletbo i Serra <eballetbo@iseebcn.com>
smsc911x: power-up phydev before doing a software reset.
Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
netlink: Properly unbind in error conditions.
Richard Cochran <richardcochran@gmail.com>
net: ptp: fix time stamp matching logic for VLAN packets.
Eric Dumazet <edumazet@google.com>
ipv6: fix IPV6_PKTINFO with v4 mapped
Daniel Borkmann <dborkman@redhat.com>
net: sctp: fix memory leak in auth key management
Daniel Borkmann <dborkman@redhat.com>
net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet
Takashi Iwai <tiwai@suse.de>
net: ppp: Don't call bpf_prog_create() in ppp_lock
Marcelo Leitner <mleitner@redhat.com>
vxlan: Do not reuse sockets for a different address family
Jesse Gross <jesse@nicira.com>
udptunnel: Add SKB_GSO_UDP_TUNNEL during gro_complete.
Karl Beldan <karl.beldan@rivierawaves.com>
net: mv643xx_eth: reclaim TX skbs only when released by the HW
Steffen Klassert <steffen.klassert@secunet.com>
gre6: Move the setting of dev->iflink into the ndo_init functions.
Steffen Klassert <steffen.klassert@secunet.com>
sit: Use ipip6_tunnel_init as the ndo_init function.
Steffen Klassert <steffen.klassert@secunet.com>
vti6: Use vti6_dev_init as the ndo_init function.
Steffen Klassert <steffen.klassert@secunet.com>
ip6_tunnel: Use ip6_tnl_dev_init as the ndo_init function.
Nikolay Aleksandrov <nikolay@redhat.com>
inet: frags: remove the WARN_ON from inet_evict_bucket
Nikolay Aleksandrov <nikolay@redhat.com>
inet: frags: fix a race between inet_evict_bucket and inet_frag_kill
Shuah Khan <shuahkh@osg.samsung.com>
x86/build: Add arch/x86/purgatory/ make generated files to gitignore
-------------
Diffstat:
.../devicetree/bindings/ata/sata_rcar.txt | 3 +-
Makefile | 4 +-
arch/arm/boot/compressed/head.S | 20 ++-
arch/arm/boot/dts/am335x-evm.dts | 2 +-
arch/arm/mach-mvebu/board-v7.c | 2 +-
arch/arm/mm/Kconfig | 1 +
arch/arm64/kernel/efi-entry.S | 27 +++-
arch/arm64/kernel/insn.c | 5 +-
arch/arm64/lib/clear_user.S | 2 +-
arch/parisc/include/uapi/asm/shmbuf.h | 25 ++-
arch/parisc/kernel/syscall_table.S | 8 +-
arch/sparc/include/asm/atomic_32.h | 2 +-
arch/sparc/include/asm/cmpxchg_32.h | 12 +-
arch/sparc/include/asm/vio.h | 14 +-
arch/sparc/kernel/pci_schizo.c | 6 +-
arch/sparc/kernel/smp_64.c | 4 +
arch/sparc/lib/atomic32.c | 27 ++++
arch/x86/.gitignore | 2 +
arch/x86/boot/compressed/Makefile | 4 +-
arch/x86/boot/compressed/head_32.S | 5 +-
arch/x86/boot/compressed/head_64.S | 5 +-
arch/x86/boot/compressed/misc.c | 13 +-
arch/x86/boot/compressed/mkpiggy.c | 9 +-
arch/x86/kernel/cpu/microcode/amd_early.c | 33 ++--
arch/x86/kernel/cpu/microcode/core_early.c | 2 +-
arch/x86/kernel/ptrace.c | 11 +-
arch/x86/kvm/emulate.c | 8 +
arch/x86/kvm/x86.c | 2 +-
arch/x86/tools/calc_run_size.pl | 30 ++++
arch/xtensa/include/uapi/asm/unistd.h | 3 +-
block/ioprio.c | 14 +-
drivers/ata/ahci.c | 28 ++--
drivers/ata/sata_rcar.c | 10 ++
drivers/block/sunvdc.c | 176 +++++++++++++++------
drivers/block/zram/zram_drv.c | 3 +-
drivers/char/hw_random/pseries-rng.c | 11 +-
drivers/cpufreq/cpufreq.c | 3 +-
drivers/crypto/caam/caamhash.c | 22 ++-
drivers/crypto/caam/key_gen.c | 29 ++--
drivers/crypto/caam/sg_sw_sec4.h | 54 -------
drivers/crypto/qat/qat_common/adf_accel_devices.h | 3 +-
drivers/crypto/qat/qat_common/adf_transport.c | 12 +-
drivers/crypto/qat/qat_common/qat_algs.c | 7 +-
drivers/crypto/qat/qat_common/qat_crypto.c | 8 +-
drivers/crypto/qat/qat_dh895xcc/adf_admin.c | 2 +-
drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 32 ++--
drivers/crypto/qat/qat_dh895xcc/adf_isr.c | 2 +-
drivers/firewire/core-cdev.c | 3 +-
drivers/gpu/drm/i915/i915_gem_gtt.c | 16 ++
drivers/gpu/drm/i915/intel_dp.c | 5 +-
drivers/gpu/drm/i915/intel_panel.c | 17 +-
drivers/gpu/drm/radeon/atom.c | 11 +-
drivers/gpu/drm/radeon/atom.h | 2 +
drivers/gpu/drm/radeon/atombios_dp.c | 4 +-
drivers/gpu/drm/radeon/atombios_i2c.c | 4 +-
drivers/gpu/drm/radeon/cik.c | 7 +-
drivers/gpu/drm/radeon/cik_sdma.c | 21 +--
drivers/gpu/drm/radeon/evergreen.c | 4 +
drivers/gpu/drm/radeon/r100.c | 3 +
drivers/gpu/drm/radeon/r600_dma.c | 20 +--
drivers/gpu/drm/radeon/radeon_device.c | 1 +
drivers/gpu/drm/radeon/rs600.c | 3 +
drivers/gpu/drm/radeon/rs690.c | 3 +
drivers/gpu/drm/radeon/rv515.c | 3 +
drivers/gpu/drm/radeon/si.c | 3 +
drivers/infiniband/core/uverbs_cmd.c | 2 +
drivers/input/mouse/alps.c | 28 +++-
drivers/input/mouse/synaptics.c | 5 +-
drivers/md/dm-bufio.c | 12 +-
drivers/md/dm-raid.c | 11 +-
drivers/md/dm-thin.c | 16 +-
drivers/md/md.c | 4 +
drivers/md/persistent-data/dm-btree-internal.h | 6 +
drivers/md/persistent-data/dm-btree-spine.c | 2 +-
drivers/md/persistent-data/dm-btree.c | 24 ++-
drivers/media/usb/ttusb-dec/ttusbdecfe.c | 3 +
drivers/mfd/max77693.c | 14 +-
drivers/mfd/twl4030-power.c | 52 ++++++
drivers/net/ethernet/broadcom/bcmsysport.c | 11 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 7 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 18 ++-
drivers/net/ethernet/smsc/smsc911x.c | 46 ++++++
drivers/net/ethernet/sun/sunvnet.c | 4 +-
drivers/net/ethernet/ti/cpts.c | 2 +-
drivers/net/macvtap.c | 2 +
drivers/net/phy/dp83640.c | 4 +-
drivers/net/ppp/ppp_generic.c | 40 ++---
drivers/net/tun.c | 16 +-
drivers/net/vxlan.c | 31 ++--
drivers/net/wireless/iwlwifi/mvm/fw.c | 10 +-
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 +
drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 +
drivers/net/wireless/iwlwifi/mvm/ops.c | 11 +-
drivers/net/wireless/iwlwifi/pcie/trans.c | 4 +-
drivers/net/wireless/mac80211_hwsim.c | 4 +-
drivers/platform/x86/asus-nb-wmi.c | 9 ++
drivers/platform/x86/dell-wmi.c | 12 +-
drivers/platform/x86/ideapad-laptop.c | 7 +
drivers/power/bq2415x_charger.c | 23 ++-
drivers/power/charger-manager.c | 163 ++++++++++++-------
drivers/pwm/core.c | 29 ++--
drivers/scsi/scsi_error.c | 4 +-
fs/gfs2/dir.c | 9 +-
fs/gfs2/dir.h | 1 +
fs/gfs2/inode.c | 6 +-
fs/nfs/delegation.c | 25 ++-
fs/nfs/delegation.h | 1 +
fs/nfs/direct.c | 1 +
fs/nfs/filelayout/filelayout.c | 3 -
fs/nfs/inode.c | 2 +-
fs/nfs/nfs4proc.c | 76 +++++----
include/dt-bindings/pinctrl/dra.h | 4 +-
include/linux/bootmem.h | 1 +
include/linux/clocksource.h | 2 +-
include/linux/crash_dump.h | 15 +-
include/linux/kgdb.h | 2 +-
include/linux/khugepaged.h | 17 +-
include/linux/memory.h | 2 +-
include/linux/mfd/max77693-private.h | 7 +
include/linux/mmzone.h | 9 ++
include/linux/nfs_xdr.h | 11 ++
include/linux/page-isolation.h | 8 +
include/linux/power/charger-manager.h | 3 -
include/linux/ring_buffer.h | 2 +-
include/net/sctp/sctp.h | 5 +
include/net/sctp/sm.h | 6 +-
include/net/udp_tunnel.h | 9 ++
include/uapi/linux/netfilter/xt_bpf.h | 2 +
init/main.c | 2 +-
ipc/ipc_sysctl.c | 3 +-
kernel/audit.c | 4 +-
kernel/audit_tree.c | 1 +
kernel/rcu/tree.c | 4 +-
kernel/trace/ring_buffer.c | 81 ++++++----
kernel/trace/trace.c | 23 +--
mm/bootmem.c | 9 +-
mm/huge_memory.c | 11 +-
mm/internal.h | 25 +++
mm/iov_iter.c | 4 +-
mm/memory_hotplug.c | 26 +++
mm/mmap.c | 8 +-
mm/nobootmem.c | 8 +-
mm/page_alloc.c | 55 +++----
mm/page_isolation.c | 43 ++++-
net/ceph/crypto.c | 169 +++++++++++++++-----
net/ipv4/inet_fragment.c | 4 +-
net/ipv4/ip_sockglue.c | 2 +-
net/ipv6/ip6_gre.c | 5 +-
net/ipv6/ip6_tunnel.c | 10 +-
net/ipv6/ip6_vti.c | 11 +-
net/ipv6/sit.c | 15 +-
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 3 +-
net/mac80211/iface.c | 7 +-
net/mac80211/mesh.c | 2 +-
net/mac80211/mlme.c | 5 +-
net/mac80211/rx.c | 14 +-
net/mac80211/spectmgmt.c | 18 +--
net/netfilter/ipset/ip_set_core.c | 2 +-
net/netfilter/nf_tables_api.c | 4 +-
net/netfilter/nfnetlink_log.c | 31 ++--
net/netfilter/nft_compat.c | 2 +-
net/netlink/af_netlink.c | 5 +-
net/sctp/associola.c | 2 +
net/sctp/auth.c | 2 -
net/sctp/inqueue.c | 33 +---
net/sctp/sm_make_chunk.c | 102 ++++++------
net/sctp/sm_statefuns.c | 21 +--
net/sunrpc/auth_gss/auth_gss.c | 35 +++-
scripts/checkpatch.pl | 2 +-
scripts/package/builddeb | 22 ++-
security/keys/keyctl.c | 2 +
sound/pci/hda/patch_conexant.c | 31 ++++
sound/usb/mixer_quirks.c | 6 +
175 files changed, 1711 insertions(+), 875 deletions(-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-19 20:50 [PATCH 3.17 000/141] 3.17.4-stable review Greg Kroah-Hartman
@ 2014-11-19 20:52 ` Greg Kroah-Hartman
2014-11-25 18:12 ` Boris Ostrovsky
0 siblings, 1 reply; 29+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-19 20:52 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Richard Hendershot, Borislav Petkov
3.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov <bp@suse.de>
commit 85be07c32496dc264661308e4d9d4e9ccaff8072 upstream.
We should be accessing it through a pointer, like on the BSP.
Tested-by: Richard Hendershot <rshendershot@mchsi.com>
Fixes: 65cef1311d5d ("x86, microcode: Add a disable chicken bit")
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/microcode/core_early.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kernel/cpu/microcode/core_early.c
+++ b/arch/x86/kernel/cpu/microcode/core_early.c
@@ -124,7 +124,7 @@ void __init load_ucode_bsp(void)
static bool check_loader_disabled_ap(void)
{
#ifdef CONFIG_X86_32
- return __pa_nodebug(dis_ucode_ldr);
+ return *((bool *)__pa_nodebug(&dis_ucode_ldr));
#else
return dis_ucode_ldr;
#endif
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-19 20:52 ` [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit Greg Kroah-Hartman
@ 2014-11-25 18:12 ` Boris Ostrovsky
2014-11-25 18:24 ` Borislav Petkov
2014-11-25 18:45 ` Greg Kroah-Hartman
0 siblings, 2 replies; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 18:12 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-kernel
Cc: stable, Richard Hendershot, Borislav Petkov,
Konrad Rzeszutek Wilk, David Vrabel
On 11/19/2014 03:52 PM, Greg Kroah-Hartman wrote:
> 3.17-stable review patch. If anyone has any objections, please let me know.
This breaks PV on Xen.
-boris
>
> ------------------
>
> From: Borislav Petkov <bp@suse.de>
>
> commit 85be07c32496dc264661308e4d9d4e9ccaff8072 upstream.
>
> We should be accessing it through a pointer, like on the BSP.
>
> Tested-by: Richard Hendershot <rshendershot@mchsi.com>
> Fixes: 65cef1311d5d ("x86, microcode: Add a disable chicken bit")
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> arch/x86/kernel/cpu/microcode/core_early.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/x86/kernel/cpu/microcode/core_early.c
> +++ b/arch/x86/kernel/cpu/microcode/core_early.c
> @@ -124,7 +124,7 @@ void __init load_ucode_bsp(void)
> static bool check_loader_disabled_ap(void)
> {
> #ifdef CONFIG_X86_32
> - return __pa_nodebug(dis_ucode_ldr);
> + return *((bool *)__pa_nodebug(&dis_ucode_ldr));
> #else
> return dis_ucode_ldr;
> #endif
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:12 ` Boris Ostrovsky
@ 2014-11-25 18:24 ` Borislav Petkov
2014-11-25 18:43 ` Boris Ostrovsky
2014-11-25 18:45 ` Greg Kroah-Hartman
1 sibling, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 18:24 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 01:12:10PM -0500, Boris Ostrovsky wrote:
> On 11/19/2014 03:52 PM, Greg Kroah-Hartman wrote:
> >3.17-stable review patch. If anyone has any objections, please let me know.
>
>
> This breaks PV on Xen.
>
> -boris
>
> >
> >------------------
> >
> >From: Borislav Petkov <bp@suse.de>
> >
> >commit 85be07c32496dc264661308e4d9d4e9ccaff8072 upstream.
> >
> >We should be accessing it through a pointer, like on the BSP.
> >
> >Tested-by: Richard Hendershot <rshendershot@mchsi.com>
> >Fixes: 65cef1311d5d ("x86, microcode: Add a disable chicken bit")
> >Signed-off-by: Borislav Petkov <bp@suse.de>
> >Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> >---
> > arch/x86/kernel/cpu/microcode/core_early.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >--- a/arch/x86/kernel/cpu/microcode/core_early.c
> >+++ b/arch/x86/kernel/cpu/microcode/core_early.c
> >@@ -124,7 +124,7 @@ void __init load_ucode_bsp(void)
> > static bool check_loader_disabled_ap(void)
> > {
> > #ifdef CONFIG_X86_32
> >- return __pa_nodebug(dis_ucode_ldr);
> >+ return *((bool *)__pa_nodebug(&dis_ucode_ldr));
And practically the same line in check_loader_disabled_bsp() doesn't?
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:24 ` Borislav Petkov
@ 2014-11-25 18:43 ` Boris Ostrovsky
2014-11-25 18:43 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 18:43 UTC (permalink / raw)
To: Borislav Petkov
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On 11/25/2014 01:24 PM, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 01:12:10PM -0500, Boris Ostrovsky wrote:
>> On 11/19/2014 03:52 PM, Greg Kroah-Hartman wrote:
>>> 3.17-stable review patch. If anyone has any objections, please let me know.
>>
>> This breaks PV on Xen.
>>
>> -boris
>>
>>> ------------------
>>>
>>> From: Borislav Petkov <bp@suse.de>
>>>
>>> commit 85be07c32496dc264661308e4d9d4e9ccaff8072 upstream.
>>>
>>> We should be accessing it through a pointer, like on the BSP.
>>>
>>> Tested-by: Richard Hendershot <rshendershot@mchsi.com>
>>> Fixes: 65cef1311d5d ("x86, microcode: Add a disable chicken bit")
>>> Signed-off-by: Borislav Petkov <bp@suse.de>
>>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>
>>> ---
>>> arch/x86/kernel/cpu/microcode/core_early.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> --- a/arch/x86/kernel/cpu/microcode/core_early.c
>>> +++ b/arch/x86/kernel/cpu/microcode/core_early.c
>>> @@ -124,7 +124,7 @@ void __init load_ucode_bsp(void)
>>> static bool check_loader_disabled_ap(void)
>>> {
>>> #ifdef CONFIG_X86_32
>>> - return __pa_nodebug(dis_ucode_ldr);
>>> + return *((bool *)__pa_nodebug(&dis_ucode_ldr));
> And practically the same line in check_loader_disabled_bsp() doesn't?
I don't think this routine is called on PV.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:43 ` Boris Ostrovsky
@ 2014-11-25 18:43 ` Borislav Petkov
2014-11-25 18:55 ` Boris Ostrovsky
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 18:43 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
> I don't think this routine is called on PV.
They're either both called or none is. At least on baremetal, that is.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:43 ` Borislav Petkov
@ 2014-11-25 18:55 ` Boris Ostrovsky
2014-11-25 19:03 ` Borislav Petkov
2014-11-25 19:08 ` Borislav Petkov
0 siblings, 2 replies; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 18:55 UTC (permalink / raw)
To: Borislav Petkov
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On 11/25/2014 01:43 PM, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
>> I don't think this routine is called on PV.
> They're either both called or none is. At least on baremetal, that is.
>
PV guests don't start with startup_32.
We are coming from a resume into load_ucode_ap as:
[ 38.644599] BUG: unable to handle kernel paging request at 0197eec0
[ 38.644599] IP: [<c1071fa6>] load_ucode_ap+0x6/0xe0
[ 38.644599] *pdpt = 0000000003267007 *pde = 0000000000000000
[ 38.644599] Oops: 0000 [#1] SMP
[ 38.644599] Modules linked in: sg sd_mod dm_multipath dm_mod
xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi
scsi_transport_iscsi scsi_mod libcrc32c crc32c_generic radeon fbcon
tileblit font bitblit ttm softcursor drm_kms_helper x86_pkg_temp_thermal
crc32c_intel xen_blkfront xen_netfront xen_fbfront fb_sys_fops sysimgblt
sysfillrect syscopyarea xen_kbdfront xenfs xen_privcmd
[ 38.644599] CPU: 0 PID: 9 Comm: migration/0 Tainted: G W
3.18.0-rc6upstream-00001-g0de9524 #1
[ 38.644599] task: eb894650 ti: eb89c000 task.ti: eb89c000
[ 38.644599] EIP: 0061:[<c1071fa6>] EFLAGS: 00010082 CPU: 0
[ 38.644599] EIP is at load_ucode_ap+0x6/0xe0
[ 38.644599] EAX: 00000000 EBX: c1823160 ECX: 00000000 EDX: c197eee0
[ 38.644599] ESI: eb9bded0 EDI: c1793e95 EBP: eb89de28 ESP: eb89de20
[ 38.644599] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
[ 38.644599] CR0: 80050033 CR2: 0197eec0 CR3: 03280000 CR4: 00042660
[ 38.644599] Stack:
[ 38.644599] eb89de30 c10539b0 eb89de30 c1070f9d eb89de54 c140de9e
eb9bded0 eb89de54
[ 38.644599] c103dbcc 00000008 deadbeef eb9bded0 eb9bdee4 eb89de80
c1397f57 00000000
[ 38.644599] 00000000 80000002 eb9bdf1c 00000000 00000002 00000003
eb9bded0 eb9bdee4
[ 38.644599] Call Trace:
[ 38.644599] [<c10539b0>] ? i8237A_resume+0xb0/0xe0
[ 38.644599] [<c1070f9d>] mc_bp_resume+0x3d/0x50
[ 38.644599] [<c140de9e>] syscore_resume+0x4e/0x190
[ 38.644599] [<c103dbcc>] ? xen_timer_resume+0x3c/0x60
[ 38.644599] [<c1397f57>] xen_suspend+0x77/0xf0
[ 38.644599] [<c110dc63>] multi_cpu_stop+0x93/0xc0
[ 38.644599] [<c110de76>] cpu_stopper_thread+0x46/0x170
[ 38.644599] [<c110dbd0>] ? irq_cpu_stop_queue_work+0x20/0x20
[ 38.644599] [<c162c536>] ? __schedule+0x356/0x880
[ 38.644599] [<c10b7aab>] ? default_wake_function+0xb/0x10
[ 38.644599] [<c10c7c00>] ? __wake_up_common+0x40/0x70
[ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
[ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
[ 38.644599] [<c16304ef>] ? _raw_spin_lock_irqsave+0x1f/0x80
[ 38.644599] [<c16306bf>] ? _raw_spin_lock_irq+0xf/0x60
[ 38.644599] [<c10aff47>] smpboot_thread_fn+0x117/0x1a0
[ 38.644599] [<c10ac824>] kthread+0xa4/0xc0
[ 38.644599] [<c10afe30>] ? smpboot_create_threads+0x60/0x60
[ 38.644599] [<c1630bc1>] ret_from_kernel_thread+0x21/0x30
[ 38.644599] [<c10ac780>] ? kthread_freezable_should_stop+0x60/0x60
[ 38.644599] Code: 55 cc eb 93 89 44 24 04 66 31 f6 c7 04 24 78 f0 74
c1 e8 84 9f 5b 00 eb ae 90 90 90 90 90 90 90 90 90 90 90 90 55 89 e5 83
ec 08 <80> 3d c0 ee 97 01 00 89 1c 24 89 74 24 04 74 12 8b 1c 24 8b 74
[ 38.644599] EIP: [<c1071fa6>] load_ucode_ap+0x6/0xe0 SS:ESP 0069:eb89de20
[ 38.644599] CR2: 000000000197eec0
[ 38.644599] ---[ end trace 0ad7358b42202518 ]---
[ 38.644599] Kernel panic - not syncing: Fatal exception
[ 38.644599] Kernel Offset: 0x0 from 0xc1000000 (relocation range:
0xc0000000-0xed7fdfff)
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:55 ` Boris Ostrovsky
@ 2014-11-25 19:03 ` Borislav Petkov
2014-11-25 19:23 ` Boris Ostrovsky
2014-11-25 19:08 ` Borislav Petkov
1 sibling, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 19:03 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 01:55:29PM -0500, Boris Ostrovsky wrote:
> On 11/25/2014 01:43 PM, Borislav Petkov wrote:
> >On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
> >>I don't think this routine is called on PV.
> >They're either both called or none is. At least on baremetal, that is.
> >
>
> PV guests don't start with startup_32.
>
> We are coming from a resume into load_ucode_ap as:
>
> [ 38.644599] BUG: unable to handle kernel paging request at 0197eec0
> [ 38.644599] IP: [<c1071fa6>] load_ucode_ap+0x6/0xe0
Aha, and at that point, the APs have enabled paging and switched to
virtual addresses, correct?
Does that fix it?
---
diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
index 2c017f242a78..11ff39fe9d88 100644
--- a/arch/x86/kernel/cpu/microcode/core_early.c
+++ b/arch/x86/kernel/cpu/microcode/core_early.c
@@ -123,11 +123,7 @@ void __init load_ucode_bsp(void)
static bool check_loader_disabled_ap(void)
{
-#ifdef CONFIG_X86_32
- return *((bool *)__pa_nodebug(&dis_ucode_ldr));
-#else
return dis_ucode_ldr;
-#endif
}
void load_ucode_ap(void)
> [ 38.644599] *pdpt = 0000000003267007 *pde = 0000000000000000
> [ 38.644599] Oops: 0000 [#1] SMP
> [ 38.644599] Modules linked in: sg sd_mod dm_multipath dm_mod xen_evtchn
> iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi
> scsi_mod libcrc32c crc32c_generic radeon fbcon tileblit font bitblit ttm
> softcursor drm_kms_helper x86_pkg_temp_thermal crc32c_intel xen_blkfront
> xen_netfront xen_fbfront fb_sys_fops sysimgblt sysfillrect syscopyarea
> xen_kbdfront xenfs xen_privcmd
> [ 38.644599] CPU: 0 PID: 9 Comm: migration/0 Tainted: G W
> 3.18.0-rc6upstream-00001-g0de9524 #1
> [ 38.644599] task: eb894650 ti: eb89c000 task.ti: eb89c000
> [ 38.644599] EIP: 0061:[<c1071fa6>] EFLAGS: 00010082 CPU: 0
> [ 38.644599] EIP is at load_ucode_ap+0x6/0xe0
> [ 38.644599] EAX: 00000000 EBX: c1823160 ECX: 00000000 EDX: c197eee0
> [ 38.644599] ESI: eb9bded0 EDI: c1793e95 EBP: eb89de28 ESP: eb89de20
> [ 38.644599] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
> [ 38.644599] CR0: 80050033 CR2: 0197eec0 CR3: 03280000 CR4: 00042660
> [ 38.644599] Stack:
> [ 38.644599] eb89de30 c10539b0 eb89de30 c1070f9d eb89de54 c140de9e
> eb9bded0 eb89de54
> [ 38.644599] c103dbcc 00000008 deadbeef eb9bded0 eb9bdee4 eb89de80
> c1397f57 00000000
> [ 38.644599] 00000000 80000002 eb9bdf1c 00000000 00000002 00000003
> eb9bded0 eb9bdee4
> [ 38.644599] Call Trace:
> [ 38.644599] [<c10539b0>] ? i8237A_resume+0xb0/0xe0
> [ 38.644599] [<c1070f9d>] mc_bp_resume+0x3d/0x50
> [ 38.644599] [<c140de9e>] syscore_resume+0x4e/0x190
> [ 38.644599] [<c103dbcc>] ? xen_timer_resume+0x3c/0x60
> [ 38.644599] [<c1397f57>] xen_suspend+0x77/0xf0
> [ 38.644599] [<c110dc63>] multi_cpu_stop+0x93/0xc0
> [ 38.644599] [<c110de76>] cpu_stopper_thread+0x46/0x170
> [ 38.644599] [<c110dbd0>] ? irq_cpu_stop_queue_work+0x20/0x20
> [ 38.644599] [<c162c536>] ? __schedule+0x356/0x880
> [ 38.644599] [<c10b7aab>] ? default_wake_function+0xb/0x10
> [ 38.644599] [<c10c7c00>] ? __wake_up_common+0x40/0x70
> [ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
> [ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
> [ 38.644599] [<c16304ef>] ? _raw_spin_lock_irqsave+0x1f/0x80
> [ 38.644599] [<c16306bf>] ? _raw_spin_lock_irq+0xf/0x60
> [ 38.644599] [<c10aff47>] smpboot_thread_fn+0x117/0x1a0
> [ 38.644599] [<c10ac824>] kthread+0xa4/0xc0
> [ 38.644599] [<c10afe30>] ? smpboot_create_threads+0x60/0x60
> [ 38.644599] [<c1630bc1>] ret_from_kernel_thread+0x21/0x30
> [ 38.644599] [<c10ac780>] ? kthread_freezable_should_stop+0x60/0x60
> [ 38.644599] Code: 55 cc eb 93 89 44 24 04 66 31 f6 c7 04 24 78 f0 74 c1
> e8 84 9f 5b 00 eb ae 90 90 90 90 90 90 90 90 90 90 90 90 55 89 e5 83 ec 08
> <80> 3d c0 ee 97 01 00 89 1c 24 89 74 24 04 74 12 8b 1c 24 8b 74
> [ 38.644599] EIP: [<c1071fa6>] load_ucode_ap+0x6/0xe0 SS:ESP 0069:eb89de20
> [ 38.644599] CR2: 000000000197eec0
> [ 38.644599] ---[ end trace 0ad7358b42202518 ]---
> [ 38.644599] Kernel panic - not syncing: Fatal exception
> [ 38.644599] Kernel Offset: 0x0 from 0xc1000000 (relocation range:
> 0xc0000000-0xed7fdfff)
>
>
>
>
> -boris
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 19:03 ` Borislav Petkov
@ 2014-11-25 19:23 ` Boris Ostrovsky
0 siblings, 0 replies; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 19:23 UTC (permalink / raw)
To: Borislav Petkov
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On 11/25/2014 02:03 PM, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 01:55:29PM -0500, Boris Ostrovsky wrote:
>> On 11/25/2014 01:43 PM, Borislav Petkov wrote:
>>> On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
>>>> I don't think this routine is called on PV.
>>> They're either both called or none is. At least on baremetal, that is.
>>>
>> PV guests don't start with startup_32.
>>
>> We are coming from a resume into load_ucode_ap as:
>>
>> [ 38.644599] BUG: unable to handle kernel paging request at 0197eec0
>> [ 38.644599] IP: [<c1071fa6>] load_ucode_ap+0x6/0xe0
> Aha, and at that point, the APs have enabled paging and switched to
> virtual addresses, correct?
Right.
>
> Does that fix it?
Hmm... no, although expected this to fix it.
-boris
>
> ---
> diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
> index 2c017f242a78..11ff39fe9d88 100644
> --- a/arch/x86/kernel/cpu/microcode/core_early.c
> +++ b/arch/x86/kernel/cpu/microcode/core_early.c
> @@ -123,11 +123,7 @@ void __init load_ucode_bsp(void)
>
> static bool check_loader_disabled_ap(void)
> {
> -#ifdef CONFIG_X86_32
> - return *((bool *)__pa_nodebug(&dis_ucode_ldr));
> -#else
> return dis_ucode_ldr;
> -#endif
> }
>
> void load_ucode_ap(void)
>
>
>> [ 38.644599] *pdpt = 0000000003267007 *pde = 0000000000000000
>> [ 38.644599] Oops: 0000 [#1] SMP
>> [ 38.644599] Modules linked in: sg sd_mod dm_multipath dm_mod xen_evtchn
>> iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi
>> scsi_mod libcrc32c crc32c_generic radeon fbcon tileblit font bitblit ttm
>> softcursor drm_kms_helper x86_pkg_temp_thermal crc32c_intel xen_blkfront
>> xen_netfront xen_fbfront fb_sys_fops sysimgblt sysfillrect syscopyarea
>> xen_kbdfront xenfs xen_privcmd
>> [ 38.644599] CPU: 0 PID: 9 Comm: migration/0 Tainted: G W
>> 3.18.0-rc6upstream-00001-g0de9524 #1
>> [ 38.644599] task: eb894650 ti: eb89c000 task.ti: eb89c000
>> [ 38.644599] EIP: 0061:[<c1071fa6>] EFLAGS: 00010082 CPU: 0
>> [ 38.644599] EIP is at load_ucode_ap+0x6/0xe0
>> [ 38.644599] EAX: 00000000 EBX: c1823160 ECX: 00000000 EDX: c197eee0
>> [ 38.644599] ESI: eb9bded0 EDI: c1793e95 EBP: eb89de28 ESP: eb89de20
>> [ 38.644599] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
>> [ 38.644599] CR0: 80050033 CR2: 0197eec0 CR3: 03280000 CR4: 00042660
>> [ 38.644599] Stack:
>> [ 38.644599] eb89de30 c10539b0 eb89de30 c1070f9d eb89de54 c140de9e
>> eb9bded0 eb89de54
>> [ 38.644599] c103dbcc 00000008 deadbeef eb9bded0 eb9bdee4 eb89de80
>> c1397f57 00000000
>> [ 38.644599] 00000000 80000002 eb9bdf1c 00000000 00000002 00000003
>> eb9bded0 eb9bdee4
>> [ 38.644599] Call Trace:
>> [ 38.644599] [<c10539b0>] ? i8237A_resume+0xb0/0xe0
>> [ 38.644599] [<c1070f9d>] mc_bp_resume+0x3d/0x50
>> [ 38.644599] [<c140de9e>] syscore_resume+0x4e/0x190
>> [ 38.644599] [<c103dbcc>] ? xen_timer_resume+0x3c/0x60
>> [ 38.644599] [<c1397f57>] xen_suspend+0x77/0xf0
>> [ 38.644599] [<c110dc63>] multi_cpu_stop+0x93/0xc0
>> [ 38.644599] [<c110de76>] cpu_stopper_thread+0x46/0x170
>> [ 38.644599] [<c110dbd0>] ? irq_cpu_stop_queue_work+0x20/0x20
>> [ 38.644599] [<c162c536>] ? __schedule+0x356/0x880
>> [ 38.644599] [<c10b7aab>] ? default_wake_function+0xb/0x10
>> [ 38.644599] [<c10c7c00>] ? __wake_up_common+0x40/0x70
>> [ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
>> [ 38.644599] [<c1630730>] ? _raw_spin_unlock_irqrestore+0x20/0x90
>> [ 38.644599] [<c16304ef>] ? _raw_spin_lock_irqsave+0x1f/0x80
>> [ 38.644599] [<c16306bf>] ? _raw_spin_lock_irq+0xf/0x60
>> [ 38.644599] [<c10aff47>] smpboot_thread_fn+0x117/0x1a0
>> [ 38.644599] [<c10ac824>] kthread+0xa4/0xc0
>> [ 38.644599] [<c10afe30>] ? smpboot_create_threads+0x60/0x60
>> [ 38.644599] [<c1630bc1>] ret_from_kernel_thread+0x21/0x30
>> [ 38.644599] [<c10ac780>] ? kthread_freezable_should_stop+0x60/0x60
>> [ 38.644599] Code: 55 cc eb 93 89 44 24 04 66 31 f6 c7 04 24 78 f0 74 c1
>> e8 84 9f 5b 00 eb ae 90 90 90 90 90 90 90 90 90 90 90 90 55 89 e5 83 ec 08
>> <80> 3d c0 ee 97 01 00 89 1c 24 89 74 24 04 74 12 8b 1c 24 8b 74
>> [ 38.644599] EIP: [<c1071fa6>] load_ucode_ap+0x6/0xe0 SS:ESP 0069:eb89de20
>> [ 38.644599] CR2: 000000000197eec0
>> [ 38.644599] ---[ end trace 0ad7358b42202518 ]---
>> [ 38.644599] Kernel panic - not syncing: Fatal exception
>> [ 38.644599] Kernel Offset: 0x0 from 0xc1000000 (relocation range:
>> 0xc0000000-0xed7fdfff)
>>
>>
>>
>>
>> -boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:55 ` Boris Ostrovsky
2014-11-25 19:03 ` Borislav Petkov
@ 2014-11-25 19:08 ` Borislav Petkov
2014-11-25 19:28 ` Boris Ostrovsky
1 sibling, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 19:08 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 01:55:29PM -0500, Boris Ostrovsky wrote:
> On 11/25/2014 01:43 PM, Borislav Petkov wrote:
> >On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
> >>I don't think this routine is called on PV.
> >They're either both called or none is. At least on baremetal, that is.
> >
>
> PV guests don't start with startup_32.
>
> We are coming from a resume into load_ucode_ap as:
Btw, why is this thing even running on xen? I'd like to make
CONFIG_MICROCODE depend on !PARAVIRT and be done with it.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 19:08 ` Borislav Petkov
@ 2014-11-25 19:28 ` Boris Ostrovsky
2014-11-25 20:26 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 19:28 UTC (permalink / raw)
To: Borislav Petkov
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On 11/25/2014 02:08 PM, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 01:55:29PM -0500, Boris Ostrovsky wrote:
>> On 11/25/2014 01:43 PM, Borislav Petkov wrote:
>>> On Tue, Nov 25, 2014 at 01:43:26PM -0500, Boris Ostrovsky wrote:
>>>> I don't think this routine is called on PV.
>>> They're either both called or none is. At least on baremetal, that is.
>>>
>> PV guests don't start with startup_32.
>>
>> We are coming from a resume into load_ucode_ap as:
> Btw, why is this thing even running on xen? I'd like to make
> CONFIG_MICROCODE depend on !PARAVIRT and be done with it.
You'd have to decide at runtime --- many baremetal systems are compiled
with PARAVIRT.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 19:28 ` Boris Ostrovsky
@ 2014-11-25 20:26 ` Borislav Petkov
2014-11-25 20:36 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 20:26 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 02:28:46PM -0500, Boris Ostrovsky wrote:
> You'd have to decide at runtime --- many baremetal systems are
> compiled with PARAVIRT.
Right, but the microcode loader is not used at all on PV, right?
If so, I'd like to add a arch_something_blabla_disabled_loader()
function which is run in the loader init path and returns false on
baremetal and a true when running as a xen guest. I'm not sure how the
detection should be done, though... CPUID with the hypervisor leaf?
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 20:26 ` Borislav Petkov
@ 2014-11-25 20:36 ` Konrad Rzeszutek Wilk
2014-11-25 21:17 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-11-25 20:36 UTC (permalink / raw)
To: Borislav Petkov
Cc: Boris Ostrovsky, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel
On Tue, Nov 25, 2014 at 09:26:28PM +0100, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 02:28:46PM -0500, Boris Ostrovsky wrote:
> > You'd have to decide at runtime --- many baremetal systems are
> > compiled with PARAVIRT.
>
> Right, but the microcode loader is not used at all on PV, right?
Is there an use-case for this in virtualization at all?
>
> If so, I'd like to add a arch_something_blabla_disabled_loader()
> function which is run in the loader init path and returns false on
> baremetal and a true when running as a xen guest. I'm not sure how the
> detection should be done, though... CPUID with the hypervisor leaf?
Why not make it in general then? Like:
if (cpu_has_hypervisor)
return;
?
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 20:36 ` Konrad Rzeszutek Wilk
@ 2014-11-25 21:17 ` Borislav Petkov
2014-11-25 21:59 ` Boris Ostrovsky
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 21:17 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Boris Ostrovsky, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel
On Tue, Nov 25, 2014 at 03:36:34PM -0500, Konrad Rzeszutek Wilk wrote:
> Is there an use-case for this in virtualization at all?
Not that I know of...
> Why not make it in general then? Like:
>
> if (cpu_has_hypervisor)
> return;
Ah, good idea. Although we need to do it by-foot because the cpu_has
stuff hasn't been initialized yet that early. Boris, I'm guessing
something that should work... ?
---
diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
index 2c017f242a78..77137b317e2a 100644
--- a/arch/x86/kernel/cpu/microcode/core_early.c
+++ b/arch/x86/kernel/cpu/microcode/core_early.c
@@ -74,6 +74,16 @@ static int x86_family(void)
return x86;
}
+static bool x86_guest(void)
+{
+ u32 eax = 0x1;
+ u32 ebx, ecx = 0, edx;
+
+ native_cpuid(&eax, &ebx, &ecx, &edx);
+
+ return !!(ecx & BIT(31));
+}
+
static bool __init check_loader_disabled_bsp(void)
{
#ifdef CONFIG_X86_32
@@ -98,6 +108,9 @@ void __init load_ucode_bsp(void)
{
int vendor, x86;
+ if (x86_guest())
+ return;
+
if (check_loader_disabled_bsp())
return;
@@ -134,6 +147,9 @@ void load_ucode_ap(void)
{
int vendor, x86;
+ if (x86_guest())
+ return;
+
if (check_loader_disabled_ap())
return;
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 21:17 ` Borislav Petkov
@ 2014-11-25 21:59 ` Boris Ostrovsky
2014-11-25 22:18 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 21:59 UTC (permalink / raw)
To: Borislav Petkov, Konrad Rzeszutek Wilk
Cc: Greg Kroah-Hartman, linux-kernel, stable, Richard Hendershot,
David Vrabel
On 11/25/2014 04:17 PM, Borislav Petkov wrote:
> On Tue, Nov 25, 2014 at 03:36:34PM -0500, Konrad Rzeszutek Wilk wrote:
>> Is there an use-case for this in virtualization at all?
> Not that I know of...
>
>> Why not make it in general then? Like:
>>
>> if (cpu_has_hypervisor)
>> return;
> Ah, good idea. Although we need to do it by-foot because the cpu_has
> stuff hasn't been initialized yet that early. Boris, I'm guessing
> something that should work... ?
>
> ---
> diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
> index 2c017f242a78..77137b317e2a 100644
> --- a/arch/x86/kernel/cpu/microcode/core_early.c
> +++ b/arch/x86/kernel/cpu/microcode/core_early.c
> @@ -74,6 +74,16 @@ static int x86_family(void)
> return x86;
> }
>
> +static bool x86_guest(void)
> +{
> + u32 eax = 0x1;
> + u32 ebx, ecx = 0, edx;
> +
> + native_cpuid(&eax, &ebx, &ecx, &edx);
This should be cpuid(0x1, &eax, &ebx, &ecx, &edx). Otherwise we are not
getting bits that the hypervisor wants the guest to see (on Xen cpuid()
turns into hypercall, on baremetal it's native).
With that change it works and
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
(May be worth adding a comment as to what is_guest() is checking for
since 31 is a magic number).
BTW, the crash had nothing to do with accessing dis_ucode_ldr, we are
crashing much later, in load_ucode_intel_ap(), trying to access
*initrd_start_p. And the reason we didn't crash before was because
compiler optimized out whole load_ucode_ap() since
check_loader_disabled_ap() was always true.
Thanks.
-boris
> +
> + return !!(ecx & BIT(31));
> +}
> +
> static bool __init check_loader_disabled_bsp(void)
> {
> #ifdef CONFIG_X86_32
> @@ -98,6 +108,9 @@ void __init load_ucode_bsp(void)
> {
> int vendor, x86;
>
> + if (x86_guest())
> + return;
> +
> if (check_loader_disabled_bsp())
> return;
>
> @@ -134,6 +147,9 @@ void load_ucode_ap(void)
> {
> int vendor, x86;
>
> + if (x86_guest())
> + return;
> +
> if (check_loader_disabled_ap())
> return;
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 21:59 ` Boris Ostrovsky
@ 2014-11-25 22:18 ` Borislav Petkov
2014-11-26 5:00 ` Boris Ostrovsky
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 22:18 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Konrad Rzeszutek Wilk, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel, x86-ml
Adding x86 people.
On Tue, Nov 25, 2014 at 04:59:34PM -0500, Boris Ostrovsky wrote:
> This should be cpuid(0x1, &eax, &ebx, &ecx, &edx). Otherwise we are not
> getting bits that the hypervisor wants the guest to see (on Xen cpuid()
> turns into hypercall, on baremetal it's native).
>
> With that change it works and
>
> Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Thanks for testing.
> (May be worth adding a comment as to what is_guest() is checking for since
> 31 is a magic number).
See below.
> BTW, the crash had nothing to do with accessing dis_ucode_ldr, we are
> crashing much later, in load_ucode_intel_ap(), trying to access
> *initrd_start_p. And the reason we didn't crash before was because compiler
> optimized out whole load_ucode_ap() since check_loader_disabled_ap() was
> always true.
Right, and my fix actually uncovered the original issue :-\
Ok, here's a v2 which adds the check to the late loader too, for
completeness. I'll write a proper commit message tomorrow.
---
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 64dc362506b7..654907db5f09 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -87,4 +87,9 @@ static inline int __init save_microcode_in_initrd(void)
}
#endif
+/* Check whether we're running as a guest on a hypervisor. */
+static inline bool x86_guest(void)
+{
+ return !!(cpuid_ecx(1) & BIT(31));
+}
#endif /* _ASM_X86_MICROCODE_H */
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 2ce9051174e6..0b6db2a97f61 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -557,6 +557,9 @@ static int __init microcode_init(void)
struct cpuinfo_x86 *c = &cpu_data(0);
int error;
+ if (x86_guest())
+ return 0;
+
if (dis_ucode_ldr)
return 0;
diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
index 2c017f242a78..dfa93e74c370 100644
--- a/arch/x86/kernel/cpu/microcode/core_early.c
+++ b/arch/x86/kernel/cpu/microcode/core_early.c
@@ -98,6 +98,9 @@ void __init load_ucode_bsp(void)
{
int vendor, x86;
+ if (x86_guest())
+ return;
+
if (check_loader_disabled_bsp())
return;
@@ -134,6 +137,9 @@ void load_ucode_ap(void)
{
int vendor, x86;
+ if (x86_guest())
+ return;
+
if (check_loader_disabled_ap())
return;
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 22:18 ` Borislav Petkov
@ 2014-11-26 5:00 ` Boris Ostrovsky
2014-11-26 10:55 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-26 5:00 UTC (permalink / raw)
To: Borislav Petkov
Cc: Konrad Rzeszutek Wilk, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel, x86-ml
On 11/25/2014 05:18 PM, Borislav Petkov wrote:
> Adding x86 people.
>
> On Tue, Nov 25, 2014 at 04:59:34PM -0500, Boris Ostrovsky wrote:
>> This should be cpuid(0x1, &eax, &ebx, &ecx, &edx). Otherwise we are not
>> getting bits that the hypervisor wants the guest to see (on Xen cpuid()
>> turns into hypercall, on baremetal it's native).
>>
>> With that change it works and
>>
>> Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Sigh... I take this back. It breaks 32-bit baremetal. I haven't looked
any further but it seems to be dying very early. I suspect cpuid pv_op
is not set up yet. If that's true, perhaps you could check whether it is
valid in x86_guest()?
I won't be able to do anything tomorrow morning, the best I can hope for
is evening.
-boris
> Thanks for testing.
>
>> (May be worth adding a comment as to what is_guest() is checking for since
>> 31 is a magic number).
> See below.
>
>> BTW, the crash had nothing to do with accessing dis_ucode_ldr, we are
>> crashing much later, in load_ucode_intel_ap(), trying to access
>> *initrd_start_p. And the reason we didn't crash before was because compiler
>> optimized out whole load_ucode_ap() since check_loader_disabled_ap() was
>> always true.
> Right, and my fix actually uncovered the original issue :-\
>
> Ok, here's a v2 which adds the check to the late loader too, for
> completeness. I'll write a proper commit message tomorrow.
>
> ---
> diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
> index 64dc362506b7..654907db5f09 100644
> --- a/arch/x86/include/asm/microcode.h
> +++ b/arch/x86/include/asm/microcode.h
> @@ -87,4 +87,9 @@ static inline int __init save_microcode_in_initrd(void)
> }
> #endif
>
> +/* Check whether we're running as a guest on a hypervisor. */
> +static inline bool x86_guest(void)
> +{
> + return !!(cpuid_ecx(1) & BIT(31));
> +}
> #endif /* _ASM_X86_MICROCODE_H */
> diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
> index 2ce9051174e6..0b6db2a97f61 100644
> --- a/arch/x86/kernel/cpu/microcode/core.c
> +++ b/arch/x86/kernel/cpu/microcode/core.c
> @@ -557,6 +557,9 @@ static int __init microcode_init(void)
> struct cpuinfo_x86 *c = &cpu_data(0);
> int error;
>
> + if (x86_guest())
> + return 0;
> +
> if (dis_ucode_ldr)
> return 0;
>
> diff --git a/arch/x86/kernel/cpu/microcode/core_early.c b/arch/x86/kernel/cpu/microcode/core_early.c
> index 2c017f242a78..dfa93e74c370 100644
> --- a/arch/x86/kernel/cpu/microcode/core_early.c
> +++ b/arch/x86/kernel/cpu/microcode/core_early.c
> @@ -98,6 +98,9 @@ void __init load_ucode_bsp(void)
> {
> int vendor, x86;
>
> + if (x86_guest())
> + return;
> +
> if (check_loader_disabled_bsp())
> return;
>
> @@ -134,6 +137,9 @@ void load_ucode_ap(void)
> {
> int vendor, x86;
>
> + if (x86_guest())
> + return;
> +
> if (check_loader_disabled_ap())
> return;
>
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-26 5:00 ` Boris Ostrovsky
@ 2014-11-26 10:55 ` Borislav Petkov
2014-11-26 12:39 ` boris ostrovsky
0 siblings, 1 reply; 29+ messages in thread
From: Borislav Petkov @ 2014-11-26 10:55 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: Konrad Rzeszutek Wilk, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel, x86-ml
On Wed, Nov 26, 2014 at 12:00:45AM -0500, Boris Ostrovsky wrote:
> Sigh... I take this back. It breaks 32-bit baremetal. I haven't looked any
> further but it seems to be dying very early. I suspect cpuid pv_op is not
> set up yet. If that's true, perhaps you could check whether it is valid in
> x86_guest()?
Right, this is why we're using the native variants in the early loader.
So we need a different method for detecting very early whether we're
running as a guest.
What I'd like more, though, is if we continue debugging the original
issue where we fail in load_ucode_intel_ap(). Does it happen on this line:
initrd_start_addr = (unsigned long)__pa_nodebug(*initrd_start_p);
where we deref the initrd_start_p? Do you have a full splat with a Code:
section?
Thanks.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-26 10:55 ` Borislav Petkov
@ 2014-11-26 12:39 ` boris ostrovsky
2014-11-26 14:44 ` Borislav Petkov
0 siblings, 1 reply; 29+ messages in thread
From: boris ostrovsky @ 2014-11-26 12:39 UTC (permalink / raw)
To: Borislav Petkov
Cc: Konrad Rzeszutek Wilk, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel, x86-ml
On 11/26/2014 5:55 AM, Borislav Petkov wrote:
> On Wed, Nov 26, 2014 at 12:00:45AM -0500, Boris Ostrovsky wrote:
>> Sigh... I take this back. It breaks 32-bit baremetal. I haven't looked any
>> further but it seems to be dying very early. I suspect cpuid pv_op is not
>> set up yet. If that's true, perhaps you could check whether it is valid in
>> x86_guest()?
> Right, this is why we're using the native variants in the early loader.
> So we need a different method for detecting very early whether we're
> running as a guest.
>
> What I'd like more, though, is if we continue debugging the original
> issue where we fail in load_ucode_intel_ap(). Does it happen on this line:
>
> initrd_start_addr = (unsigned long)__pa_nodebug(*initrd_start_p);
I don't have access to my test setup right now (and won't be until late
today at best) but I am pretty sure this was the line when I was looking
at this yesterday.
>
> where we deref the initrd_start_p? Do you have a full splat with a Code:
> section?
https://lkml.org/lkml/2014/11/25/973 is all I have right now.
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-26 12:39 ` boris ostrovsky
@ 2014-11-26 14:44 ` Borislav Petkov
0 siblings, 0 replies; 29+ messages in thread
From: Borislav Petkov @ 2014-11-26 14:44 UTC (permalink / raw)
To: boris ostrovsky
Cc: Konrad Rzeszutek Wilk, Greg Kroah-Hartman, linux-kernel, stable,
Richard Hendershot, David Vrabel, x86-ml
On Wed, Nov 26, 2014 at 07:39:26AM -0500, boris ostrovsky wrote:
> https://lkml.org/lkml/2014/11/25/973 is all I have right now.
Ok, so the Code: section from this splat says:
25: 55 push %ebp
26: 89 e5 mov %esp,%ebp
28: 83 ec 08 sub $0x8,%esp
2b:* 80 3d c0 ee 97 01 00 cmpb $0x0,0x197eec0 <-- trapping instruction
32: 89 1c 24 mov %ebx,(%esp)
35: 89 74 24 04 mov %esi,0x4(%esp)
39: 74 12 je 0x4d
3b: 8b 1c 24 mov (%esp),%ebx
3e: 8b .byte 0x8b
3f: 74 .byte 0x74
which I can correlate to the dis_ucode_ldr test here:
.loc 1 134 0
.loc 1 137 0
cmpb $0, dis_ucode_ldr+1073741824 #, *_11
je .L46 #,
so we must be faulting when accessing that dis_ucode_ldr thing. But you
said that accessing it through its virtual address doesn't fix the issue
either. Which is very very strange...
Hmmm.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:12 ` Boris Ostrovsky
2014-11-25 18:24 ` Borislav Petkov
@ 2014-11-25 18:45 ` Greg Kroah-Hartman
2014-11-25 18:47 ` Borislav Petkov
2014-11-25 18:50 ` Boris Ostrovsky
1 sibling, 2 replies; 29+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-25 18:45 UTC (permalink / raw)
To: Boris Ostrovsky
Cc: linux-kernel, stable, Richard Hendershot, Borislav Petkov,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 01:12:10PM -0500, Boris Ostrovsky wrote:
> On 11/19/2014 03:52 PM, Greg Kroah-Hartman wrote:
> >3.17-stable review patch. If anyone has any objections, please let me know.
>
>
> This breaks PV on Xen.
Does that mean it is also broken in Linus's tree? If so, please fix it
there. If not, is there some other patch I am missing for 3.17-stable
to resolve this?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:45 ` Greg Kroah-Hartman
@ 2014-11-25 18:47 ` Borislav Petkov
2014-11-25 18:50 ` Boris Ostrovsky
1 sibling, 0 replies; 29+ messages in thread
From: Borislav Petkov @ 2014-11-25 18:47 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Boris Ostrovsky, linux-kernel, stable, Richard Hendershot,
Konrad Rzeszutek Wilk, David Vrabel
On Tue, Nov 25, 2014 at 10:45:01AM -0800, Greg Kroah-Hartman wrote:
> Does that mean it is also broken in Linus's tree?
Should be.
> If so, please fix it there.
Gladly, if Boris would share some more info as to why it breaks the PV
gunk...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit
2014-11-25 18:45 ` Greg Kroah-Hartman
2014-11-25 18:47 ` Borislav Petkov
@ 2014-11-25 18:50 ` Boris Ostrovsky
1 sibling, 0 replies; 29+ messages in thread
From: Boris Ostrovsky @ 2014-11-25 18:50 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, stable, Richard Hendershot, Borislav Petkov,
Konrad Rzeszutek Wilk, David Vrabel
On 11/25/2014 01:45 PM, Greg Kroah-Hartman wrote:
> On Tue, Nov 25, 2014 at 01:12:10PM -0500, Boris Ostrovsky wrote:
>> On 11/19/2014 03:52 PM, Greg Kroah-Hartman wrote:
>>> 3.17-stable review patch. If anyone has any objections, please let me know.
>>
>> This breaks PV on Xen.
> Does that mean it is also broken in Linus's tree? If so, please fix it
> there. If not, is there some other patch I am missing for 3.17-stable
> to resolve this?
Yes, it is broken in Linus's tree. That's the only tree that I tested
and before we have a fix I wanted to avoid for this to trickle into
stable trees as well (although I may be late).
-boris
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2014-11-27 23:33 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-27 3:13 [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit Boris Ostrovsky
2014-11-27 9:12 ` Borislav Petkov
2014-11-27 16:21 ` Konrad Rzeszutek Wilk
2014-11-27 16:36 ` Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2014-11-27 23:33 Boris Ostrovsky
2014-11-27 17:14 Boris Ostrovsky
2014-11-27 17:20 ` Borislav Petkov
2014-11-19 20:50 [PATCH 3.17 000/141] 3.17.4-stable review Greg Kroah-Hartman
2014-11-19 20:52 ` [PATCH 3.17 100/141] x86, microcode: Fix accessing dis_ucode_ldr on 32-bit Greg Kroah-Hartman
2014-11-25 18:12 ` Boris Ostrovsky
2014-11-25 18:24 ` Borislav Petkov
2014-11-25 18:43 ` Boris Ostrovsky
2014-11-25 18:43 ` Borislav Petkov
2014-11-25 18:55 ` Boris Ostrovsky
2014-11-25 19:03 ` Borislav Petkov
2014-11-25 19:23 ` Boris Ostrovsky
2014-11-25 19:08 ` Borislav Petkov
2014-11-25 19:28 ` Boris Ostrovsky
2014-11-25 20:26 ` Borislav Petkov
2014-11-25 20:36 ` Konrad Rzeszutek Wilk
2014-11-25 21:17 ` Borislav Petkov
2014-11-25 21:59 ` Boris Ostrovsky
2014-11-25 22:18 ` Borislav Petkov
2014-11-26 5:00 ` Boris Ostrovsky
2014-11-26 10:55 ` Borislav Petkov
2014-11-26 12:39 ` boris ostrovsky
2014-11-26 14:44 ` Borislav Petkov
2014-11-25 18:45 ` Greg Kroah-Hartman
2014-11-25 18:47 ` Borislav Petkov
2014-11-25 18:50 ` Boris Ostrovsky
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).