Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5167366pxj; Wed, 9 Jun 2021 10:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYBOPRGomkgeSxOALG7pQp1cdz5z66Lps5zAM59kukQJGx5OyHOy7uXBZO/TRz6FbO02Qj X-Received: by 2002:a17:907:9813:: with SMTP id ji19mr976732ejc.318.1623260340525; Wed, 09 Jun 2021 10:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623260340; cv=none; d=google.com; s=arc-20160816; b=XjDtCMSBT3DvS4F9UZZlkUpBk+4OtkeG9C56H/qd6lvMWPxGciRfSw+us0kn1U0zYm KUVtXaoFW9URFeGCe20gL+y/e0lEpCFaUoLuiYR3jTvNbzPiW2XKuXqyTI4L3s2SWmSz bHGycB1MAg2i77LzCKWhAN6jiTlm22SvxRpXRuoYVqaFGe2ZTnkGyqVvwV3/VCflaCOI UMmVRSWL47Uld8P4gZxTgFjHhGK2GViJy2NmKZFP9dAgreEmuW3ZnYcBh5Uqhw5Vq1LR ODBJ+Naaa8Z+SyQDkEPXe7QT0XTpaOWwZBLVVYsIB/zs9kKT/LguftVCHwB8miMj6Vt2 qRUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=erPgMtzYOBQBaE9YrhT0y+f20x07wD3cMZRhrUGyNNc=; b=duygxj3xzTjTrlPuTQBaeCnP+9mO9lQeXkEsEMy6U5vygQS/f4zjepctJZ+fJ+cY6B J8bjJmUewWSi0uzwy3gMxd3SRIoVv3BRQxCo24rbvrpejG0+av2YruWmlSc8X8s+cYCU RrfvCz+xbNw8vNu1OLdrOZhX+kTiDZCqUYyUYfB5x40QEQXd8U/2xZWQACg1eeAV8xi/ DaCqPfYrXih2oXVsDWpuXugluHwUFflhsbj2A53oy3bvvqV5E+aQMZQgnzXqFc66f8M8 Ju5V9Tdu5xW6Js7F/UtC22Uq4bxF70wAO6jBg6gmb554Ov0FI0SZCpTWtbzgzuUjdQIC qlRA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si348299ejh.531.2021.06.09.10.38.34; Wed, 09 Jun 2021 10:39:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237106AbhFIODM (ORCPT + 99 others); Wed, 9 Jun 2021 10:03:12 -0400 Received: from mga12.intel.com ([192.55.52.136]:8950 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbhFIODM (ORCPT ); Wed, 9 Jun 2021 10:03:12 -0400 IronPort-SDR: PA/E2CPZ2H2n+MCJjPJVxySwpebn0NQ0Mdw7CKqtSWtqfrchjO1U70O1d4mVFmOOVMrPeXAKnM E1j+6tVkHuAQ== X-IronPort-AV: E=McAfee;i="6200,9189,10010"; a="184764552" X-IronPort-AV: E=Sophos;i="5.83,261,1616482800"; d="scan'208";a="184764552" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2021 07:01:17 -0700 IronPort-SDR: 7urlEGBKJViTW/EwOgU4kVm2CQSLxbgs7NQ0UxHwew0xQv9U2IG/gfWYHWIqLSKL9O4ZJP3isV aHBSFX8VICLg== X-IronPort-AV: E=Sophos;i="5.83,261,1616482800"; d="scan'208";a="402450855" Received: from davidhok-mobl3.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.9.9]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2021 07:01:15 -0700 Subject: Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstraction To: Borislav Petkov Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org, Tom Lendacky References: <20210527042356.3983284-2-sathyanarayanan.kuppuswamy@linux.intel.com> <20210601211417.2177598-1-sathyanarayanan.kuppuswamy@linux.intel.com> <82f9e5a9-682a-70be-e5ea-938bb742265f@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <9466ae0b-3a2a-5a43-a4c6-39e07ebe0fbc@linux.intel.com> Date: Wed, 9 Jun 2021 07:01:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/7/21 11:26 AM, Borislav Petkov wrote: >> This header only exists in x86 arch code. So it is better to protect >> it with x86 specific header file. > That doesn't sound like a special reason to me. And compilers are > usually very able at discarding unused symbols so I don't see a problem > with keeping all includes at the top, like it is usually done. I am still not clear. What happens when a driver which includes linux/protected-guest.h is compiled for non-x86 arch (s390 or arm64)? Since asm/sev.h and asm/tdx.h exists only in x86_64 arch, IMO, it should be placed under CONFIG_INTEL_TDX_GUEST or CONFIG_AMD_MEM_ENCRYPT did I miss anything? -- Sathyanarayanan Kuppuswamy Linux Kernel Developer