Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1679042iob; Thu, 19 May 2022 11:47:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ8L0UqSp6ynLxfe/dPVEcQSnPtnUEBSusinQKuh7zQ0b9hMD/Xv35fbMU44x2LKu4/w5s X-Received: by 2002:a17:903:228f:b0:15e:be12:a181 with SMTP id b15-20020a170903228f00b0015ebe12a181mr6077633plh.21.1652986027960; Thu, 19 May 2022 11:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652986027; cv=none; d=google.com; s=arc-20160816; b=HLmZslQV54mspCl5PAkPZMclgTOBsuBgpG2Mi2Tr/bwJDoHtjI4/S8rOaHRpySU26Z 7QlyLSNHhhz0dGIDxf84Y/GvQZMBQw9SJ1hDIvkpl/or8rnliNLjIblknEfFd6gpkkg9 N6FzeOt6LqMYVO4zzGp6/aYbELGtHW7JUfgxSJkJPTF7QchyjY/GkMkpYRqaYAERIyFj 8kH6N/PTwPpIY2crWmtIX6ZoqmuxU7SJ6KDnTS+yphFr5nkeXD30LxA7K3flG6Pxszt6 7Pwwx4UBYt9qdNWbtJVD3zgXY0zxXCwFNUfaAFLtE4t0QDqG/pO3xll4wWuwa8NLCpTt Q+Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g7xCp6J3k4L2dkaSWosqH9kge3uPbogCKlir9eF0rGw=; b=vwjau70EYGEdh4uQaxRr7hIvsVQ3XKrMZHmLodSHg5YGKye1g/h5FKDN7f5IstKuZ+ 8JmlLYhNW5VGfgKu3aCKPyUoXZM+RYGW4HGlZN2P9QDDD2L1Ycq1JkRCBP7X6dx5oWNm yXuFT7Rz+/HQUWjvrSspCpM/zn7NWqqIoaGJepmYRshCG7AAPppQjVlSDtt6toYraBLQ MrQC559Zwd4CSL9222KsMQgZJzOXZalhRhyz0DEnvdpntKZMW5H1yuJRJ8FLIrBn/DK8 V6Hng1Ffa410syAC7+pxSL7qDsLmdZ+k+HZ1gGvItTkinwBh4eYZJWYlBwwAJ1KhWzsY kW3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LOxGwIJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jd6-20020a170903260600b00153b2d165d8si6557001plb.480.2022.05.19.11.46.48; Thu, 19 May 2022 11:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LOxGwIJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242054AbiESRAk (ORCPT + 99 others); Thu, 19 May 2022 13:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234096AbiESRAj (ORCPT ); Thu, 19 May 2022 13:00:39 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CBE2B66 for ; Thu, 19 May 2022 10:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=g7xCp6J3k4L2dkaSWosqH9kge3uPbogCKlir9eF0rGw=; b=LOxGwIJzeEdNh9RKyGjDZiEa13 fjaut1Kx6s93BK2A5wahP5RHOCuE21Ssz0OSKDFxlv8SWwpH84C3n1eijyHSbqfl7i0iNBNaJDV3C YZVmsZeWeY08AQ802UELHYM6uanc4kdLT9uTB1yWgmh8qMFY1qIS0qZo2Vuhxxwd9Sc2Gvdub0dQR oe36axBUTmpUIwt0ygeFxkdJHR1UKr0n7lDlQnGyBKPkNI6PgAR+0T1mAyjmwTEXqMiXkrTSyUhNP i60D2Aq8z2KP865EWMEZf/XfxZTWgZjFW2NeWEU9fL1JF/aMKC1gqn15DMP7vIgXOXG1WqhpK2d7S 0wyKDnRw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrjVT-0025Ro-Mk; Thu, 19 May 2022 17:00:13 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 0DB3C980E7F; Thu, 19 May 2022 19:00:10 +0200 (CEST) Date: Thu, 19 May 2022 19:00:09 +0200 From: Peter Zijlstra To: Guenter Roeck Cc: x86@kernel.org, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, brgerst@gmail.com, jiangshanlai@gmail.com, Andrew.Cooper3@citrix.com, mark.rutland@arm.com, Borislav Petkov Subject: Re: [PATCH 3/6] x86/entry: Use PUSH_AND_CLEAR_REGS for compat Message-ID: <20220519170009.GL2578@worktop.programming.kicks-ass.net> References: <20220506121431.563656641@infradead.org> <20220506121631.293889636@infradead.org> <20220519162411.GA4095576@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519162411.GA4095576@roeck-us.net> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2022 at 09:24:11AM -0700, Guenter Roeck wrote: > On Fri, May 06, 2022 at 02:14:34PM +0200, Peter Zijlstra wrote: > > Since the upper regs don't exist for ia32 code, preserving them > > doesn't hurt and it simplifies the code. > > > > This doesn't add any attack surface that would not already be > > available through INT80. > > > > Notably: > > > > - 32bit SYSENTER: didn't clear si, dx, cx. > > > > - 32bit SYSCALL, INT80: *do* clear si since the C functions don't > > take a second argument. > > > > - 64bit: didn't clear si since the C functions take a second > > argument; except the error_entry path might have only one argument, > > so clearing si was missing here. > > > > 32b SYSENTER should be clearing all those 3 registers, nothing uses them > > and selftests pass. > > > > Unconditionally clear rsi since it simplifies code. > > > > Signed-off-by: Peter Zijlstra (Intel) > > Reviewed-by: Borislav Petkov > > linux-next (next-20220519) crashes due to this patch when booting > q35:EPYC-Rome in qemu. Could you try backing out each of the hunks one at a time? They're all more or less independent. My bet with this being a #PF on an AMD machine, it's either the SI clear or the SYSCALL change.