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 655BAC433FE for ; Wed, 23 Mar 2022 12:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243571AbiCWM4r (ORCPT ); Wed, 23 Mar 2022 08:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbiCWM4p (ORCPT ); Wed, 23 Mar 2022 08:56:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 468917C165; Wed, 23 Mar 2022 05:55:14 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1648040112; 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: in-reply-to:in-reply-to:references:references; bh=h7Mrb8Fsde3pJqBhXMbymwp59oXpDJjejh4OrYFjnM4=; b=hD7vXlWlc9G4Pn3agAJBeX4ZaHPKNxd5qebkoqv5Sx1/GV4HrZSFtGuKazVB2jm7f0sQMY fB/6Kt1X6k16xtAWEk8jWDT9rMynh6sxmyiVKs9aKLW4vKvhg9DgX4yOWks59eo089Q7ht oYrcjj3oFU+orOfxUSkg5oo8w88dVwmuy4081sEW+Zb/IawSaPeoc2dvqcSryTyiILDZXD 1F7Z4+Al5Y0MF3DhfG8lo9q87NP/2F3O2IEWRMjBCy6mRM98TLKQqgqgQ4DdELmoNVWgeE wZwphF4UXUXDYEQbFA59dkk0REX7BBD6gxF7MECJYSLIhQ2kO/VEPCt6pwX8ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1648040112; 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: in-reply-to:in-reply-to:references:references; bh=h7Mrb8Fsde3pJqBhXMbymwp59oXpDJjejh4OrYFjnM4=; b=nRgb4kwZpe/J2hdx8rPoulcssST4IC/wXnTL0PSRWvXIqRIWH0pTVtb5U0imEkvX5VUTmJ d8ddEBunaWiUv4CQ== To: Paolo Bonzini , dave.hansen@linux.intel.com Cc: yang.zhong@intel.com, ravi.v.shankar@intel.com, mingo@redhat.com, "Chang S. Bae" , bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org, KVM list Subject: Re: ping Re: [PATCH v4 0/2] x86: Fix ARCH_REQ_XCOMP_PERM and update the test In-Reply-To: <87a6dgam7b.ffs@tglx> References: <20220129173647.27981-1-chang.seok.bae@intel.com> <87a6dgam7b.ffs@tglx> Date: Wed, 23 Mar 2022 13:55:11 +0100 Message-ID: <877d8kakwg.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 23 2022 at 13:27, Thomas Gleixner wrote: > On Wed, Mar 23 2022 at 12:04, Paolo Bonzini wrote: >> can this series be included in 5.18 and CCed to stable? > > working on it. There is another issue with that which I'm currently > looking into. The size calculation for the kernel state fails to take supervisor states into account. Up to 5.18 that did not matter because ENQCMD/PASID was disabled. But now it matters... Thanks, tglx --- --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1625,6 +1625,8 @@ static int __xstate_request_perm(u64 per /* Calculate the resulting kernel state size */ mask = permitted | requested; + /* Take supervisor states into account */ + mask |= xfeatures_mask_supervisor(); ksize = xstate_calculate_size(mask, compacted); /* Calculate the resulting user state size */