This is the 4.9.109 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlskwcMACgkQONu9yGCS
aT5ihQ/9Fibj8r1Q15wIpuhK6D7jraf89Y1Evmgx+EnOp68qf8IHLH3OI9uKV8Sl
q5Js5KSR2PZ4F81t6NU/D0wpf+At3lCHj1XcqR8gWA691drBKFrGGN5Rn53S7MhZ
mev1PVKyiN0p7UtLXcWuKfrVjNqOkMeh7zM1tM6UQnyLUUANw0X6wrB9E91GSr3+
lwz4+fK5BrEJxzlqs2SBIaV/OliPXgvKbBq6cPcCOvw51V2QElKeYEDOVD+056qq
qAAyuLbBFCV2uZpnFEQGJjdmWngxGcj93D5J5NcvAbDdkStRWtNmlSBmxsH9OjHc
uuEYOIui5dwS28GKgUUeVN+7k3vaYor62lwNaHZN2QO8QGdqoOY9g9T+P2zGwvtm
8lK5ddRErwIK9ch68roHpx/TK7LWE4v2/qViJUxwF99yuGHrmPxCuj+2x2aWr3j8
YiFgUJVbcYuF6P2tWmSLNVoGPJ+Gy0iCFRIOHdPYQd/EshHNa/s8FzmumlMWJXrf
8+3ybpU4qklbQhAAFAKaySCpRkF3EXDYss1WXlKEcn+l95aRM9T+hG4iT5IqLsq0
BE9V31nTVS8TYFlXeykB1F04Ya3vNzRhY3oHyfuX77nrmvK94IL6zGucYJVS7DcM
wBFvhdbHh+VgHB0vxeSA5BeAuT2KuDGp6vCYy/P9d1Ov/Tz4ZwY=
=ONJj
-----END PGP SIGNATURE-----
Merge 4.9.109 into android-4.9
Changes in 4.9.109
x86/fpu: Hard-disable lazy FPU mode
bonding: correctly update link status during mii-commit phase
bonding: fix active-backup transition
bonding: require speed/duplex only for 802.3ad, alb and tlb
nvme-pci: initialize queue memory before interrupts
af_key: Always verify length of provided sadb_key
x86/crypto, x86/fpu: Remove X86_FEATURE_EAGER_FPU #ifdef from the crc32c code
nvmet: Move serial number from controller to subsystem
nvmet: don't report 0-bytes in serial number
nvmet: don't overwrite identify sn/fr with 0-bytes
gpio: No NULL owner
KVM: x86: introduce linear_{read,write}_system
KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system
staging: android: ion: Switch to pr_warn_once in ion_buffer_destroy
usbip: vhci_sysfs: fix potential Spectre v1
usb-storage: Add support for FL_ALWAYS_SYNC flag in the UAS driver
usb-storage: Add compatibility quirk flags for G-Technologies G-Drive
usb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting
serial: sh-sci: Stop using printk format %pCr
tty/serial: atmel: use port->name as name in request_irq()
serial: samsung: fix maxburst parameter for DMA transactions
serial: 8250: omap: Fix idling of clocks for unused uarts
vmw_balloon: fixing double free when batching mode is off
tty: pl011: Avoid spuriously stuck-off interrupts
kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access
Input: goodix - add new ACPI id for GPD Win 2 touch screen
Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI ID
crypto: vmx - Remove overly verbose printk from AES init routines
crypto: omap-sham - fix memleak
perf: sync up x86/.../cpufeatures.h
Linux 4.9.109
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
a4230beab3
38 changed files with 273 additions and 244 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 108
|
||||
SUBLEVEL = 109
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -58,16 +58,11 @@
|
|||
asmlinkage unsigned int crc_pcl(const u8 *buffer, int len,
|
||||
unsigned int crc_init);
|
||||
static int crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_EAGERFPU;
|
||||
#if defined(X86_FEATURE_EAGER_FPU)
|
||||
#define set_pcl_breakeven_point() \
|
||||
do { \
|
||||
if (!use_eager_fpu()) \
|
||||
crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_NOEAGERFPU; \
|
||||
} while (0)
|
||||
#else
|
||||
#define set_pcl_breakeven_point() \
|
||||
(crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_NOEAGERFPU)
|
||||
#endif
|
||||
#endif /* CONFIG_X86_64 */
|
||||
|
||||
static u32 crc32c_intel_le_hw_byte(u32 crc, unsigned char const *data, size_t length)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
#define X86_FEATURE_EXTD_APICID ( 3*32+26) /* has extended APICID (8 bits) */
|
||||
#define X86_FEATURE_AMD_DCM ( 3*32+27) /* multi-node processor */
|
||||
#define X86_FEATURE_APERFMPERF ( 3*32+28) /* APERFMPERF */
|
||||
#define X86_FEATURE_EAGER_FPU ( 3*32+29) /* "eagerfpu" Non lazy FPU restore */
|
||||
/* free, was #define X86_FEATURE_EAGER_FPU ( 3*32+29) * "eagerfpu" Non lazy FPU restore */
|
||||
#define X86_FEATURE_NONSTOP_TSC_S3 ( 3*32+30) /* TSC doesn't stop in S3 state */
|
||||
|
||||
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ extern u64 fpu__get_supported_xfeatures_mask(void);
|
|||
*/
|
||||
static __always_inline __pure bool use_eager_fpu(void)
|
||||
{
|
||||
return static_cpu_has(X86_FEATURE_EAGER_FPU);
|
||||
return true;
|
||||
}
|
||||
|
||||
static __always_inline __pure bool use_xsaveopt(void)
|
||||
|
|
|
|||
|
|
@ -105,11 +105,12 @@ struct x86_emulate_ops {
|
|||
* @addr: [IN ] Linear address from which to read.
|
||||
* @val: [OUT] Value read from memory, zero-extended to 'u_long'.
|
||||
* @bytes: [IN ] Number of bytes to read from memory.
|
||||
* @system:[IN ] Whether the access is forced to be at CPL0.
|
||||
*/
|
||||
int (*read_std)(struct x86_emulate_ctxt *ctxt,
|
||||
unsigned long addr, void *val,
|
||||
unsigned int bytes,
|
||||
struct x86_exception *fault);
|
||||
struct x86_exception *fault, bool system);
|
||||
|
||||
/*
|
||||
* read_phys: Read bytes of standard (non-emulated/special) memory.
|
||||
|
|
@ -127,10 +128,11 @@ struct x86_emulate_ops {
|
|||
* @addr: [IN ] Linear address to which to write.
|
||||
* @val: [OUT] Value write to memory, zero-extended to 'u_long'.
|
||||
* @bytes: [IN ] Number of bytes to write to memory.
|
||||
* @system:[IN ] Whether the access is forced to be at CPL0.
|
||||
*/
|
||||
int (*write_std)(struct x86_emulate_ctxt *ctxt,
|
||||
unsigned long addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *fault);
|
||||
struct x86_exception *fault, bool system);
|
||||
/*
|
||||
* fetch: Read bytes of standard (non-emulated/special) memory.
|
||||
* Used for instruction fetch.
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@
|
|||
*/
|
||||
static void fpu__init_cpu_ctx_switch(void)
|
||||
{
|
||||
if (!boot_cpu_has(X86_FEATURE_EAGER_FPU))
|
||||
stts();
|
||||
else
|
||||
clts();
|
||||
clts();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -233,42 +230,6 @@ static void __init fpu__init_system_xstate_size_legacy(void)
|
|||
fpu_user_xstate_size = fpu_kernel_xstate_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* FPU context switching strategies:
|
||||
*
|
||||
* Against popular belief, we don't do lazy FPU saves, due to the
|
||||
* task migration complications it brings on SMP - we only do
|
||||
* lazy FPU restores.
|
||||
*
|
||||
* 'lazy' is the traditional strategy, which is based on setting
|
||||
* CR0::TS to 1 during context-switch (instead of doing a full
|
||||
* restore of the FPU state), which causes the first FPU instruction
|
||||
* after the context switch (whenever it is executed) to fault - at
|
||||
* which point we lazily restore the FPU state into FPU registers.
|
||||
*
|
||||
* Tasks are of course under no obligation to execute FPU instructions,
|
||||
* so it can easily happen that another context-switch occurs without
|
||||
* a single FPU instruction being executed. If we eventually switch
|
||||
* back to the original task (that still owns the FPU) then we have
|
||||
* not only saved the restores along the way, but we also have the
|
||||
* FPU ready to be used for the original task.
|
||||
*
|
||||
* 'lazy' is deprecated because it's almost never a performance win
|
||||
* and it's much more complicated than 'eager'.
|
||||
*
|
||||
* 'eager' switching is by default on all CPUs, there we switch the FPU
|
||||
* state during every context switch, regardless of whether the task
|
||||
* has used FPU instructions in that time slice or not. This is done
|
||||
* because modern FPU context saving instructions are able to optimize
|
||||
* state saving and restoration in hardware: they can detect both
|
||||
* unused and untouched FPU state and optimize accordingly.
|
||||
*
|
||||
* [ Note that even in 'lazy' mode we might optimize context switches
|
||||
* to use 'eager' restores, if we detect that a task is using the FPU
|
||||
* frequently. See the fpu->counter logic in fpu/internal.h for that. ]
|
||||
*/
|
||||
static enum { ENABLE, DISABLE } eagerfpu = ENABLE;
|
||||
|
||||
/*
|
||||
* Find supported xfeatures based on cpu features and command-line input.
|
||||
* This must be called after fpu__init_parse_early_param() is called and
|
||||
|
|
@ -276,40 +237,10 @@ static enum { ENABLE, DISABLE } eagerfpu = ENABLE;
|
|||
*/
|
||||
u64 __init fpu__get_supported_xfeatures_mask(void)
|
||||
{
|
||||
/* Support all xfeatures known to us */
|
||||
if (eagerfpu != DISABLE)
|
||||
return XCNTXT_MASK;
|
||||
|
||||
/* Warning of xfeatures being disabled for no eagerfpu mode */
|
||||
if (xfeatures_mask & XFEATURE_MASK_EAGER) {
|
||||
pr_err("x86/fpu: eagerfpu switching disabled, disabling the following xstate features: 0x%llx.\n",
|
||||
xfeatures_mask & XFEATURE_MASK_EAGER);
|
||||
}
|
||||
|
||||
/* Return a mask that masks out all features requiring eagerfpu mode */
|
||||
return ~XFEATURE_MASK_EAGER;
|
||||
return XCNTXT_MASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable features dependent on eagerfpu.
|
||||
*/
|
||||
static void __init fpu__clear_eager_fpu_features(void)
|
||||
{
|
||||
setup_clear_cpu_cap(X86_FEATURE_MPX);
|
||||
}
|
||||
|
||||
/*
|
||||
* Pick the FPU context switching strategy:
|
||||
*
|
||||
* When eagerfpu is AUTO or ENABLE, we ensure it is ENABLE if either of
|
||||
* the following is true:
|
||||
*
|
||||
* (1) the cpu has xsaveopt, as it has the optimization and doing eager
|
||||
* FPU switching has a relatively low cost compared to a plain xsave;
|
||||
* (2) the cpu has xsave features (e.g. MPX) that depend on eager FPU
|
||||
* switching. Should the kernel boot with noxsaveopt, we support MPX
|
||||
* with eager FPU switching at a higher cost.
|
||||
*/
|
||||
/* Legacy code to initialize eager fpu mode. */
|
||||
static void __init fpu__init_system_ctx_switch(void)
|
||||
{
|
||||
static bool on_boot_cpu __initdata = 1;
|
||||
|
|
@ -318,17 +249,6 @@ static void __init fpu__init_system_ctx_switch(void)
|
|||
on_boot_cpu = 0;
|
||||
|
||||
WARN_ON_FPU(current->thread.fpu.fpstate_active);
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_XSAVEOPT) && eagerfpu != DISABLE)
|
||||
eagerfpu = ENABLE;
|
||||
|
||||
if (xfeatures_mask & XFEATURE_MASK_EAGER)
|
||||
eagerfpu = ENABLE;
|
||||
|
||||
if (eagerfpu == ENABLE)
|
||||
setup_force_cpu_cap(X86_FEATURE_EAGER_FPU);
|
||||
|
||||
printk(KERN_INFO "x86/fpu: Using '%s' FPU context switches.\n", eagerfpu == ENABLE ? "eager" : "lazy");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -337,11 +257,6 @@ static void __init fpu__init_system_ctx_switch(void)
|
|||
*/
|
||||
static void __init fpu__init_parse_early_param(void)
|
||||
{
|
||||
if (cmdline_find_option_bool(boot_command_line, "eagerfpu=off")) {
|
||||
eagerfpu = DISABLE;
|
||||
fpu__clear_eager_fpu_features();
|
||||
}
|
||||
|
||||
if (cmdline_find_option_bool(boot_command_line, "no387"))
|
||||
setup_clear_cpu_cap(X86_FEATURE_FPU);
|
||||
|
||||
|
|
|
|||
|
|
@ -802,6 +802,19 @@ static inline int jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
|
|||
return assign_eip_near(ctxt, ctxt->_eip + rel);
|
||||
}
|
||||
|
||||
static int linear_read_system(struct x86_emulate_ctxt *ctxt, ulong linear,
|
||||
void *data, unsigned size)
|
||||
{
|
||||
return ctxt->ops->read_std(ctxt, linear, data, size, &ctxt->exception, true);
|
||||
}
|
||||
|
||||
static int linear_write_system(struct x86_emulate_ctxt *ctxt,
|
||||
ulong linear, void *data,
|
||||
unsigned int size)
|
||||
{
|
||||
return ctxt->ops->write_std(ctxt, linear, data, size, &ctxt->exception, true);
|
||||
}
|
||||
|
||||
static int segmented_read_std(struct x86_emulate_ctxt *ctxt,
|
||||
struct segmented_address addr,
|
||||
void *data,
|
||||
|
|
@ -813,7 +826,7 @@ static int segmented_read_std(struct x86_emulate_ctxt *ctxt,
|
|||
rc = linearize(ctxt, addr, size, false, &linear);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
return ctxt->ops->read_std(ctxt, linear, data, size, &ctxt->exception);
|
||||
return ctxt->ops->read_std(ctxt, linear, data, size, &ctxt->exception, false);
|
||||
}
|
||||
|
||||
static int segmented_write_std(struct x86_emulate_ctxt *ctxt,
|
||||
|
|
@ -827,7 +840,7 @@ static int segmented_write_std(struct x86_emulate_ctxt *ctxt,
|
|||
rc = linearize(ctxt, addr, size, true, &linear);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
return ctxt->ops->write_std(ctxt, linear, data, size, &ctxt->exception);
|
||||
return ctxt->ops->write_std(ctxt, linear, data, size, &ctxt->exception, false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1500,8 +1513,7 @@ static int read_interrupt_descriptor(struct x86_emulate_ctxt *ctxt,
|
|||
return emulate_gp(ctxt, index << 3 | 0x2);
|
||||
|
||||
addr = dt.address + index * 8;
|
||||
return ctxt->ops->read_std(ctxt, addr, desc, sizeof *desc,
|
||||
&ctxt->exception);
|
||||
return linear_read_system(ctxt, addr, desc, sizeof *desc);
|
||||
}
|
||||
|
||||
static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt,
|
||||
|
|
@ -1564,8 +1576,7 @@ static int read_segment_descriptor(struct x86_emulate_ctxt *ctxt,
|
|||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
|
||||
return ctxt->ops->read_std(ctxt, *desc_addr_p, desc, sizeof(*desc),
|
||||
&ctxt->exception);
|
||||
return linear_read_system(ctxt, *desc_addr_p, desc, sizeof(*desc));
|
||||
}
|
||||
|
||||
/* allowed just for 8 bytes segments */
|
||||
|
|
@ -1579,8 +1590,7 @@ static int write_segment_descriptor(struct x86_emulate_ctxt *ctxt,
|
|||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
|
||||
return ctxt->ops->write_std(ctxt, addr, desc, sizeof *desc,
|
||||
&ctxt->exception);
|
||||
return linear_write_system(ctxt, addr, desc, sizeof *desc);
|
||||
}
|
||||
|
||||
static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
|
||||
|
|
@ -1741,8 +1751,7 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
|
|||
return ret;
|
||||
}
|
||||
} else if (ctxt->mode == X86EMUL_MODE_PROT64) {
|
||||
ret = ctxt->ops->read_std(ctxt, desc_addr+8, &base3,
|
||||
sizeof(base3), &ctxt->exception);
|
||||
ret = linear_read_system(ctxt, desc_addr+8, &base3, sizeof(base3));
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
if (is_noncanonical_address(get_desc_base(&seg_desc) |
|
||||
|
|
@ -2055,11 +2064,11 @@ static int __emulate_int_real(struct x86_emulate_ctxt *ctxt, int irq)
|
|||
eip_addr = dt.address + (irq << 2);
|
||||
cs_addr = dt.address + (irq << 2) + 2;
|
||||
|
||||
rc = ops->read_std(ctxt, cs_addr, &cs, 2, &ctxt->exception);
|
||||
rc = linear_read_system(ctxt, cs_addr, &cs, 2);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
|
||||
rc = ops->read_std(ctxt, eip_addr, &eip, 2, &ctxt->exception);
|
||||
rc = linear_read_system(ctxt, eip_addr, &eip, 2);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
return rc;
|
||||
|
||||
|
|
@ -2903,12 +2912,12 @@ static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt,
|
|||
#ifdef CONFIG_X86_64
|
||||
base |= ((u64)base3) << 32;
|
||||
#endif
|
||||
r = ops->read_std(ctxt, base + 102, &io_bitmap_ptr, 2, NULL);
|
||||
r = ops->read_std(ctxt, base + 102, &io_bitmap_ptr, 2, NULL, true);
|
||||
if (r != X86EMUL_CONTINUE)
|
||||
return false;
|
||||
if (io_bitmap_ptr + port/8 > desc_limit_scaled(&tr_seg))
|
||||
return false;
|
||||
r = ops->read_std(ctxt, base + io_bitmap_ptr + port/8, &perm, 2, NULL);
|
||||
r = ops->read_std(ctxt, base + io_bitmap_ptr + port/8, &perm, 2, NULL, true);
|
||||
if (r != X86EMUL_CONTINUE)
|
||||
return false;
|
||||
if ((perm >> bit_idx) & mask)
|
||||
|
|
@ -3037,35 +3046,30 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt,
|
|||
u16 tss_selector, u16 old_tss_sel,
|
||||
ulong old_tss_base, struct desc_struct *new_desc)
|
||||
{
|
||||
const struct x86_emulate_ops *ops = ctxt->ops;
|
||||
struct tss_segment_16 tss_seg;
|
||||
int ret;
|
||||
u32 new_tss_base = get_desc_base(new_desc);
|
||||
|
||||
ret = ops->read_std(ctxt, old_tss_base, &tss_seg, sizeof tss_seg,
|
||||
&ctxt->exception);
|
||||
ret = linear_read_system(ctxt, old_tss_base, &tss_seg, sizeof tss_seg);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
save_state_to_tss16(ctxt, &tss_seg);
|
||||
|
||||
ret = ops->write_std(ctxt, old_tss_base, &tss_seg, sizeof tss_seg,
|
||||
&ctxt->exception);
|
||||
ret = linear_write_system(ctxt, old_tss_base, &tss_seg, sizeof tss_seg);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
ret = ops->read_std(ctxt, new_tss_base, &tss_seg, sizeof tss_seg,
|
||||
&ctxt->exception);
|
||||
ret = linear_read_system(ctxt, new_tss_base, &tss_seg, sizeof tss_seg);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
if (old_tss_sel != 0xffff) {
|
||||
tss_seg.prev_task_link = old_tss_sel;
|
||||
|
||||
ret = ops->write_std(ctxt, new_tss_base,
|
||||
&tss_seg.prev_task_link,
|
||||
sizeof tss_seg.prev_task_link,
|
||||
&ctxt->exception);
|
||||
ret = linear_write_system(ctxt, new_tss_base,
|
||||
&tss_seg.prev_task_link,
|
||||
sizeof tss_seg.prev_task_link);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -3181,38 +3185,34 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,
|
|||
u16 tss_selector, u16 old_tss_sel,
|
||||
ulong old_tss_base, struct desc_struct *new_desc)
|
||||
{
|
||||
const struct x86_emulate_ops *ops = ctxt->ops;
|
||||
struct tss_segment_32 tss_seg;
|
||||
int ret;
|
||||
u32 new_tss_base = get_desc_base(new_desc);
|
||||
u32 eip_offset = offsetof(struct tss_segment_32, eip);
|
||||
u32 ldt_sel_offset = offsetof(struct tss_segment_32, ldt_selector);
|
||||
|
||||
ret = ops->read_std(ctxt, old_tss_base, &tss_seg, sizeof tss_seg,
|
||||
&ctxt->exception);
|
||||
ret = linear_read_system(ctxt, old_tss_base, &tss_seg, sizeof tss_seg);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
save_state_to_tss32(ctxt, &tss_seg);
|
||||
|
||||
/* Only GP registers and segment selectors are saved */
|
||||
ret = ops->write_std(ctxt, old_tss_base + eip_offset, &tss_seg.eip,
|
||||
ldt_sel_offset - eip_offset, &ctxt->exception);
|
||||
ret = linear_write_system(ctxt, old_tss_base + eip_offset, &tss_seg.eip,
|
||||
ldt_sel_offset - eip_offset);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
ret = ops->read_std(ctxt, new_tss_base, &tss_seg, sizeof tss_seg,
|
||||
&ctxt->exception);
|
||||
ret = linear_read_system(ctxt, new_tss_base, &tss_seg, sizeof tss_seg);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
|
||||
if (old_tss_sel != 0xffff) {
|
||||
tss_seg.prev_task_link = old_tss_sel;
|
||||
|
||||
ret = ops->write_std(ctxt, new_tss_base,
|
||||
&tss_seg.prev_task_link,
|
||||
sizeof tss_seg.prev_task_link,
|
||||
&ctxt->exception);
|
||||
ret = linear_write_system(ctxt, new_tss_base,
|
||||
&tss_seg.prev_task_link,
|
||||
sizeof tss_seg.prev_task_link);
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6928,8 +6928,7 @@ static int nested_vmx_check_vmptr(struct kvm_vcpu *vcpu, int exit_reason,
|
|||
vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))
|
||||
return 1;
|
||||
|
||||
if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, &vmptr,
|
||||
sizeof(vmptr), &e)) {
|
||||
if (kvm_read_guest_virt(vcpu, gva, &vmptr, sizeof(vmptr), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -7469,8 +7468,8 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
|
|||
vmx_instruction_info, true, &gva))
|
||||
return 1;
|
||||
/* _system ok, as nested_vmx_check_permission verified cpl=0 */
|
||||
kvm_write_guest_virt_system(&vcpu->arch.emulate_ctxt, gva,
|
||||
&field_value, (is_long_mode(vcpu) ? 8 : 4), NULL);
|
||||
kvm_write_guest_virt_system(vcpu, gva, &field_value,
|
||||
(is_long_mode(vcpu) ? 8 : 4), NULL);
|
||||
}
|
||||
|
||||
nested_vmx_succeed(vcpu);
|
||||
|
|
@ -7505,8 +7504,8 @@ static int handle_vmwrite(struct kvm_vcpu *vcpu)
|
|||
if (get_vmx_mem_address(vcpu, exit_qualification,
|
||||
vmx_instruction_info, false, &gva))
|
||||
return 1;
|
||||
if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva,
|
||||
&field_value, (is_64_bit_mode(vcpu) ? 8 : 4), &e)) {
|
||||
if (kvm_read_guest_virt(vcpu, gva, &field_value,
|
||||
(is_64_bit_mode(vcpu) ? 8 : 4), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -7603,9 +7602,9 @@ static int handle_vmptrst(struct kvm_vcpu *vcpu)
|
|||
vmx_instruction_info, true, &vmcs_gva))
|
||||
return 1;
|
||||
/* ok to use *_system, as nested_vmx_check_permission verified cpl=0 */
|
||||
if (kvm_write_guest_virt_system(&vcpu->arch.emulate_ctxt, vmcs_gva,
|
||||
(void *)&to_vmx(vcpu)->nested.current_vmptr,
|
||||
sizeof(u64), &e)) {
|
||||
if (kvm_write_guest_virt_system(vcpu, vmcs_gva,
|
||||
(void *)&to_vmx(vcpu)->nested.current_vmptr,
|
||||
sizeof(u64), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -7659,8 +7658,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
|
|||
if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),
|
||||
vmx_instruction_info, false, &gva))
|
||||
return 1;
|
||||
if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, &operand,
|
||||
sizeof(operand), &e)) {
|
||||
if (kvm_read_guest_virt(vcpu, gva, &operand, sizeof(operand), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -7723,8 +7721,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
|
|||
if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),
|
||||
vmx_instruction_info, false, &gva))
|
||||
return 1;
|
||||
if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, &vpid,
|
||||
sizeof(u32), &e)) {
|
||||
if (kvm_read_guest_virt(vcpu, gva, &vpid, sizeof(u32), &e)) {
|
||||
kvm_inject_page_fault(vcpu, &e);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4395,11 +4395,10 @@ static int kvm_fetch_guest_virt(struct x86_emulate_ctxt *ctxt,
|
|||
return X86EMUL_CONTINUE;
|
||||
}
|
||||
|
||||
int kvm_read_guest_virt(struct x86_emulate_ctxt *ctxt,
|
||||
int kvm_read_guest_virt(struct kvm_vcpu *vcpu,
|
||||
gva_t addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *exception)
|
||||
{
|
||||
struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
|
||||
u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0;
|
||||
|
||||
return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access,
|
||||
|
|
@ -4407,12 +4406,17 @@ int kvm_read_guest_virt(struct x86_emulate_ctxt *ctxt,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_read_guest_virt);
|
||||
|
||||
static int kvm_read_guest_virt_system(struct x86_emulate_ctxt *ctxt,
|
||||
gva_t addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *exception)
|
||||
static int emulator_read_std(struct x86_emulate_ctxt *ctxt,
|
||||
gva_t addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *exception, bool system)
|
||||
{
|
||||
struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
|
||||
return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, 0, exception);
|
||||
u32 access = 0;
|
||||
|
||||
if (!system && kvm_x86_ops->get_cpl(vcpu) == 3)
|
||||
access |= PFERR_USER_MASK;
|
||||
|
||||
return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access, exception);
|
||||
}
|
||||
|
||||
static int kvm_read_guest_phys_system(struct x86_emulate_ctxt *ctxt,
|
||||
|
|
@ -4424,18 +4428,16 @@ static int kvm_read_guest_phys_system(struct x86_emulate_ctxt *ctxt,
|
|||
return r < 0 ? X86EMUL_IO_NEEDED : X86EMUL_CONTINUE;
|
||||
}
|
||||
|
||||
int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
|
||||
gva_t addr, void *val,
|
||||
unsigned int bytes,
|
||||
struct x86_exception *exception)
|
||||
static int kvm_write_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
|
||||
struct kvm_vcpu *vcpu, u32 access,
|
||||
struct x86_exception *exception)
|
||||
{
|
||||
struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
|
||||
void *data = val;
|
||||
int r = X86EMUL_CONTINUE;
|
||||
|
||||
while (bytes) {
|
||||
gpa_t gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, addr,
|
||||
PFERR_WRITE_MASK,
|
||||
access,
|
||||
exception);
|
||||
unsigned offset = addr & (PAGE_SIZE-1);
|
||||
unsigned towrite = min(bytes, (unsigned)PAGE_SIZE - offset);
|
||||
|
|
@ -4456,6 +4458,27 @@ int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
|
|||
out:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int emulator_write_std(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val,
|
||||
unsigned int bytes, struct x86_exception *exception,
|
||||
bool system)
|
||||
{
|
||||
struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
|
||||
u32 access = PFERR_WRITE_MASK;
|
||||
|
||||
if (!system && kvm_x86_ops->get_cpl(vcpu) == 3)
|
||||
access |= PFERR_USER_MASK;
|
||||
|
||||
return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
|
||||
access, exception);
|
||||
}
|
||||
|
||||
int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,
|
||||
unsigned int bytes, struct x86_exception *exception)
|
||||
{
|
||||
return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
|
||||
PFERR_WRITE_MASK, exception);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_write_guest_virt_system);
|
||||
|
||||
static int vcpu_mmio_gva_to_gpa(struct kvm_vcpu *vcpu, unsigned long gva,
|
||||
|
|
@ -5180,8 +5203,8 @@ static void emulator_set_hflags(struct x86_emulate_ctxt *ctxt, unsigned emul_fla
|
|||
static const struct x86_emulate_ops emulate_ops = {
|
||||
.read_gpr = emulator_read_gpr,
|
||||
.write_gpr = emulator_write_gpr,
|
||||
.read_std = kvm_read_guest_virt_system,
|
||||
.write_std = kvm_write_guest_virt_system,
|
||||
.read_std = emulator_read_std,
|
||||
.write_std = emulator_write_std,
|
||||
.read_phys = kvm_read_guest_phys_system,
|
||||
.fetch = kvm_fetch_guest_virt,
|
||||
.read_emulated = emulator_read_emulated,
|
||||
|
|
|
|||
|
|
@ -161,11 +161,11 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);
|
|||
void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr);
|
||||
u64 get_kvmclock_ns(struct kvm *kvm);
|
||||
|
||||
int kvm_read_guest_virt(struct x86_emulate_ctxt *ctxt,
|
||||
int kvm_read_guest_virt(struct kvm_vcpu *vcpu,
|
||||
gva_t addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *exception);
|
||||
|
||||
int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
|
||||
int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu,
|
||||
gva_t addr, void *val, unsigned int bytes,
|
||||
struct x86_exception *exception);
|
||||
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
|
|||
|
||||
if (test_bit(FLAGS_SGS_COPIED, &dd->flags))
|
||||
free_pages((unsigned long)sg_virt(ctx->sg),
|
||||
get_order(ctx->sg->length));
|
||||
get_order(ctx->sg->length + ctx->bufcnt));
|
||||
|
||||
if (test_bit(FLAGS_SGS_ALLOCED, &dd->flags))
|
||||
kfree(ctx->sg);
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ static int p8_aes_init(struct crypto_tfm *tfm)
|
|||
alg, PTR_ERR(fallback));
|
||||
return PTR_ERR(fallback);
|
||||
}
|
||||
printk(KERN_INFO "Using '%s' as fallback implementation.\n",
|
||||
crypto_tfm_alg_driver_name((struct crypto_tfm *) fallback));
|
||||
|
||||
crypto_cipher_set_flags(fallback,
|
||||
crypto_cipher_get_flags((struct
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@ static int p8_aes_cbc_init(struct crypto_tfm *tfm)
|
|||
alg, PTR_ERR(fallback));
|
||||
return PTR_ERR(fallback);
|
||||
}
|
||||
printk(KERN_INFO "Using '%s' as fallback implementation.\n",
|
||||
crypto_tfm_alg_driver_name((struct crypto_tfm *) fallback));
|
||||
|
||||
crypto_blkcipher_set_flags(
|
||||
fallback,
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ static int p8_aes_ctr_init(struct crypto_tfm *tfm)
|
|||
alg, PTR_ERR(fallback));
|
||||
return PTR_ERR(fallback);
|
||||
}
|
||||
printk(KERN_INFO "Using '%s' as fallback implementation.\n",
|
||||
crypto_tfm_alg_driver_name((struct crypto_tfm *) fallback));
|
||||
|
||||
crypto_blkcipher_set_flags(
|
||||
fallback,
|
||||
|
|
|
|||
|
|
@ -64,8 +64,6 @@ static int p8_ghash_init_tfm(struct crypto_tfm *tfm)
|
|||
alg, PTR_ERR(fallback));
|
||||
return PTR_ERR(fallback);
|
||||
}
|
||||
printk(KERN_INFO "Using '%s' as fallback implementation.\n",
|
||||
crypto_tfm_alg_driver_name(crypto_shash_tfm(fallback)));
|
||||
|
||||
crypto_shash_set_flags(fallback,
|
||||
crypto_shash_get_flags((struct crypto_shash
|
||||
|
|
|
|||
|
|
@ -3204,6 +3204,8 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
|||
struct gpio_desc *desc = NULL;
|
||||
int status;
|
||||
enum gpio_lookup_flags lookupflags = 0;
|
||||
/* Maybe we have a device name, maybe not */
|
||||
const char *devname = dev ? dev_name(dev) : "?";
|
||||
|
||||
dev_dbg(dev, "GPIO lookup for consumer %s\n", con_id);
|
||||
|
||||
|
|
@ -3232,8 +3234,11 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
|||
return desc;
|
||||
}
|
||||
|
||||
/* If a connection label was passed use that, else use the device name as label */
|
||||
status = gpiod_request(desc, con_id ? con_id : dev_name(dev));
|
||||
/*
|
||||
* If a connection label was passed use that, else attempt to use
|
||||
* the device name as label
|
||||
*/
|
||||
status = gpiod_request(desc, con_id ? con_id : devname);
|
||||
if (status < 0)
|
||||
return ERR_PTR(status);
|
||||
|
||||
|
|
|
|||
|
|
@ -1249,6 +1249,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
|
|||
{ "ELAN060B", 0 },
|
||||
{ "ELAN060C", 0 },
|
||||
{ "ELAN0611", 0 },
|
||||
{ "ELAN0612", 0 },
|
||||
{ "ELAN1000", 0 },
|
||||
{ }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -858,6 +858,7 @@ MODULE_DEVICE_TABLE(i2c, goodix_ts_id);
|
|||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id goodix_acpi_match[] = {
|
||||
{ "GDIX1001", 0 },
|
||||
{ "GDIX1002", 0 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
|
||||
|
|
|
|||
|
|
@ -576,15 +576,9 @@ static void vmballoon_pop(struct vmballoon *b)
|
|||
}
|
||||
}
|
||||
|
||||
if (b->batch_page) {
|
||||
vunmap(b->batch_page);
|
||||
b->batch_page = NULL;
|
||||
}
|
||||
|
||||
if (b->page) {
|
||||
__free_page(b->page);
|
||||
b->page = NULL;
|
||||
}
|
||||
/* Clearing the batch_page unconditionally has no adverse effect */
|
||||
free_page((unsigned long)b->batch_page);
|
||||
b->batch_page = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -991,16 +985,13 @@ static const struct vmballoon_ops vmballoon_batched_ops = {
|
|||
|
||||
static bool vmballoon_init_batching(struct vmballoon *b)
|
||||
{
|
||||
b->page = alloc_page(VMW_PAGE_ALLOC_NOSLEEP);
|
||||
if (!b->page)
|
||||
struct page *page;
|
||||
|
||||
page = alloc_page(GFP_KERNEL | __GFP_ZERO);
|
||||
if (!page)
|
||||
return false;
|
||||
|
||||
b->batch_page = vmap(&b->page, 1, VM_MAP, PAGE_KERNEL);
|
||||
if (!b->batch_page) {
|
||||
__free_page(b->page);
|
||||
return false;
|
||||
}
|
||||
|
||||
b->batch_page = page_address(page);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -384,20 +384,15 @@ static int bond_update_speed_duplex(struct slave *slave)
|
|||
slave->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
res = __ethtool_get_link_ksettings(slave_dev, &ecmd);
|
||||
if (res < 0) {
|
||||
slave->link = BOND_LINK_DOWN;
|
||||
if (res < 0)
|
||||
return 1;
|
||||
}
|
||||
if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1)) {
|
||||
slave->link = BOND_LINK_DOWN;
|
||||
if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1))
|
||||
return 1;
|
||||
}
|
||||
switch (ecmd.base.duplex) {
|
||||
case DUPLEX_FULL:
|
||||
case DUPLEX_HALF:
|
||||
break;
|
||||
default:
|
||||
slave->link = BOND_LINK_DOWN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -1536,7 +1531,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
|||
new_slave->delay = 0;
|
||||
new_slave->link_failure_count = 0;
|
||||
|
||||
bond_update_speed_duplex(new_slave);
|
||||
if (bond_update_speed_duplex(new_slave) &&
|
||||
bond_needs_speed_duplex(bond))
|
||||
new_slave->link = BOND_LINK_DOWN;
|
||||
|
||||
new_slave->last_rx = jiffies -
|
||||
(msecs_to_jiffies(bond->params.arp_interval) + 1);
|
||||
|
|
@ -2140,7 +2137,14 @@ static void bond_miimon_commit(struct bonding *bond)
|
|||
continue;
|
||||
|
||||
case BOND_LINK_UP:
|
||||
bond_update_speed_duplex(slave);
|
||||
if (bond_update_speed_duplex(slave) &&
|
||||
bond_needs_speed_duplex(bond)) {
|
||||
slave->link = BOND_LINK_DOWN;
|
||||
netdev_warn(bond->dev,
|
||||
"failed to get link speed/duplex for %s\n",
|
||||
slave->dev->name);
|
||||
continue;
|
||||
}
|
||||
bond_set_slave_link_state(slave, BOND_LINK_UP,
|
||||
BOND_SLAVE_NOTIFY_NOW);
|
||||
slave->last_link_up = jiffies;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue