On Mon, Nov 09, 2020 at 11:33:18PM -0600, Mike Christie wrote:
> The following patches were made over Michael's vhost branch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/log/?h=vhost
>
> They fixe a couple issues where the guest is getting IO errors:
> 1. The admin may set n
Wei Liu writes:
> Just like MSI/MSI-X, IO-APIC interrupts are remapped by Microsoft
> Hypervisor when Linux runs as the root partition. Implement an IRQ chip
> to handle mapping and unmapping of IO-APIC interrupts.
>
> Use custom functions for mapping and unmapping ACPI GSIs. They will
> issue Mi
Wei Liu writes:
> Microsoft Hypervisor requires the root partition to make a few
> hypercalls to setup application processors before they can be used.
>
> Signed-off-by: Lillian Grassin-Drake
> Signed-off-by: Sunil Muthuswamy
> Co-Developed-by: Lillian Grassin-Drake
> Co-Developed-by: Sunil Mu
Wei Liu writes:
> They are used to deposit pages into Microsoft Hypervisor and bring up
> logical and virtual processors.
>
> Signed-off-by: Lillian Grassin-Drake
> Signed-off-by: Sunil Muthuswamy
> Signed-off-by: Nuno Das Neves
> Co-Developed-by: Lillian Grassin-Drake
> Co-Developed-by: Suni
Wei Liu writes:
> When Linux is running as the root partition, the hypercall page will
> have already been setup by Hyper-V. Copy the content over to the
> allocated page.
>
> The suspend, resume and cleanup paths remain untouched because they are
> not supported in this setup yet.
What about ad
Wei Liu writes:
> We will need the partition ID for executing some hypercalls later.
>
> Signed-off-by: Lillian Grassin-Drake
> Co-Developed-by: Sunil Muthuswamy
> Signed-off-by: Wei Liu
> ---
> arch/x86/hyperv/hv_init.c | 26 ++
> arch/x86/include/asm/mshyperv
Wei Liu writes:
> When Linux runs as the root partition, it will need to make hypercalls
> which return data from the hypervisor.
>
> Allocate pages for storing results when Linux runs as the root
> partition.
>
> Signed-off-by: Lillian Grassin-Drake
> Co-Developed-by: Lillian Grassin-Drake
> S
Wei Liu writes:
> Signed-off-by: Wei Liu
In the missing commit message I'd like to see why we don't use 'TSC
page' clocksource for the root partition. My guess would be that it's
not available and actually we're supposed to use raw TSC value (because
root partitions never migrate) but please sp
Wei Liu writes:
> The IOMMU code needs more work. We're sure for now the IRQ remapping
> hooks are not applicable when Linux is the root.
Super-nitpick: I would suggest we always say 'root partition' as 'root'
has a 'slightly different' meaning in Linux and this commit message may
sound confusin
Wei Liu writes:
> There is no VMBus and the other infrastructures initialized in
> hv_acpi_init when Linux is running as the root partition.
>
> Signed-off-by: Wei Liu
> ---
> drivers/hv/vmbus_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/
Wei Liu writes:
> For now we can use the privilege flag to check. Stash the value to be
> used later.
>
> Put in a bunch of defines for future use when we want to have more
> fine-grained detection.
>
> Signed-off-by: Wei Liu
> ---
> arch/x86/hyperv/hv_init.c | 4
> arch/x86/incl
Wei Liu writes:
> This makes the name match Hyper-V TLFS.
>
> Signed-off-by: Wei Liu
> ---
> include/asm-generic/hyperv-tlfs.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/asm-generic/hyperv-tlfs.h
> b/include/asm-generic/hyperv-tlfs.h
> index e73a11850055..
Let's add a safe mechanism to unplug memory, avoiding long/endless loops
when trying to offline memory - similar to in SBM.
Fake-offline all memory (via alloc_contig_range()) before trying to
offline+remove it. Use this mode as default, but allow to enable the other
mode explicitly (which could gi
Currently, we do not support device block sizes that exceed the Linux
memory block size. For example, having a device block size of 1 GiB (e.g.,
gigantic pages in the hypervisor) won't work with 128 MiB Linux memory
blocks.
Let's implement Big Block Mode (BBM), whereby we add/remove at least
one L
Let's try to unplug completely offline big blocks first. Then, (if
enabled via unplug_offline) try to offline and remove whole big blocks.
No locking necessary - we can deal with concurrent onlining/offlining
just fine.
Note1: This is sub-optimal and might be dangerous in some environments: we
co
Let's allow to force BBM, even if subblocks would be possible. Take care
of properly calculating the first big block id, because the start
address might no longer be aligned to the big block size.
Also, allow to manually configure the size of Big Blocks.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsi
virtio-mem soon wants to use offline_and_remove_memory() memory that
exceeds a single Linux memory block (memory_block_size_bytes()). Let's
remove that restriction.
Let's remember the old state and try to restore that if anything goes
wrong. While re-onlining can, in general, fail, it's highly unl
Let's rename them accordingly. virtio_mem_plug_request() and
virtio_mem_unplug_request() will be handled separately.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 90 ++
Let's move first_mb_id/next_mb_id/last_usable_mb_id accordingly.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 46 ++---
1 file changed, 23 insertions(+), 23 de
Let's rename to "sbs_per_mb" and "sb_size" and move accordingly.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 96 ++---
1 file changed, 48 insertions(+), 48 de
Let's rename and move accordingly. While at it, rename sb_bitmap to
"sb_states".
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 132 +++---
Let's use wrappers for the low-level functions that dev_dbg/dev_warn
and work on addr + size, such that we can reuse them for adding/removing
in other granularity.
We only warn when adding memory failed, because that's something to pay
attention to. We won't warn when removing failed, we'll reuse
Let's rename accordingly.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 29 +++--
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/
Let's add some documentation for the current mode - Sub Block Mode (SBM) -
to prepare for a new mode - Big Block Mode (BBM).
Follow-up patches will properly factor out the existing Sub Block Mode
(SBM) and implement Big Block Mode (BBM).
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Mich
let's use a new "sbm" sub-struct to hold SBM-specific state and rename +
move applicable definitions, functions, and variables (related to
memory block states).
While at it:
- Drop the "_STATE" part from memory block states
- Rename "nb_mb_state" to "mb_count"
- "set_mb_state" / "get_mb_state" vs.
We don't want to add too much memory when it's not getting onlined
immediately, to avoid running OOM. Generalize the handling, to avoid
making use of memory block states. Use a threshold of 1 GiB for now.
Properly adjust the offline size when adding/removing memory. As we are
not always protected
Avoid using memory block ids. While at it, use uint64_t for
address/size.
This is a preparation for Big Block Mode (BBM).
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 10 +++---
1 fi
Let's trigger from offlining code only when we're not allowed to unplug
online memory. Handle the other case (memmap possibly freeing up another
memory block) when actually removing memory. We now also properly handle
the case when removing already offline memory blocks via
virtio_mem_mb_remove().
No longer used, let's drop it.
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c b/drive
Let's check by traversing busy system RAM resources instead, to avoid
relying on memory block states.
Don't use walk_system_ram_range(), as that works on pages and we want to
use the bare addresses we have easily at hand.
This is a preparation for Big Block Mode (BBM), which won't have memory
blo
The calculation is already complicated enough, let's limit it to one
location.
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 20 +++-
1 file changed,
@Andrew, can we have an ack for patch #27, so that one can go via
the vhost tree for 5.11?
---
virtio-mem currently only supports device block sizes that span at most
a single Linux memory block. For example, gigantic pages in the hypervisor
result on x86-64 in a device block size of 1 GiB - when
Let's factor out the core pieces and place the implementation next to
virtio_mem_fake_offline(). We'll reuse this functionality soon.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 73 +
Avoid using memory block ids. Rename it to virtio_mem_contains_range().
This is a preparation for Big Block Mode (BBM).
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 9 +
1 file c
Let's move the existing dev_dbg() into the functions, print if something
went wrong, and also print for virtio_mem_send_unplug_all_request().
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 50 +
Let's determine the target nid only once in case we have none specified -
usually, we'll end up with node 0 either way.
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c |
ZONE_MOVABLE is supposed to give some guarantees, yet,
alloc_contig_range() isn't prepared to properly deal with some racy
cases properly (e.g., temporary page pinning when exiting processed, PCP).
Retry 5 times for now. There is certainly room for improvement in the
future.
Cc: "Michael S. Tsirk
... which now matches virtio_mem_fake_online(). We'll reuse this
functionality soon.
Reviewed-by: Wei Yang
Reviewed-by: Pankaj Gupta
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 34 ---
Let's use pageblock_nr_pages and MAX_ORDER_NR_PAGES instead where
possible to simplify.
Add a comment why we have that restriction for now.
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 35 ++
We can drop rc2, we don't actually need the value.
Reviewed-by: Pankaj Gupta
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git
No harm done, but let's be consistent.
Reviewed-by: Pankaj Gupta
Reviewed-by: Wei Yang
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/driver
We actually need one byte less (next_mb_id is exclusive, first_mb_id is
inclusive). While at it, compact the code.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions
On 12/11/2020 12:24, Wei Liu wrote:
> On Thu, Nov 12, 2020 at 10:56:17AM +0100, Daniel Lezcano wrote:
>> On 05/11/2020 17:58, Wei Liu wrote:
>>> Signed-off-by: Wei Liu
Acked-by: Daniel Lezcano
>>> ---
>>
>> I would like to apply this patch but the changelog is too short (one line).
>>
>> Please
On 2020-11-12 09:10:34 [+0100], Marek Szyprowski wrote:
> I can do more tests to help fixing this issue. Just let me know what to do.
-> https://lkml.kernel.org/r/87y2j6n8mj@nanos.tec.linutronix.de
Sebastian
___
Virtualization mailing list
Virtualiz
Marek,
On Thu, Nov 12 2020 at 09:10, Marek Szyprowski wrote:
> On 03.11.2020 10:27, Thomas Gleixner wrote:
>
> I can do more tests to help fixing this issue. Just let me know what to do.
Just sent out the fix before I saw your report.
https://lore.kernel.org/r/87y2j6n8mj@nanos.tec.linut
On 05/11/2020 17:58, Wei Liu wrote:
> Signed-off-by: Wei Liu
> ---
I would like to apply this patch but the changelog is too short (one line).
Please add a small paragraph (no need to resend just answer here, I will
amend the log myself.
> drivers/clocksource/hyperv_timer.c | 3 +++
> 1 file c
46 matches
Mail list logo