lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Feb 2023 13:58:21 +0800
From:   Tianyu Lan <ltykernel@...il.com>
To:     "Michael Kelley (LINUX)" <mikelley@...rosoft.com>,
        "luto@...nel.org" <luto@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "seanjc@...gle.com" <seanjc@...gle.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "jgross@...e.com" <jgross@...e.com>,
        Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        "kirill@...temov.name" <kirill@...temov.name>,
        "jiangshan.ljs@...group.com" <jiangshan.ljs@...group.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "ashish.kalra@....com" <ashish.kalra@....com>,
        "srutherford@...gle.com" <srutherford@...gle.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "anshuman.khandual@....com" <anshuman.khandual@....com>,
        "pawan.kumar.gupta@...ux.intel.com" 
        <pawan.kumar.gupta@...ux.intel.com>,
        "adrian.hunter@...el.com" <adrian.hunter@...el.com>,
        "daniel.sneddon@...ux.intel.com" <daniel.sneddon@...ux.intel.com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "sandipan.das@....com" <sandipan.das@....com>,
        "ray.huang@....com" <ray.huang@....com>,
        "brijesh.singh@....com" <brijesh.singh@....com>,
        "michael.roth@....com" <michael.roth@....com>,
        "thomas.lendacky@....com" <thomas.lendacky@....com>,
        "venu.busireddy@...cle.com" <venu.busireddy@...cle.com>,
        "sterritt@...gle.com" <sterritt@...gle.com>,
        "tony.luck@...el.com" <tony.luck@...el.com>,
        "samitolvanen@...gle.com" <samitolvanen@...gle.com>,
        "fenghua.yu@...el.com" <fenghua.yu@...el.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: [RFC PATCH V3 08/16] x86/hyperv: Initialize cpu and memory for
 sev-snp enlightened guest

On 2/1/2023 2:20 AM, Michael Kelley (LINUX) wrote:
>> +struct memory_map_entry {
>> +	u64 starting_gpn;
>> +	u64 numpages;
>> +	u16 type;
>> +	u16 flags;
>> +	u32 reserved;
>> +};
> Am I correct that this structure is defined by Hyper-V?  If so, it seems
> like it should go in hyperv-tlfs.h, along with the definition of
> EN_SEV_SNP_PROCESSOR_INFO_ADDR (which is also defined by
> Hyper-V?)
>

Yes, it's Hyper-V data structure and will move to hyperv-tlfs.h.


>> +			if (e820_end < ram_end) {
>> +				pr_info("Hyper-V: add e820 entry [mem %#018Lx-%#018Lx]\n", e820_end, ram_end - 1);
>> +				e820__range_add(e820_end, ram_end - e820_end,
>> +						E820_TYPE_RAM);
>> +				for (page = e820_end; page < ram_end; page += PAGE_SIZE)
>> +					pvalidate((unsigned long)__va(page), RMP_PG_SIZE_4K, true);
>> +			}
>> +		}
>> +	}
>> +
> For SNP vTOM mode, most of the supporting code is placed in
> arch/x86/hyperv/ivm.c, which is built only if CONFIG_HYPERV
> is defined.  arch/x86/kernel/cpu/mshyperv.c is built for*any*
> flavor of guest (i.e., CONFIG_HYPERVISOR_GUEST).  I'm thinking
> all this code should go as a supporting function in ivm.c, to
> avoid overloading mshyperv.c.  Take a look at how hv_vtom_init()
> is handled in my patch set.
> 
> Breaking it out as a separate supporting function might also
> help reduce the deep indentation problem a bit. 😄

Good idea. Will update in the next version.
Thanks for your suggestion.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ