Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4582067pxj; Tue, 25 May 2021 11:11:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu50vdSPaSRmrtPwgg49vMadxR13wDY0QMjmZoqL8FwfFPqKQkLQ+qJNAddBg5bsq1lqOx X-Received: by 2002:a92:1909:: with SMTP id 9mr22485476ilz.229.1621966308020; Tue, 25 May 2021 11:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621966308; cv=none; d=google.com; s=arc-20160816; b=PoHAHHWORki4KzrIJHTrwZ0rov5IBqgzjkgAuH277Blgq550ayKorE/WC9tWSaAsvN lU+zmjID4XdLq1+BlVkJHU8T1RSI5l8U/ODWi/uy8a1IftD/lg7ux/hKtAExykSkjvEb rXxzOpdYwFYmPzdeUuAddsESnp8KvB0r+p7JggolggHQXRG2qkTwDYg0HV1PAcNSKSaj HtTHLCAvBWoAifCGRrcNY4B6vi2gAI+s/KvJflgTwFBDWDOABkJ43Zyy55n7klh2LEt8 z66m1cROKONO3YsoFwQVnNKgZo1bho3Z963JyxhN7pe3oKaIDcyPldIP2puMudGGbU94 sJmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6ADo+SJAFDYoZ/cFSnzSHZKB9hTw+MZcTWevSiWUSgc=; b=vmJ1tvAhQETkwgg19lCcxoihQ2t399CTmOGBIL3LABefe62WMsSLvb9duJwboZNOFU Yt165rN5ynUvSKk0waUwrbWf/bGei2yuRZafqcdl95tm9omrehGJu/mPNMPD7dL8Z4Fr S+mjSN04La7YtbOMqA42ukqqaKeFbHCdi9lxa2Z27zVhw5pbASdQXDeIp5Z4thbFN137 JJ43/TgnOp8y2R0fzblDqUt5pOxKJ9tHuUKH9Lea/0BM4Ppj6g7MmhzOZ1Gz4q68lIcG EqcBf8GaAV22KoWe0gjQnuhT5hHInXCsFtXrTHjMil4lQE0V1ro2+cA1p9IOAPpiss73 L3SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=pL8P7QCZ; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si20735814ils.62.2021.05.25.11.11.34; Tue, 25 May 2021 11:11:48 -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=@alien8.de header.s=dkim header.b=pL8P7QCZ; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234022AbhEYR2t (ORCPT + 99 others); Tue, 25 May 2021 13:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233933AbhEYR2m (ORCPT ); Tue, 25 May 2021 13:28:42 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3403C061574 for ; Tue, 25 May 2021 10:27:12 -0700 (PDT) Received: from zn.tnic (p200300ec2f0c1b000aca3c1b1089f8dd.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:1b00:aca:3c1b:1089:f8dd]) (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 13E171EC0249; Tue, 25 May 2021 19:27:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1621963631; 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=6ADo+SJAFDYoZ/cFSnzSHZKB9hTw+MZcTWevSiWUSgc=; b=pL8P7QCZ9HNe+NWlAqQR386tRlbmLdOcUoWgO4zbA4srQfTe8qvBUrl4yDj9kM4M5PVeVo 2emcZ2PzH1gctKxcwZMIFMPURMzrKgJlP0t72ZXd3Orn8/xpStZBYkK/fu5s1O+/nAHDGv OoII/7s68zOa5YBR4CKlD7XG8za8T0k= Date: Tue, 25 May 2021 19:27:05 +0200 From: Borislav Petkov To: Len Brown Cc: "Chang S. Bae" , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , X86 ML , "Brown, Len" , Dave Hansen , "Liu, Jing2" , "Ravi V. Shankar" , Linux Kernel Mailing List Subject: Re: [PATCH v5 15/28] x86/arch_prctl: Create ARCH_GET_XSTATE/ARCH_PUT_XSTATE Message-ID: References: <20210523193259.26200-1-chang.seok.bae@intel.com> <20210523193259.26200-16-chang.seok.bae@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 07:10:57PM -0400, Len Brown wrote: > 1. CPUID has AMX > 2. XCR0 has AMX > 3. Linux permission has been requested and granted to this process Actually, you want *only* 3 as 1 is a bad idea - we're in this mess because userspace does feature detection on its own even when kernel support is needed. When Linux grants the permission, 1 and 2 should be implicitly given. > The dis-advantage of on-demand is that there is no buffer release mechanism -- > the buffer lives as long as the task lives. Though, per previous conversation, > a future kernel could easily implement a buffer re-claim mechanism > behind the scenes > since the kernel is empowered to re-arm XFD for whatever reason it wants... Why is buffer release even needed? 1) sounds like a simple and clean thing to do. > 2. Synchronous allocation. Any task in the process that has AMX permission can > make a 2nd system call to request that the kernel synchronously allocate the > 8KB buffer for that task. * That doesn't sound as clean. More like unneeded work on the side of userspace programmer which she/he can save her-/himself from. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette