mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tianyu Lan <ltykernel@gmail.com>
To: Borislav Petkov <bp@alien8.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Wei Liu <wei.liu@kernel.org>
Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@intel.com,
	luto@kernel.org, peterz@infradead.org,
	sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com,
	ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com,
	hpa@zytor.com, jmattson@google.com, seanjc@google.com,
	thomas.lendacky@amd.com, brijesh.singh@amd.com, x86@kernel.org,
	linux-kernel@vger.kernel.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	Tianyu Lan <Tianyu.Lan@microsoft.com>
Subject: Re: [PATCH 1/4] x86/hyperv: Add missing ARCH_HAS_CC_PLATFORM dependency
Date: Wed, 23 Feb 2022 15:04:41 +0800	[thread overview]
Message-ID: <4769a3c0-449b-184a-5c61-a0e155f9c5b4@gmail.com> (raw)
In-Reply-To: <YhVCoveTwsDZXE5G@zn.tnic>

On 2/23/2022 4:08 AM, Borislav Petkov wrote:
> On Tue, Feb 22, 2022 at 09:57:37PM +0300, Kirill A. Shutemov wrote:
>> On x86, cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) supposes to return
>> true for HyperV if isolation is supported. But it only does it if the
>> kernel is compiled with AMD_MEM_ENCRYPT enabled.
>>
>> It happens due to missed ARCH_HAS_CC_PLATFORM dependency. Without
>> ARCH_HAS_CC_PLATFORM enabled, cc_platform_has() always returns false.
>>
>> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
>> Cc: Haiyang Zhang <haiyangz@microsoft.com>
>> Cc: Stephen Hemminger <sthemmin@microsoft.com>
>> Cc: Wei Liu <wei.liu@kernel.org>
>> Cc: Dexuan Cui <decui@microsoft.com>
>> Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>
>> ---
>>   drivers/hv/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
>> index 0747a8f1fcee..424d3f0751dc 100644
>> --- a/drivers/hv/Kconfig
>> +++ b/drivers/hv/Kconfig
>> @@ -8,6 +8,7 @@ config HYPERV
>>   		|| (ARM64 && !CPU_BIG_ENDIAN))
>>   	select PARAVIRT
>>   	select X86_HV_CALLBACK_VECTOR if X86
>> +	select ARCH_HAS_CC_PLATFORM if x86
>>   	select VMAP_PFN
>>   	help
>>   	  Select this option to run Linux as a Hyper-V client operating
>> -- 
> 
> Good catch.
> 
> I'm guessing this needs
> 
> Fixes: c789b90a6904 ("x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has()")
> 
> which added hyperv_cc_platform_has() and which needs to go to Linus now,
> as an urgent fix for 5.17 as that patch came into 5.17-rc1.
> 
> Wei?
> 

Hi Borias, wei and Kill:
       Current Hyper-V Isolation VM requires AMD_MEM_ENCRYPT option 
which selects ARCH_HAS_CC_PLATFORM. Linux guest can't boot up without 
AMD_MEM_ENCRYPT option. So this is why not select ARCH_HAS_CC_PLATFORM
here.

  reply	other threads:[~2022-02-23  7:04 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 18:57 [PATCH 0/4] x86: Cleanup and extend computing computing API Kirill A. Shutemov
2022-02-22 18:57 ` [PATCH 1/4] x86/hyperv: Add missing ARCH_HAS_CC_PLATFORM dependency Kirill A. Shutemov
2022-02-22 20:08   ` Borislav Petkov
2022-02-23  7:04     ` Tianyu Lan [this message]
2022-02-23 10:41       ` Borislav Petkov
2022-02-23 10:43         ` Tianyu Lan
2022-02-23 10:56           ` Borislav Petkov
2022-02-23 11:02             ` Tianyu Lan
2022-02-23 11:47               ` Kirill A. Shutemov
2022-02-23 14:09                 ` Tianyu Lan
2022-02-23 15:46                   ` Kirill A. Shutemov
2022-02-22 18:57 ` [PATCH 2/4] x86: Rename cc_platform.c to arch/x86/coco/core.c Kirill A. Shutemov
2022-02-22 20:52   ` Borislav Petkov
2022-02-24 11:59   ` [tip: x86/cc] x86/cc: Move arch/x86/{kernel/cc_platform.c => coco/core.c} tip-bot2 for Kirill A. Shutemov
2022-02-22 18:57 ` [PATCH 3/4] x86/coco: Explicitly declare type of confidential computing platform Kirill A. Shutemov
2022-02-24 11:59   ` [tip: x86/cc] " tip-bot2 for Kirill A. Shutemov
2022-02-22 18:57 ` [PATCH 4/4] x86/coco: Add API to handle encryption mask Kirill A. Shutemov
2022-02-24 11:59   ` [tip: x86/cc] " tip-bot2 for Kirill A. Shutemov
2022-02-22 21:56 ` [PATCH 0/4] x86: Cleanup and extend computing computing API Tom Lendacky
2022-02-23  4:35 ` [PATCH] x86/mm/cpa: Generalize __set_memory_enc_pgtable() Brijesh Singh
2022-02-23 11:31   ` Borislav Petkov
2022-02-23 11:55     ` Kirill A. Shutemov
2022-02-23 12:13       ` Borislav Petkov
2022-02-23 12:25         ` Kirill A. Shutemov
2022-02-23 12:38           ` Borislav Petkov
2022-02-23 12:54             ` Kirill A. Shutemov
2022-02-23 14:33             ` Brijesh Singh
2022-02-24 11:59   ` [tip: x86/cc] " tip-bot2 for Brijesh Singh
2022-02-23 19:10 ` [PATCH 0/4] x86: Cleanup and extend computing computing API Borislav Petkov
2022-02-23 19:17   ` [PATCH 1/4] x86/cc: Move arch/x86/{kernel/cc_platform.c => coco/core.c} Borislav Petkov
2022-02-23 19:17   ` [PATCH 2/4] x86/coco: Explicitly declare type of confidential computing platform Borislav Petkov
2022-02-23 19:17   ` [PATCH 3/4] x86/coco: Add API to handle encryption mask Borislav Petkov
2022-02-23 19:17   ` [PATCH 4/4] x86/mm/cpa: Generalize __set_memory_enc_pgtable() Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4769a3c0-449b-184a-5c61-a0e155f9c5b4@gmail.com \
    --to=ltykernel@gmail.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=david@redhat.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=seanjc@google.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=wei.liu@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®