Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
17c10ff
xfrm: delete x->tunnel as we delete x
qsn Jul 29, 2025
e4b7d37
Revert "xfrm: destroy xfrm_state synchronously on net exit path"
qsn Jul 29, 2025
e36f227
xfrm: also call xfrm_state_delete_tunnel at destroy time for states t…
qsn Dec 4, 2025
cbda4dc
xfrm: flush all states in xfrm_state_fini
qsn Aug 4, 2025
ee5e5e3
leds: spi-byte: Use devm_led_classdev_register_ext()
stklcode Feb 4, 2024
a18bea4
Documentation: process: Also mention Sasha Levin as stable tree maint…
bagasme Oct 22, 2025
036001f
jbd2: avoid bug_on in jbd2_journal_get_create_access() when file syst…
Oct 25, 2025
c37706a
ext4: refresh inline data size before write operations
deepanshu406 Oct 20, 2025
b48fe87
ksmbd: ipc: fix use-after-free in ipc_msg_send_request
llllIIIllll Nov 26, 2025
af2ebdf
locking/spinlock/debug: Fix data-race in do_raw_write_lock
ccpalex Sep 19, 2025
c9de1b0
ext4: add i_data_sem protection in ext4_destroy_inline_data_nolock()
Nov 4, 2025
00b50cd
comedi: pcl818: fix null-ptr-deref in pcl818_ai_cancel()
Oct 23, 2025
86f0669
KVM: SVM: Don't skip unrelated instruction if INT3/INTO is replaced
osandov Nov 4, 2025
de0b9d9
USB: serial: option: add Foxconn T99W760
SlarkXiao Nov 18, 2025
7e60127
USB: serial: option: add Telit Cinterion FE910C04 new compositions
fabio-porcedda Nov 26, 2025
06ca3d7
USB: serial: option: move Telit 0x10c7 composition in the right place
fabio-porcedda Nov 26, 2025
81589c2
USB: serial: ftdi_sio: match on interface number for jtag
jhovold Nov 10, 2025
d7fc4a0
serial: add support of CPCI cards
Nov 10, 2025
b98949a
USB: serial: belkin_sa: fix TIOCMBIS and TIOCMBIC
jhovold Oct 22, 2025
6a7cda1
USB: serial: kobil_sct: fix TIOCMBIS and TIOCMBIC
jhovold Oct 22, 2025
7522497
ftrace: bpf: Fix IPMODIFY + DIRECT in modify_ftrace_direct()
liu-song-6 Oct 27, 2025
8668bf9
spi: xilinx: increase number of retries before declaring stall
agamez Nov 6, 2025
dad6000
spi: imx: keep dma request disabled before dma transfer setup
Oct 24, 2025
aa4209b
drm/vmwgfx: Use kref in vmw_bo_dirty
en4bz Oct 30, 2025
fa2866c
Bluetooth: btrtl: Avoid loading the config file on security chips
rtkbt-max Nov 5, 2025
ac46d5b
smb: fix invalid username check in smb3_fs_context_parse_param()
sunichi Nov 11, 2025
392e5e2
ALSA: usb-audio: Add native DSD quirks for PureAudio DAC series
bruce-awareit Nov 14, 2025
74a469e
bfs: Reconstruct file type when loading from disk
Oct 23, 2025
29be967
HID: hid-input: Extend Elan ignore battery quirk to USB
superm1 Oct 30, 2025
5aa6c72
nvme: fix admin request_queue lifetime
keithbusch Nov 4, 2025
5ad1af3
pinctrl: qcom: msm: Fix deadlock in pinmux configuration
ptalari27 Nov 10, 2025
10a5b38
platform/x86: acer-wmi: Ignore backlight event
Wer-Wolf Nov 17, 2025
c0d3448
HID: apple: Add SONiX AK870 PRO to non_apple_keyboards quirk list
AprilGrimoire Oct 22, 2025
11eded1
platform/x86: huawei-wmi: add keys for HONOR models
st0nie Oct 29, 2025
48deab5
platform/x86/amd: pmc: Add Lenovo Legion Go 2 to pmc quirk list
antheas Oct 8, 2025
9b3df72
platform/x86/amd/pmc: Add spurious_8042 to Xbox Ally
antheas Oct 24, 2025
b294052
HID: elecom: Add support for ELECOM M-XT3URBK (018F)
Nov 3, 2025
a170203
LoongArch: Mask all interrupts during kexec/kdump
chenhuacai Nov 20, 2025
36efc5d
samples: work around glibc redefining some of our defines wrong
torvalds Nov 21, 2025
feff464
wifi: rtw88: Add USB ID 2001:3329 for D-Link AC13U rev. A1
a5a5aa555oo Sep 29, 2025
581b4d7
comedi: c6xdigio: Fix invalid PNP driver unregistration
ian-abbott Oct 23, 2025
34f2755
comedi: multiq3: sanitize config options in multiq3_attach()
Oct 23, 2025
3683402
comedi: check device's attached status in compat ioctls
Oct 23, 2025
62dc320
staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser
cyberkunju Nov 20, 2025
16bfdda
staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing
cyberkunju Nov 20, 2025
12445d4
staging: rtl8723bs: fix out-of-bounds read in OnBeacon ESR IE parsing
cyberkunju Nov 20, 2025
19ca80a
smack: fix bug: unprivileged task can create labels
goongas Jun 16, 2025
26ebb25
gpu: host1x: Fix race in syncpt alloc/free
MainakNvidia Jul 7, 2025
d7827d0
drm/panel: visionox-rm69299: Don't clear all mode flags
agx Sep 10, 2025
a42c33f
drm/vgem-fence: Fix potential deadlock on release
jkrzyszt-intel Sep 26, 2025
52b8adb
USB: Fix descriptor count when handling invalid MBIM extended descriptor
pip-izony Sep 28, 2025
eba0c46
clk: renesas: cpg-mssr: Add missing 1ms delay into reset toggle callback
Sep 18, 2025
4f9cb3a
clk: renesas: rzg2l: Simplify the logic in rzg2l_mod_clock_endisable()
claudiubeznea Sep 12, 2023
4bc5c9a
clk: renesas: rzg2l: Remove critical area
claudiubeznea Sep 29, 2023
c432eb4
clk: renesas: rzg2l: Use %x format specifier to print CLK_ON_R()
claudiubeznea Oct 10, 2023
a30e1f7
clk: renesas: Use str_on_off() helper
geertu Apr 28, 2025
f53fbdb
clk: renesas: Pass sub struct of cpg_mssr_priv to cpg_clk_register
May 15, 2025
3706d14
clk: renesas: cpg-mssr: Read back reset registers to assure values la…
Sep 22, 2025
d47c0b6
HID: logitech-hidpp: Do not assume FAP in hidpp_send_message_sync()
MavChtz Oct 2, 2025
582db03
objtool: Fix standalone --hacks=jump_label
dylanbhatch Sep 23, 2025
87d8dc7
objtool: Fix weak symbol detection
jpoimboe Sep 17, 2025
532b87d
irqchip/irq-bcm7038-l1: Fix section mismatch
jhovold Oct 13, 2025
039e1c1
irqchip/irq-bcm7120-l2: Fix section mismatch
jhovold Oct 13, 2025
6cafff7
irqchip/irq-brcmstb-l2: Fix section mismatch
jhovold Oct 13, 2025
4c14bc1
irqchip/imx-mu-msi: Fix section mismatch
jhovold Oct 13, 2025
7277053
irqchip/qcom-irq-combiner: Fix section mismatch
jhovold Oct 13, 2025
28047c0
crypto: authenc - Correctly pass EINPROGRESS back up to the caller
herbertx Sep 24, 2025
fafbb21
ntfs3: fix uninit memory after failed mi_read in mi_format_new
rpthibeault Oct 12, 2025
dd5c15d
ntfs3: Fix uninit buffer allocated by __getname()
sidharth-458 Sep 23, 2025
e721226
rculist: Add hlist_nulls_replace_rcu() and hlist_nulls_replace_init_r…
Oct 15, 2025
25c44da
inet: Avoid ehash lookup race in inet_ehash_insert()
Oct 15, 2025
7a250cd
iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
Oct 17, 2025
26a025f
arm64: dts: freescale: imx8mp-venice-gw7905-2x: remove duplicate usdh…
Gateworks Sep 18, 2025
4da7de8
arm64: dts: imx8mm-venice-gw72xx: remove unused sdhc1 pinctrl
Gateworks Sep 18, 2025
aad419c
arm64: dts: imx8mp-venice-gw702x: remove off-board uart
Gateworks Sep 18, 2025
a68e2a1
arm64: dts: imx8mp-venice-gw702x: remove off-board sdhc1
Gateworks Sep 18, 2025
7e0d2d7
PCI: rcar-gen2: Drop ARM dependency from PCI_RCAR_GEN2
geertu Oct 3, 2025
957f0b7
uio: uio_fsl_elbc_gpcm:: Add null pointer check to uio_fsl_elbc_gpcm_…
Oct 15, 2025
5529834
clk: qcom: camcc-sm6350: Specify Titan GDSC power domain as a parent …
Oct 21, 2025
52288e0
clk: qcom: camcc-sm6350: Fix PLL config of PLL2
lweiss-fairphone Oct 21, 2025
cbf806a
crypto: asymmetric_keys - prevent overflow in asymmetric_key_generate_id
toblux Oct 13, 2025
8bd6a08
crypto: hisilicon/qm - restore original qos values
Oct 18, 2025
edb705e
wifi: ath11k: fix peer HE MCS assignment
Oct 17, 2025
f91acbe
s390/smp: Fix fallback CPU detection
hcahca Oct 20, 2025
5fec2bc
s390/ap: Don't leak debug feature files if AP instructions are not av…
hcahca Oct 24, 2025
fdfbd05
arm64: dts: ti: k3-am62p: Fix memory ranges for GPU
StaticRocket Sep 19, 2025
3790536
firmware: imx: scu-irq: fix OF node leak in
MrVan Oct 17, 2025
bdc37fd
arm64: dts: qcom: sdm845-oneplus: Correct gpio used for slider
soyersoyer Sep 27, 2025
270730c
phy: mscc: Fix PTP for VSC8574 and VSC8572
HoratiuVultur Oct 23, 2025
df385eb
sctp: Defer SCTP_DBG_OBJCNT_DEC() to sctp_destroy_sock().
q2ven Oct 23, 2025
a8e1f4b
RDMA/rxe: Fix null deref on srq->rq.queue after resize failure
zhuyj Oct 27, 2025
9628602
ARM: dts: renesas: gose: Remove superfluous port property
Sep 29, 2025
60256e2
ARM: dts: renesas: r9a06g032-rzn1d400-db: Drop invalid #cells properties
Oct 7, 2025
46501bc
Revert "mtd: rawnand: marvell: fix layouts"
Oct 24, 2025
fd44566
mtd: nand: relax ECC parameter validation check
Oct 24, 2025
1971f77
mtd: rawnand: lpc32xx_slc: fix GPIO descriptor leak on probe error an…
ISCAS-Vulab Oct 28, 2025
26b6ba9
task_work: Fix NMI race condition
Sep 22, 2025
a673f2e
x86/dumpstack: Prevent KASAN false positive warnings in __show_regs()
Oct 23, 2025
04e63f7
tools/nolibc/stdio: let perror work when NOLIBC_IGNORE_ERRNO is set
benzea Sep 24, 2025
2c25383
LoongArch: Add machine_kexec_mask_interrupts() implementation
chenhuacai Dec 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Documentation/process/2.Process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ kernels go out with a handful of known regressions though, hopefully, none
of them are serious.

Once a stable release is made, its ongoing maintenance is passed off to the
"stable team," currently Greg Kroah-Hartman. The stable team will release
occasional updates to the stable release using the 5.x.y numbering scheme.
"stable team," currently consists of Greg Kroah-Hartman and Sasha Levin. The
stable team will release occasional updates to the stable release using the
5.x.y numbering scheme.

To be considered for an update release, a patch must (1) fix a significant
bug, and (2) already be merged into the mainline for the next development
kernel. Kernels will typically receive stable updates for a little more
Expand Down
1 change: 0 additions & 1 deletion arch/arm/boot/dts/renesas/r8a7793-gose.dts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@
port@3 {
reg = <3>;
adv7180_out: endpoint {
bus-width = <8>;
remote-endpoint = <&vin1ep>;
};
};
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/boot/dts/renesas/r9a06g032-rzn1d400-db.dts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@

&switch {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

pinctrl-names = "default";
pinctrl-0 = <&pins_eth3>, <&pins_eth4>, <&pins_mdio1>;
Expand Down
11 changes: 0 additions & 11 deletions arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,6 @@
>;
};

pinctrl_usdhc1: usdhc1grp {
fsl,pins = <
MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK 0x190
MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD 0x1d0
MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x1d0
MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x1d0
MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x1d0
MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3 0x1d0
>;
};

pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190
Expand Down
51 changes: 0 additions & 51 deletions arch/arm64/boot/dts/freescale/imx8mp-venice-gw702x.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -373,39 +373,13 @@
status = "okay";
};

/* off-board header */
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
status = "okay";
};

/* console */
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
status = "okay";
};

/* off-board header */
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3>;
status = "okay";
};

/* off-board */
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
bus-width = <4>;
non-removable;
status = "okay";
bus-width = <4>;
non-removable;
status = "okay";
};

/* eMMC */
&usdhc3 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
Expand Down Expand Up @@ -499,38 +473,13 @@
>;
};

pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x140
MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x140
>;
};

pinctrl_uart2: uart2grp {
fsl,pins = <
MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX 0x140
MX8MP_IOMUXC_UART2_TXD__UART2_DCE_TX 0x140
>;
};

pinctrl_uart3: uart3grp {
fsl,pins = <
MX8MP_IOMUXC_UART3_RXD__UART3_DCE_RX 0x140
MX8MP_IOMUXC_UART3_TXD__UART3_DCE_TX 0x140
>;
};

pinctrl_usdhc1: usdhc1grp {
fsl,pins = <
MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK 0x190
MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD 0x1d0
MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0 0x1d0
MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1 0x1d0
MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2 0x1d0
MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3 0x1d0
>;
};

pinctrl_usdhc3: usdhc3grp {
fsl,pins = <
MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK 0x190
Expand Down
11 changes: 0 additions & 11 deletions arch/arm64/boot/dts/freescale/imx8mp-venice-gw72xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,6 @@
>;
};

pinctrl_usdhc1: usdhc1grp {
fsl,pins = <
MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK 0x190
MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD 0x1d0
MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0 0x1d0
MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1 0x1d0
MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2 0x1d0
MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3 0x1d0
>;
};

pinctrl_usdhc2: usdhc2grp {
fsl,pins = <
MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK 0x190
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@
bias-disable;
};

tri_state_key_default: tri-state-key-default-state {
pins = "gpio40", "gpio42", "gpio26";
alert_slider_default: alert-slider-default-state {
pins = "gpio126", "gpio52", "gpio24";
function = "gpio";
drive-strength = <2>;
bias-disable;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/ti/k3-am62p.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<0x00 0x01000000 0x00 0x01000000 0x00 0x01b28400>, /* First peripheral window */
<0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */
<0x00 0x0e000000 0x00 0x0e000000 0x00 0x01d20000>, /* Second peripheral window */
<0x00 0x0fd00000 0x00 0x0fd00000 0x00 0x00020000>, /* GPU */
<0x00 0x0fd80000 0x00 0x0fd80000 0x00 0x00080000>, /* GPU */
<0x00 0x20000000 0x00 0x20000000 0x00 0x0a008000>, /* Third peripheral window */
<0x00 0x30040000 0x00 0x30040000 0x00 0x00080000>, /* PRUSS-M */
<0x00 0x30101000 0x00 0x30101000 0x00 0x00010100>, /* CSI window */
Expand Down
24 changes: 24 additions & 0 deletions arch/loongarch/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,28 @@ void kexec_reboot(void)
BUG();
}

static void machine_kexec_mask_interrupts(void)
{
unsigned int i;
struct irq_desc *desc;

for_each_irq_desc(i, desc) {
struct irq_chip *chip;

chip = irq_desc_get_chip(desc);
if (!chip)
continue;

if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
chip->irq_eoi(&desc->irq_data);

if (chip->irq_mask)
chip->irq_mask(&desc->irq_data);

if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
chip->irq_disable(&desc->irq_data);
}
}

#ifdef CONFIG_SMP
static void kexec_shutdown_secondary(void *regs)
Expand Down Expand Up @@ -290,6 +312,7 @@ void machine_crash_shutdown(struct pt_regs *regs)
#ifdef CONFIG_SMP
crash_smp_send_stop();
#endif
machine_kexec_mask_interrupts();
cpumask_set_cpu(crashing_cpu, &cpus_in_crash);

pr_info("Starting crashdump kernel...\n");
Expand Down Expand Up @@ -327,6 +350,7 @@ void machine_kexec(struct kimage *image)

/* We do not want to be bothered. */
local_irq_disable();
machine_kexec_mask_interrupts();

pr_notice("EFI boot flag 0x%lx\n", efi_boot);
pr_notice("Command line at 0x%lx\n", cmdline_ptr);
Expand Down
1 change: 1 addition & 0 deletions arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ static void __ref smp_get_core_info(struct sclp_core_info *info, int early)
continue;
info->core[info->configured].core_id =
address >> smp_cpu_mt_shift;
info->core[info->configured].type = boot_core_type;
info->configured++;
}
info->combined = info->configured;
Expand Down
9 changes: 9 additions & 0 deletions arch/x86/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,11 @@ u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu);
* the gfn, i.e. retrying the instruction will hit a
* !PRESENT fault, which results in a new shadow page
* and sends KVM back to square one.
*
* EMULTYPE_SKIP_SOFT_INT - Set in combination with EMULTYPE_SKIP to only skip
* an instruction if it could generate a given software
* interrupt, which must be encoded via
* EMULTYPE_SET_SOFT_INT_VECTOR().
*/
#define EMULTYPE_NO_DECODE (1 << 0)
#define EMULTYPE_TRAP_UD (1 << 1)
Expand All @@ -1983,6 +1988,10 @@ u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu);
#define EMULTYPE_PF (1 << 6)
#define EMULTYPE_COMPLETE_USER_EXIT (1 << 7)
#define EMULTYPE_WRITE_PF_TO_SP (1 << 8)
#define EMULTYPE_SKIP_SOFT_INT (1 << 9)

#define EMULTYPE_SET_SOFT_INT_VECTOR(v) ((u32)((v) & 0xff) << 16)
#define EMULTYPE_GET_SOFT_INT_VECTOR(e) (((e) >> 16) & 0xff)

int kvm_emulate_instruction(struct kvm_vcpu *vcpu, int emulation_type);
int kvm_emulate_instruction_from_buffer(struct kvm_vcpu *vcpu,
Expand Down
23 changes: 21 additions & 2 deletions arch/x86/kernel/dumpstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ static void show_regs_if_on_stack(struct stack_info *info, struct pt_regs *regs,
* in false positive reports. Disable instrumentation to avoid those.
*/
__no_kmsan_checks
static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, const char *log_lvl)
static void __show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, const char *log_lvl)
{
struct unwind_state state;
struct stack_info stack_info = {0};
Expand Down Expand Up @@ -305,6 +305,25 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
}
}

static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, const char *log_lvl)
{
/*
* Disable KASAN to avoid false positives during walking another
* task's stacks, as values on these stacks may change concurrently
* with task execution.
*/
bool disable_kasan = task && task != current;

if (disable_kasan)
kasan_disable_current();

__show_trace_log_lvl(task, regs, stack, log_lvl);

if (disable_kasan)
kasan_enable_current();
}

void show_stack(struct task_struct *task, unsigned long *sp,
const char *loglvl)
{
Expand Down
24 changes: 13 additions & 11 deletions arch/x86/kvm/svm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ static bool svm_can_emulate_instruction(struct kvm_vcpu *vcpu, int emul_type,
void *insn, int insn_len);

static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,
int emul_type,
bool commit_side_effects)
{
struct vcpu_svm *svm = to_svm(vcpu);
Expand Down Expand Up @@ -414,7 +415,7 @@ static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,
if (unlikely(!commit_side_effects))
old_rflags = svm->vmcb->save.rflags;

if (!kvm_emulate_instruction(vcpu, EMULTYPE_SKIP))
if (!kvm_emulate_instruction(vcpu, emul_type))
return 0;

if (unlikely(!commit_side_effects))
Expand All @@ -432,11 +433,13 @@ static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,

static int svm_skip_emulated_instruction(struct kvm_vcpu *vcpu)
{
return __svm_skip_emulated_instruction(vcpu, true);
return __svm_skip_emulated_instruction(vcpu, EMULTYPE_SKIP, true);
}

static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu)
static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu, u8 vector)
{
const int emul_type = EMULTYPE_SKIP | EMULTYPE_SKIP_SOFT_INT |
EMULTYPE_SET_SOFT_INT_VECTOR(vector);
unsigned long rip, old_rip = kvm_rip_read(vcpu);
struct vcpu_svm *svm = to_svm(vcpu);

Expand All @@ -452,7 +455,7 @@ static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu)
* in use, the skip must not commit any side effects such as clearing
* the interrupt shadow or RFLAGS.RF.
*/
if (!__svm_skip_emulated_instruction(vcpu, !nrips))
if (!__svm_skip_emulated_instruction(vcpu, emul_type, !nrips))
return -EIO;

rip = kvm_rip_read(vcpu);
Expand Down Expand Up @@ -488,7 +491,7 @@ static void svm_inject_exception(struct kvm_vcpu *vcpu)
kvm_deliver_exception_payload(vcpu, ex);

if (kvm_exception_is_soft(ex->vector) &&
svm_update_soft_interrupt_rip(vcpu))
svm_update_soft_interrupt_rip(vcpu, ex->vector))
return;

svm->vmcb->control.event_inj = ex->vector
Expand Down Expand Up @@ -3723,24 +3726,23 @@ static bool svm_set_vnmi_pending(struct kvm_vcpu *vcpu)

static void svm_inject_irq(struct kvm_vcpu *vcpu, bool reinjected)
{
struct kvm_queued_interrupt *intr = &vcpu->arch.interrupt;
struct vcpu_svm *svm = to_svm(vcpu);
u32 type;

if (vcpu->arch.interrupt.soft) {
if (svm_update_soft_interrupt_rip(vcpu))
if (intr->soft) {
if (svm_update_soft_interrupt_rip(vcpu, intr->nr))
return;

type = SVM_EVTINJ_TYPE_SOFT;
} else {
type = SVM_EVTINJ_TYPE_INTR;
}

trace_kvm_inj_virq(vcpu->arch.interrupt.nr,
vcpu->arch.interrupt.soft, reinjected);
trace_kvm_inj_virq(intr->nr, intr->soft, reinjected);
++vcpu->stat.irq_injections;

svm->vmcb->control.event_inj = vcpu->arch.interrupt.nr |
SVM_EVTINJ_VALID | type;
svm->vmcb->control.event_inj = intr->nr | SVM_EVTINJ_VALID | type;
}

void svm_complete_interrupt_delivery(struct kvm_vcpu *vcpu, int delivery_mode,
Expand Down
21 changes: 21 additions & 0 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -8926,6 +8926,23 @@ static bool is_vmware_backdoor_opcode(struct x86_emulate_ctxt *ctxt)
return false;
}

static bool is_soft_int_instruction(struct x86_emulate_ctxt *ctxt,
int emulation_type)
{
u8 vector = EMULTYPE_GET_SOFT_INT_VECTOR(emulation_type);

switch (ctxt->b) {
case 0xcc:
return vector == BP_VECTOR;
case 0xcd:
return vector == ctxt->src.val;
case 0xce:
return vector == OF_VECTOR;
default:
return false;
}
}

/*
* Decode an instruction for emulation. The caller is responsible for handling
* code breakpoints. Note, manually detecting code breakpoints is unnecessary
Expand Down Expand Up @@ -9016,6 +9033,10 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
* injecting single-step #DBs.
*/
if (emulation_type & EMULTYPE_SKIP) {
if (emulation_type & EMULTYPE_SKIP_SOFT_INT &&
!is_soft_int_instruction(ctxt, emulation_type))
return 0;

if (ctxt->mode != X86EMUL_MODE_PROT64)
ctxt->eip = (u32)ctxt->_eip;
else
Expand Down
Loading