* [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe
@ 2019-06-14 8:23 Ni, Ray
2019-06-14 8:44 ` [edk2-devel] " Yao, Jiewen
0 siblings, 1 reply; 4+ messages in thread
From: Ni, Ray @ 2019-06-14 8:23 UTC (permalink / raw)
To: devel; +Cc: Jordan Justen, Andrew Fish, Zhiguang Liu, Hao A Wu
When running 2nd instance of WinHost.exe, below error is printed:
ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd...
The root cause is "RECOVERY.FD" is exclusively opened by the first
instance of WinHost.exe.
The patch changes to open "RECOVERY.FD" in shared way so that
2nd+ instance of WinHost.exe can still run successfully.
Signed-off-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
---
EmulatorPkg/Win/Host/WinHost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c
index bd7662683a..5a354d084e 100644
--- a/EmulatorPkg/Win/Host/WinHost.c
+++ b/EmulatorPkg/Win/Host/WinHost.c
@@ -269,7 +269,7 @@ Returns:
NtFileHandle = CreateFile (
FileName,
GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CreationDisposition,
FILE_ATTRIBUTE_NORMAL,
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe
2019-06-14 8:23 [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe Ni, Ray
@ 2019-06-14 8:44 ` Yao, Jiewen
2019-06-14 8:53 ` Ni, Ray
[not found] ` <15A804AED7A7D734.10316@groups.io>
0 siblings, 2 replies; 4+ messages in thread
From: Yao, Jiewen @ 2019-06-14 8:44 UTC (permalink / raw)
To: devel@edk2.groups.io, Ni, Ray
Cc: Justen, Jordan L, Andrew Fish, Liu, Zhiguang, Wu, Hao A
Hi
It is good to support 2nd instance.
But the risk is that 2 instances may access to the same variable region.
It might cause unpredictable behavior in the variable driver later.
Do we have investigate that impact?
Thank you
Yao Jiewen
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Ni,
> Ray
> Sent: Friday, June 14, 2019 4:23 PM
> To: devel@edk2.groups.io
> Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>
> Subject: [edk2-devel] [PATCH] EmulatorPkg/Win: support running multiple
> WinHost.exe
>
> When running 2nd instance of WinHost.exe, below error is printed:
> ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd...
>
> The root cause is "RECOVERY.FD" is exclusively opened by the first
> instance of WinHost.exe.
>
> The patch changes to open "RECOVERY.FD" in shared way so that
> 2nd+ instance of WinHost.exe can still run successfully.
>
> Signed-off-by: Ray Ni <ray.ni@intel.com>
>
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> ---
> EmulatorPkg/Win/Host/WinHost.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/EmulatorPkg/Win/Host/WinHost.c
> b/EmulatorPkg/Win/Host/WinHost.c
> index bd7662683a..5a354d084e 100644
> --- a/EmulatorPkg/Win/Host/WinHost.c
> +++ b/EmulatorPkg/Win/Host/WinHost.c
> @@ -269,7 +269,7 @@ Returns:
> NtFileHandle = CreateFile (
> FileName,
> GENERIC_READ | GENERIC_WRITE |
> GENERIC_EXECUTE,
> - FILE_SHARE_READ,
> + FILE_SHARE_READ | FILE_SHARE_WRITE,
> NULL,
> CreationDisposition,
> FILE_ATTRIBUTE_NORMAL,
> --
> 2.21.0.windows.1
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe
2019-06-14 8:44 ` [edk2-devel] " Yao, Jiewen
@ 2019-06-14 8:53 ` Ni, Ray
[not found] ` <15A804AED7A7D734.10316@groups.io>
1 sibling, 0 replies; 4+ messages in thread
From: Ni, Ray @ 2019-06-14 8:53 UTC (permalink / raw)
To: Yao, Jiewen, devel@edk2.groups.io
Cc: Justen, Jordan L, Andrew Fish, Liu, Zhiguang, Wu, Hao A
I agree this patch only removes the limitation that blocks running 2nd instance of WinHost.exe.
I will investigate the impact on variable storage part.
> -----Original Message-----
> From: Yao, Jiewen <jiewen.yao@intel.com>
> Sent: Friday, June 14, 2019 4:44 PM
> To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>
> Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>
> Subject: RE: [edk2-devel] [PATCH] EmulatorPkg/Win: support running
> multiple WinHost.exe
>
> Hi
> It is good to support 2nd instance.
>
> But the risk is that 2 instances may access to the same variable region.
>
> It might cause unpredictable behavior in the variable driver later.
>
> Do we have investigate that impact?
>
> Thank you
> Yao Jiewen
>
>
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Ni, Ray
> > Sent: Friday, June 14, 2019 4:23 PM
> > To: devel@edk2.groups.io
> > Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> > <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> > <hao.a.wu@intel.com>
> > Subject: [edk2-devel] [PATCH] EmulatorPkg/Win: support running
> > multiple WinHost.exe
> >
> > When running 2nd instance of WinHost.exe, below error is printed:
> > ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd...
> >
> > The root cause is "RECOVERY.FD" is exclusively opened by the first
> > instance of WinHost.exe.
> >
> > The patch changes to open "RECOVERY.FD" in shared way so that
> > 2nd+ instance of WinHost.exe can still run successfully.
> >
> > Signed-off-by: Ray Ni <ray.ni@intel.com>
> >
> > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > ---
> > EmulatorPkg/Win/Host/WinHost.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/EmulatorPkg/Win/Host/WinHost.c
> > b/EmulatorPkg/Win/Host/WinHost.c index bd7662683a..5a354d084e
> 100644
> > --- a/EmulatorPkg/Win/Host/WinHost.c
> > +++ b/EmulatorPkg/Win/Host/WinHost.c
> > @@ -269,7 +269,7 @@ Returns:
> > NtFileHandle = CreateFile (
> > FileName,
> > GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
> > - FILE_SHARE_READ,
> > + FILE_SHARE_READ | FILE_SHARE_WRITE,
> > NULL,
> > CreationDisposition,
> > FILE_ATTRIBUTE_NORMAL,
> > --
> > 2.21.0.windows.1
> >
> >
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe
[not found] ` <15A804AED7A7D734.10316@groups.io>
@ 2019-06-17 7:02 ` Ni, Ray
0 siblings, 0 replies; 4+ messages in thread
From: Ni, Ray @ 2019-06-17 7:02 UTC (permalink / raw)
To: devel@edk2.groups.io, Ni, Ray, Yao, Jiewen
Cc: Justen, Jordan L, Andrew Fish, Liu, Zhiguang, Wu, Hao A
I withdraw this patch because multiple instances of WinHost.exe may
change the same FV_RECOVERY.FD file for NV variable modification.
Supporting multiple instances of WinHost.exe is not proper and may
introduce potential issues.
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
> Sent: Friday, June 14, 2019 4:54 PM
> To: Yao, Jiewen <jiewen.yao@intel.com>; devel@edk2.groups.io
> Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> <hao.a.wu@intel.com>
> Subject: Re: [edk2-devel] [PATCH] EmulatorPkg/Win: support running
> multiple WinHost.exe
>
> I agree this patch only removes the limitation that blocks running 2nd
> instance of WinHost.exe.
> I will investigate the impact on variable storage part.
>
> > -----Original Message-----
> > From: Yao, Jiewen <jiewen.yao@intel.com>
> > Sent: Friday, June 14, 2019 4:44 PM
> > To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>
> > Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> > <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> > <hao.a.wu@intel.com>
> > Subject: RE: [edk2-devel] [PATCH] EmulatorPkg/Win: support running
> > multiple WinHost.exe
> >
> > Hi
> > It is good to support 2nd instance.
> >
> > But the risk is that 2 instances may access to the same variable region.
> >
> > It might cause unpredictable behavior in the variable driver later.
> >
> > Do we have investigate that impact?
> >
> > Thank you
> > Yao Jiewen
> >
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > Of Ni, Ray
> > > Sent: Friday, June 14, 2019 4:23 PM
> > > To: devel@edk2.groups.io
> > > Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> > > <afish@apple.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Wu, Hao A
> > > <hao.a.wu@intel.com>
> > > Subject: [edk2-devel] [PATCH] EmulatorPkg/Win: support running
> > > multiple WinHost.exe
> > >
> > > When running 2nd instance of WinHost.exe, below error is printed:
> > > ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd...
> > >
> > > The root cause is "RECOVERY.FD" is exclusively opened by the first
> > > instance of WinHost.exe.
> > >
> > > The patch changes to open "RECOVERY.FD" in shared way so that
> > > 2nd+ instance of WinHost.exe can still run successfully.
> > >
> > > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > >
> > > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > > Cc: Andrew Fish <afish@apple.com>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > ---
> > > EmulatorPkg/Win/Host/WinHost.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/EmulatorPkg/Win/Host/WinHost.c
> > > b/EmulatorPkg/Win/Host/WinHost.c index bd7662683a..5a354d084e
> > 100644
> > > --- a/EmulatorPkg/Win/Host/WinHost.c
> > > +++ b/EmulatorPkg/Win/Host/WinHost.c
> > > @@ -269,7 +269,7 @@ Returns:
> > > NtFileHandle = CreateFile (
> > > FileName,
> > > GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
> > > - FILE_SHARE_READ,
> > > + FILE_SHARE_READ | FILE_SHARE_WRITE,
> > > NULL,
> > > CreationDisposition,
> > > FILE_ATTRIBUTE_NORMAL,
> > > --
> > > 2.21.0.windows.1
> > >
> > >
> > >
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-17 7:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14 8:23 [PATCH] EmulatorPkg/Win: support running multiple WinHost.exe Ni, Ray
2019-06-14 8:44 ` [edk2-devel] " Yao, Jiewen
2019-06-14 8:53 ` Ni, Ray
[not found] ` <15A804AED7A7D734.10316@groups.io>
2019-06-17 7:02 ` Ni, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox