From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 335861843 for ; Mon, 16 May 2022 22:03:39 +0000 (UTC) Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-2f83983782fso168814577b3.6 for ; Mon, 16 May 2022 15:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IjaOHrJPxQNUMk++gKnFcKFfTSw8FlwW+UyobtzjVj0=; b=CmIEj5n1Rl0HWNhLuhDFskWScqMt8sTZf+nhjXYfnm9nlgr/YXq9h82Fae9Y2KTq1g KryZOd70RTA6tPdFd6uEglWV6hKFFIZmg7ZFv30zU1JzLwvckRRLR0MEMdF00hjHIHDf hVEuQ8BqEIRE3mG//CqcrOWdJM1NQz8jL2LfiBTS0Uvbwue/yEjA0leJcwc3aoJbKFUo HsYsHIyfIVblYlpHWWLtcT5unFYiki04NZBQO/jfec+mhGllAxhTLo9QATAqOOLauq7u ckKDPDyG+lHdQjd1OuL/8h39HKfWcmiAhNYRkNnJwcWE1smI+GnPF/PAEkdRN2Dzzitq q0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IjaOHrJPxQNUMk++gKnFcKFfTSw8FlwW+UyobtzjVj0=; b=DKr+8nbndIjodho1Os/9duXoZQXUvO1YxMtU7oWhfrTnolATbnmiZuxElFDJjW9gk7 zIGIfhxOr8wHVyvlADJKhUWRDxbD82T5CnALWy6301lZi8ZB1vuLuiw+0Dcz4MNs/U6V Q9e6dB9JC69Yo4xJqq5lTOi4euYBg876P2kxgP8mogizJ/eMBJKWNXOyNuB7rWhn4x9t DFCxaS3PB5PCOWdP+azoVMxvgpUmlb/AHjoNQ866iJIRJ4GkSS5wCzDwItDjLWERgXD2 76RX/o3qpHM10/xtna1OywBHxVSCX3vKGAmnbk6BYjw0coHnB1XMU7aZH5y6qkOzbIO4 kcIA== X-Gm-Message-State: AOAM532zj8/DJrpYK92eLb9Hu4SW9+B2kxwEHbBJmgVzV2kFKsWHplD2 fy7s42dlpIX9BRpD9foSTS6YRkSeDUco8g998jPjRA== X-Google-Smtp-Source: ABdhPJw3sBkLaeksICo+46rO2UaS3Fk7vsTQRrcZQqDXNASr5C339hIh2SUj2o4+spHZoBL4AtjH3f55xJ+hksTEK84= X-Received: by 2002:a0d:d747:0:b0:2ff:22b9:9281 with SMTP id z68-20020a0dd747000000b002ff22b99281mr1573852ywd.305.1652738618031; Mon, 16 May 2022 15:03:38 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-21-samitolvanen@google.com> <19b3e040302d4d8aa240eee43427dfaa@AcuMS.aculab.com> <20220516214414.GR76023@worktop.programming.kicks-ass.net> In-Reply-To: <20220516214414.GR76023@worktop.programming.kicks-ass.net> From: Sami Tolvanen Date: Mon, 16 May 2022 15:03:02 -0700 Message-ID: Subject: Re: [RFC PATCH v2 20/21] x86: Add support for CONFIG_CFI_CLANG To: Peter Zijlstra Cc: David Laight , "linux-kernel@vger.kernel.org" , Kees Cook , Josh Poimboeuf , "x86@kernel.org" , Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , "linux-hardening@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "llvm@lists.linux.dev" Content-Type: text/plain; charset="UTF-8" On Mon, May 16, 2022 at 2:44 PM Peter Zijlstra wrote: > > On Mon, May 16, 2022 at 09:32:55PM +0000, David Laight wrote: > > > > The compiler always generates this specific instruction sequence. > > > > Yes, but there are several ways to encode 'cmpl imm,-6(reg)'. > > Yes, but we don't care. This *always* uses the 32bit immediate form. > Even if the immediate is small. Yes, that part is not a problem, but it's a valid point that LLVM might not always use r8-r15 here, so I will have to check for the REX prefix before blindly attempting to decode the instruction. Sami From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62E4CC433EF for ; Mon, 16 May 2022 22:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l6e6ouYzK90CxPgn+H9UcL9+UDbJAnq6Ah6CdUVgqac=; b=wl0hw8gWBrDkii e1ry+7M3p2zZVwKkrh8ZAyhKga5Itx3RF42Kw1wICvWvg+3w1jkaFmOyE38rqsTRJ0r+/qJcFyGiW On3O2Q7T+l7DV33MqKj93qmgZT+71i1mGZ8a6x8qcVxPMOP2rgkI1Kchhj5qDdYPD7TxLsZ78VWIk 6kUa8sp5kiMBUNpdRsMA7XjnFs0gnygwBPADOXbRI3wZK9cLrj1tIeYLHsCnywkO1SF5LqJpfgXtU kGOWSMpSZYLmuC5py0gUzxdAWMG/x6R1hc2B5q+yndf+U3kT25gz884rq1sr88LDeS8dAKhSrBWhF I5JjRrlfmU3/ubM5eW6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqioc-00APut-Er; Mon, 16 May 2022 22:03:46 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqioY-00APtC-UZ for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 22:03:45 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-2fedd26615cso56097407b3.7 for ; Mon, 16 May 2022 15:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IjaOHrJPxQNUMk++gKnFcKFfTSw8FlwW+UyobtzjVj0=; b=CmIEj5n1Rl0HWNhLuhDFskWScqMt8sTZf+nhjXYfnm9nlgr/YXq9h82Fae9Y2KTq1g KryZOd70RTA6tPdFd6uEglWV6hKFFIZmg7ZFv30zU1JzLwvckRRLR0MEMdF00hjHIHDf hVEuQ8BqEIRE3mG//CqcrOWdJM1NQz8jL2LfiBTS0Uvbwue/yEjA0leJcwc3aoJbKFUo HsYsHIyfIVblYlpHWWLtcT5unFYiki04NZBQO/jfec+mhGllAxhTLo9QATAqOOLauq7u ckKDPDyG+lHdQjd1OuL/8h39HKfWcmiAhNYRkNnJwcWE1smI+GnPF/PAEkdRN2Dzzitq q0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IjaOHrJPxQNUMk++gKnFcKFfTSw8FlwW+UyobtzjVj0=; b=ugP7PZbVTCs/p46+HZRtGVA5bBNgDyV5zYGLSvPq9hTFHPR71VfhiM54MEQP2JqreD y8Q3adgu/rfiQzQxTiBKRPTOOeW7XIvmdftnx2Bo9HgY/W/nFzwX9zTUuD53ux09Hyxy HEKn3y5sDjj7vIGq31iEeIeP0zW3Bf46XzDGnZ99zk7xz+6CyNBYyCmMk1PM3mlYTh1L anKPoy3STBH7JgETV5gDINtHCq1epIjtbePm2bSnTSW1HsAFh8M1FY21q/7ZQRy1UR0b S9W1r4kkzw1+/Chd8XNjlQFGRO6wv48A2dJq70tikGC0b0S03RsgFUTwYyccS5ZSToK3 nkpQ== X-Gm-Message-State: AOAM533YGVN/JQZ/yoSW47S15Y6o4HcyGUMURfInrqwfYPHb+zR91Q8E tB0DtX81JrSeOliKkjCGUKNlKpApZF9+FKFTzYj35Y/0tt8= X-Google-Smtp-Source: ABdhPJw3sBkLaeksICo+46rO2UaS3Fk7vsTQRrcZQqDXNASr5C339hIh2SUj2o4+spHZoBL4AtjH3f55xJ+hksTEK84= X-Received: by 2002:a0d:d747:0:b0:2ff:22b9:9281 with SMTP id z68-20020a0dd747000000b002ff22b99281mr1573852ywd.305.1652738618031; Mon, 16 May 2022 15:03:38 -0700 (PDT) MIME-Version: 1.0 References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-21-samitolvanen@google.com> <19b3e040302d4d8aa240eee43427dfaa@AcuMS.aculab.com> <20220516214414.GR76023@worktop.programming.kicks-ass.net> In-Reply-To: <20220516214414.GR76023@worktop.programming.kicks-ass.net> From: Sami Tolvanen Date: Mon, 16 May 2022 15:03:02 -0700 Message-ID: Subject: Re: [RFC PATCH v2 20/21] x86: Add support for CONFIG_CFI_CLANG To: Peter Zijlstra Cc: David Laight , "linux-kernel@vger.kernel.org" , Kees Cook , Josh Poimboeuf , "x86@kernel.org" , Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , "linux-hardening@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "llvm@lists.linux.dev" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220516_150343_032294_19889933 X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 16, 2022 at 2:44 PM Peter Zijlstra wrote: > > On Mon, May 16, 2022 at 09:32:55PM +0000, David Laight wrote: > > > > The compiler always generates this specific instruction sequence. > > > > Yes, but there are several ways to encode 'cmpl imm,-6(reg)'. > > Yes, but we don't care. This *always* uses the 32bit immediate form. > Even if the immediate is small. Yes, that part is not a problem, but it's a valid point that LLVM might not always use r8-r15 here, so I will have to check for the REX prefix before blindly attempting to decode the instruction. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel