This is the 4.9.181 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlz/gPoACgkQONu9yGCS
aT7Hmw//VuPPksf6knKTYI4iJzlwVUAovkkxUVfb2iuj9nEipRp+KocWeGCBBBEf
kirRIhQqhMRq8z21sfw6CSJvfAmWbWKOwrm47v4EcCCmklbFKW6CyV5lILXbavNr
myQCn6dia9UOSPSUKodscrFeqVELnrH2UUODE4KgDMsI6SN3uRiBVws+hvfJlkhA
4svLCn5gZ1VTUt+f2OVikNzDnLlcrF80WbeSwxxmTKwblyS5Spc2q3PQz4HVs27A
B+3VvzAKj/y4vCWntbMPfKCmmQ67Qkiwrh9J0VinXOnf3bPmL2rxGrmZqeDec2z1
fPonQL0Jhf6SGoIP4bbvpefnNA9xffSkvvF2kfk2QphdRoww2W2ELU6BYu/c9Tde
ulJjGCJruiUcU91GinMCU3aNPoXhCnyhdG3g9A+U2DOHD68+XcogSshDNPvVvY6C
Pz1P7Uak+FIxPEYhwUVBt5s5yvwgqWz3AVMMxF5beB5sMU78CUWY5Je+7ue/r2AA
Np4Zt3QuJw03vnNELPyK/tlyUJxDUbjjskPHJrPztNkHI9LEhrHBnwjBl7I8jVlU
H2pCToC9HcAXuCOkYV5QPbYl0xbTv0gqcDZ8ArjTaV/DefUBPrRxvA5gH+Zgfw0D
bGWTIDUfGgDPJ+05yp8bu19f150BQ7m00Ho1J6yxDD3Xhm61DDE=
=NUA4
-----END PGP SIGNATURE-----
Merge 4.9.181 into android-4.9
Changes in 4.9.181
ipv6: Consider sk_bound_dev_if when binding a raw socket to an address
llc: fix skb leak in llc_build_and_send_ui_pkt()
net: fec: fix the clk mismatch in failed_reset path
net-gro: fix use-after-free read in napi_gro_frags()
net: stmmac: fix reset gpio free missing
usbnet: fix kernel crash after disconnect
tipc: Avoid copying bytes beyond the supplied data
bnxt_en: Fix aggregation buffer leak under OOM condition.
ipv4/igmp: fix another memory leak in igmpv3_del_delrec()
ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST
net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT
net: mvneta: Fix err code path of probe
net: mvpp2: fix bad MVPP2_TXQ_SCHED_TOKEN_CNTR_REG queue value
crypto: vmx - ghash: do nosimd fallback manually
xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
Revert "tipc: fix modprobe tipc failed after switch order of device registration"
tipc: fix modprobe tipc failed after switch order of device registration
sparc64: Fix regression in non-hypervisor TLB flush xcall
include/linux/bitops.h: sanitize rotate primitives
xhci: update bounce buffer with correct sg num
xhci: Use %zu for printing size_t type
xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()
usb: xhci: avoid null pointer deref when bos field is NULL
usbip: usbip_host: fix BUG: sleeping function called from invalid context
usbip: usbip_host: fix stub_dev lock context imbalance regression
USB: Fix slab-out-of-bounds write in usb_get_bos_descriptor
USB: sisusbvga: fix oops in error path of sisusb_probe
USB: Add LPM quirk for Surface Dock GigE adapter
USB: rio500: refuse more than one device at a time
USB: rio500: fix memory leak in close after disconnect
media: usb: siano: Fix general protection fault in smsusb
media: usb: siano: Fix false-positive "uninitialized variable" warning
media: smsusb: better handle optional alignment
scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
scsi: zfcp: fix to prevent port_remove with pure auto scan LUNs (only sdevs)
Btrfs: fix race updating log root item during fsync
powerpc/perf: Fix MMCRA corruption by bhrb_filter
ALSA: hda/realtek - Set default power save node to 0
drm/nouveau/i2c: Disable i2c bus access after ->fini()
tty: serial: msm_serial: Fix XON/XOFF
tty: max310x: Fix external crystal register setup
memcg: make it work on sparse non-0-node systems
kernel/signal.c: trace_signal_deliver when signal_group_exit
docs: Fix conf.py for Sphinx 2.0
staging: vc04_services: prevent integer overflow in create_pagelist()
CIFS: cifs_read_allocate_pages: don't iterate through whole page array on ENOMEM
gcc-plugins: Fix build failures under Darwin host
drm/vmwgfx: Don't send drm sysfs hotplug events on initial master set
brcmfmac: add length checks in scheduled scan result handler
brcmfmac: assure SSID length from firmware is limited
brcmfmac: add subtype check for event handling in data path
binder: Replace "%p" with "%pK" for stable
binder: replace "%p" with "%pK"
fs: prevent page refcount overflow in pipe_buf_get
mm, gup: remove broken VM_BUG_ON_PAGE compound check for hugepages
mm, gup: ensure real head page is ref-counted when using hugepages
mm: prevent get_user_pages() from overflowing page refcount
mm: make page ref count overflow check tighter and more explicit
Revert "x86/build: Move _etext to actual end of .text"
efi/libstub: Unify command line param parsing
media: uvcvideo: Fix uvc_alloc_entity() allocation alignment
ethtool: fix potential userspace buffer overflow
neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit
net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query
net: rds: fix memory leak in rds_ib_flush_mr_pool
pktgen: do not sleep with the thread lock held.
ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
Revert "fib_rules: fix error in backport of e9919a24d302 ("fib_rules: return 0...")"
Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"
rcu: locking and unlocking need to always be at least barriers
parisc: Use implicit space register selection for loading the coherence index of I/O pdirs
fuse: fallocate: fix return with locked inode
x86/power: Fix 'nosmt' vs hibernation triple fault during resume
MIPS: pistachio: Build uImage.gz by default
Revert "MIPS: perf: ath79: Fix perfcount IRQ assignment"
genwqe: Prevent an integer overflow in the ioctl
drm/gma500/cdv: Check vbt config bits when detecting lvds panels
drm/radeon: prefer lower reference dividers
drm/i915: Fix I915_EXEC_RING_MASK
TTY: serial_core, add ->install
fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock
fuse: Add FOPEN_STREAM to use stream_open()
ipv4: Define __ipv4_neigh_lookup_noref when CONFIG_INET is disabled
ethtool: check the return value of get_regs_len
Linux 4.9.181
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
6ccab84548
101 changed files with 1202 additions and 397 deletions
|
|
@ -37,7 +37,7 @@ from load_config import loadConfig
|
|||
extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain']
|
||||
|
||||
# The name of the math extension changed on Sphinx 1.4
|
||||
if major == 1 and minor > 3:
|
||||
if (major == 1 and minor > 3) or (major > 1):
|
||||
extensions.append("sphinx.ext.imgmath")
|
||||
else:
|
||||
extensions.append("sphinx.ext.pngmath")
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 180
|
||||
SUBLEVEL = 181
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -183,6 +183,12 @@ const char *get_system_type(void)
|
|||
return ath79_sys_type;
|
||||
}
|
||||
|
||||
int get_c0_perfcount_int(void)
|
||||
{
|
||||
return ATH79_MISC_IRQ(5);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(get_c0_perfcount_int);
|
||||
|
||||
unsigned int get_c0_compare_int(void)
|
||||
{
|
||||
return CP0_LEGACY_COMPARE_IRQ;
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@ cflags-$(CONFIG_MACH_PISTACHIO) += \
|
|||
-I$(srctree)/arch/mips/include/asm/mach-pistachio
|
||||
load-$(CONFIG_MACH_PISTACHIO) += 0xffffffff80400000
|
||||
zload-$(CONFIG_MACH_PISTACHIO) += 0xffffffff81000000
|
||||
all-$(CONFIG_MACH_PISTACHIO) := uImage.gz
|
||||
|
|
|
|||
|
|
@ -1800,6 +1800,7 @@ static int power_pmu_event_init(struct perf_event *event)
|
|||
int n;
|
||||
int err;
|
||||
struct cpu_hw_events *cpuhw;
|
||||
u64 bhrb_filter;
|
||||
|
||||
if (!ppmu)
|
||||
return -ENOENT;
|
||||
|
|
@ -1896,13 +1897,14 @@ static int power_pmu_event_init(struct perf_event *event)
|
|||
err = power_check_constraints(cpuhw, events, cflags, n + 1);
|
||||
|
||||
if (has_branch_stack(event)) {
|
||||
cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
|
||||
bhrb_filter = ppmu->bhrb_filter_map(
|
||||
event->attr.branch_sample_type);
|
||||
|
||||
if (cpuhw->bhrb_filter == -1) {
|
||||
if (bhrb_filter == -1) {
|
||||
put_cpu_var(cpu_hw_events);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
cpuhw->bhrb_filter = bhrb_filter;
|
||||
}
|
||||
|
||||
put_cpu_var(cpu_hw_events);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ enum {
|
|||
#define POWER8_MMCRA_IFM1 0x0000000040000000UL
|
||||
#define POWER8_MMCRA_IFM2 0x0000000080000000UL
|
||||
#define POWER8_MMCRA_IFM3 0x00000000C0000000UL
|
||||
#define POWER8_MMCRA_BHRB_MASK 0x00000000C0000000UL
|
||||
|
||||
/* Table of alternatives, sorted by column 0 */
|
||||
static const unsigned int event_alternatives[][MAX_ALT] = {
|
||||
|
|
@ -262,6 +263,8 @@ static u64 power8_bhrb_filter_map(u64 branch_sample_type)
|
|||
|
||||
static void power8_config_bhrb(u64 pmu_bhrb_filter)
|
||||
{
|
||||
pmu_bhrb_filter &= POWER8_MMCRA_BHRB_MASK;
|
||||
|
||||
/* Enable BHRB filter in PMU */
|
||||
mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ enum {
|
|||
#define POWER9_MMCRA_IFM1 0x0000000040000000UL
|
||||
#define POWER9_MMCRA_IFM2 0x0000000080000000UL
|
||||
#define POWER9_MMCRA_IFM3 0x00000000C0000000UL
|
||||
#define POWER9_MMCRA_BHRB_MASK 0x00000000C0000000UL
|
||||
|
||||
GENERIC_EVENT_ATTR(cpu-cycles, PM_CYC);
|
||||
GENERIC_EVENT_ATTR(stalled-cycles-frontend, PM_ICT_NOSLOT_CYC);
|
||||
|
|
@ -177,6 +178,8 @@ static u64 power9_bhrb_filter_map(u64 branch_sample_type)
|
|||
|
||||
static void power9_config_bhrb(u64 pmu_bhrb_filter)
|
||||
{
|
||||
pmu_bhrb_filter &= POWER9_MMCRA_BHRB_MASK;
|
||||
|
||||
/* Enable BHRB filter in PMU */
|
||||
mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ xcall_flush_tlb_kernel_range: /* 44 insns */
|
|||
sub %g7, %g1, %g3
|
||||
srlx %g3, 18, %g2
|
||||
brnz,pn %g2, 2f
|
||||
add %g2, 1, %g2
|
||||
sethi %hi(PAGE_SIZE), %g2
|
||||
sub %g3, %g2, %g3
|
||||
or %g1, 0x20, %g1 ! Nucleus
|
||||
1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP
|
||||
|
|
@ -750,7 +750,7 @@ __cheetah_xcall_flush_tlb_kernel_range: /* 44 insns */
|
|||
sub %g7, %g1, %g3
|
||||
srlx %g3, 18, %g2
|
||||
brnz,pn %g2, 2f
|
||||
add %g2, 1, %g2
|
||||
sethi %hi(PAGE_SIZE), %g2
|
||||
sub %g3, %g2, %g3
|
||||
or %g1, 0x20, %g1 ! Nucleus
|
||||
1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP
|
||||
|
|
|
|||
|
|
@ -292,7 +292,17 @@ int hibernate_resume_nonboot_cpu_disable(void)
|
|||
* address in its instruction pointer may not be possible to resolve
|
||||
* any more at that point (the page tables used by it previously may
|
||||
* have been overwritten by hibernate image data).
|
||||
*
|
||||
* First, make sure that we wake up all the potentially disabled SMT
|
||||
* threads which have been initially brought up and then put into
|
||||
* mwait/cpuidle sleep.
|
||||
* Those will be put to proper (not interfering with hibernation
|
||||
* resume) sleep afterwards, and the resumed kernel will decide itself
|
||||
* what to do with them.
|
||||
*/
|
||||
ret = cpuhp_smt_enable();
|
||||
if (ret)
|
||||
return ret;
|
||||
smp_ops.play_dead = resume_play_dead;
|
||||
ret = disable_nonboot_cpus();
|
||||
smp_ops.play_dead = play_dead;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/gfp.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
#include <asm/init.h>
|
||||
#include <asm/proto.h>
|
||||
|
|
@ -218,3 +219,35 @@ int arch_hibernation_header_restore(void *addr)
|
|||
restore_cr3 = rdr->cr3;
|
||||
return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
int arch_resume_nosmt(void)
|
||||
{
|
||||
int ret = 0;
|
||||
/*
|
||||
* We reached this while coming out of hibernation. This means
|
||||
* that SMT siblings are sleeping in hlt, as mwait is not safe
|
||||
* against control transition during resume (see comment in
|
||||
* hibernate_resume_nonboot_cpu_disable()).
|
||||
*
|
||||
* If the resumed kernel has SMT disabled, we have to take all the
|
||||
* SMT siblings out of hlt, and offline them again so that they
|
||||
* end up in mwait proper.
|
||||
*
|
||||
* Called with hotplug disabled.
|
||||
*/
|
||||
cpu_hotplug_enable();
|
||||
if (cpu_smt_control == CPU_SMT_DISABLED ||
|
||||
cpu_smt_control == CPU_SMT_FORCE_DISABLED) {
|
||||
enum cpuhp_smt_control old = cpu_smt_control;
|
||||
|
||||
ret = cpuhp_smt_enable();
|
||||
if (ret)
|
||||
goto out;
|
||||
ret = cpuhp_smt_disable(old);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
out:
|
||||
cpu_hotplug_disable();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,14 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/**
|
||||
* GHASH routines supporting VMX instructions on the Power 8
|
||||
*
|
||||
* Copyright (C) 2015 International Business Machines Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 only.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* Copyright (C) 2015, 2019 International Business Machines Inc.
|
||||
*
|
||||
* Author: Marcelo Henrique Cerri <mhcerri@br.ibm.com>
|
||||
*
|
||||
* Extended by Daniel Axtens <dja@axtens.net> to replace the fallback
|
||||
* mechanism. The new approach is based on arm64 code, which is:
|
||||
* Copyright (C) 2014 - 2018 Linaro Ltd. <ard.biesheuvel@linaro.org>
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
|
@ -39,71 +31,25 @@ void gcm_ghash_p8(u64 Xi[2], const u128 htable[16],
|
|||
const u8 *in, size_t len);
|
||||
|
||||
struct p8_ghash_ctx {
|
||||
/* key used by vector asm */
|
||||
u128 htable[16];
|
||||
struct crypto_shash *fallback;
|
||||
/* key used by software fallback */
|
||||
be128 key;
|
||||
};
|
||||
|
||||
struct p8_ghash_desc_ctx {
|
||||
u64 shash[2];
|
||||
u8 buffer[GHASH_DIGEST_SIZE];
|
||||
int bytes;
|
||||
struct shash_desc fallback_desc;
|
||||
};
|
||||
|
||||
static int p8_ghash_init_tfm(struct crypto_tfm *tfm)
|
||||
{
|
||||
const char *alg = "ghash-generic";
|
||||
struct crypto_shash *fallback;
|
||||
struct crypto_shash *shash_tfm = __crypto_shash_cast(tfm);
|
||||
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
|
||||
fallback = crypto_alloc_shash(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
|
||||
if (IS_ERR(fallback)) {
|
||||
printk(KERN_ERR
|
||||
"Failed to allocate transformation for '%s': %ld\n",
|
||||
alg, PTR_ERR(fallback));
|
||||
return PTR_ERR(fallback);
|
||||
}
|
||||
|
||||
crypto_shash_set_flags(fallback,
|
||||
crypto_shash_get_flags((struct crypto_shash
|
||||
*) tfm));
|
||||
|
||||
/* Check if the descsize defined in the algorithm is still enough. */
|
||||
if (shash_tfm->descsize < sizeof(struct p8_ghash_desc_ctx)
|
||||
+ crypto_shash_descsize(fallback)) {
|
||||
printk(KERN_ERR
|
||||
"Desc size of the fallback implementation (%s) does not match the expected value: %lu vs %u\n",
|
||||
alg,
|
||||
shash_tfm->descsize - sizeof(struct p8_ghash_desc_ctx),
|
||||
crypto_shash_descsize(fallback));
|
||||
return -EINVAL;
|
||||
}
|
||||
ctx->fallback = fallback;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void p8_ghash_exit_tfm(struct crypto_tfm *tfm)
|
||||
{
|
||||
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
|
||||
if (ctx->fallback) {
|
||||
crypto_free_shash(ctx->fallback);
|
||||
ctx->fallback = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int p8_ghash_init(struct shash_desc *desc)
|
||||
{
|
||||
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm));
|
||||
struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
dctx->bytes = 0;
|
||||
memset(dctx->shash, 0, GHASH_DIGEST_SIZE);
|
||||
dctx->fallback_desc.tfm = ctx->fallback;
|
||||
dctx->fallback_desc.flags = desc->flags;
|
||||
return crypto_shash_init(&dctx->fallback_desc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key,
|
||||
|
|
@ -121,7 +67,51 @@ static int p8_ghash_setkey(struct crypto_shash *tfm, const u8 *key,
|
|||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
return crypto_shash_setkey(ctx->fallback, key, keylen);
|
||||
|
||||
memcpy(&ctx->key, key, GHASH_BLOCK_SIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void __ghash_block(struct p8_ghash_ctx *ctx,
|
||||
struct p8_ghash_desc_ctx *dctx)
|
||||
{
|
||||
if (!IN_INTERRUPT) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
gcm_ghash_p8(dctx->shash, ctx->htable,
|
||||
dctx->buffer, GHASH_DIGEST_SIZE);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
} else {
|
||||
crypto_xor((u8 *)dctx->shash, dctx->buffer, GHASH_BLOCK_SIZE);
|
||||
gf128mul_lle((be128 *)dctx->shash, &ctx->key);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void __ghash_blocks(struct p8_ghash_ctx *ctx,
|
||||
struct p8_ghash_desc_ctx *dctx,
|
||||
const u8 *src, unsigned int srclen)
|
||||
{
|
||||
if (!IN_INTERRUPT) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
gcm_ghash_p8(dctx->shash, ctx->htable,
|
||||
src, srclen);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
} else {
|
||||
while (srclen >= GHASH_BLOCK_SIZE) {
|
||||
crypto_xor((u8 *)dctx->shash, src, GHASH_BLOCK_SIZE);
|
||||
gf128mul_lle((be128 *)dctx->shash, &ctx->key);
|
||||
srclen -= GHASH_BLOCK_SIZE;
|
||||
src += GHASH_BLOCK_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int p8_ghash_update(struct shash_desc *desc,
|
||||
|
|
@ -131,49 +121,33 @@ static int p8_ghash_update(struct shash_desc *desc,
|
|||
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm));
|
||||
struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
if (IN_INTERRUPT) {
|
||||
return crypto_shash_update(&dctx->fallback_desc, src,
|
||||
srclen);
|
||||
} else {
|
||||
if (dctx->bytes) {
|
||||
if (dctx->bytes + srclen < GHASH_DIGEST_SIZE) {
|
||||
memcpy(dctx->buffer + dctx->bytes, src,
|
||||
srclen);
|
||||
dctx->bytes += srclen;
|
||||
return 0;
|
||||
}
|
||||
if (dctx->bytes) {
|
||||
if (dctx->bytes + srclen < GHASH_DIGEST_SIZE) {
|
||||
memcpy(dctx->buffer + dctx->bytes, src,
|
||||
GHASH_DIGEST_SIZE - dctx->bytes);
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
gcm_ghash_p8(dctx->shash, ctx->htable,
|
||||
dctx->buffer, GHASH_DIGEST_SIZE);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
src += GHASH_DIGEST_SIZE - dctx->bytes;
|
||||
srclen -= GHASH_DIGEST_SIZE - dctx->bytes;
|
||||
dctx->bytes = 0;
|
||||
srclen);
|
||||
dctx->bytes += srclen;
|
||||
return 0;
|
||||
}
|
||||
len = srclen & ~(GHASH_DIGEST_SIZE - 1);
|
||||
if (len) {
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
gcm_ghash_p8(dctx->shash, ctx->htable, src, len);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
src += len;
|
||||
srclen -= len;
|
||||
}
|
||||
if (srclen) {
|
||||
memcpy(dctx->buffer, src, srclen);
|
||||
dctx->bytes = srclen;
|
||||
}
|
||||
return 0;
|
||||
memcpy(dctx->buffer + dctx->bytes, src,
|
||||
GHASH_DIGEST_SIZE - dctx->bytes);
|
||||
|
||||
__ghash_block(ctx, dctx);
|
||||
|
||||
src += GHASH_DIGEST_SIZE - dctx->bytes;
|
||||
srclen -= GHASH_DIGEST_SIZE - dctx->bytes;
|
||||
dctx->bytes = 0;
|
||||
}
|
||||
len = srclen & ~(GHASH_DIGEST_SIZE - 1);
|
||||
if (len) {
|
||||
__ghash_blocks(ctx, dctx, src, len);
|
||||
src += len;
|
||||
srclen -= len;
|
||||
}
|
||||
if (srclen) {
|
||||
memcpy(dctx->buffer, src, srclen);
|
||||
dctx->bytes = srclen;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int p8_ghash_final(struct shash_desc *desc, u8 *out)
|
||||
|
|
@ -182,25 +156,14 @@ static int p8_ghash_final(struct shash_desc *desc, u8 *out)
|
|||
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm));
|
||||
struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
if (IN_INTERRUPT) {
|
||||
return crypto_shash_final(&dctx->fallback_desc, out);
|
||||
} else {
|
||||
if (dctx->bytes) {
|
||||
for (i = dctx->bytes; i < GHASH_DIGEST_SIZE; i++)
|
||||
dctx->buffer[i] = 0;
|
||||
preempt_disable();
|
||||
pagefault_disable();
|
||||
enable_kernel_vsx();
|
||||
gcm_ghash_p8(dctx->shash, ctx->htable,
|
||||
dctx->buffer, GHASH_DIGEST_SIZE);
|
||||
disable_kernel_vsx();
|
||||
pagefault_enable();
|
||||
preempt_enable();
|
||||
dctx->bytes = 0;
|
||||
}
|
||||
memcpy(out, dctx->shash, GHASH_DIGEST_SIZE);
|
||||
return 0;
|
||||
if (dctx->bytes) {
|
||||
for (i = dctx->bytes; i < GHASH_DIGEST_SIZE; i++)
|
||||
dctx->buffer[i] = 0;
|
||||
__ghash_block(ctx, dctx);
|
||||
dctx->bytes = 0;
|
||||
}
|
||||
memcpy(out, dctx->shash, GHASH_DIGEST_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct shash_alg p8_ghash_alg = {
|
||||
|
|
@ -215,11 +178,9 @@ struct shash_alg p8_ghash_alg = {
|
|||
.cra_name = "ghash",
|
||||
.cra_driver_name = "p8_ghash",
|
||||
.cra_priority = 1000,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_SHASH | CRYPTO_ALG_NEED_FALLBACK,
|
||||
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
|
||||
.cra_blocksize = GHASH_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct p8_ghash_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = p8_ghash_init_tfm,
|
||||
.cra_exit = p8_ghash_exit_tfm,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "efistub.h"
|
||||
|
||||
|
||||
static int efi_get_secureboot(efi_system_table_t *sys_table_arg)
|
||||
{
|
||||
static efi_char16_t const sb_var_name[] = {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@
|
|||
|
||||
static unsigned long __chunk_size = EFI_READ_CHUNK_SIZE;
|
||||
|
||||
static int __section(.data) __nokaslr;
|
||||
|
||||
int __pure nokaslr(void)
|
||||
{
|
||||
return __nokaslr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow the platform to override the allocation granularity: this allows
|
||||
* systems that have the capability to run with a larger page size to deal
|
||||
|
|
@ -366,14 +373,6 @@ efi_status_t efi_parse_options(char const *cmdline)
|
|||
if (str == cmdline || (str && str > cmdline && *(str - 1) == ' '))
|
||||
__nokaslr = 1;
|
||||
|
||||
/*
|
||||
* Currently, the only efi= option we look for is 'nochunk', which
|
||||
* is intended to work around known issues on certain x86 UEFI
|
||||
* versions. So ignore for now on other architectures.
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_X86))
|
||||
return EFI_SUCCESS;
|
||||
|
||||
/*
|
||||
* If no EFI parameters were specified on the cmdline we've got
|
||||
* nothing to do.
|
||||
|
|
|
|||
|
|
@ -609,6 +609,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
|
|||
int pipe;
|
||||
u8 pin;
|
||||
|
||||
if (!dev_priv->lvds_enabled_in_vbt)
|
||||
return;
|
||||
|
||||
pin = GMBUS_PORT_PANEL;
|
||||
if (!lvds_is_present_in_vbt(dev, &pin)) {
|
||||
DRM_DEBUG_KMS("LVDS is not present in VBT\n");
|
||||
|
|
|
|||
|
|
@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
|
|||
if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
|
||||
dev_priv->edp.support = 1;
|
||||
|
||||
dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
|
||||
DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
|
||||
|
||||
/* This bit means to use 96Mhz for DPLL_A or not */
|
||||
if (driver->primary_lfp_id)
|
||||
dev_priv->dplla_96mhz = true;
|
||||
|
|
|
|||
|
|
@ -538,6 +538,7 @@ struct drm_psb_private {
|
|||
int lvds_ssc_freq;
|
||||
bool is_lvds_on;
|
||||
bool is_mipi_on;
|
||||
bool lvds_enabled_in_vbt;
|
||||
u32 mipi_ctrl_display;
|
||||
|
||||
unsigned int core_freq;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ struct nvkm_i2c_bus {
|
|||
struct mutex mutex;
|
||||
struct list_head head;
|
||||
struct i2c_adapter i2c;
|
||||
u8 enabled;
|
||||
};
|
||||
|
||||
int nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *);
|
||||
|
|
@ -56,6 +57,7 @@ struct nvkm_i2c_aux {
|
|||
struct mutex mutex;
|
||||
struct list_head head;
|
||||
struct i2c_adapter i2c;
|
||||
u8 enabled;
|
||||
|
||||
u32 intr;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -105,9 +105,15 @@ nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux)
|
|||
{
|
||||
struct nvkm_i2c_pad *pad = aux->pad;
|
||||
int ret;
|
||||
|
||||
AUX_TRACE(aux, "acquire");
|
||||
mutex_lock(&aux->mutex);
|
||||
ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_AUX);
|
||||
|
||||
if (aux->enabled)
|
||||
ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_AUX);
|
||||
else
|
||||
ret = -EIO;
|
||||
|
||||
if (ret)
|
||||
mutex_unlock(&aux->mutex);
|
||||
return ret;
|
||||
|
|
@ -141,6 +147,24 @@ nvkm_i2c_aux_del(struct nvkm_i2c_aux **paux)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nvkm_i2c_aux_init(struct nvkm_i2c_aux *aux)
|
||||
{
|
||||
AUX_TRACE(aux, "init");
|
||||
mutex_lock(&aux->mutex);
|
||||
aux->enabled = true;
|
||||
mutex_unlock(&aux->mutex);
|
||||
}
|
||||
|
||||
void
|
||||
nvkm_i2c_aux_fini(struct nvkm_i2c_aux *aux)
|
||||
{
|
||||
AUX_TRACE(aux, "fini");
|
||||
mutex_lock(&aux->mutex);
|
||||
aux->enabled = false;
|
||||
mutex_unlock(&aux->mutex);
|
||||
}
|
||||
|
||||
int
|
||||
nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *func,
|
||||
struct nvkm_i2c_pad *pad, int id,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ int nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
|
|||
int nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
|
||||
int id, struct nvkm_i2c_aux **);
|
||||
void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
|
||||
void nvkm_i2c_aux_init(struct nvkm_i2c_aux *);
|
||||
void nvkm_i2c_aux_fini(struct nvkm_i2c_aux *);
|
||||
int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
|
||||
u32 addr, u8 *data, u8 size);
|
||||
|
||||
|
|
|
|||
|
|
@ -160,8 +160,18 @@ nvkm_i2c_fini(struct nvkm_subdev *subdev, bool suspend)
|
|||
{
|
||||
struct nvkm_i2c *i2c = nvkm_i2c(subdev);
|
||||
struct nvkm_i2c_pad *pad;
|
||||
struct nvkm_i2c_bus *bus;
|
||||
struct nvkm_i2c_aux *aux;
|
||||
u32 mask;
|
||||
|
||||
list_for_each_entry(aux, &i2c->aux, head) {
|
||||
nvkm_i2c_aux_fini(aux);
|
||||
}
|
||||
|
||||
list_for_each_entry(bus, &i2c->bus, head) {
|
||||
nvkm_i2c_bus_fini(bus);
|
||||
}
|
||||
|
||||
if ((mask = (1 << i2c->func->aux) - 1), i2c->func->aux_stat) {
|
||||
i2c->func->aux_mask(i2c, NVKM_I2C_ANY, mask, 0);
|
||||
i2c->func->aux_stat(i2c, &mask, &mask, &mask, &mask);
|
||||
|
|
@ -180,6 +190,7 @@ nvkm_i2c_init(struct nvkm_subdev *subdev)
|
|||
struct nvkm_i2c *i2c = nvkm_i2c(subdev);
|
||||
struct nvkm_i2c_bus *bus;
|
||||
struct nvkm_i2c_pad *pad;
|
||||
struct nvkm_i2c_aux *aux;
|
||||
|
||||
list_for_each_entry(pad, &i2c->pad, head) {
|
||||
nvkm_i2c_pad_init(pad);
|
||||
|
|
@ -189,6 +200,10 @@ nvkm_i2c_init(struct nvkm_subdev *subdev)
|
|||
nvkm_i2c_bus_init(bus);
|
||||
}
|
||||
|
||||
list_for_each_entry(aux, &i2c->aux, head) {
|
||||
nvkm_i2c_aux_init(aux);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue