From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 829FE610E for ; Thu, 8 Sep 2022 21:16:17 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id 29so21177277edv.2 for ; Thu, 08 Sep 2022 14:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Lr8oiy+JZ5JB+d+QkGV7FDirBPOdIiFwxT3YvDwpj8w=; b=LEaHRiXOMVqfETuRtrKDKenARH14qGRl7NuB14aBEgeGMGDbtWkzQVh7KylKuhB81s TxAgAz88H1/wFtBfBFXaJMjn9BqJ3YVRnK2wBWrnAUzzcO+Jcxz/bAKaZfjSBtkDEYaN JrtGiPbJ0nlKQXtYte0RSwd2BUastFp1538FMZRnLjouyAQw7TyOiH939vzUi4PgnPlU 1ywc9DWipvNeZaDaO1iTX6M6UH88ZAe8GEoN/8DOuPX30m3kHZpUCsKR0iu87CXHLS2P oM0cYVleAG1luTB1ykljvduO8DDMzt8jbpchT1b/rzsJR9qe2XXu8HxXOVCuG6l1mGBC Y4+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Lr8oiy+JZ5JB+d+QkGV7FDirBPOdIiFwxT3YvDwpj8w=; b=C5xP56HrAQorZR+njzpgoWHL+DeoK/UTDPHEYBf4eh0YMNIBgOKbVDXvbrUXvWNdJ+ Z41TIAWrIh0igwqzQjGzSQpnqUwTk7rvqsk/+6Flqu5AQwx1+YvN1IgYthG4cU9NkUTC 2Stcf88Y0MhYTbKugtw6AdNEHA9RVFoYG6ezq44HcI75Dyyd0K65NGJKWyvT/MUGteZ1 ZwFHhXxfzw3VM+s2sNxPOL7JnjvvT3+Fw7rEoRw0hrSYJ+lc2VSQSKjkuVRTuW1gRYDX XEACcXrwFrPlyq5W42kygkLZPNHi6rRcWAIAeZncPNqlGNQomRRxVFCK15mgW4g3WT7G nAnA== X-Gm-Message-State: ACgBeo1TEa9xzpUsKhIXaI5XBS/2J6yA3p+Ri6IGORDLQcwp5vaVlevs ux0CGxC/X22lofZTc/x1MIRi7wWUm1Zy0G5bLiDJ X-Google-Smtp-Source: AA6agR5lsRmAOE/0+TTz415bYxQiXfuxn/OW7pA3his5JST/uY+2zxr8lfmlZJuVp7ZpH5p8b5vEhIAXAzK3XUN1mds= X-Received: by 2002:a05:6402:274c:b0:44f:334e:1e11 with SMTP id z12-20020a056402274c00b0044f334e1e11mr5788349edd.304.1662671775594; Thu, 08 Sep 2022 14:16:15 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220902213750.1124421-1-morbo@google.com> <20220902213750.1124421-3-morbo@google.com> <202209022251.B14BD50B29@keescook> <202209071609.BE5BF18D6@keescook> In-Reply-To: <202209071609.BE5BF18D6@keescook> From: Bill Wendling Date: Thu, 8 Sep 2022 22:16:04 +0100 Message-ID: Subject: Re: [PATCH 2/2] x86/paravirt: add extra clobbers with ZERO_CALL_USED_REGS enabled To: Kees Cook Cc: Peter Zijlstra , Nick Desaulniers , Juergen Gross , "Srivatsa S. Bhat (VMware)" , Alexey Makhalov , VMware PV-Drivers Reviewers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , virtualization@lists.linux-foundation.org, LKML , Nathan Chancellor , clang-built-linux , linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Thu, Sep 8, 2022 at 12:10 AM Kees Cook wrote: > > On Wed, Sep 07, 2022 at 10:50:03AM +0200, Peter Zijlstra wrote: > > On Tue, Sep 06, 2022 at 11:00:07PM -0700, Nick Desaulniers wrote: > > > On Sun, Sep 4, 2022 at 11:02 PM Bill Wendling wrote: > > > > > > > > On Sat, Sep 3, 2022 at 12:18 AM Kees Cook wrote: > > > > > > > > > > On Fri, Sep 02, 2022 at 09:37:50PM +0000, Bill Wendling wrote: > > > > > > [...] > > > > > > callq *pv_ops+536(%rip) > > > > > > > > > > Do you know which pv_ops function is this? I can't figure out where > > > > > pte_offset_kernel() gets converted into a pv_ops call.... > > > > > > > > > This one is _paravirt_ident_64, I believe. I think that the original > > > > issue Nathan was seeing was with another seemingly innocuous function. > > > > > > _paravirt_ident_64 is marked noinstr, which makes me suspect that it > > > really needs to not be touched at all by the compiler for > > > these...special features. > > > > My source tree sayeth: > > > > u64 notrace _paravirt_ident_64(u64 x) > > I don't see noinstr either. But it seems a reasonable thing to do? > > Bill, does fixing up the noinstr macro and adding it here fix the > problem? > [sorry for late response] Let me give it a shot. I'll also test out Peter's suggestion, which might be a better option in the long run. I suspect that we'll need to devise similar patches for other places, but it shouldn't be hard to find them all. -bw -bw