From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 697A2C433EF for ; Wed, 16 Mar 2022 19:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352937AbiCPTYo (ORCPT ); Wed, 16 Mar 2022 15:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358093AbiCPTYX (ORCPT ); Wed, 16 Mar 2022 15:24:23 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70D86E576 for ; Wed, 16 Mar 2022 12:21:51 -0700 (PDT) Received: from zn.tnic (p200300ea971561ec329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9715:61ec:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7DC6E1EC0347; Wed, 16 Mar 2022 20:21:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1647458494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Rj/DRn2HS3AXggW7KqDfmpgD2DfDqz4E8zLMyP0tMd4=; b=dCI/jpTlQ6nwAv+WNtOOw9llZkuV5neHMXYhlm4lNt/H1i+MMll2gUuvH2i/Tgr7YOniix z7w3VEn2aseIWPr0+3l1+cuCF2xKmgj04NbexiAUtbeVuh2OSFEdQbRLiKGXlGONjwZMLn 443BBI79tiorOzZBZBslpoA7bpZmjjQ= Date: Wed, 16 Mar 2022 20:21:31 +0100 From: Borislav Petkov To: Dave Hansen Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, Peter Zijlstra Subject: Re: system locks up with CONFIG_SLS=Y; 5.17.0-rc Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 16, 2022 at 12:02:59PM -0700, Dave Hansen wrote: > This hit one of the new int3's in "ASM_RET" in "setc" in > arch/x86/kvm/emulate.c: > > FOP_SETCC(setc) > > Did the extra 'int3' screw up some presumed jump offset or something? Yap, looks like it. I wonder how no one managed to hit this yet... Jamie, does this fix it, per chance? --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f667bd8df533..e88ce4171c4a 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -430,8 +430,11 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop); FOP_END /* Special case for SETcc - 1 instruction per cc */ + +#define SETCC_ALIGN 8 + #define FOP_SETCC(op) \ - ".align 4 \n\t" \ + ".align " __stringify(SETCC_ALIGN) " \n\t" \ ".type " #op ", @function \n\t" \ #op ": \n\t" \ ASM_ENDBR \ @@ -1049,7 +1052,7 @@ static int em_bsr_c(struct x86_emulate_ctxt *ctxt) static __always_inline u8 test_cc(unsigned int condition, unsigned long flags) { u8 rc; - void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf); + void (*fop)(void) = (void *)em_setcc + SETCC_ALIGN * (condition & 0xf); flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF; asm("push %[flags]; popf; " CALL_NOSPEC -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette