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 6A6FBC47082 for ; Mon, 7 Jun 2021 20:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E5A261108 for ; Mon, 7 Jun 2021 20:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbhFGUQ3 (ORCPT ); Mon, 7 Jun 2021 16:16:29 -0400 Received: from mail.skyhub.de ([5.9.137.197]:33840 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbhFGUQ3 (ORCPT ); Mon, 7 Jun 2021 16:16:29 -0400 Received: from zn.tnic (p200300ec2f0b4f003f1ec01ee0666919.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:4f00:3f1e:c01e:e066:6919]) (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 77A311EC01DF; Mon, 7 Jun 2021 22:14:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623096876; 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=B4pmyNunWUMjDUP69GNVkOnzL1WI6677dnlEB/m07d4=; b=LERCftxMXPY0iHQQhSe4ACZfV2y43PCMsz1Tm+CVPxusNdk7a5Qwoxk38YZNy9ziJu1K+Y uI8HoOPBJPvhdqJ8EnxUtIsosrCKxy/p9N/tUazJFrnnZO7lz0ebwOoUwPBzOx3LhmquGP Yb5FJ1uA2UfaQBDnUR0cWE7PbZF+euk= Date: Mon, 7 Jun 2021 22:14:30 +0200 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: Kuppuswamy Sathyanarayanan , 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 Subject: Re: [RFC v2-fix-v2 1/1] x86: Introduce generic protected guest abstractionn Message-ID: References: <20210527042356.3983284-2-sathyanarayanan.kuppuswamy@linux.intel.com> <20210601211417.2177598-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210607195544.qlya6i5s2l2fkms2@box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210607195544.qlya6i5s2l2fkms2@box> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 10:55:44PM +0300, Kirill A. Shutemov wrote: > I think conversions like this are wrong: relocate_kernel(), which got > called here, only knows how to deal with SME, not how to handle some > generic case. What do you mean wrong? Wrong for TDX? If so, then that can be protected_guest_has(SME) or so, which would be false on Intel. And this patch was only a mechanical conversion to see how it would look like. > If code is written to handle a specific technology we need to stick > with a check that makes it clear. Trying to make sound generic only > leads to confusion. Sure, fine by me. And I don't want a zoo of gazillion small checking functions per technology. sev_, tdx_, yadda yadda. So stuff better be unified. Even if you'd have vendor-specific defines you hand into that function - and you will have such - it is still much saner than what it turns into with the AMD side of things. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette