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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 48A4CC47080 for ; Mon, 31 May 2021 19:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1921361260 for ; Mon, 31 May 2021 19:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231409AbhEaTQe (ORCPT ); Mon, 31 May 2021 15:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbhEaTQd (ORCPT ); Mon, 31 May 2021 15:16:33 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C7CC061574 for ; Mon, 31 May 2021 12:14:53 -0700 (PDT) Received: from zn.tnic (p200300ec2f080f00caafab4a831a2d08.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:f00:caaf:ab4a:831a:2d08]) (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 814481EC0570; Mon, 31 May 2021 21:14:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1622488491; 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=tzOm/G5qfBYV1P1hRsvP4m2wExoTfbnjW+M/2R/uxaM=; b=FWSJ2LNsRYwnvOTJbHXhOVfNDRR1506QAP7UysJLaeVjadc7DLZgICluyPUbaUcOLQcQJO K5YUEdtMy8KxcNuwXj+az0r/L6G2pqkHU8MyasRLtJbSnQrQndn0k7JBr/o5DQ4+aRWvXS KJ7nQc3q2B1Eax4/ZyLt37VB8g3YPiI= Date: Mon, 31 May 2021 21:14:45 +0200 From: Borislav Petkov To: "Kuppuswamy, Sathyanarayanan" 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 Subject: Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap() Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <280669ec-d43a-83af-55ba-ad03411538b5@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 31, 2021 at 11:45:38AM -0700, Kuppuswamy, Sathyanarayanan 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. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette