Re: [Xen-devel] [PATCH v3 4/9] x86/mm/tlb: Flush remote and local TLBs concurrently

2019-07-30 Thread Michael Kelley
trace/hyperv.h | 2 +- > arch/x86/kernel/kvm.c | 11 +-- > arch/x86/kernel/paravirt.c| 2 +- > arch/x86/mm/tlb.c | 47 ++- > arch/x86/xen/mmu_pv.c | 11 +++ > inc

Re: [Xen-devel] [PATCH v2 6/6] x86: implement Hyper-V clock source

2019-12-18 Thread Michael Kelley
From: Durrant, Paul Sent: Wednesday, December 18, 2019 7:24 AM > > From: Wei Liu On Behalf Of Wei Liu > > Sent: 18 December 2019 14:43 [snip] > > + > > +static inline uint64_t read_hyperv_timer(void) > > +{ > > +uint64_t scale, offset, ret, tsc; > > +uint32_t seq; > > +const struc

Re: [Xen-devel] [PATCH 4/8] x86/hyperv: setup hypercall page

2019-12-29 Thread Michael Kelley
From: Wei Liu On Behalf Of Wei Liu Sent: Sunday, December 29, 2019 10:34 AM > > Signed-off-by: Wei Liu > --- > xen/arch/x86/guest/hyperv/hyperv.c | 41 +++--- > 1 file changed, 38 insertions(+), 3 deletions(-) > > diff --git a/xen/arch/x86/guest/hyperv/hyperv.c > b/x

Re: [Xen-devel] [PATCH 8/8] x86/hyperv: setup VP assist page

2019-12-29 Thread Michael Kelley
From: Wei Liu On Behalf Of Wei Liu Sent: Sunday, December 29, 2019 10:34 AM > > VP assist page is rather important as we need to toggle some bits in > that page such that L1 guest can make hypercalls directly to L0 Hyper-V. > > Preemptively split out set_vp_assist page which will be used in th

Re: [Xen-devel] [PATCH v2 3/3] x86/hyperv: L0 assisted TLB flush

2020-02-14 Thread Michael Kelley
From: Wei Liu On Behalf Of Wei Liu Sent: Friday, February 14, 2020 4:35 AM > > Implement L0 assisted TLB flush for Xen on Hyper-V. It takes advantage > of several hypercalls: > > * HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST > * HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX > * HVCALL_FLUSH_VIRTUAL_ADDRESS_SPA

Re: [Xen-devel] [PATCH v3 3/3] x86/hyperv: L0 assisted TLB flush

2020-02-17 Thread Michael Kelley
From: Wei Liu On Behalf Of Wei Liu [snip] > diff --git a/xen/arch/x86/guest/hyperv/util.c > b/xen/arch/x86/guest/hyperv/util.c > new file mode 100644 > index 00..0abb37b05f > --- /dev/null > +++ b/xen/arch/x86/guest/hyperv/util.c > @@ -0,0 +1,74 @@ > +/**

Re: [Xen-devel] [PATCH v3 3/5] x86/hyperv: provide percpu hypercall input page

2020-01-07 Thread Michael Kelley
From: Wei Liu Sent: Tuesday, January 7, 2020 8:34 AM > > On Mon, Jan 06, 2020 at 11:27:18AM +0100, Jan Beulich wrote: > > On 05.01.2020 17:47, Wei Liu wrote: > > > Hyper-V's input / output argument must be 8 bytes aligned an not cross > > > page boundary. The easiest way to satisfy those requirem

Re: [Xen-devel] [PATCH v4 2/7] x86/hyperv: setup hypercall page

2020-01-22 Thread Michael Kelley
From: Wei Liu On Behalf Of Wei Liu Sent: Wednesday, January 22, 2020 12:24 PM > > Use the top-most addressable page for that purpose. Adjust e820 code > accordingly. > > We also need to register Xen's guest OS ID to Hyper-V. Use 0x300 as the > OS type. > > Signed-off-by: Wei Liu > --- > XXX

Re: [Xen-devel] [PATCH v4 2/7] x86/hyperv: setup hypercall page

2020-01-23 Thread Michael Kelley
From: Jan Beulich Sent: Thursday, January 23, 2020 3:19 AM > > On 22.01.2020 21:23, Wei Liu wrote: > > --- a/xen/arch/x86/e820.c > > +++ b/xen/arch/x86/e820.c > > @@ -36,6 +36,22 @@ boolean_param("e820-verbose", e820_verbose); > > struct e820map e820; > > struct e820map __initdata e820_raw; > >

RE: [PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-24 Thread Michael Kelley
ome simplification of the pvops implementation. > > Signed-off-by: Juergen Gross > --- > V4: > - drop paravirt_time.h again > - don't move Hyper-V code (Michael Kelley) > --- > arch/x86/Kconfig | 1 + > arch/x86/include/asm/mshyperv.

RE: [PATCH] x86/mtrr: Rename mtrr_overwrite_state() to guest_force_mtrr_state()

2024-10-18 Thread Michael Kelley
t; + guest_force_mtrr_state(var, reg, MTRR_TYPE_UNCACHABLE); > #endif > } > > @@ -195,7 +195,7 @@ static void __init xen_pv_init_platform(void) > if (xen_initial_domain()) > xen_set_mtrr_data(); > else > - mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK); > + guest_force_mtrr_state(NULL, 0, MTRR_TYPE_WRBACK); > > /* Adjust nr_cpu_ids before "enumeration" happens */ > xen_smp_count_cpus(); > -- > 2.45.2 > LGTM Reviewed-by: Michael Kelley

RE: [PATCH V3 01/13] x86/HV: Initialize GHCB page in Isolation VM

2021-08-12 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject: [PATCH V3 01/13] x86/HV: Initialize GHCB page in Isolation VM The subject line tag on patches under arch/x86/hyperv is generally "x86/hyperv:". There's some variation in the spelling of "hyperv", but let's go with the all lowercas

RE: [PATCH V3 02/13] x86/HV: Initialize shared memory boundary in the Isolation VM.

2021-08-12 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject: [PATCH V3 02/13] x86/HV: Initialize shared memory boundary in the > Isolation VM. As with Patch 1, use the "x86/hyperv:" tag in the Subject line. > > From: Tianyu Lan > > Hyper-V exposes shared memory boundary via cpuid > HYPE

RE: [PATCH V3 03/13] x86/HV: Add new hvcall guest address host visibility support

2021-08-12 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject: [PATCH V3 03/13] x86/HV: Add new hvcall guest address host > visibility support Use "x86/hyperv:" tag in the Subject line. > > From: Tianyu Lan > > Add new hvcall guest address host visibility support to mark > memory visible

RE: [PATCH V3 03/13] x86/HV: Add new hvcall guest address host visibility support

2021-08-12 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM [snip] > diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c > index ad8a5c586a35..1e4a0882820a 100644 > --- a/arch/x86/mm/pat/set_memory.c > +++ b/arch/x86/mm/pat/set_memory.c > @@ -29,6 +29,8 @@ > #include > #includ

RE: [PATCH V3 04/13] HV: Mark vmbus ring buffer visible to host in Isolation VM

2021-08-12 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject: [PATCH V3 04/13] HV: Mark vmbus ring buffer visible to host in > Isolation VM > Use tag "Drivers: hv: vmbus:" in the Subject line. > Mark vmbus ring buffer visible with set_memory_decrypted() when > establish gpadl handle. > >

RE: [PATCH V3 05/13] HV: Add Write/Read MSR registers via ghcb page

2021-08-13 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject: [PATCH V3 05/13] HV: Add Write/Read MSR registers via ghcb page See previous comments about tag in the Subject line. > Hyper-V provides GHCB protocol to write Synthetic Interrupt > Controller MSR registers in Isolation VM with AMD

RE: [PATCH V3 05/13] HV: Add Write/Read MSR registers via ghcb page

2021-08-13 Thread Michael Kelley
From: Michael Kelley Sent: Friday, August 13, 2021 12:31 PM > To: Tianyu Lan ; KY Srinivasan ; > Haiyang Zhang ; > Stephen Hemminger ; wei@kernel.org; Dexuan Cui > ; > t...@linutronix.de; mi...@redhat.com; b...@alien8.de; x...@kernel.org; > h...@zytor.com; dave.han...@li

RE: [PATCH V3 06/13] HV: Add ghcb hvcall support for SNP VM

2021-08-13 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > Hyper-V provides ghcb hvcall to handle VMBus > HVCALL_SIGNAL_EVENT and HVCALL_POST_MESSAGE > msg in SNP Isolation VM. Add such support. > > Signed-off-by: Tianyu Lan > --- > arch/x86/hyperv/ivm.c | 43

RE: [PATCH V3 07/13] HV/Vmbus: Add SNP support for VMbus channel initiate message

2021-08-13 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > The monitor pages in the CHANNELMSG_INITIATE_CONTACT msg are shared > with host in Isolation VM and so it's necessary to use hvcall to set > them visible to host. In Isolation VM with AMD SEV SNP, the access > address should be in the ext

RE: [PATCH V3 00/13] x86/Hyper-V: Add Hyper-V Isolation VM support

2021-08-16 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > Hyper-V provides two kinds of Isolation VMs. VBS(Virtualization-based > security) and AMD SEV-SNP unenlightened Isolation VMs. This patchset > is to add support for these Isolation VM support in Linux. > A general comment about this ser

RE: [PATCH V3 08/13] HV/Vmbus: Initialize VMbus ring buffer for Isolation VM

2021-08-16 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > VMbus ring buffer are shared with host and it's need to s/it's need/it needs/ > be accessed via extra address space of Isolation VM with > SNP support. This patch is to map the ring buffer > address in extra address space via ioremap().

RE: [PATCH V3 11/13] HV/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-08-19 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > Hyper-V Isolation VM requires bounce buffer support to copy > data from/to encrypted memory and so enable swiotlb force > mode to use swiotlb bounce buffer for DMA transaction. > > In Isolation VM with AMD SEV, the bounce buffer needs to

RE: [PATCH V3 12/13] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-08-19 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > The Subject line tag should be "hv_netvsc:". > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vm

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-19 Thread Michael Kelley
From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > Subject line tag should be "scsi: storvsc:" > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > storvsc rx/tx ring buffer. The page buffer used by vm

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley
From: h...@lst.de Sent: Thursday, August 19, 2021 9:33 PM > > On Thu, Aug 19, 2021 at 06:17:40PM +, Michael Kelley wrote: > > > > > > @@ -1824,6 +1848,13 @@ static int storvsc_queuecommand(struct Scsi_Host > > > *host, struct scsi_cmnd *scmnd) > >

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 20, 2021 8:20 AM > > On 8/20/2021 2:17 AM, Michael Kelley wrote: > > From: Tianyu Lan Sent: Monday, August 9, 2021 10:56 AM > > > > I'm not clear on why payload->range.offset needs to be set again. > > Even after the d

RE: [PATCH V3 13/13] HV/Storvsc: Add Isolation VM support for storvsc driver

2021-08-20 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 20, 2021 11:04 AM > > On 8/21/2021 12:08 AM, Michael Kelley wrote: > >>>> } > >>> The whole approach here is to do dma remapping on each individual page > >>> of the I/O buffer. But wouldn't it

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-26 Thread Michael Kelley
ormance measurements. With CONFIG_SWIOTLB_DYNAMIC, > swiotlb_find_pool() is not trivial, and it uses an RCU read lock, > so avoiding the redundant calls helps performance in a hot path. > When CONFIG_SWIOTLB_DYNAMIC is *not* set, the code size reduction > is minimal and the perf

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-27 Thread Michael Kelley
From: Petr Tesařík Sent: Wednesday, June 26, 2024 11:52 PM > > Oh, right. The idea is good, but I was not able to reply immediately > and then forgot about it. > > For the record, I considered an alternative: Call swiotlb_* functions > unconditionally and bail out early if the pool is NULL. But

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-27 Thread Michael Kelley
From: Petr Tesařík Sent: Thursday, June 27, 2024 12:21 AM [...] > > @@ -187,10 +169,13 @@ static inline bool is_swiotlb_buffer(struct device > > *dev, phys_addr_t paddr) > > * This barrier pairs with smp_mb() in swiotlb_find_slots(). > > */ > > smp_rmb(); > > - return READ_ONCE(

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-27 Thread Michael Kelley
From: h...@lst.de Sent: Thursday, June 27, 2024 8:25 AM > > On Thu, Jun 27, 2024 at 02:59:03PM +, Michael Kelley wrote: > > Conceptually, it's still being used as a boolean function based on > > whether the return value is NULL. Renaming it to swiotlb_get_poo

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-29 Thread Michael Kelley
From: Michael Kelley Sent: Thursday, June 27, 2024 8:05 AM > > From: Petr Tesařík Sent: Thursday, June 27, 2024 12:21 AM > > [...] > > > > @@ -187,10 +169,13 @@ static inline bool is_swiotlb_buffer(struct device > > > *dev, phys_addr_t paddr) > > >

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-29 Thread Michael Kelley
From: Petr Tesařík Sent: Friday, June 28, 2024 12:47 AM > > V Fri, 28 Jun 2024 08:01:29 +0200 > "h...@lst.de" napsáno: > > > On Thu, Jun 27, 2024 at 04:02:59PM +, Michael Kelley wrote: > > > > > Conceptually, it's still being used as a boolea

RE: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()

2024-06-30 Thread Michael Kelley
From: h...@lst.de Sent: Saturday, June 29, 2024 10:56 PM > > On Sat, Jun 29, 2024 at 03:55:58PM +, Michael Kelley wrote: > > Unless there is further discussion on this point, I'll just keep the > > original > > "is_swiotlb_buffer()" in v2. > &

RE: [PATCH v2 1/1] swiotlb: Reduce swiotlb pool lookups

2024-07-06 Thread Michael Kelley
From: Christoph Hellwig Sent: Friday, July 5, 2024 10:50 PM > > Hi Michael, > > I like the idea behind this, but can you respin it to avoid some of > the added code duplication. We have a lot of this pattern: > > pool = swiotlb_find_pool(dev, paddr); > if (pool) > swi

RE: [PATCH v2 1/1] swiotlb: Reduce swiotlb pool lookups

2024-07-06 Thread Michael Kelley
From: Michael Kelley Sent: Saturday, July 6, 2024 7:12 PM [ ... ] > > > > If we then stub out swiotlb_find_pool to return NULL for !CONFIG_SWIOTLB, > > we also don't need extra stubs for all the __swiotlb_ helpers as the > > compiler will eliminate the calls as dead

RE: [PATCH v3 1/1] swiotlb: Reduce swiotlb pool lookups

2024-07-09 Thread Michael Kelley
From: Christoph Hellwig Sent: Monday, July 8, 2024 11:26 PM > > Hi Michael, > > I've applied this, but I've made a few changes before that directly as > we're getting close to the end of the merge window. > > Most of it is very slight formatting tweaks, but I've also kept the > dma_uses_io_tlb

RE: [PATCH v3 1/1] swiotlb: Reduce swiotlb pool lookups

2024-07-10 Thread Michael Kelley
From: Petr Tesařík Sent: Wednesday, July 10, 2024 4:32 AM > > On Wed, 10 Jul 2024 07:55:20 +0200 > Christoph Hellwig wrote: > > > On Tue, Jul 09, 2024 at 09:08:18PM +0200, Petr Tesařík wrote: > > > I'm confused. If you're not a big fan, why are we effectively adding > > > them to more places no

RE: [PATCH 1/2] swiotlb: Remove alloc_size argument to swiotlb_tbl_map_single()

2024-05-06 Thread Michael Kelley
emory addresses and > sizes, including those that reproduce the edge case bug: > > * 4K granule and 0 min_align_mask > * 4K granule and 0xFFF min_align_mask (4K - 1) > * 16K granule and 0xFFF min_align_mask > * 64K granule and 0xFFF min_align_mask > * 64K granule and 0x3FFF min_al

RE: [PATCH 1/2] swiotlb: Remove alloc_size argument to swiotlb_tbl_map_single()

2024-04-15 Thread Michael Kelley
From: Petr Tesařík Sent: Monday, April 15, 2024 4:46 AM > > Hi Michael, > > sorry for taking so long to answer. Yes, there was no agreement on the > removal of the "dir" parameter, but I'm not sure it's because of > symmetry with swiotlb_sync_*(), because the topic was not really > discussed. >

RE: [PATCH 1/2] swiotlb: Remove alloc_size argument to swiotlb_tbl_map_single()

2024-04-15 Thread Michael Kelley
From: Petr Tesařík Sent: Monday, April 15, 2024 5:50 AM > > On Mon, 15 Apr 2024 12:23:22 +0000 > Michael Kelley wrote: > > > From: Petr Tesařík Sent: Monday, April 15, 2024 4:46 AM > > > > > > Hi Michael, > > > > > > sorry for taking

RE: [PATCH v3 06/15] x86/paravirt: switch time pvops functions to use static_call()

2020-12-17 Thread Michael Kelley
From: Juergen Gross Sent: Thursday, December 17, 2020 1:31 AM > The time pvops functions are the only ones left which might be > used in 32-bit mode and which return a 64-bit value. > > Switch them to use the static_call() mechanism instead of pvops, as > this allows quite some simplification of

RE: [PATCH V4 00/13] x86/Hyper-V: Add Hyper-V Isolation VM support

2021-08-31 Thread Michael Kelley
From: Christoph Hellwig Sent: Monday, August 30, 2021 5:01 AM > > Sorry for the delayed answer, but I look at the vmap_pfn usage in the > previous version and tried to come up with a better version. This > mostly untested branch: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/hea

RE: [PATCH V4 01/13] x86/hyperv: Initialize GHCB page in Isolation VM

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > Hyperv exposes GHCB page via SEV ES GHCB MSR for SNP guest > to communicate with hypervisor. Map GHCB page for all > cpus to read/write MSR register and submit hvcall request > via ghcb page. > > Signed-off-by: Tianyu Lan > --- > Chagn

RE: [PATCH V4 02/13] x86/hyperv: Initialize shared memory boundary in the Isolation VM.

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > Hyper-V exposes shared memory boundary via cpuid > HYPERV_CPUID_ISOLATION_CONFIG and store it in the > shared_gpa_boundary of ms_hyperv struct. This prepares > to share memory with host for SNP guest. > > Signed-off-by: Tianyu Lan > --

RE: [PATCH V4 03/13] x86/hyperv: Add new hvcall guest address host visibility support

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > Add new hvcall guest address host visibility support to mark > memory visible to host. Call it inside set_memory_decrypted > /encrypted(). Add HYPERVISOR feature check in the > hv_is_isolation_supported() to optimize in non-virtualizatio

RE: [PATCH V4 04/13] hyperv: Mark vmbus ring buffer visible to host in Isolation VM

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > Mark vmbus ring buffer visible with set_memory_decrypted() when > establish gpadl handle. > > Signed-off-by: Tianyu Lan > --- > Change since v3: >* Change vmbus_teardown_gpadl() parameter and put gpadl handle, >buffer a

RE: [PATCH V4 06/13] hyperv: Add ghcb hvcall support for SNP VM

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > Subject line tag should probably be "x86/hyperv:" since the majority of the code added is under arch/x86. > hyperv provides ghcb hvcall to handle VMBus > HVCALL_SIGNAL_EVENT and HVCALL_POST_MESSAGE > msg in SNP Isolation VM. Add such sup

RE: [PATCH V4 07/13] hyperv/Vmbus: Add SNP support for VMbus channel initiate message

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > Subject line tag should be "Drivers: hv: vmbus:" > The monitor pages in the CHANNELMSG_INITIATE_CONTACT msg are shared > with host in Isolation VM and so it's necessary to use hvcall to set > them visible to host. In Isolation VM with AM

RE: [PATCH V4 08/13] hyperv/vmbus: Initialize VMbus ring buffer for Isolation VM

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > Subject tag should be "Drivers: hv: vmbus: " > VMbus ring buffer are shared with host and it's need to > be accessed via extra address space of Isolation VM with > AMD SNP support. This patch is to map the ring buffer > address in extra

RE: [PATCH V4 11/13] hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > hyperv Isolation VM requires bounce buffer support to copy > data from/to encrypted memory and so enable swiotlb force > mode to use swiotlb bounce buffer for DMA transaction. > > In Isolation VM with AMD SEV, the bounce buffer needs to

RE: [PATCH V4 13/13] hv_storvsc: Add Isolation VM support for storvsc driver

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > Per previous comment, the Subject line tag should be "scsi: storvsc: " > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > storvsc rx/tx ring buffer

RE: [PATCH V4 12/13] hv_netvsc: Add Isolation VM support for netvsc driver

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > pagebuffer() stills need to

RE: [PATCH V4 05/13] hyperv: Add Write/Read MSR registers via ghcb page

2021-09-01 Thread Michael Kelley
From: Tianyu Lan Sent: Friday, August 27, 2021 10:21 AM > > Hyperv provides GHCB protocol to write Synthetic Interrupt > Controller MSR registers in Isolation VM with AMD SEV SNP > and these registers are emulated by hypervisor directly. > Hyperv requires to write SINTx MSR registers twice. First

RE: [PATCH V4 12/13] hv_netvsc: Add Isolation VM support for netvsc driver

2021-09-01 Thread Michael Kelley
From: Michael Kelley Sent: Wednesday, September 1, 2021 7:34 PM [snip] > > +int netvsc_dma_map(struct hv_device *hv_dev, > > + struct hv_netvsc_packet *packet, > > + struct hv_page_buffer *pb) > > +{ > > + u32 pa

RE: [PATCH V4 00/13] x86/Hyper-V: Add Hyper-V Isolation VM support

2021-09-02 Thread Michael Kelley
From: Christoph Hellwig Sent: Thursday, September 2, 2021 1:00 AM > > On Tue, Aug 31, 2021 at 05:16:19PM +, Michael Kelley wrote: > > As a quick overview, I think there are four places where the > > shared_gpa_boundary must be applied to adjust the guest physical > &

RE: [PATCH V4 08/13] hyperv/vmbus: Initialize VMbus ring buffer for Isolation VM

2021-09-02 Thread Michael Kelley
From: Tianyu Lan Sent: Thursday, September 2, 2021 6:36 AM > > On 9/2/2021 8:23 AM, Michael Kelley wrote: > >> + } else { > >> + pages_wraparound = kcalloc(page_cnt * 2 - 1, > >> +

RE: [PATCH V5 04/12] Drivers: hv: vmbus: Mark vmbus ring buffer visible to host in Isolation VM

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > Mark vmbus ring buffer visible with set_memory_decrypted() when > establish gpadl handle. > > Signed-off-by: Tianyu Lan > --- > Change sincv v4 > * Change gpadl handle in netvsc and uio driver from u32 to > struct vmbu

RE: [PATCH V5 05/12] x86/hyperv: Add Write/Read MSR registers via ghcb page

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > Hyperv provides GHCB protocol to write Synthetic Interrupt > Controller MSR registers in Isolation VM with AMD SEV SNP > and these registers are emulated by hypervisor directly. > Hyperv requires to write SINTx MSR registers twice. Fi

RE: [PATCH V5 07/12] Drivers: hv: vmbus: Add SNP support for VMbus channel initiate message

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > The monitor pages in the CHANNELMSG_INITIATE_CONTACT msg are shared > with host in Isolation VM and so it's necessary to use hvcall to set > them visible to host. In Isolation VM with AMD SEV SNP, the access > address should be in the

RE: [PATCH V5 09/12] x86/Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > In Isolation VM with AMD SEV, bounce buffer needs to be accessed via > extra address space which is above shared_gpa_boundary > (E.G 39 bit address line) reported by Hyper-V CPUID ISOLATION_CONFIG. > The access physical address will b

RE: [PATCH V5 10/12] hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > hyperv Isolation VM requires bounce buffer support to copy > data from/to encrypted memory and so enable swiotlb force > mode to use swiotlb bounce buffer for DMA transaction. > > In Isolation VM with AMD SEV, the bounce buffer needs

RE: [PATCH V5 11/12] scsi: storvsc: Add Isolation VM support for storvsc driver

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > storvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > mpb_desc() still needs t

RE: [PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver

2021-09-15 Thread Michael Kelley
From: Tianyu Lan Sent: Tuesday, September 14, 2021 6:39 AM > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > pagebuffer() stills nee

RE: [PATCH, RESEND] x86/mtrr: Rename mtrr_overwrite_state() to guest_force_mtrr_state()

2024-12-02 Thread Michael Kelley
From: Kirill A. Shutemov Sent: Sunday, December 1, 2024 11:32 PM > > Rename the helper to better reflect its function. > > Signed-off-by: Kirill A. Shutemov > Suggested-by: Dave Hansen > Acked-by: Dave Hansen FWIW, I previously gave my "Reviewed-by" on this patch [1]. I didn't call it out e

RE: [PATCH 16/16] x86/kvmclock: Use TSC for sched_clock if it's constant and non-stop

2025-02-08 Thread Michael Kelley
From: Sean Christopherson Sent: Friday, February 7, 2025 9:23 AM > > Dropping a few people/lists whose emails are bouncing. > > On Fri, Jan 31, 2025, Sean Christopherson wrote: > > @@ -369,6 +369,11 @@ void __init kvmclock_init(void) > > #ifdef CONFIG_X86_LOCAL_APIC > > x86_cpuinit.early_p

RE: [PATCH 16/16] x86/kvmclock: Use TSC for sched_clock if it's constant and non-stop

2025-02-12 Thread Michael Kelley
From: Sean Christopherson Sent: Monday, February 10, 2025 8:22 AM > > On Sat, Feb 08, 2025, Michael Kelley wrote: > > From: Sean Christopherson Sent: Friday, February 7, > > 2025 9:23 AM > > > > > > Dropping a few people/lists whose emails are bouncing. &g

RE: [PATCH v2 10/38] clocksource: hyper-v: Don't save/restore TSC offset when using HV sched_clock

2025-03-03 Thread Michael Kelley
d. Modulo the terminology used in the commit message, Reviewed-by: Michael Kelley Tested-by: Michael Kelley > --- > drivers/clocksource/hyperv_timer.c | 10 -- > 1 file changed, 10 deletions(-) > > diff --git a/drivers/clocksource/hyperv_timer.c > b/drivers/cl

RE: [PATCH v2 08/38] clocksource: hyper-v: Register sched_clock save/restore iff it's necessary

2025-03-03 Thread Michael Kelley
firmly x86-only, i.e. adding a small amount of x86 > specific code (which will be reduced in future cleanups) doesn't > meaningfully pollute generic code. I'm good with this approach. > > Signed-off-by: Sean Christopherson Modulo the terminology used in the commit me

RE: [PATCH v2 09/38] clocksource: hyper-v: Drop wrappers to sched_clock save/restore helpers

2025-03-03 Thread Michael Kelley
ws. > > No functional change intended. > > Signed-off-by: Sean Christopherson Modulo the terminology in the commit message, Reviewed-by: Michael Kelley Tested-by: Michael Kelley > --- > drivers/clocksource/hyperv_timer.c | 34 +- > include/clocks

RE: [PATCH v2 31/38] x86/tsc: Pass KNOWN_FREQ and RELIABLE as params to registration

2025-03-03 Thread Michael Kelley
es & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { > - tsc_register_calibration_routines(hv_get_tsc_khz, > hv_get_tsc_khz); > - setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); > + enum tsc_properties tsc_properties = TSC_FREQUENCY_KNOWN; > + > + if (ms_hyperv.f

RE: [PATCH v2 03/38] x86/tsc: Add helper to register CPU and TSC freq calibration routines

2025-03-03 Thread Michael Kelley
static void __init ms_hyperv_init_platform(void) > > if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS && > ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) { > - x86_platform.calibrate_tsc = hv_get_tsc_khz; > -

RE: [PATCH v2 3/4] hv_balloon: update the NR_BALLOON_PAGES state

2025-03-14 Thread Michael Kelley
available in /sys/kernel/debug/hv-balloon when CONFIG_DEBUGFS=y. But it seems OK to also report the # of pages ballooned through /proc/meminfo, which works even if CONFIG_DEBUGFS=n. Reviewed-by: Michael Kelley

RE: Allocating SEV C-bit-cleared pages (without relying on swiotlb)

2025-03-28 Thread Michael Kelley
From: Teddy Astie Sent: Thursday, March 27, 2025 7:12 AM > To: linux-ker...@vger.kernel.org; linux...@vger.kernel.org > Cc: Xen-devel > Subject: Allocating SEV C-bit-cleared pages (without relying on swiotlb) > > Hello Linux mailing list ! > > For porting Linux code to make it work on Xen with

RE: [PATCH 09/15] swiotlb: make the swiotlb_init interface more useful

2022-04-04 Thread Michael Kelley (LINUX)
From: Christoph Hellwig Sent: Sunday, April 3, 2022 10:06 PM > > Pass a bool to pass if swiotlb needs to be enabled based on the Wording problems. I'm not sure what you meant to say. > addressing needs and replace the verbose argument with a set of > flags, including one to force enable bounce

RE: [PATCH V2 1/6] Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM

2021-11-23 Thread Michael Kelley (LINUX)
From: Tianyu Lan Sent: Tuesday, November 23, 2021 6:31 AM > > In Isolation VM with AMD SEV, bounce buffer needs to be accessed via > extra address space which is above shared_gpa_boundary (E.G 39 bit > address line) reported by Hyper-V CPUID ISOLATION_CONFIG. The access > physical address will be

RE: [PATCH V2 4/6] hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-11-23 Thread Michael Kelley (LINUX)
From: Tianyu Lan Sent: Tuesday, November 23, 2021 6:31 AM > > hyperv Isolation VM requires bounce buffer support to copy > data from/to encrypted memory and so enable swiotlb force > mode to use swiotlb bounce buffer for DMA transaction. > > In Isolation VM with AMD SEV, the bounce buffer needs

RE: [PATCH V2 5/6] net: netvsc: Add Isolation VM support for netvsc driver

2021-11-23 Thread Michael Kelley (LINUX)
From: Tianyu Lan Sent: Tuesday, November 23, 2021 6:31 AM > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > pagebuffer() stills need t

RE: [PATCH V2 5/6] net: netvsc: Add Isolation VM support for netvsc driver

2021-11-24 Thread Michael Kelley (LINUX)
From: Tianyu Lan Sent: Tuesday, November 23, 2021 6:31 AM > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > pagebuffer() stills need t

RE: [PATCH 08/11] swiotlb: make the swiotlb_init interface more useful

2022-02-27 Thread Michael Kelley (LINUX)
From: Christoph Hellwig Sent: Sunday, February 27, 2022 6:31 AM > > Pass a bool to pass if swiotlb needs to be enabled based on the > addressing needs and replace the verbose argument with a set of > flags, including one to force enable bounce buffering. > > Note that this patch removes the poss

RE: [PATCH 08/11] swiotlb: make the swiotlb_init interface more useful

2022-02-28 Thread Michael Kelley (LINUX)
From: Christoph Hellwig Sent: Monday, February 28, 2022 3:31 AM > > On Mon, Feb 28, 2022 at 02:53:39AM +, Michael Kelley (LINUX) wrote: > > From: Christoph Hellwig Sent: Sunday, February 27, 2022 6:31 > > AM > > > > > > Pass a bool to pass if swio

RE: [PATCH 10/12] swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction

2022-03-04 Thread Michael Kelley (LINUX)
From: Christoph Hellwig Sent: Tuesday, March 1, 2022 2:53 AM > > Power SVM wants to allocate a swiotlb buffer that is not restricted to low > memory for > the trusted hypervisor scheme. Consolidate the support for this into the > swiotlb_init > interface by adding a new flag. Hyper-V Isolated

RE: [PATCH 10/12] swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction

2022-03-06 Thread Michael Kelley (LINUX)
From: Dongli Zhang Sent: Friday, March 4, 2022 10:28 AM > > Hi Michael, > > On 3/4/22 10:12 AM, Michael Kelley (LINUX) wrote: > > From: Christoph Hellwig Sent: Tuesday, March 1, 2022 2:53 AM > >> > >> Power SVM wants to allocate a swiotlb buffer that is no

RE: [PATCH v3 7/8] genirq: Return a const cpumask from irq_data_get_affinity_mask

2022-07-03 Thread Michael Kelley (LINUX)
u32 slot, u32 vector, u8 vector_count) > { > int cpu; > @@ -1697,7 +1697,7 @@ static void hv_compose_msi_msg(struct irq_data *data, > struct msi_msg *msg) > struct hv_pci_dev *hpdev; > struct pci_bus *pbus; > struct pci_dev *pdev; > - struc

RE: [PATCH 3/7] hv: simplify sysctl registration

2023-03-02 Thread Michael Kelley (LINUX)
ould the following registration fail. >*/ > - hv_ctl_table_hdr = register_sysctl_table(hv_root_table); > + hv_ctl_table_hdr = register_sysctl("kernel", hv_ctl_table); > if (!hv_ctl_table_hdr) > pr_err("Hyper-V: sysctl table register error"); > > -- > 2.39.1 Reviewed-by: Michael Kelley

RE: [PATCH v4 00/12] x86/mtrr: fix handling with PAT but without MTRR

2023-03-07 Thread Michael Kelley (LINUX)
nlighten_pv.c| 52 +++ > 13 files changed, 454 insertions(+), 252 deletions(-) > > -- > 2.35.3 I've tested a Linux 6.2 kernel plus this series in a normal Hyper-V guest and in a Hyper-V guest using SEV-SNP with vTOM. MMIO memory is correctly mapped as WB or UC- depending on the request, which fixes the original problem introduced for Hyper-V by the Xen-specific change. Tested-by: Michael Kelley

Problem with pat_enable() and commit 72cbc8f04fe2

2023-01-09 Thread Michael Kelley (LINUX)
I've come across a case with a VM running on Hyper-V that doesn't get MTRRs, but the PAT is functional. (This is a Confidential VM using AMD's SEV-SNP encryption technology with the vTOM option.) In this case, the changes in commit 72cbc8f04fe2 ("x86/PAT: Have pat_enabled() properly reflect state

RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a transient memory pool

2023-07-05 Thread Michael Kelley (LINUX)
From: Petr Tesarik Sent: Tuesday, June 27, 2023 2:54 AM > > Try to allocate a transient memory pool if no suitable slots can be found, > except when allocating from a restricted pool. The transient pool is just > enough big for this one bounce buffer. It is inserted into a per-device > list of t

RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a transient memory pool

2023-07-06 Thread Michael Kelley (LINUX)
From: Greg Kroah-Hartman Sent: Thursday, July 6, 2023 1:07 AM > > On Thu, Jul 06, 2023 at 03:50:55AM +, Michael Kelley (LINUX) wrote: > > From: Petr Tesarik Sent: Tuesday, June 27, > > 2023 > 2:54 AM > > > > > > Try to allocate a transient memory

RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a transient memory pool

2023-07-08 Thread Michael Kelley (LINUX)
From: Petr Tesařík Sent: Friday, July 7, 2023 3:22 AM > > On Fri, 7 Jul 2023 10:29:00 +0100 > Greg Kroah-Hartman wrote: > > > On Thu, Jul 06, 2023 at 02:22:50PM +0000, Michael Kelley (LINUX) wrote: > > > From: Greg Kroah-Hartman Sent: Thursday, > > > July

RE: [PATCH v3 4/7] swiotlb: if swiotlb is full, fall back to a transient memory pool

2023-07-11 Thread Michael Kelley (LINUX)
From: Petr Tesařík Sent: Monday, July 10, 2023 2:36 AM > > On Sat, 8 Jul 2023 15:18:32 +0000 > "Michael Kelley (LINUX)" wrote: > > > From: Petr Tesařík Sent: Friday, July 7, 2023 3:22 AM > > > > > > On Fri, 7 Jul 2023 10:29:00 +0100 > > &g

RE: [PATCH 02/30] ARM: kexec: Disable IRQs/FIQs also on crash CPUs shutdown path

2022-04-29 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Wednesday, April 27, 2022 3:49 PM > > Currently the regular CPU shutdown path for ARM disables IRQs/FIQs > in the secondary CPUs - smp_send_stop() calls ipi_cpu_stop(), which > is responsible for that. This makes sense, since we're turning off > such CPUs, puttin

RE: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-04-29 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Wednesday, April 27, 2022 3:49 PM > > Currently we have a debug infrastructure in the notifiers file, but > it's very simple/limited. This patch extends it by: > > (a) Showing all registered/unregistered notifiers' callback names; > > (b) Adding a dynamic debug

RE: [PATCH 16/30] drivers/hv/vmbus, video/hyperv_fb: Untangle and refactor Hyper-V panic notifiers

2022-04-29 Thread Michael Kelley (LINUX)
I don't think is the case. There is a dependency on Patch 14 of your series where PANIC_NOTIFIER is introduced. > Cc: Andrea Parri (Microsoft) > Cc: Dexuan Cui > Cc: Haiyang Zhang > Cc: "K. Y. Srinivasan" > Cc: Michael Kelley > Cc: Stephen Hemminger > Cc:

RE: [PATCH 19/30] panic: Add the panic hypervisor notifier list

2022-04-29 Thread Michael Kelley (LINUX)
S. Miller" > Cc: Dexuan Cui > Cc: Doug Berger > Cc: Evan Green > Cc: Florian Fainelli > Cc: Haiyang Zhang > Cc: Hari Bathini > Cc: Heiko Carstens > Cc: Julius Werner > Cc: Justin Chen > Cc: "K. Y. Srinivasan" > Cc: Lee Jones > Cc: Markus

RE: [PATCH 24/30] panic: Refactor the panic path

2022-04-29 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Wednesday, April 27, 2022 3:49 PM > > The panic() function is somewhat convoluted - a lot of changes were > made over the years, adding comments that might be misleading/outdated > now, it has a code structure that is a bit complex to follow, with > lots of condi

RE: [PATCH 24/30] panic: Refactor the panic path

2022-05-03 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Friday, April 29, 2022 1:38 PM > > On 29/04/2022 14:53, Michael Kelley (LINUX) wrote: > > From: Guilherme G. Piccoli Sent: Wednesday, April 27, > > 2022 > 3:49 PM > >> [...] > >> + panic_notifiers_level= > >>

RE: [PATCH 19/30] panic: Add the panic hypervisor notifier list

2022-05-03 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Friday, April 29, 2022 11:04 AM > > On 29/04/2022 14:30, Michael Kelley (LINUX) wrote: > > From: Guilherme G. Piccoli Sent: Wednesday, April 27, > > 2022 > 3:49 PM > >> [...] > >> > >> @@ -2843,7 +2843,7 @

RE: [PATCH 16/30] drivers/hv/vmbus, video/hyperv_fb: Untangle and refactor Hyper-V panic notifiers

2022-05-03 Thread Michael Kelley (LINUX)
From: Guilherme G. Piccoli Sent: Friday, April 29, 2022 3:35 PM > > Hi Michael, first of all thanks for the great review, much appreciated. > Some comments inline below: > > On 29/04/2022 14:16, Michael Kelley (LINUX) wrote: > > [...] > >> hypervisor I/O completio

  1   2   >