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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95F67C43217 for ; Tue, 7 Dec 2021 09:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234320AbhLGJug (ORCPT ); Tue, 7 Dec 2021 04:50:36 -0500 Received: from mail.skyhub.de ([5.9.137.197]:38582 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbhLGJuf (ORCPT ); Tue, 7 Dec 2021 04:50:35 -0500 Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (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 0C8C41EC0512; Tue, 7 Dec 2021 10:47:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1638870420; 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=wRE0vGa0fNJQQgdPcGxdfvPKi0PLqxdR04fFjmBBpUY=; b=cz2oWQLH06+YeLVYP0B8dsSse8TDIxm+kRm8PQ7oDI9AlFqc0hCQRm0Ehi7YBpIgPTgDOo +0LEN/izPXYL7h+K7KjaOZiGmCWrIHSEPBrg2CJ65pOFaaUOI+tcqVWYIIBpNmrCbCAy41 wDvwWgGs9ZnpiaHLkYCu2f36mGkRLO4= Date: Tue, 7 Dec 2021 10:47:01 +0100 From: Borislav Petkov To: Tianyu Lan Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, davem@davemloft.net, kuba@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, arnd@arndb.de, hch@infradead.org, m.szyprowski@samsung.com, robin.murphy@arm.com, Tianyu.Lan@microsoft.com, thomas.lendacky@amd.com, michael.h.kelley@microsoft.com, iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, vkuznets@redhat.com, brijesh.singh@amd.com, konrad.wilk@oracle.com, hch@lst.de, joro@8bytes.org, parri.andrea@gmail.com, dave.hansen@intel.com Subject: Re: [PATCH V6 2/5] x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has() Message-ID: References: <20211207075602.2452-1-ltykernel@gmail.com> <20211207075602.2452-3-ltykernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211207075602.2452-3-ltykernel@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 07, 2021 at 02:55:58AM -0500, Tianyu Lan wrote: > From: Tianyu Lan > > Hyper-V provides Isolation VM which has memory encrypt support. Add > hyperv_cc_platform_has() and return true for check of GUEST_MEM_ENCRYPT > attribute. You need to refresh on how to write commit messages - never say what the patch is doing - that's visible in the diff itself. Rather, you should talk about *why* it is doing what it is doing. > bool cc_platform_has(enum cc_attr attr) > { > + if (hv_is_isolation_supported()) > + return hyperv_cc_platform_has(attr); Is there any reason for the hv_is_.. check to come before... > + > if (sme_me_mask) > return amd_cc_platform_has(attr); ... the sme_me_mask check? What's in sme_me_mask on hyperv? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette 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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA45CC433F5 for ; Tue, 7 Dec 2021 09:47:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5C84B60789; Tue, 7 Dec 2021 09:47:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QDeA_opieE8k; Tue, 7 Dec 2021 09:47:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id D6BAD605C0; Tue, 7 Dec 2021 09:47:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B520CC001E; Tue, 7 Dec 2021 09:47:14 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3AC46C0012 for ; Tue, 7 Dec 2021 09:47:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2913360602 for ; Tue, 7 Dec 2021 09:47:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eR7n_Bb92jvP for ; Tue, 7 Dec 2021 09:47:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0CBB9605C0 for ; Tue, 7 Dec 2021 09:47:07 +0000 (UTC) Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (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 0C8C41EC0512; Tue, 7 Dec 2021 10:47:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1638870420; 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=wRE0vGa0fNJQQgdPcGxdfvPKi0PLqxdR04fFjmBBpUY=; b=cz2oWQLH06+YeLVYP0B8dsSse8TDIxm+kRm8PQ7oDI9AlFqc0hCQRm0Ehi7YBpIgPTgDOo +0LEN/izPXYL7h+K7KjaOZiGmCWrIHSEPBrg2CJ65pOFaaUOI+tcqVWYIIBpNmrCbCAy41 wDvwWgGs9ZnpiaHLkYCu2f36mGkRLO4= Date: Tue, 7 Dec 2021 10:47:01 +0100 From: Borislav Petkov To: Tianyu Lan Subject: Re: [PATCH V6 2/5] x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has() Message-ID: References: <20211207075602.2452-1-ltykernel@gmail.com> <20211207075602.2452-3-ltykernel@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211207075602.2452-3-ltykernel@gmail.com> Cc: linux-hyperv@vger.kernel.org, brijesh.singh@amd.com, dave.hansen@linux.intel.com, dave.hansen@intel.com, hpa@zytor.com, kys@microsoft.com, hch@lst.de, linux-arch@vger.kernel.org, hch@infradead.org, wei.liu@kernel.org, sthemmin@microsoft.com, linux-scsi@vger.kernel.org, x86@kernel.org, decui@microsoft.com, michael.h.kelley@microsoft.com, mingo@redhat.com, kuba@kernel.org, jejb@linux.ibm.com, parri.andrea@gmail.com, thomas.lendacky@amd.com, Tianyu.Lan@microsoft.com, arnd@arndb.de, konrad.wilk@oracle.com, haiyangz@microsoft.com, tglx@linutronix.de, martin.petersen@oracle.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, vkuznets@redhat.com, robin.murphy@arm.com, davem@davemloft.net X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, Dec 07, 2021 at 02:55:58AM -0500, Tianyu Lan wrote: > From: Tianyu Lan > > Hyper-V provides Isolation VM which has memory encrypt support. Add > hyperv_cc_platform_has() and return true for check of GUEST_MEM_ENCRYPT > attribute. You need to refresh on how to write commit messages - never say what the patch is doing - that's visible in the diff itself. Rather, you should talk about *why* it is doing what it is doing. > bool cc_platform_has(enum cc_attr attr) > { > + if (hv_is_isolation_supported()) > + return hyperv_cc_platform_has(attr); Is there any reason for the hv_is_.. check to come before... > + > if (sme_me_mask) > return amd_cc_platform_has(attr); ... the sme_me_mask check? What's in sme_me_mask on hyperv? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu