KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-04-17 Thread Victor Miasnikov

Hi!

Short:


>> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>>   Mixing KVM hypercalls and Hyper-V requires some tricks. It

VVM>> KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?

It's not related.


Are You shue?
Xen-team _think_ too what is not related, but has non-100% _full_ emulation of 
Hyper-V and, as result, create problems

Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:

==
KVM emulates Hyper-V to host enlightened Windows.

. . .

[ hpa: the problem here is that KVM doesn't emulate Hyper-V well
 enough,  .  . ]

. . .

+  * KVM emulates Hyper-V to support enlightened Windows.
+  * Check to see first if we are on a KVM Hypervisor.
+ if (KVM_cpuid_base())
+  return false;
. . .
==

Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ?



--
Full:

- Original Message - 
From: "Michael S. Tsirkin"

To: "K. Y. Srinivasan"
Cc:
Sent: Wednesday, April 17, 2013 10:06 AM
Subject: Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V



On Sun, Feb 03, 2013 at 05:22:38PM -0800, K. Y. Srinivasan wrote:

Xen emulates Hyper-V to host enlightened Windows. Looks like this
emulation may be turned on by default even for Linux guests. Check and
fail Hyper-V detection if we are on Xen.

Signed-off-by: K. Y. Srinivasan kys (at) microsoft.com


I'm very curious what's the specific bug that is fixed here?
I went over the original discussion in
https://patchwork.kernel.org/patch/2064331/
and that's still not clear to me. Is there a configuration
that is broken without this patch but starts working with
this patch?

It seems that one might want to use hyper-v emulation e.g. to test
hyper-v code without using windows, so the functionality
that this patch disables is not completely useless,
so there should be a good reason for disabling it.

Could you enlighten me please? :)


Short history of question:

{{
==

> And hypercall has its own set of problems with Windows guests.
> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>   Mixing KVM hypercalls and Hyper-V requires some tricks. It

Can't we simply register a hypercall ID range with Microsoft?

> may also affect WHQLing Windows drivers since driver will talk to HW
> bypassing Windows interfaces.

Then the WHQL'ed driver doesn't support the PV MMIO hcall?

==

KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?
}}

{{

>> When KVM runs in Hyper-V emulation mode it expects to get Hyper-V hypercalls.
>>   Mixing KVM hypercalls and Hyper-V requires some tricks. It
KVM  "Hyper-V emulation"   -- this can be related "Linux on Hyper-V" ?

It's not related.


Are You shue?
Xen-team _think_ too what is not related, but has non-100% _full_ emulation of 
Hyper-V and, as result, create problems:

==
Xen emulates Hyper-V to host enlightened Windows. Looks like this
emulation may be turned on by default even for Linux guests. Check and
fail Hyper-V detection if we are on Xen.

[ hpa: the problem here is that Xen doesn't emulate Hyper-V well
 enough, and if the Xen support isn't compiled in, we end up stubling
 over the Hyper-V emulation and try to activate it -- and it fails. ]

. . .

+ /*
+  * Xen emulates Hyper-V to support enlightened Windows.
+  * Check to see first if we are on a Xen Hypervisor.
+  */
+ if (xen_cpuid_base())
+  return false;
+
==
}}


Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:

==
KVM emulates Hyper-V to host enlightened Windows. Looks like this
emulation may be turned on by default even for Linux guests. Check and
fail Hyper-V detection if we are on KVM.

[ hpa: the problem here is that KVM doesn't emulate Hyper-V well
 enough, and if the KVM support isn't compiled in, we end up stubling
 over the Hyper-V emulation and try to activate it -- and it fails. ]

. . .

+ /*
+  * KVM emulates Hyper-V to support enlightened Windows.
+  * Check to see first if we are on a KVM Hypervisor.
+  */
+ if (KVM_cpuid_base())
+  return false;
+
==


Or  "KVM emulates Hyper-V" as  "Hyper-V emulates Hyper-V" ?


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.



- Original Message - 
From: "Michael S. Tsirkin"

To: "Victor Miasnikov"
Sent: Wednesday, April 17, 2013 10:07 AM

I'm not sure what are we talking about then, but please
use the mailing list appropriate for the subject.


- Original Message - 
From: "Victor Miasnikov" vvm (a) tut (dot) by

To: "Michael S. Tsirkin"
Cc: "KY Srinivasan"
Sent: Tuesday, April 16, 2013 9:36 AM
Subject: Are You shue what is 100% _full_ emulation of Hyper-V? Re: It's not related Re: KVM "Hyper-V emulation" -- this 
can 

Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-04-17 Thread Victor Miasnikov

Hi!

2013/4/17 Jan Beulich


>>> On 17.04.13 at 12:16, "Michael S. Tsirkin"  wrote:
> If the hypervisor says it's Hyper-V, that's because it wants
> guests to use Hyper-V. I don't see why is guest second-guessing
> this a good idea.

There are two reasons here: For one, when the hypervisor is not
Hyper-V, but is providing some Hyper-V emulation, that's intended
for Windows guests to use, not e.g. Linux ones, especially when
such guests could use the native hypervisor interface with much
greater benefit.

And second, there reportedly are features of (newer?) Hyper-V
that some emulation may not provide, but that are also not easily
detectable.




Yes

+




On Wed, Apr 17, 2013 at 12:10:01PM +0300, Victor Miasnikov wrote:






Question is very simple:  Hyper-V users/sysadmins need wait patch a-la this:
Or  "KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V emulates 
Hyper-V" as "Hyper-V emulates
Hyper-V" ?



No.  You are using Hyper-V, not the 
KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
emulation of it.
No patches dealing with this emulation should have any effect on you.



This is _positive_ variant of possible future,
but on _practic_ very often we need prevent _negative_ variant of possible 
future



==
+ /*
+  * KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V 
emulates Hyper-V to support
enlightened Windows.
+  * Check to see first if we are on a 
KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V
Hypervisor.
+  */
+
+ if 
(KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V_cpuid_base())
+  return false;




If the hypervisor says it's Hyper-V, that's because it wants guests to use 
Hyper-V.




Even if guest ( i.e. Virtual Computer) contain Linux OS ?



==
KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V 
emulates Hyper-V to host enlightened
Windows.

. . .

[ hpa: the problem here is that
KVM_and_or_XEN_or_other_Hypervisor_what_has_non-full-emulation_of_Hyper-V 
doesn't emulate Hyper-V well enough,  .
 . ]


What's emulated not well enough?



In case of XEN variant non-full-emulation_of_Hyper-V , IMHO :

{{
- Original Message - 
From: "Victor Miasnikov"

To: "Michael S. Tsirkin"
Sent: Wednesday, April 17, 2013 12:41 PM
Subject: IMHO, XEN emulation of Hyper-V not contain needed clocksource for 
Lunux guest Re: [PATCH 2/3] X86: Add a check
to catch Xen emulation of Hyper-V

Hi!


It seems that one might want to use hyper-v emulation e.g. to test
hyper-v code without using windows, so the functionality
that this patch disables is not completely useless,
so there should be a good reason for disabling it.


As I undestand, XEN emulation of Hyper-V not contain  needed clocksource for 
Lunux guest ( virtual computers)

I.e. Linux VM "think" what is running on Hyper-V host call 
clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100)
and a-la BSOD or vice versa . . .



I went over the original discussion in
https://patchwork.kernel.org/patch/2064331/
and that's still not clear to me. Is there a configuration
that is broken without this patch but starts working with
this patch?



IMHO, this related to:

- clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
+ if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
+  clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);


See

https://lkml.org/lkml/2013/2/12/623
==
   Date Tue, 12 Feb 2013 16:56:07 -0800
   From tip-bot for Olaf Hering
   Subject [tip:x86/hyperv] x86: Hyper-V: register clocksource only if 
its advertised

. . .

==



Best regards, Victor Miasnikov
}}





Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: KVM "Hyper-V emulation" -- this can be related "Linux on Hyper-V" ? Or "KVM emulates Hyper-V" as "Hyper-V emulates Hyper-V" ? Re: [PATCH 2/3] X86: Add a check to catch Xen emulation of Hyper-V

2013-04-17 Thread Victor Miasnikov


Hi!


This is _positive_ variant of possible future,
but on _practic_ very often we need prevent _negative_ variant of possible
future


I don't really know what this means.



On practic: this means, that need test with KVM "Hyper-V emulation" not only 
Windows guest, but _all_ Linux guest

_all_ Linux need read -- not only RHEL, but 
-- Debian 7.X ( kernell v3.2 with own hotfixes set) , 
-- Ubuntu 12.04 LTS ( kernell v3.2 with hotfixes)

-- Ubuntu 12.04.03 LTS ( kernell v3.5 with hotfixes)
-- Ubuntu 12.10 ( kernell v3.5 with hotfixes)
-- Linuxes with kernel v3.6 / or v3.7
-- Linuxes with latest stable kernel v3.8 ( for example Arch Linux)
-- other possible variants

Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


P.S.
 I'm personal not want, what KVM "Hyper-V emulation" initiative stopped 
implemented
If it work as need -- this is very good

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Please, apply patch both 3.10 and 3.9 Re: [PATCH 1/1] X86: Handle Xen emulation of Hyper-V more gracefully

2013-04-18 Thread Victor Miasnikov


Hi!



- /*
- * Xen emulates Hyper-V to support enlightened Windows.
- * Check to see first if we are on a Xen Hypervisor.
- */
- if (xen_cpuid_base())
- return false;


. . . 


 void hv_register_vmbus_handler(int irq, irq_handler_t handler)
 {
+ /*
+ * Setup the IDT for hypervisor callback.
+ */
+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
+



Michael S. Tsirkin> Any chance we can fast-path this patch into 3.9 so 
Michael S. Tsirkin> that we don't release a kernel with hyper-v on Xen completely disabled?



Yes, this backport from linux-next ( future 3.10 ) to 3.9 ( on 2013-04-18 -- 
3.9-rc(7+N) )  look like usefull . . .

Please, apply patch both 3.10 and 3.9

Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


- Original Message - 
From: "Michael S. Tsirkin" 
To: "K. Y. Srinivasan"

Cc:
Sent: Thursday, April 18, 2013 5:17 PM
Subject: Re: [PATCH 1/1] X86: Handle Xen emulation of Hyper-V more gracefully



On Thu, Apr 18, 2013 at 08:44:46AM -0700, K. Y. Srinivasan wrote:

Install the Hyper-V specific interrupt handler only when needed. This would
permit us to get rid of the Xen check. Note that when the vmbus drivers invokes
the call to register its handler, we are sure to be running on Hyper-V.

Signed-off-by: K. Y. Srinivasan 


Looks good to me, this will address the concern. FWIW

Acked-by: Michael S. Tsirkin 


Any chance we can fast-path this patch into 3.9 so that we don't release
a kernel with hyper-v on Xen completely disabled?


---


. . .
 

- /*
- * Xen emulates Hyper-V to support enlightened Windows.
- * Check to see first if we are on a Xen Hypervisor.
- */
- if (xen_cpuid_base())
- return false;
-
 cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
   &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
 
@@ -82,12 +75,6 @@ static void __init ms_hyperv_init_platform(void)
 
 if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)

 clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
-#if IS_ENABLED(CONFIG_HYPERV)
- /*
- * Setup the IDT for hypervisor callback.
- */
- alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
-#endif
 }


. . .


 void hv_register_vmbus_handler(int irq, irq_handler_t handler)
 {
+ /*
+ * Setup the IDT for hypervisor callback.
+ */
+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
+
 vmbus_irq = irq;


. . .





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


ToDo: backport to v3.2 patches Fw: use hv_storvsc instead of ata_piix for IDE disks ( but not for the CD-ROM) Re: Kernel v3.2 used in SlackWare 14.00 please, backport all needed patches

2013-05-30 Thread Victor Miasnikov

Hi!

B.H.>  I think Slackware might do better to
B.H.> backport the Hyper-V drivers from Linux 3.4,

In SlackWare 14.1 used Linux Kernel v3.8.X
with already fixed source code
i.e. "use hv_storvsc instead of ata_piix for IDE disks ( but not for the 
CD-ROM)"
work as need

But, in SlackWare 14.00 (  actual stable version of SlackWare)
used Linux Kernel v3.2

(  Because backport requested at 2012-06-08  ( and apply to v3.4 -- Thanks!) has been ignored ( linux-3.2.45.tar.xz has 
non-fixed ata_piix.c) in part v3.2


 I ask about backport on 08/16/2012 09:53 AM :

- Original Message - 
From: "Patrick J. Volkerding"

To: "Victor Miasnikov" vvm
Sent: Thursday, August 16, 2012 7:00 PM
Subject: Re: b3) Please: backport to Slackware 14.0 patches 1b) db63a4c8115a libata 1) cd006086fa5d ata_piix Fw: 
Slackware 14.0 RC2 in virtual computer ( guest ) on Hyper-V


On 08/16/2012 09:53 AM, Victor Miasnikov wrote:

Thanks! LAN & SCSI *.ko related Hyper-V work as need
Please: backport to Slackware 14.0 patches 1b) db63a4c8115a libata 1) 
cd006086fa5d ata_piix


. . . ( skipped by VVM:  as possible non-public msg.)

Pat
--
)


B.H.> as Debian and Ubuntu have done with 3.2-based kernels.

Yes: backport source code related  Hyper-V -- is right solution


B.H.> But that sort of large backport isn't allowed on kernel.org stable 
branches.

I know -- see later "June 04, 2012 3:33 PM"


B.H.> I'm not going to read through all of what you wrote . . . ( skipped by 
VVM)


No problem, read this:
-- June 08, 2012
-- v3.2.X
--   cd006086fa5d
--   db63a4c8115a
---  URL near phrase "way to cleanly identify Hyper-V but not Virtual PC 7"

{{{
need backport requested at 2012-06-08(!) :
 . . .
( look on sub-string "3.2")

http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg439101.html

Or
==
- Original Message - 
From: "Victor Miasnikov"

To: "Greg KH" ; "Jonathan Nieder" ; "Andy Whitcroft"
Cc: ; ; "KY Srinivasan"; "Mike 
Sterling"
Sent: Friday, June 08, 2012 1:36 PM
Subject: Re: Re: ToDo: backport to v3.4 , v3.3 , v3.2 patches 1b) db63a4c8115a 
libata 1) cd006086fa5d ata_piix: defer
disks to the Hyper-V drivers by default Fw: use hv_storvsc instead of ata_piix 
for IDE disks ( but not for the CD-ROM)

. . .

{

> > Hyper-V admins need _worked_ Linux v3.4.X / v3.3.X / v3.2.X
> > Please, _fix_ errors related "use hv_storvsc instead of ata_piix to
> > handle the IDE disks devices ( but not for the CD-ROM)"


 i.e. need backport to all actual version after 3.1

 cd006086fa5d ata_piix: defer disks to the Hyper-V drivers by default

and its prerequisite

 db63a4c8115a libata: add a host flag to ignore detected ATA devices
}
==
}}}


{{{

Still, if there is a way to cleanly identify Hyper-V but not Virtual PC 7, this 
would be great!


FIXed: ef773e1..bec35f4

Write in
https://bugzilla.kernel.org/show_bug.cgi?id=52821
}}}







B.H.>  In short, you need to identify the commit hash for each of the changes 
you want,
B.H.> and provide the backported patch for any commits
B.H.> that can't simply be cherry-picked.

IMHO:

VVM>  In short, MS_HV_Team need to identify the commit hash for each of the 
changes MS_HV_Team want,
VVM> and provide the backported patch for any commits
VVM> that can't simply be cherry-picked.





B.H.> Please read Documentation/stable_kernel_rules.txt.

Already . . .

Ben, please remember:

==
- Original Message - 
From: "Victor Miasnikov" vvm

To:
Cc: ;  . . .
Sent: Monday, June 04, 2012 3:33 PM
Subject: Re: Linux on Hyper-V 1) cd006086fa5d ata_piix: defer disks to the Hyper-V drivers by default 2) db63a4c8115a 
libata: add a host flag to ignore detected ATA device FW: use hv_storvsc instead of ata_piix to handle the IDE disks 
devices ( but not for the ...


Hi!

VVM > > > Hyper-V admins need _worked_ Linux v3.4.X / v3.3.X / v3.2.X
VVM > > >
VVM > > > Please, _fix_ errors related "use hv_storvsc instead of ata_piix to
VVM > > > handle the IDE disks devices ( but not for the CD-ROM)"


. . .


Lots of things would be "nice",
but as this doesn't meet the stable_kernel_rules.txt rules, sorry, I can't take 
them.


IMHO, patches "does meet the stable_kernel_rules.txt rules" by _all_ criterias 
. . .

See info correlated with rules:
==
Rules on what kind of patches are accepted, and which ones are not, into the
"-stable" tree:

{
- It must be obviously correct and tested.

Tested ( but, in early implementaition): Ubuntu 12.04 + OpenSUSE

}

{

- It cannot be bigger than 100 lines, with context.


79 lines
+
47 lines
}
 . . .
==




Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/




- Original Message - 
From: "Ben Hutchings"

To: "Victor Miasnikov"
C

CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 system starts regular boot when waking from s2ram Fw: [PATCH 2/2] x86: Make

2013-05-15 Thread Victor Miasnikov

Hi!

b)

See in P.S.
CONFIG_PARAVIRT_GUEST in arch/ia64

a)
config-3.10.0-rc1-fullnohzdisabled
==
# CONFIG_HYPERVISOR_GUEST is not set
==


- select PARAVIRT_GUEST
+ select HYPERVISOR_GUEST


TO Borislav Petkov :  first [but not last :-( ] non-upgraded config . . .

TO All:

Please, replace
CONFIG_PARAVIRT_GUEST=y
with
CONFIG_HYPERVISOR_GUEST=y


{=
patch-3.10-rc1
==
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 64630f15f181..0403b51d20ba 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -2,7 +2,7 @@ menu "Microsoft Hyper-V guest support"

config HYPERV
 tristate "Microsoft Hyper-V client drivers"
- depends on X86 && ACPI && PCI && X86_LOCAL_APIC
+ depends on X86 && ACPI && PCI && X86_LOCAL_APIC && HYPERVISOR_GUEST
 help
   Select this option to run Linux as a Hyper-V client operating
   system.
==


IMHO, related not only Hyper-V, but XEN, KVM , etc.

( and VMWare
config VMWARE_BALLOON
 tristate "VMware Balloon Driver"
- depends on X86
+ depends on X86 && HYPERVISOR_GUEST
)


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.

Is good?

CONFIG_PARAVIRT_GUEST in arch/ia64 :

./linux-3.10-rc1/arch/ia64/include/asm/native/
inst.h
./linux-3.10-rc1/arch/ia64/configs/
xen_domu_defconfig
./linux-3.10-rc1/arch/ia64/include/asm/
hw_irq.h
iosapic.h
paravirt.h

==
. . .
#ifdef CONFIG_PARAVIRT_GUEST

#define PARAVIRT_HYPERVISOR_TYPE_DEFAULT 0
#define PARAVIRT_HYPERVISOR_TYPE_XEN  1
. . .
==


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 system starts regular boot when waking from s2ram Fw: [PATCH 2/2] x86: M

2013-05-15 Thread Victor Miasnikov


Hi!


>- select PARAVIRT_GUEST
>+ select HYPERVISOR_GUEST


I might have missed the previous discussion but how does this relate to
the original problem reported to this (https://lkml.org/lkml/2013/5/14/398)
thread?


As example:

https://lkml.org/lkml/2013/5/14/398
==
. . .
# CONFIG_HYPERVISOR_GUEST is not set
. . .
==


For record:
$grep HYPERVISOR_GUEST .config
# CONFIG_HYPERVISOR_GUEST is not set



Why not
CONFIG_HYPERVISOR_GUEST=y

?


$grep PARAVIRT_GUEST .config
$



Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 Fw: [PATCH 2/2] x86: Make Linux guest support optional

2013-05-15 Thread Victor Miasnikov

Hi!


>>>- select PARAVIRT_GUEST
>>>+ select HYPERVISOR_GUEST
>
>I might have missed the previous discussion but how does this relate to
>the original problem reported to this (https://lkml.org/lkml/2013/5/14/398)
>thread?

As example:

https://lkml.org/lkml/2013/5/14/398
==
. . .
# CONFIG_HYPERVISOR_GUEST is not set
. . .
==

>For record:
>$grep HYPERVISOR_GUEST .config
># CONFIG_HYPERVISOR_GUEST is not set


Why not
CONFIG_HYPERVISOR_GUEST=y


This is unrelated to the issue discussed in this thread.


Yes: Is another 1-2 problem[s], but is problem[s]:


==
TO All:

Please, replace
CONFIG_PARAVIRT_GUEST=y
with
CONFIG_HYPERVISOR_GUEST=y
==

==
Is good?

CONFIG_PARAVIRT_GUEST in arch/ia64 :

./linux-3.10-rc1/arch/ia64/include/asm/native/
inst.h
./linux-3.10-rc1/arch/ia64/configs/
xen_domu_defconfig
./linux-3.10-rc1/arch/ia64/include/asm/
hw_irq.h
iosapic.h
paravirt.h

==
. . .
#ifdef CONFIG_PARAVIRT_GUEST

#define PARAVIRT_HYPERVISOR_TYPE_DEFAULT 0
#define PARAVIRT_HYPERVISOR_TYPE_XEN  1
. . .
==

==

Comments ?

Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 Fw: [PATCH 2/2] x86: Make Linux guest support optional

2013-05-15 Thread Victor Miasnikov


Hi!


. . . depends on BROKEN on ia64 . . .


Is mini-problem [, IMHO] 


See example of real problem:



changed the Kconfig symbol to CONFIG_HYPERVISOR_GUEST on x86.


And when CONFIG_HYPERVISOR_GUEST not set ( IMHO, not special) , as result

linux-mainline ( non-official, but very usefull) v3.10-rc1 2013-05-12 for Arch 
Linux

not contain

hv_storvsc.ko.gz

as not contain (

hv_vmbus.ko.gz
hv_utils.ko.gz
hv_netvsc.ko.gz
hv_balloon.ko.gz


)

Arch Linux  linux-mainline v3.9 contain all this files

i.e. not only "balloon driver[s]"


{=
patch-3.10-rc1
==
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 64630f15f181..0403b51d20ba 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -2,7 +2,7 @@ menu "Microsoft Hyper-V guest support"

config HYPERV
 tristate "Microsoft Hyper-V client drivers"
- depends on X86 && ACPI && PCI && X86_LOCAL_APIC
+ depends on X86 && ACPI && PCI && X86_LOCAL_APIC && HYPERVISOR_GUEST
 help
   Select this option to run Linux as a Hyper-V client operating
   system.
==


==
@@ -596,44 +592,17 @@ config SCHED_OMIT_FRAME_POINTER

   If in doubt, say "Y".

-menuconfig PARAVIRT_GUEST
- bool "Paravirtualized guest support"
+menuconfig HYPERVISOR_GUEST
+ bool "Linux guest support"
 ---help---
-   Say Y here to get to see options related to running Linux under
-   various hypervisors.  This option alone does not add any kernel code.
+   Say Y here to enable options for running Linux under various hyper-
+   visors. This option enables basic hypervisor detection and platform
+   setup.

-   If you say N, all options in this submenu will be skipped and disabled.
+   If you say N, all options in this submenu will be skipped and
+   disabled, and Linux guest support won't be built in.

==


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Kernel v3.2 used in SlackWare 14.00 please, backport all needed patches Re: [PATCH net, 1/2] hyperv: Fix a kernel warning from netvsc_linkstatus_callback()

2013-05-23 Thread Victor Miasnikov

Hi!


(the 3.2 version is different,
and it's instaging. (at not used by distros anyway))


No: used

Linux Kernel v3.2 used in:
-- SlackWare 14.00

This is actual stable version SlackWare

Please, backport all(!) needed patches

I'm download https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.45.tar.xz

File ata_piix.c ( SHA1 ceaf441142ad3f6768ff71f023e73d0695458e2c ) from
./linux-3.2.45/drivers/ata/
not contain:
( even not contain sub-string "Hyper-V")
== ( VVM: symbol TAB replaced by Space+Space -- special for users of MS IE, MS 
OutLook [Express] )
static int prefer_ms_hyperv = 1;
module_param(prefer_ms_hyperv, int, 0);
MODULE_PARM_DESC(prefer_ms_hyperv,
 "Prefer Hyper-V paravirtualization drivers instead of ATA, "
 "0 - Use ATA drivers, "
 "1 (Default) - Use the paravirtualization drivers.");

static void piix_ignore_devices_quirk(struct ata_host *host)
{
#if IS_ENABLED(CONFIG_HYPERV_STORAGE)
 static const struct dmi_system_id ignore_hyperv[] = {
   {
 /* On Hyper-V hypervisors the disks are exposed on
  * both the emulated SATA controller and on the
  * paravirtualised drivers.  The CD/DVD devices
  * are only exposed on the emulated controller.
  * Request we ignore ATA devices on this host.
  */
 .ident = "Hyper-V Virtual Machine",
 .matches = {
   DMI_MATCH(DMI_SYS_VENDOR,
   "Microsoft Corporation"),
   DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
 },
   },
   { }  /* terminate list */
 };
 static const struct dmi_system_id allow_virtual_pc[] = {
   {
 /* In MS Virtual PC guests the DMI ident is nearly
  * identical to a Hyper-V guest. One difference is the
  * product version which is used here to identify
  * a Virtual PC guest. This entry allows ata_piix to
  * drive the emulated hardware.
  */
 .ident = "MS Virtual PC 2007",
 .matches = {
   DMI_MATCH(DMI_SYS_VENDOR,
   "Microsoft Corporation"),
   DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
   DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
 },
   },
   { }  /* terminate list */
 };
 const struct dmi_system_id *ignore = dmi_first_match(ignore_hyperv);
 const struct dmi_system_id *allow = dmi_first_match(allow_virtual_pc);

 if (ignore && !allow && prefer_ms_hyperv) {
   host->flags |= ATA_HOST_IGNORE_ATA;
   dev_info(host->dev, "%s detected, ATA device ignore set\n",
 ignore->ident);
 }
#endif
==


_Absolutly_ ( as _minimum_ for SlackWare 14.00 ) need backport requested at 
2012-06-08(!) :
( look on sub-string "3.2")
==
- Original Message - 
From: "Victor Miasnikov"

To: "Greg KH" ; "Jonathan Nieder" ; "Andy Whitcroft"
Cc: ; ; "KY Srinivasan"; "Mike 
Sterling"
Sent: Friday, June 08, 2012 1:36 PM
Subject: Re: Re: ToDo: backport to v3.4 , v3.3 , v3.2 patches 1b) db63a4c8115a 
libata 1) cd006086fa5d ata_piix: defer
disks to the Hyper-V drivers by default Fw: use hv_storvsc instead of ata_piix 
for IDE disks ( but not for the CD-ROM)

. . .

{

> > Hyper-V admins need _worked_ Linux v3.4.X / v3.3.X / v3.2.X
> > Please, _fix_ errors related "use hv_storvsc instead of ata_piix to
> > handle the IDE disks devices ( but not for the CD-ROM)"


 i.e. need backport to all actual version after 3.1

 cd006086fa5d ata_piix: defer disks to the Hyper-V drivers by default

and its prerequisite

 db63a4c8115a libata: add a host flag to ignore detected ATA devices
}
==

and not forget patch related Bug 52821 :

{{
== ==
- Original Message - 
From: vvm

To: Andreas
Sent: Wednesday, January 30, 2013 4:20 PM
Subject: FIXed: ef773e1..bec35f4 Re: ata_piix.prefer_ms_hyperv=0 works Fw: Bug 
52821 - ata_piix ATA_HOST_IGNORE_ATA for
Hyper-V also affects Virtual PC 7 
https://bugzilla.novell.com/show_bug.cgi?id=737532 Or
https://bugzilla.kernel.org/show_bug.cgi?id=52821


Hi!

Short:


Still, if there is a way to cleanly identify Hyper-V but not Virtual PC 7, this 
would be great!


FIXed: ef773e1..bec35f4

Write in
https://bugzilla.kernel.org/show_bug.cgi?id=52821

"please, backport to 3.4 . . . 3.6 . . . 3.7"

  . . .

Full:



(
. . .


Still, if there is a way to cleanly identify Hyper-V but not Virtual PC 7, this 
would be great!


FIXed: ef773e1..bec35f4


- Original Message - 
From: "Jeff Garzik"

To: "Olaf Hering"
Cc:  . . . ; "KY Srinivasan"
Sent: Wednesday, November 28, 2012 8:44 PM
Subject: Re: [PATCH] ata_piix: reenable MS Virtual PC guests

On 09/18/2012 11:48 AM, Olaf Hering wrote:
An earlier commit cd006086fa5d91414d8ff9ff2b78fbb593878e3c ("ata_piix:
defer disks to the Hyper-V drivers by default") broke MS Virtual PC
guests. Hyper-V guests and Virtual PC guests have nearly identical DMI
info. As a result the driver d

Re: Linux does not use more than the startup RAM under Hyper-V with dynamic memory enabled RE: [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] Drivers: hv:

2014-03-06 Thread Victor Miasnikov

Hi!

Short:

Question to Linux kernel team:

may be patch


[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"


can solve problems with dynamic memory hot add in Hyper-V VMs with Linux OS ?



Full:

BW>> .., if I set the startup memory to 512 MB, and enable dynamic
BW>> memory with a minimum of 512 MB and a maximum of 8192 MB,
BW>>  the system will never allocate than 512 MB of physical memory

BW>>
BW>> Have I encountered a bug in the Hyper-V balloon driver?
BW>>

Unfortunately,  It's long story . . . :-(

a)

I already ( on January 09, 2014 2:18 PM )  write about problems with "Online the hot-added 
memory"  in "user space" see
P.P.S.

b)

 See

Bug 979257 -[Hyper-V][RHEL6.5][RFE]in-kernel online support for memory hot-add
https://bugzilla.redhat.com/show_bug.cgi?id=979257

(  Info from this topic may be interessant not only for RedHat users )


b2)

Detail about pathes related problem "Online the hot-added memory"  in "user 
space" :


[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"


=== 0001-Drivers-base-memory-Export-functionality-for-in-kern.patch
 . . .
+/*
+ * Given the start pfn of a memory block; bring the memory
+ * block online. This API would be useful for drivers that may
+ * want to bring "online" the memory that has been hot-added.
+ */
+
+int online_memory_block(unsigned long start_pfn) {  struct mem_section
+*cur_section;  struct memory_block *cur_memory_block;

 . . .
===


==
 . . .
== 0002-Drivers-hv-balloon-Online-the-hot-added-memory-in-co.patch
  . . .
   /*
-   * Wait for the memory block to be onlined.
-   * Since the hot add has succeeded, it is ok to
-   * proceed even if the pages in the hot added region
-   * have not been "onlined" within the allowed time.
+   * Before proceeding to hot add the next segment,
+   * online the segment that has been hot added.
*/
-  wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ);
+  online_memory_block(start_pfn);

  }





c)

 Before apply patches ( see in P.S. about native udev-script) we are need use 
one of this methods:

http://social.technet.microsoft.com/Forums/en-US/8e1994b9-9ca1-4411-ad8e-25e6b1ee28e1/dynamic-memory-on-linux-vm?forum=linuxintegrationservices



c1)

"/bin/cp method" by Nikolay Pushkarev :

Following udev rule works slightly faster for me (assuming that memory0 bank 
always in online state):

SUBSYSTEM=="memory", ACTION=="add", 
DEVPATH=="/devices/system/memory/memory[1-9]*",
RUN+="/bin/cp /sys$devpath/../memory0/state /sys$devpath/state"}}

( VVM : of course all need be place in one line, 2 line in this msg. -- only 
for good visual formating reasons )


c2)

udev rule using "putarg" by Nikolay Pushkarev :


Even "/bin/cp method" udev rule work time to time not as need :-(


As a result, Nikolay Pushkarev write a program putarg.c, that is even faster than 
"/bin/cp method" :

==
#include 
#include 
#include 
#include 
int main(int argc, char** argv) {
 int i, fd;
 if (argc < 2) return 0;
 if ((fd = open(argv[1], O_RDWR)) < 0) return 1;
 for (i = 2; i < argc; i++) {
   if (write(fd, argv[i], strlen(argv[i])) < 0) {
 close(fd);
 return i;
   }
 }
 close(fd);
 return 0;
}
==

The first argument - the name of the output file ,
and argument number 2 ( and all subsequent (  if exist ) ) - are text that are 
wiil be written in output file.


Compile source code to executable file by run command:
gcc -o putarg -s putarg.c

The resulting binary need be placed an accessible location , such as /usr/bin, 
or wherever you want.


Now udev rule using "putarg" can be written as :

SUBSYSTEM=="memory", ACTION=="add", RUN+="/usr/bin/putarg /sys$devpath/state 
online"


This complex solutions ( compiled file and udev-rule ) works exceptionally fast.





Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.

Nikolay Pushkarev about standart udev-script :

{{

Strange, that the native udev-script

SUBSYSTEM=="memory", ACTION=="add", ATTR{state}="online"


triggered somehow through time ( VVM: very often not work as need )


}}



P.P.S.

- Original Message - 
From: "Victor Miasnikov"

To: "Dan Carpenter"; "K. Y. Srinivasan" ; 
Cc: "Greg KH" ; ; ; ""Andy 
Whitcroft"" ;

Sent: Thursday, January 09, 2014 2:18 PM
Subject: RE: [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in 
context" Re: [PATCH 1/1] Drivers: hv:
Implement the file copy service


Hi!


Is there no way we could implement file copying in user space?



 For "file copy service"  "user space"  may be pretty good

But I ( and other Hyper-V sysadmin)  see non-Ok ( in "political correct"

Re: Linux does not use more than the startup RAM under Hyper-V with dynamic memory enabled RE: [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] Drivers: hv:

2014-03-06 Thread Victor Miasnikov

Hi!

VVM>>  Question to Linux kernel team: may be patch
VVM>> >>> [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in 
context"
VVM>> can solve problems with dynamic memory hot add in Hyper-V VMs with Linux 
OS ?

K.Y.S>  I will try to get my in-context onlining patches accepted upstream.

Thanks!

Feature dynamic memory hot add in Hyper-V VMs with Linux OS  -- is very usefull 
for Hyper-V sysadmins
Stable work for this feature -- must be hi-priority task for developers


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


- Original Message ----- 
From: "KY Srinivasan"

To: "Victor Miasnikov"; linux-kernel@vger.kernel.org; "Brian Wong"
Cc: "Abhishek Gupta (LIS)"
Sent: Thursday, March 06, 2014 1:23 PM
Subject: RE: Linux does not use more than the startup RAM under Hyper-V with 
dynamic memory enabled RE: [PATCH 2/2]
Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] 
Drivers: hv:


Victor,

I will try to get my in-context onlining patches accepted upstream.

K. Y


-Original Message-
From: Victor Miasnikov [mailto:v...@tut.by]
Sent: Thursday, March 6, 2014 3:38 PM
To: linux-kernel@vger.kernel.org; Brian Wong
Cc: Abhishek Gupta (LIS); KY Srinivasan
Subject: Re: Linux does not use more than the startup RAM under Hyper-V
with dynamic memory enabled RE: [PATCH 2/2] Drivers: hv: balloon: Online
the hot-added memory "in context" Re: [PATCH 1/1] Drivers: hv:




- Original Message - 
From: "Victor Miasnikov"

To:  linux-kernel@vger.kernel.org; "Brian Wong"
Cc: "Abhishek Gupta (LIS)" ( zzz (at) microsoft.com>; "KY 
Srinivasan" zzz (at) microsoft.com
Sent: Thursday, March 06, 2014 1:07 PM
Subject: Re: Linux does not use more than the startup RAM under Hyper-V with 
dynamic memory enabled RE: [PATCH 2/2]
Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] 
Drivers: hv:

Hi!

Short:

Question to Linux kernel team:

may be patch


[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"


can solve problems with dynamic memory hot add in Hyper-V VMs with Linux OS ?



Full:

BW>> .., if I set the startup memory to 512 MB, and enable dynamic
BW>> memory with a minimum of 512 MB and a maximum of 8192 MB,
BW>>  the system will never allocate than 512 MB of physical memory

BW>>
BW>> Have I encountered a bug in the Hyper-V balloon driver?
BW>>

Unfortunately,  It's long story . . . :-(

a)

I already ( on January 09, 2014 2:18 PM )  write about problems with "Online the hot-added 
memory"  in "user space" see
P.P.S.

b)

 See

Bug 979257 -[Hyper-V][RHEL6.5][RFE]in-kernel online support for memory hot-add
https://bugzilla.redhat.com/show_bug.cgi?id=979257

(  Info from this topic may be interessant not only for RedHat users )


b2)

Detail about pathes related problem "Online the hot-added memory"  in "user 
space" :


[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"


=== 0001-Drivers-base-memory-Export-functionality-for-in-kern.patch
 . . .
+/*
+ * Given the start pfn of a memory block; bring the memory
+ * block online. This API would be useful for drivers that may
+ * want to bring "online" the memory that has been hot-added.
+ */
+
+int online_memory_block(unsigned long start_pfn) {  struct mem_section
+*cur_section;  struct memory_block *cur_memory_block;

 . . .
===


==
 . . .
== 0002-Drivers-hv-balloon-Online-the-hot-added-memory-in-co.patch
  . . .
   /*
-   * Wait for the memory block to be onlined.
-   * Since the hot add has succeeded, it is ok to
-   * proceed even if the pages in the hot added region
-   * have not been "onlined" within the allowed time.
+   * Before proceeding to hot add the next segment,
+   * online the segment that has been hot added.
*/
-  wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ);
+  online_memory_block(start_pfn);

  }





c)

 Before apply patches ( see in P.S. about native udev-script) we are need use 
one of this methods:

http://social.technet.microsoft.com/Forums/en-US/8e1994b9-9ca1-4411-ad8e-25e6b1ee28e1/dynamic-memory-on-linux-vm?forum=linuxintegrationservices



c1)

"/bin/cp method" by Nikolay Pushkarev :

Following udev rule works slightly faster for me (assuming that memory0 bank 
always in online state):

SUBSYSTEM=="memory", ACTION=="add", 
DEVPATH=="/devices/system/memory/memory[1-9]*",
RUN+="/bin/cp /sys$devpath/../memory0/state /sys$devpath/state"}}

( VVM : of course all need be place in one line, 2 line in this msg. -- only 
for good visual formating reasons )


c2)

udev rule using "putarg" by Nikolay Pushkarev :


Even "/bin/cp method"

RE: [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] Drivers: hv: Implement the file copy service

2014-01-09 Thread Victor Miasnikov

Hi!


Is there no way we could implement file copying in user space?



 For "file copy service"  "user space"  may be pretty good

But I ( and other Hyper-V sysadmin)  see non-Ok ( in "political correct" 
terminalogy) results with "hv: balloon: Online
the hot-added memory" in "user space"


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/



P.S.

==
[PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context"
==


What news?  Roadmap?



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux does not use more than the startup RAM under Hyper-V with dynamic memory enabled RE: [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] Drivers: hv:

2014-03-07 Thread Victor Miasnikov

Hi!

VVM>>>>
VVM>>>>  Question to Linux kernel team: may be patch
VVM>>>> >>> [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in 
context"
VVM>>>> can solve problems with dynamic memory hot add in Hyper-V VMs with 
Linux OS ?
VVM>>>>
K.Y.S>>>
K.Y.S>>>  I will try to get my in-context onlining patches accepted upstream.
K.Y.S>>>

VVM>>
VVM>> Thanks! Feature dynamic memory hot add in Hyper-V VMs with Linux OS  -- 
is very usefull for Hyper-V sysadmins
VVM> Stable work for this feature -- must be hi-priority task for developers
VVM>
 +
B.W.>>
B.W.>> So can I expect to see this patched by the next kernel version?
B.W.>>


J.L.>
J.L.> I would hold your breath on this one.
J.L.>


J.L.>
J.L.> The maintainers of the memory subsystem has rejected the patch exposing 
certain functions
J.L.>

 When?

Please resend to me message from maintainer with "reject"

(
 I again search in my archive of messages from this mail list, and not found 
message[s],
about Brian Wong write
)

J.L.>
J.L.> so hv_balloon can online the newly added memory to the system.
J.L.> They think that having udev to handle such events is a better place.
J.L.>

 Look like You read "Bug 979257" . . .


J.L.> And in case if somebody hasn't posted it here, this is the udev rule that 
KY has given to me in the past:
==
SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo 
online > /sys$devpath/state'"
==

 Add to Youre collection of udev rules:

http://social.technet.microsoft.com/Forums/windowsserver/en-US/21519c00-47d4-44a4-b2d3-64cd3098849e/rhel-70-centos-70-rhel-65-centos-65-rhel-64-centos-64-include-support-for-hyperv?forum=linuxintegrationservices
==
Michael Kelley:
The VM crash   . . . ( VVM: some details skipped by me ) should be fixed by 
adding the udev rule. The udev rule looks
like:
SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory*[0-9]", 
TEST=="/sys$devpath/state",
RUN+="/bin/sh -c 'echo online > /sys$devpath/state'"


Nikolay Pushkarev:
Following rule works slightly faster for me (assuming that memory0 bank always 
in online state):

SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[1-9]*", 
RUN+="/bin/cp
/sys$devpath/../memory0/state /sys$devpath/state"
==


And another topic in russian:
http://social.technet.microsoft.com/Forums/ru-RU/addd8d0a-fe38-4679-b0be-c355e12b5b32/centos-65-?forum=virtualizationru
( But You can use Google translate service or vice versa )



Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


- Original Message - 
From: "Jeff Leung"

To: "Brian Wong"; "Victor Miasnikov" ; "KY Srinivasan" ( zz (at) 
microsoft.com ); linux-kernel@vger.kernel.org
Cc: "Abhishek Gupta (LIS)" ( z (at) microsoft.com)
Sent: Thursday, March 06, 2014 9:25 PM
Subject: RE: Linux does not use more than the startup RAM under Hyper-V with 
dynamic memory enabled RE: [PATCH 2/2]
Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] 
Drivers: hv:


B.W.> So can I expect to see this patched by the next kernel version?

I would hold your breath on this one.
The maintainers of the memory subsystem has rejected the patch exposing certain 
functions
so hv_balloon can online the newly added memory to the system.
They think that having udev to handle such events is a better place.

And in case if somebody hasn't posted it here, this is the udev rule that KY 
has given to me in the past:

SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f
/sys$devpath/state ] && echo online > /sys$devpath/state'"


--





- Original Message - 
From: "Brian Wong"

To: "Victor Miasnikov"; "KY Srinivasan" ( zz (at) microsoft.com ); 
linux-kernel@vger.kernel.org
Cc: "Abhishek Gupta (LIS)"  ( z (at) microsoft.com)
Sent: Thursday, March 06, 2014 9:11 PM
Subject: Re: Linux does not use more than the startup RAM under Hyper-V with 
dynamic memory enabled RE: [PATCH 2/2]
Drivers: hv: balloon: Online the hot-added memory "in context" Re: [PATCH 1/1] 
Drivers: hv:


 . . .

VVM>>>
VVM>>>  Question to Linux kernel team: may be patch
VVM>>> >>> [PATCH 2/2] Drivers: hv: balloon: Online the hot-added memory "in 
context"
VVM>>> can solve problems with dynamic memory hot add in Hyper-V VMs with Linux 
OS ?
VVM>>>
K.Y.S>>
K.Y.S>>  I will try to get my in-context onlining patches accepted upstream.
K.Y.

search by phrase a-la "MS-TFS: 157532" -- "has relevance for Hyper-V sysadmins" Re: [PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic

2014-06-26 Thread Victor Miasnikov

Hi!

Short:

1)
greg k-h> don't add marker lines like this that provide no relevancy to anyone 
else.

"no relevancy to anyone else" -- strange: it "has relevance for Hyper-V 
sysadmins"
For search by keywords in web archives of this mail list

1b)

greg k-h> If you want to refer to a public bug tracker,
greg k-h> that's great

Yes: public bug tracker are welcom


Full:

D.C>>>>
D.C>>>> MS-TFS: 157532
D.C>>>>

Greg K-h>>>
Greg K-h>>> What is this line for?
Greg K-h>>>

D.C.>> This line is for our internal bug repository.
D.C.>>
D.C.>> The MS-TFS line has appeared in the commit description for a while if you
D.C.>> search for it in 'git log'  of linux-next.
D.C.>>

greg k-h>
greg k-h> Please
greg k-h> don't add marker lines like this that provide no relevancy to anyone 
else.

"no relevancy to anyone else" -- strange: it "has relevance for Hyper-V 
sysadmins"

For search by keywords in web archives of this mail list

See example:
Results of search sesssion by phrase "MS-TFS: 157532" :
==
LKML: Dexuan Cui: RE: [PATCH] video: hyperv: hyperv_fb ...
lkml.org/lkml/2014/6/24/844
1 day ago - MS-TFS: 157532 > What is this line for? Hi Greg, This line is for our internal bug repository. We have an 
automated system to correlate bugs ...

==
+
==
[PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force ...
www.gossamer-threads.com/lists/linux/kernel/1952989
5 hours ago - the VSC flushes any future framebuffer change to the VSP immediately. 
MS-TFS: 157532. Signed-off-by: Dexuan Cui

==


greg k-h> I don't allow gerrit ids for the same reason.
greg k-h> If you want to refer to a public bug tracker,
greg k-h> that's great


Yes: public bug tracker are welcom


greg k-h>, otherwise, don't include it.




Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/


- Original Message - 
From: "Greg KH"

To: "Dexuan Cui"
Cc: . . .
Sent: Thursday, June 26, 2014 6:36 AM
Subject: Re: [PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force 
on VM panic

On Tue, Jun 24, 2014 at 09:44:14PM +, Dexuan Cui wrote:

>On Tue, Jun 24, 2014 at 08:29:17AM +0800, Dexuan Cui wrote:
>> Currently the VSC has no chance to notify the VSP of the dirty rectangle on 
VM
>> panic because the notification work is done in a workqueue, and in panic() 
the
>> kernel typically ends up in an infinite loop, and a typical kernel config has
>> CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch
>> can't happen in panic() and the workqueue won't have a chance to run. As a
>> result, the VM Connection window can't refresh until it's closed and we
>> re-connect to the VM.
>>
>> We can register a handler on panic_notifier_list: the handler can notify
>> the VSC and switch the framebuffer driver to a "synchronous mode", meaning
>> the VSC flushes any future framebuffer change to the VSP immediately.
>>
>> MS-TFS: 157532

> What is this line for?

Hi Greg,
This line is for our internal bug repository.
We have an automated system to correlate bugs with fixes so that our test
team knows when a bug fix has been accepted upstream and they need to
write a new test case for it.

The MS-TFS line has appeared in the commit description for a while if you
search for it in 'git log'  of linux-next.

Please let us know if you have further comments.


Please don't add marker lines like this that provide no relevancy to
anyone else.  I don't allow gerrit ids for the same reason.  If you want
to refer to a public bug tracker, that's great, otherwise, don't
include it.

greg k-h
--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Non-FIXed in Linux Kernel v3.14.8 2014-06-16 Fw: hyperv: Change the receive buffer size for legacy hosts Re: Regression in hyperv network driver in 3.14 Fw: Debian Bug#748609: ( 3.14-0 : Hyper-V netvs

2014-06-26 Thread Victor Miasnikov

Hi!

2014-03-09

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/hyperv?id=99d3016de4f2a29635f5382b0e9bd0e5f2151487
hyperv: Change the receive buffer size for legacy hosts

+

Haiyang Zhang write on  May 27, 2014 6:22 PM:
I ( Haiyang Zhang)  will ask the maintainer
( for backport id=99d3016de4f2a29635f5382b0e9bd0e5f2151487  ), see if it will 
be in next 3.14 update as well.

+

Haiyang Zhang on  June 25, 2014 19:14 ( UTC+3) :
I ( Haiyang Zhang)  have requested that patch for stable branch, but  . . . ( 
VVM: skipped by me)

V.V.M.:
Problem  Non-FIXed in Linux Kernel v3.14.8 2014-06-16  :-(

Reason?  Roadmap?

(

Without this patch ( i.e. in kernel v3.14 )  LANCard driver/.ko is simply not 
start in case VM with OS Linux on Hyper-V
host with Win 2008 R2 ( Win 2012 R2 not affected)

)


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.

About "rules":

IMHO,
In fact _all_ patch equal 16-1 = 15 :-) i.e.

-#define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */
+#define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*15) /* 15MB */




- Original Message ----- 
From: Victor Miasnikov

To: Haiyang Zhang; Abhishek Gupta (LIS)
Cc: KY Srinivasan; Кулешов Андрей Анатольевич; Mathieu Simon; Bernhard Walle
Sent: Wednesday, June 25, 2014 1:19 PM
Subject: Non-FIXed in Linux Kernel v3.14.8 2014-06-16 Fw: hyperv: Change the 
receive buffer size for legacy hosts Re:
Regression in hyperv network driver in 3.14 Fw: Debian Bug#748609: 
(linux-image-3.14-0.bpo.1-amd64: Hyper-V netvsc no
networking)


Hi!

Problem  Non-FIXed in Linux Kernel v3.14.8 2014-06-16  :-(

Reason?  Roadmap?

 . . .

==
cat /var/log/syslog
hv_netvsc vmbus_0_9 (unregistered net_device): Unable to complete receive 
buffer initialization with NetVsp - status 2
hv_netvsc vmbus_0_9 (unregistered net_device): unable to connect to NetVSP - -22
hv_netvsc vmbus_0_9 (unregistered net_device): unable to add netvsc device (ret 
-22)
hv_vmbus: probe failed for device vmbus_0_9 (-22)
hv_netvsc: probe of vmbus_0_9 failed with error -22
==

==
It defines a NETVSC_RECEIVE_BUFFER_SIZE_LEGACY of 15MB instead of 16MB
used on newer versions of this Hypervisor.
Technically this also affects Jessie when running as guest on Windows Server 
2008 R2.
==

==
Yes, this commit is in stable tree:
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/hyperv?id=99d3016de4f2a29635f5382b0e9bd0e5f2151487
hyperv: Change the receive buffer size for legacy hosts

I will ask the maintainer, see if it will be in next 3.14 update as well.

Thanks,
- Haiyang
==




Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/

P.S.

History of problem:


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748609
==

cat /var/log/syslog
hv_netvsc vmbus_0_9 (unregistered net_device): Unable to complete receive 
buffer initialization with NetVsp - status 2
hv_netvsc vmbus_0_9 (unregistered net_device): unable to connect to NetVSP - -22
hv_netvsc vmbus_0_9 (unregistered net_device): unable to add netvsc device (ret 
-22)
hv_vmbus: probe failed for device vmbus_0_9 (-22)
hv_netvsc: probe of vmbus_0_9 failed with error -22



It defines a NETVSC_RECEIVE_BUFFER_SIZE_LEGACY of 15MB instead of 16MB
used on newer versions of this Hypervisor.
Technically this also affects Jessie when running as guest on Windows Server 
2008 R2.
==



+
- Original Message - 
From: "Haiyang Zhang"

To: "Bernhard Walle" ; "KY Srinivasan"
Cc: 
Sent: Tuesday, May 27, 2014 6:22 PM
Subject: RE: Regression in hyperv network driver in 3.14


-Original Message-
From: Bernhard Walle
Sent: Tuesday, May 27, 2014 10:42 AM
To: KY Srinivasan
Cc: Haiyang Zhang; linux-kernel@vger.kernel.org
Subject: RE: Regression in hyperv network driver in 3.14

Am 2014-05-27 15:43, schrieb KY Srinivasan:

>> Can I provide more information to track down the problem?
>
> This bug has been fixed upstream. The issue is with regards to the
> older hosts (ws2008 r2) not
> Being able to handle the larger receive buffer currently used.

Can you point me to the commit that fixed the problem? Woudln't that
be something for -stable since the problem is still in 3.14.4.



Yes, this commit is in stable tree:
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/hyperv?id=99d3016de4f2a29635f5382b0e9bd0e5f2151487
hyperv: Change the receive buffer size for legacy hosts

I will ask the maintainer, see if it will be in next 3.14 update as well.

Thanks,
- Haiyang

Nryvnz}zjvzz~zjyA

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] hyperv: Implement Time Synchronization using host time sample

2014-10-14 Thread Victor Miasnikov

Hi!


VMware has put a lot of effort into host -> guest timesync so I think
there is a case for some form of host based time sync on HyperV.

 . . .


IMHO, you should let the guest steer its own clock. 
That gives the end user the most flexibility.



  No problem:

Time Sync can be turn off in VM settings



Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/