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 X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4299FC4708F for ; Tue, 1 Jun 2021 21:16:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C330613B1 for ; Tue, 1 Jun 2021 21:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234890AbhFAVSU (ORCPT ); Tue, 1 Jun 2021 17:18:20 -0400 Received: from mga06.intel.com ([134.134.136.31]:63172 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234707AbhFAVSN (ORCPT ); Tue, 1 Jun 2021 17:18:13 -0400 IronPort-SDR: IqBf7QQJ3LNZFXZAaP+EajqTz9lQ/OrRgmrAl24D+/N5qxj90Lz5hNDJVzFrB/EH6p4M2l/PqK le1Aw0B4cqSw== X-IronPort-AV: E=McAfee;i="6200,9189,10002"; a="264822798" X-IronPort-AV: E=Sophos;i="5.83,241,1616482800"; d="scan'208";a="264822798" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 14:16:30 -0700 IronPort-SDR: Ahr6yiJeA+QINx6dPh6s1Y1XSbvy790SlbtSqyxH6xGj5Xn25z53+Vf2T1tRQL5Az1NVc5TO6p K/4fYsShrCuA== X-IronPort-AV: E=Sophos;i="5.83,241,1616482800"; d="scan'208";a="416610847" Received: from gemalouf-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.213.187.103]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 14:16:30 -0700 Subject: Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap() To: Borislav Petkov Cc: Tom Lendacky , Sean Christopherson , Dave Hansen , Andi Kleen , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , linux-kernel@vger.kernel.org, Brijesh Singh References: <0e233779-9c10-11df-b527-ef61e003ea35@linux.intel.com> <86b4d995-9619-81fa-5ef4-86f48ab01e96@amd.com> <96a63ddf-98f9-7095-f7bb-100bf56a4d10@linux.intel.com> <280669ec-d43a-83af-55ba-ad03411538b5@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Tue, 1 Jun 2021 14:16:27 -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 Hi, On 5/31/21 12:14 PM, Borislav Petkov wrote: >> We can also use protected_guest_has(VM_VIRTIO_SECURE_FIX) or something >> similar for this purpose. Andi, any comments? > protected_guest_has() is enough for that - no need for two functions. > >> IMHO, its better to use above generic config option in common header >> file (linux/protected_guest.h). Any architecture that implements >> protected guest feature can enable it. This will help is hide arch >> specific config options in arch specific header file. > You define empty function stubs for when the arch config option is not > enabled. Everything else is unnecessary. When another architecture needs > this, then another architecture will generalize it like it is usually > done. Please check the updated version in email titled "[RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstraction". We can continue the rest of the discussion in that email. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer