lantianyu1...@gmail.com writes:
> From: Lan Tianyu
>
> On the bare metal, enabling X2APIC mode requires interrupt remapping
> function which helps to deliver irq to cpu with 32-bit APIC ID.
> Hyper-V doesn't provide interrupt remapping function so far and Hyper-V
> MSI protocol already supports
check.
Reported-by: Zdenek Kaspar
Tested-by: Zdenek Kaspar
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx/nested.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 653830d0f3da..4bd0902bfd8c 100644
--- a/arc
lantianyu1...@gmail.com writes:
> From: Lan Tianyu
>
> On the bare metal, enabling X2APIC mode requires interrupt remapping
> function which helps to deliver irq to cpu with 32-bit APIC ID.
> Hyper-V doesn't provide interrupt remapping function so far and Hyper-V
> MSI protocol already supports
Vitaly Kuznetsov writes:
> We shouldn't probably be suggesting using Enlightened VMCS when it's not
> enabled (not supported from guest's point of view). Hyper-V on KVM seems
> to be fine either way but let's be consistent.
>
Fixes: 2bc39970e932 ("x86/kvm/h
We shouldn't probably be suggesting using Enlightened VMCS when it's not
enabled (not supported from guest's point of view). Hyper-V on KVM seems
to be fine either way but let's be consistent.
Reviewed-by: Liran Alon
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 ++-
1 file
System reset through synthetic MSR is not recommended neither by genuine
Hyper-V nor my QEMU.
Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Liran Alon
---
arch/x86/kvm/hyperv.c | 1 -
1 file changed,
Be more consistent with genuine Hyper-V: don't recommend using Enlightened
VMCS when it wasn't enabled, don't advertise reset via synthetic MSR.
Vitaly Kuznetsov (2):
x86/kvm/hyper-v: don't recommend doing reset via synthetic MSR
x86/kvm/hyper-v: recommend using eVMCS only when it is enabled
Liran Alon writes:
>> On 24 Jan 2019, at 19:15, Vitaly Kuznetsov wrote:
>>
>> We shouldn't probably be suggesting using Enlightened VMCS when it's not
>> enabled (not supported from guest's point of view). System reset through
>> synthetic MSR is not recommended
: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index ac44a681f065..4730fcaa70cf 100644
--- a/ar
HV_X64_MSR_GUEST_IDLE_AVAILABLE appeared in kvm_vcpu_ioctl_get_hv_cpuid()
by mistake: it announces support for HV_X64_MSR_GUEST_IDLE (0x40F0)
which we don't support in KVM (yet).
Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
Signed-off-by: Vitaly
Maya Nakamura writes:
> Remove a duplicate definition of VP set (hv_vp_set) and use the common
> definition (hv_vpset) that is used in other places.
>
> Signed-off-by: Maya Nakamura
> ---
> drivers/pci/controller/pci-hyperv.c | 25 -
> 1 file changed, 12 insertions(+),
Vitaly Kuznetsov writes:
> kvm-unit-tests' eventinj "NMI failing on IDT" test results in NMI being
> delivered to the host (L1) when it's running nested. The problem seems to
> be: svm_complete_interrupts() raises 'nmi_injected' flag but later we
> decide to reflect EX
Check that KVM_CAP_HYPERV_ENLIGHTENED_VMCS returns correct version range.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/x86_64/evmcs_test.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c
b/tools/testing/selftests/kvm
ssue by re-arranging things in nested_enable_evmcs().
Fixes: e2e871ab2f02 ("x86/kvm/hyper-v: Introduce nested_get_evmcs_version()
helper")
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx/evmcs.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/vm
fix could be
queued before 5.0.
Vitaly Kuznetsov (2):
x86/kvm/hyper-v: nested_enable_evmcs() sets vmcs_version incorrectly
KVM: selftests: check returned evmcs version range
arch/x86/kvm/vmx/evmcs.c| 7 ---
tools/testing/selftests/kvm/x86_64/evmcs_test.c | 6 +
Tony Luck writes:
> On Wed, Jan 9, 2019 at 5:00 AM Borislav Petkov wrote:
>>
>> On Wed, Jan 09, 2019 at 01:09:31PM +0100, Vitaly Kuznetsov wrote:
>> > Hm, why is that? In theory, hypervisors can pass through or emulate the
>> > required MSRs...
>>
>>
ce.
Fixes: fca91f6d60b6e ("kvm: nVMX: Set VM instruction error for VMPTRLD of
unbacked page")
Reported-by: Cornelia Huck
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx/nested.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kv
Borislav Petkov writes:
> So, assuming RDT is not going to be supported in a guest
Hm, why is that? In theory, hypervisors can pass through or emulate the
required MSRs...
--
Vitaly
Dan Carpenter writes:
> On Mon, Jan 07, 2019 at 07:38:20PM +0100, Vitaly Kuznetsov wrote:
>> (I remember Greg disliked when people were tagging patches for stable@
>> themselves, he prefered maintainers deciding if the particular commit
>> deserves stable@ or not - but as y
David Hildenbrand writes:
> On 07.01.19 14:44, Vitaly Kuznetsov wrote:
>> David Hildenbrand writes:
>>
...
>>> On 04.01.19 15:19, Vitaly Kuznetsov wrote:
>>>>if (start_pfn > has->start_pfn &&
>>>>
injection upon entry so it got delivered to L1 instead of L2.
It seems that VMX code solves the same issue in prepare_vmcs12(), this was
introduced with code refactoring in commit 5f3d5799974b ("KVM: nVMX: Rework
event injection and recovery").
Signed-off-by: Vitaly Kuznetsov
---
ar
Sasha Levin writes:
> On Mon, Jan 07, 2019 at 02:44:30PM +0100, Vitaly Kuznetsov wrote:
>>P.S. I still think about bringing mem_hotplug_begin()/done() to
>>hv_balloon but that's going to be a separate discussion, here I want to
>>have a small fix backportable to stable.
>
David Hildenbrand writes:
> On 04.01.19 15:19, Vitaly Kuznetsov wrote:
>> Hyper-V memory hotplug protocol has 2M granularity and in Linux x86 we use
>> 128M. To deal with it we implement partial section onlining by registering
>> custom page onlining callback (hv_online_page
pages and checks sections instead. But in Hyper-V balloon driver we
do PageReserved(pfn_to_page()) check and this is now wrong.
Switch to checking online_section_nr() instead.
Signed-off-by: Vitaly Kuznetsov
---
drivers/hv/hv_balloon.c | 10 ++
1 file changed, 6 insertions(+), 4
Radim Krčmář writes:
> 2018-12-19 12:06+0100, Vitaly Kuznetsov:
>> AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm
>> knows nothing about it, however, this MSR is among emulated_msrs and
>> thus returned with KVM_GET_MSR_INDEX_LIST. The co
Borislav Petkov writes:
> On Thu, Dec 20, 2018 at 02:40:46PM +0100, Vitaly Kuznetsov wrote:
>> It was found that AWS x1 instances (Xen-based) lack xen.git commit
>> 1f1d183d4900 (x86/HVM: don't give the wrong impression of WRMSR succeeding)
>> and because of that t
: RDMSR from 0xc90 at rIP:
0x88c5bba3 (native_read_msr+0x3/0x30)
The issue should definitely get fixed on AWS side. We can, however, simply
workaround this in Linux and live happily after.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kernel/cpu/intel_rdt.c | 3 ++-
1 file changed, 2
ation is
needed")
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/svm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index b78c691adea2..38821b0b78da 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2923,6 +2923,8
xit reason: 8 (SHUTDOWN),
it is not obvious which particular stage failed. Add the info.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/x86_64/evmcs_test.c | 4 ++--
tools/testing/selftests/kvm/x86_64/state_test.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --
-by: Vitaly Kuznetsov
---
arch/x86/kvm/svm.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2acb42b74a51..dfdf7d0b7f88 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -5845,6 +5845,13 @@ static bool svm_cpu_has_accelerated_tpr
Paolo Bonzini writes:
> On 17/12/18 11:30, Vitaly Kuznetsov wrote:
>>> Queued, thanks. I moved this above the direct EOI series so that
>>> KVM_CAP_HYPERV_STIMER_DIRECT need not exist at any point of the history.
>>>
>> Thanks! Just to make sure (and t
Paolo Bonzini writes:
>
> Queued, thanks. I moved this above the direct EOI series so that
> KVM_CAP_HYPERV_STIMER_DIRECT need not exist at any point of the history.
>
Thanks! Just to make sure (and to conclude our discussion with Roman):
with your Qemu maintainer hat on, do you agree with the
Jim Mattson writes:
> On Tue, Oct 16, 2018 at 9:50 AM Vitaly Kuznetsov wrote:
>>
>> +
>> + vmx->nested.hv_evmcs = kmap(vmx->nested.hv_evmcs_page);
>
> Are you sure that directly mapping guest memory isn't going to lead to
> time-of-check vs. t
this. 'struct hv_vp_assist_page'
and 'struct hv_enlightened_vmcs' need to be properly padded to support the
change.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly Kuznetsov
Acked-by: Thomas Gleixner
Acked-by: Nadav Amit
Reviewed-by: Michael Kelley
---
- Changes since v3:
- Properly pad
Vitaly Kuznetsov writes:
> /* Define virtual processor assist page structure. */
> struct hv_vp_assist_page {
> @@ -519,7 +519,7 @@ struct hv_vp_assist_page {
> __u64 nested_enlightenments_control[2];
> __u32 enlighten_vmentry;
> __u64 current_nested_vmcs;
&
be merged with the original patch implementing
direct mode stimers or just put on top.
Vitaly Kuznetsov (2):
x86/hyper-v: Stop caring about EOI for direct stimers
x86/kvm/hyper-v: disallow setting illegal vectors for direct mode
stimers
arch/x86/kvm/hyp
()). Remove the redundant part.
Suggested-by: Roman Kagan
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 36 +++-
1 file changed, 3 insertions(+), 33 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index e6a2a085644a..0a16a77e6ac3
APIC vectors used for direct mode stimers should be valid for lAPIC and
just like genuine Hyper-V we should #GP when an illegal one is specified.
Add the appropriate check to stimer_set_config()
Suggested-by: Roman Kagan
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 5 +
1
Roman Kagan writes:
> [ Sorry, missed this one ]
>
> On Wed, Dec 05, 2018 at 04:36:21PM +0100, Vitaly Kuznetsov wrote:
>> Turns out we over-engineered Direct Mode for stimers a bit: unlike
>> traditional stimers where we may want to try to re-inject the message upon
>&g
Roman Kagan writes:
> On Tue, Dec 11, 2018 at 02:28:14PM +0100, Vitaly Kuznetsov wrote:
>> Roman Kagan writes:
>>
>> > On Mon, Dec 10, 2018 at 06:21:56PM +0100, Vitaly Kuznetsov wrote:
>>
>> >> +
>> >> +Curr
Roman Kagan writes:
> On Mon, Dec 10, 2018 at 06:21:56PM +0100, Vitaly Kuznetsov wrote:
>> +
>> +Currently, the following list of CPUID leaves are returned:
>> + HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS
>> + HYPERV_CPUID_INTERFACE
>> + HYPERV_CPUID_V
k...@linuxonhyperv.com writes:
> +
> +static inline u64 hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page
> *tsc_pg,
> +u64 *cur_tsc)
> +{
> + u64 scale, offset;
> + u32 sequence;
> +
> + /*
> + * The protocol for reading Hyper-V
BIT(13) in HYPERV_CPUID_FEATURES.EBX is described as "ConfigureProfiler" in
TLFS v4.0 but starting 5.0 it is replaced with 'Reserved'. As we don't
currently us it in kernel it can just be dropped.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Michael Kelley
---
arch/x86/include/
The newly introduced KVM_GET_SUPPORTED_HV_CPUID covers Direct Mode stimers
feature so we can drop KVM_CAP_HYPERV_STIMER_DIRECT and reuse its number.
Signed-off-by: Vitaly Kuznetsov
---
- This patch only makes sense befor 4.21 merge window, disregard if it
doesn't make it in time.
---
arch/x86
In case we want to test failing ioctls we need an option to not
fail. Following _vcpu_run() precedent implement _vcpu_ioctl().
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/include/kvm_util.h | 2 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 14 --
2 files
Add a simple (and stupid) hyperv_cpuid test: check that we got the
expected number of entries with and without Enlightened VMCS enabled
and that all currently reserved fields are zeroed.
Signed-off-by: Vitaly Kuznetsov
---
Changes since v1:
- Check for -E2BIG
---
tools/testing/selftests/kvm
KVM's (e.g. 0x4000,
0x4001) and we would probably confuse userspace in case we decide to
return these twice.
KVM_CAP_HYPERV_CPUID's number is interim: we're intended to drop
KVM_CAP_HYPERV_STIMER_DIRECT and use its number instead.
Suggested-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
-
The upcoming KVM_GET_SUPPORTED_HV_CPUID ioctl will need to return
Enlightened VMCS version in HYPERV_CPUID_NESTED_FEATURES.EAX when
it was enabled.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm.c | 7 +++
arch/x86/kvm/vmx.c
ed-off-by: Vitaly Kuznetsov
Reviewed-by: Michael Kelley
---
arch/x86/include/asm/hyperv-tlfs.h | 186 ++---
arch/x86/kvm/hyperv.c | 4 +-
2 files changed, 93 insertions(+), 97 deletions(-)
diff --git a/arch/x86/include/asm/hyperv-tlfs.h
b/arch/x86/inclu
KVM_CAP_HYPERV_STIMER_DIRECT before it's
too late.
Vitaly Kuznetsov (7):
x86/hyper-v: Do some housekeeping in hyperv-tlfs.h
x86/hyper-v: Drop HV_X64_CONFIGURE_PROFILER definition
x86/kvm/hyper-v: Introduce nested_get_evmcs_version() helper
x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID
x86/kvm/hyper-v
Roman Kagan writes:
> On Mon, Dec 10, 2018 at 01:54:18PM +0100, Vitaly Kuznetsov wrote:
>> Roman Kagan writes:
>> > Just noticed that the patch seems to assume that "direct" timers are
>> > allowed to use any vectors including 0-15. I guess this is incorrec
Roman Kagan writes:
> On Mon, Nov 26, 2018 at 04:47:31PM +0100, Vitaly Kuznetsov wrote:
>> Turns out Hyper-V on KVM (as of 2016) will only use synthetic timers
>> if direct mode is available. With direct mode we notify the guest by
>> asserting APIC irq instead of se
Ben Hutchings writes:
> 3.16.62-rc1 review patch. If anyone has any objections, please let me know.
>
> --
>
> From: Vitaly Kuznetsov
>
> commit 2d408c0d4574b01b9ed45e02516888bf925e11a9 upstream.
>
> Commit f599c64fdf7d ("xen-netfront: Fix race
Vitaly Kuznetsov writes:
> With every new Hyper-V Enlightenment we implement we're forced to add a
> KVM_CAP_HYPERV_* capability. While this approach works it is fairly
> inconvenient: the majority of the enlightenments we do have corresponding
> CPUID feature bit(s) and userspace
KarimAllah Ahmed writes:
> Use kvm_vcpu_map for accessing the enhanced VMCS since using
just a nitpick: "eVMCS" stands for Enlightened VMCS, not 'enhanced' :-)
> kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has
> a "struct page".
>
> Signed-off-by: KarimAllah Ahmed
>
KarimAllah Ahmed writes:
> Use kvm_vcpu_map for accessing the enhanced VMCS since using
just a nitpick: "eVMCS" stands for Enlightened VMCS, not 'enhanced' :-)
> kvm_vcpu_gpa_to_page() and kmap() will only work for guest memory that has
> a "struct page".
>
> Signed-off-by: KarimAllah Ahmed
>
BIT(13) in HYPERV_CPUID_FEATURES.EBX is described as "ConfigureProfiler" in
TLFS v4.0 but starting 5.0 it is replaced with 'Reserved'. As we don't
currently us it in kernel it can just be dropped.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 1 -
1 file
BIT(13) in HYPERV_CPUID_FEATURES.EBX is described as "ConfigureProfiler" in
TLFS v4.0 but starting 5.0 it is replaced with 'Reserved'. As we don't
currently us it in kernel it can just be dropped.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 1 -
1 file
KVM's (e.g. 0x4000,
0x4001) and we would probably confuse userspace in case we decide to
return these twice.
KVM_CAP_HYPERV_CPUID's number is interim: we're intended to drop
KVM_CAP_HYPERV_STIMER_DIRECT and use its number instead.
Suggested-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
---
KVM's (e.g. 0x4000,
0x4001) and we would probably confuse userspace in case we decide to
return these twice.
KVM_CAP_HYPERV_CPUID's number is interim: we're intended to drop
KVM_CAP_HYPERV_STIMER_DIRECT and use its number instead.
Suggested-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
---
ed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 186 ++---
arch/x86/kvm/hyperv.c | 4 +-
2 files changed, 93 insertions(+), 97 deletions(-)
diff --git a/arch/x86/include/asm/hyperv-tlfs.h
b/arch/x86/include/asm/hyperv-tlfs.h
index ebfed5
The upcoming KVM_GET_SUPPORTED_HV_CPUID ioctl will need to return
Enlightened VMCS version in HYPERV_CPUID_NESTED_FEATURES.EAX when
it was enabled.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm.c | 7 +++
arch/x86/kvm/vmx.c
Add a simple (and stupid) hyperv_cpuid test: check that we got the
expected number of entries with and without Enlightened VMCS enabled
and that all currently reserved fields are zeroed.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm
ed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 186 ++---
arch/x86/kvm/hyperv.c | 4 +-
2 files changed, 93 insertions(+), 97 deletions(-)
diff --git a/arch/x86/include/asm/hyperv-tlfs.h
b/arch/x86/include/asm/hyperv-tlfs.h
index ebfed5
The upcoming KVM_GET_SUPPORTED_HV_CPUID ioctl will need to return
Enlightened VMCS version in HYPERV_CPUID_NESTED_FEATURES.EAX when
it was enabled.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm.c | 7 +++
arch/x86/kvm/vmx.c
Add a simple (and stupid) hyperv_cpuid test: check that we got the
expected number of entries with and without Enlightened VMCS enabled
and that all currently reserved fields are zeroed.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm
The newly introduced KVM_GET_SUPPORTED_HV_CPUID covers Direct Mode stimers
feature so we can drop KVM_CAP_HYPERV_STIMER_DIRECT and reuse its number.
Signed-off-by: Vitaly Kuznetsov
---
- This patch only makes sense befor 4.21 merge window, disregard if it
doesn't make it in time.
---
arch/x86
The newly introduced KVM_GET_SUPPORTED_HV_CPUID covers Direct Mode stimers
feature so we can drop KVM_CAP_HYPERV_STIMER_DIRECT and reuse its number.
Signed-off-by: Vitaly Kuznetsov
---
- This patch only makes sense befor 4.21 merge window, disregard if it
doesn't make it in time.
---
arch/x86
ioctl
works) and removes recently added KVM_CAP_HYPERV_STIMER_DIRECT before it's
too late.
Vitaly Kuznetsov (6):
x86/hyper-v: Do some housekeeping in hyperv-tlfs.h
x86/hyper-v: Drop HV_X64_CONFIGURE_PROFILER definition
x86/kvm/hyper-v: Introduce nested_get_evmcs_version() helper
x86/kvm
ioctl
works) and removes recently added KVM_CAP_HYPERV_STIMER_DIRECT before it's
too late.
Vitaly Kuznetsov (6):
x86/hyper-v: Do some housekeeping in hyperv-tlfs.h
x86/hyper-v: Drop HV_X64_CONFIGURE_PROFILER definition
x86/kvm/hyper-v: Introduce nested_get_evmcs_version() helper
x86/kvm
()). Remove the redundant part.
Suggested-by: Roman Kagan
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 36 +++-
1 file changed, 3 insertions(+), 33 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index e6a2a085644a..0a16a77e6ac3
()). Remove the redundant part.
Suggested-by: Roman Kagan
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 36 +++-
1 file changed, 3 insertions(+), 33 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index e6a2a085644a..0a16a77e6ac3
Roman Kagan writes:
> On Mon, Nov 26, 2018 at 04:47:31PM +0100, Vitaly Kuznetsov wrote:
>> @@ -379,6 +398,14 @@ void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int
>> vector)
>> for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
>> if (synic_get_
Roman Kagan writes:
> On Mon, Nov 26, 2018 at 04:47:31PM +0100, Vitaly Kuznetsov wrote:
>> @@ -379,6 +398,14 @@ void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int
>> vector)
>> for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
>> if (synic_get_
this.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly Kuznetsov
Acked-by: Thomas Gleixner
Acked-by: Nadav Amit
---
- Changes since v2:
- add __packed to struct 'u' defined within union 'hv_port_id'
[Michael Kelley]
- This is a follow-up to my "[PATCH v2 0/4] x86/kvm/hyper-v: Impl
this.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly Kuznetsov
Acked-by: Thomas Gleixner
Acked-by: Nadav Amit
---
- Changes since v2:
- add __packed to struct 'u' defined within union 'hv_port_id'
[Michael Kelley]
- This is a follow-up to my "[PATCH v2 0/4] x86/kvm/hyper-v: Impl
Michael Kelley writes:
> From: Vitaly Kuznetsov Sent: Friday, November 30, 2018
> 4:54 AM
>>
>> @@ -466,7 +466,7 @@ union hv_message_flags {
>> struct {
>> __u8 msg_pending:1;
>> __u8 reserved:7;
>> -};
>>
Michael Kelley writes:
> From: Vitaly Kuznetsov Sent: Friday, November 30, 2018
> 4:54 AM
>>
>> @@ -466,7 +466,7 @@ union hv_message_flags {
>> struct {
>> __u8 msg_pending:1;
>> __u8 reserved:7;
>> -};
>>
Nadav Amit writes:
[skip]
>
> Having said that, something else is sort of strange in the TLFS definitions,
> I think (I really know little about this whole protocol). Look at the
> following definitions from hyperv-tlfs.h:
>
>> struct hv_vpset {
>> u64 format;
>> u64
Nadav Amit writes:
[skip]
>
> Having said that, something else is sort of strange in the TLFS definitions,
> I think (I really know little about this whole protocol). Look at the
> following definitions from hyperv-tlfs.h:
>
>> struct hv_vpset {
>> u64 format;
>> u64
Roman Kagan writes:
> On Fri, Nov 30, 2018 at 02:44:54PM +0100, Vitaly Kuznetsov wrote:
>
>> I also checked this patch before sending out, WS2016 guest boots without
>> issues. Any particular places you're worried about?
>
> It's Linux guests on Hyper-V that need to be ch
Roman Kagan writes:
> On Fri, Nov 30, 2018 at 02:44:54PM +0100, Vitaly Kuznetsov wrote:
>
>> I also checked this patch before sending out, WS2016 guest boots without
>> issues. Any particular places you're worried about?
>
> It's Linux guests on Hyper-V that need to be ch
Roman Kagan writes:
> On Fri, Nov 30, 2018 at 01:15:11PM +0100, Vitaly Kuznetsov wrote:
>> Without 'packed' compiler is free to add optimization paddings and re-order
>> structure fields for randomization/optimization. And structures from
>> hyperv-tlfs.h are used
Roman Kagan writes:
> On Fri, Nov 30, 2018 at 01:15:11PM +0100, Vitaly Kuznetsov wrote:
>> Without 'packed' compiler is free to add optimization paddings and re-order
>> structure fields for randomization/optimization. And structures from
>> hyperv-tlfs.h are used
this.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly Kuznetsov
Acked-by: Thomas Gleixner
---
- Changes since v1:
- Re-worded commit message for clarity. [Thomas Gleixner]
- This is a follow-up to my "[PATCH v2 0/4] x86/kvm/hyper-v: Implement
Direct Mode for synthetic timers&qu
this.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly Kuznetsov
Acked-by: Thomas Gleixner
---
- Changes since v1:
- Re-worded commit message for clarity. [Thomas Gleixner]
- This is a follow-up to my "[PATCH v2 0/4] x86/kvm/hyper-v: Implement
Direct Mode for synthetic timers&qu
Thomas Gleixner writes:
> On Fri, 30 Nov 2018, Vitaly Kuznetsov wrote:
>
>> Subject: x86/hyper-v: define structures from TLFS as packed
>
> Please start the first word after the prefix colon with an uppercase
> letter. Also structures from TLFS doesn't make sense
Thomas Gleixner writes:
> On Fri, 30 Nov 2018, Vitaly Kuznetsov wrote:
>
>> Subject: x86/hyper-v: define structures from TLFS as packed
>
> Please start the first word after the prefix colon with an uppercase
> letter. Also structures from TLFS doesn't make sense
Without 'packed' compiler is free to add optimization paddings and re-order
structure fields for randomization/optimization. And structures from
hyperv-tlfs.h are used for hypervisor-guest communication, we need to
ultimately forbid such practices.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly
Without 'packed' compiler is free to add optimization paddings and re-order
structure fields for randomization/optimization. And structures from
hyperv-tlfs.h are used for hypervisor-guest communication, we need to
ultimately forbid such practices.
Suggested-by: Nadav Amit
Signed-off-by: Vitaly
Nadav Amit writes:
>> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote:
>>
>> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote:
>>
>>> Nadav Amit writes:
>>>
>>>> On a different note: how come all of the hyper-v structs are not marked
>
Nadav Amit writes:
>> On Nov 28, 2018, at 5:07 AM, Thomas Gleixner wrote:
>>
>> On Wed, 28 Nov 2018, Vitaly Kuznetsov wrote:
>>
>>> Nadav Amit writes:
>>>
>>>> On a different note: how come all of the hyper-v structs are not marked
>
Nadav Amit writes:
>
> On a different note: how come all of the hyper-v structs are not marked
> with the “packed" attribute?
"packed" should not be needed with proper padding; I vaguely remember
someone (from x86@?) arguing _against_ "packed".
--
Vitaly
Nadav Amit writes:
>
> On a different note: how come all of the hyper-v structs are not marked
> with the “packed" attribute?
"packed" should not be needed with proper padding; I vaguely remember
someone (from x86@?) arguing _against_ "packed".
--
Vitaly
Out of pure curiosity I decided to check what 'gcc -O3' produces when we
use bitfields and masks. As of 'gcc version 8.2.1 20181105 (Red Hat 8.2.1-5)
(GCC)'
1) bitfields:
struct abc {
int enabled:1;
int _pad:7;
int vec:8;
};
int is_good(struct abc *s) {
if
Out of pure curiosity I decided to check what 'gcc -O3' produces when we
use bitfields and masks. As of 'gcc version 8.2.1 20181105 (Red Hat 8.2.1-5)
(GCC)'
1) bitfields:
struct abc {
int enabled:1;
int _pad:7;
int vec:8;
};
int is_good(struct abc *s) {
if
Roman Kagan writes:
> [ Sorry for having missed v1 ]
>
> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote:
>> We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
>> room for code sharing.
>>
>> Signed-off-by: Vitaly Kuzne
Roman Kagan writes:
> [ Sorry for having missed v1 ]
>
> On Mon, Nov 26, 2018 at 04:47:29PM +0100, Vitaly Kuznetsov wrote:
>> We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
>> room for code sharing.
>>
>> Signed-off-by: Vitaly Kuzne
Paolo Bonzini writes:
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index 2b7a652c9fa4..b8da14cee8e5 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -975,6 +975,7 @@ struct kvm_ppc_resize_hpt {
>> #define KVM_CAP_HYPERV_ENLIGHTENED_VMCS
Paolo Bonzini writes:
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index 2b7a652c9fa4..b8da14cee8e5 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -975,6 +975,7 @@ struct kvm_ppc_resize_hpt {
>> #define KVM_CAP_HYPERV_ENLIGHTENED_VMCS
801 - 900 of 4372 matches
Mail list logo