Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp29049pxj; Tue, 1 Jun 2021 14:18:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYnn5VBD/NYhZudvVyeEXSfNqJ8RkYeAYJAiSbSZEHkmOh8wTy0YoaZwMnV83G5evHl+b7 X-Received: by 2002:a17:907:9e1:: with SMTP id ce1mr18151684ejc.104.1622582294066; Tue, 01 Jun 2021 14:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622582294; cv=none; d=google.com; s=arc-20160816; b=xx6lnxAwWrGXM33xzMIpOlr4RZcbK+TLanNFVnbw5OS4gfpwW249+AdNnyapU47RRS 6kZ/4+2QLAjvVMmMiGrSuNgK+NCG+B+65zWcw8UOGYhtCk84gVBBh8tlBVe0JuGMvFij 4PDbQCrqMBBfbgoAnAPD6krkfJvXsLYfH/mF7q9N2UVlvrlnpFND0ZMRA78cB78J4tif C4KnBReYaP7YRJrjsQ8MzeRuUxu38KeggrODZ8ooeXnrpsfAUTCFFKJdvB9shVF5jVqb MfYJFy3m9jDiYZwK0jr50z/LtoA9Q14UsJ/SZLUO6MAbE//aXrogylrmWkjxmAfN0SIt RU2Q== 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=dMUSooZcMI8M8FdpaTeo6oHKVKN5Oh+jAUHdpCM06ag=; b=Ff34D7rygytIgAmKFXSXx0DkfIWm0KheMM4033iWiyP3xGM04QL+GjcxHkQYQyzBvX sBck6bxB6Jdx4+HEAQOVFCkc8Hm3t0uKSqNyQ7jHesrybUK87Ho9PSpZf5Frr6DvrunJ YR7fGQD/mqWQ1Azrt/deWQypxo+6xIu7YKU1E+G7KZxXl3dOFQdY53Se22ywgua61f4O tkcshaqbVxG3cz3oYfdLmMiv4OUh8Q5AYJkN5doW49CUOYHEpbFd92IFMNU5AK02graZ o91Hz4iUn7aHToN1AqpB9SzUnNRYsOwsedMvamsuvKs8epePknr/CoHdGQiqf4VYxtFI XghA== 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 f18si15867014ejk.304.2021.06.01.14.17.41; Tue, 01 Jun 2021 14:18:14 -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 S234833AbhFAVST (ORCPT + 99 others); Tue, 1 Jun 2021 17:18:19 -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