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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91E39C3A5A7 for ; Thu, 8 Dec 2022 11:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbiLHLLR (ORCPT ); Thu, 8 Dec 2022 06:11:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLHLLA (ORCPT ); Thu, 8 Dec 2022 06:11:00 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3EF47F8BC; Thu, 8 Dec 2022 03:10:11 -0800 (PST) Received: from zn.tnic (p200300ea9733e73d329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e73d: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 74ABC1EC0674; Thu, 8 Dec 2022 12:10:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1670497810; 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=Y/dlSQlwaW6qqeNkhgJdMiH59ouL4apa5gZVhWMRT4s=; b=OIZbB3qKghdj4LPSM4aWEbdKWePHGUg9m/dkgnuGHHorlGvJt/6A/5MtjRDEkp/BYrnBwK dhLIwBIRMimV1yafWmfJkl9EYOniXpgobWwReEQMDC2Zc7YirkrfR2w1WA/PGqhrg8VcMP BCBqUTPb9r3BSNwJ+is8NjGnKjKjctw= Date: Thu, 8 Dec 2022 12:10:10 +0100 From: Borislav Petkov To: "Edgecombe, Rick P" Cc: "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Yu, Yu-cheng" , "dave.hansen@linux.intel.com" , "kirill.shutemov@linux.intel.com" , "Eranian, Stephane" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "pavel@ucw.cz" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "linux-doc@vger.kernel.org" , "arnd@arndb.de" , "tglx@linutronix.de" , "Schimpe, Christina" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "akpm@linux-foundation.org" , "jamorris@linux.microsoft.com" , "john.allen@amd.com" , "rppt@kernel.org" , "andrew.cooper3@citrix.com" , "mingo@redhat.com" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" Subject: Re: [PATCH v4 03/39] x86/cpufeatures: Add CPU feature flags for shadow stacks Message-ID: References: <20221203003606.6838-1-rick.p.edgecombe@intel.com> <20221203003606.6838-4-rick.p.edgecombe@intel.com> <63ea77f5d14739f8184ea51a4df939a58b4764ab.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <63ea77f5d14739f8184ea51a4df939a58b4764ab.camel@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Wed, Dec 07, 2022 at 10:35:59PM +0000, Edgecombe, Rick P wrote: > Yes, the suggestion was to have one for kernel and one for user. But I > was also thinking about how KVM could hypothetically support shadow > stack in guests in the non !CONFIG_X86_USER_SHADOW_STACK case (it only > needs CET_U xsave support). So that configuration wouldn't expose > user_shstk and since KVM's guest feature support is retrieved > programmatically, it could be nice to have some hint for KVM users that > they could try. Maybe it's simpler to just tie KVM and host support > together though. I'll remove "shstk". Hmm, I don't have a clear idea how guest shstk support should do so maybe this is all way off but yeah, if the host supports CET - the *hardware* feature - then you can use the same logic to support that in a VM. I.e., if the guest sees CET - i.e., HV has advertized it - then guest kernel behaves exactly the same as on the host. But it is likely I'm missing something more involved... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette