Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp999045pxb; Thu, 23 Sep 2021 15:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZb0dTz7IbL08henz9funxVoIICHQzaETgvX2uKPazM/XC56OqC7FrJM3yne+Vjsq+Dpse X-Received: by 2002:a92:c0c4:: with SMTP id t4mr5736966ilf.235.1632436588357; Thu, 23 Sep 2021 15:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632436588; cv=none; d=google.com; s=arc-20160816; b=Wbval7N15xDK4twATzXrs+FEde/LLlJQSAVSXjyiPVmfv20hE9+gFcX/WkuBw2C20M FWKHWiD9bruBIAZGgHUyVb87MvZUj7BA2GZbOS4yJKQ78YAKKeoUCNx9hJdYYEEF9fSl qp1s3m2P2p5KQtUDlNhz5/rw6qBAW/6l/6Q+g5wVw4CNBIbpNAAA9z35upifXn99cmPg K2Z8arTVU99br+zXk7kLtkcRkBXVKIDBEqbFV0Fpae3WD2J+D1d984TQWP8bTXSbIWGB aqChurVisdu/roW/Zni/TeC0EJ2zPtQ+y1NFrthJt5U20Orld3Fwtsy/g7VYWCMIea5e AF2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=L2ZhBYtJSvsZ3l7DnjO1RVJlU7qQTq328JBw+26BNO0=; b=DUb+NsgMZtR6C83oH0+8AdL5Df3S5TY2ySbmVtja8LOroeH7kscm7/qUEw7Thplj0D uJCVYUXVuNOtfAKxEXV4+5a2223dB+0dcib6YhUctblzdbKusaeXVeIXkNW5EqzR1SJx cMbnepwxBfPBh3w7hodiZveSI1VDpgx5CxOigNX99UeV/0uXzhOpa01rHKMHRhG6DHas nyixmtnyfFvnE89mq/tzl7hQ2AIBtLG0gZN9bRG9yrzmkMBMZ9iBlKbz88DQeCzwHryo Ddr+cSo+q/8tY47yhWZRAtaoycwARPzIOr6UgKZT2aPH/w7UzQQWbuy37ws8BNn9n+TD BwqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AP2AqeL2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="C0Pn5U/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si9409473ios.88.2021.09.23.15.36.16; Thu, 23 Sep 2021 15:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AP2AqeL2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="C0Pn5U/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243477AbhIWWfm (ORCPT + 99 others); Thu, 23 Sep 2021 18:35:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:37652 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243431AbhIWWfk (ORCPT ); Thu, 23 Sep 2021 18:35:40 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1632436445; 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=L2ZhBYtJSvsZ3l7DnjO1RVJlU7qQTq328JBw+26BNO0=; b=AP2AqeL2It81p8EYgU0ybGho7LB+fApxbTmly/ggs1shuqHQQHYakj1Y1V64qry/bSY5fB 2kDyrurJ4kW1q6toAyoMrundluRj28RNSBBxzhUcUaD7xwLJN+kCJVvUlomT3h97kSHj8o PugfBxdna1AC/63Xf/5FiWrNiEZrkG8ciEUvptOAVbWcGsxPkpbnspRAqsDLGLWpPslChE CNUyzYQkYKv15igtp86SI/tiEIzIbea5VlmKkc+miIXpNcUdQinOMyYf8+FkJMjO1bdr6F IIi8xhJK7pywp4oE/tW+BwPA9Nrm/Vjhr+/Xun85rlj8oeopPa6/wC5J4tB3SQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1632436445; 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=L2ZhBYtJSvsZ3l7DnjO1RVJlU7qQTq328JBw+26BNO0=; b=C0Pn5U/YXm47mFk3fbXZQ1wtQFg7AG5C8SWwYN78P+hG8M5mLENfAsMrk+hXP+9nAoB1Lm aKpHY+vQmzE6zOAw== To: Sohil Mehta , x86@kernel.org Cc: Sohil Mehta , Tony Luck , Dave Hansen , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Jens Axboe , Christian Brauner , Peter Zijlstra , Shuah Khan , Arnd Bergmann , Jonathan Corbet , Ashok Raj , Jacob Pan , Gayatri Kammela , Zeng Guang , Dan Williams , Randy E Witt , Ravi V Shankar , Ramesh Thomas , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 04/13] x86/fpu/xstate: Enumerate User Interrupts supervisor state In-Reply-To: <20210913200132.3396598-5-sohil.mehta@intel.com> References: <20210913200132.3396598-1-sohil.mehta@intel.com> <20210913200132.3396598-5-sohil.mehta@intel.com> Date: Fri, 24 Sep 2021 00:34:04 +0200 Message-ID: <87ilyqgbvn.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13 2021 at 13:01, Sohil Mehta wrote: > Enable xstate supervisor support for User Interrupts by default. What means enabled by default? It's enabled when available and not disabled on the command line. > The user interrupt state for a task consists of the MSR state and the > User Interrupt Flag (UIF) value. XSAVES and XRSTORS handle saving and > restoring both of these states. > > in the past. The Uintr context switching code would also need rework and > additional testing in that regard.> What? Which issues were reported and if they have been reported then how is the provided code correct? > +/* > + * State component 14 is supervisor state used for User Interrupts state. > + * The size of this state is 48 bytes > + */ > +struct uintr_state { > + u64 handler; > + u64 stack_adjust; > + u32 uitt_size; > + u8 uinv; > + u8 pad1; > + u8 pad2; > + u8 uif_pad3; /* bit 7 - UIF, bits 6:0 - reserved */ Please do not use tail comments. Also what kind of name is uif_pad3? Bitfields exist for a reason. Aside of that please use tabs to seperate type and name. > + u64 upid_addr; > + u64 uirr; > + u64 uitt_addr; > +} __packed; > + Thanks, tglx