lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 4 Apr 2014 15:01:51 +0000
From:	KY Srinivasan <kys@...rosoft.com>
To:	Vivek Goyal <vgoyal@...hat.com>
CC:	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"olaf@...fle.de" <olaf@...fle.de>,
	"apw@...onical.com" <apw@...onical.com>,
	"jasowang@...hat.com" <jasowang@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH 1/1] x86/platform/hyperv: When on Hyper-v use NULL
 legacy PIC



> -----Original Message-----
> From: Vivek Goyal [mailto:vgoyal@...hat.com]
> Sent: Friday, April 4, 2014 7:12 AM
> To: KY Srinivasan
> Cc: x86@...nel.org; linux-kernel@...r.kernel.org; olaf@...fle.de;
> apw@...onical.com; jasowang@...hat.com; hpa@...or.com; KY Srinivasan;
> stable@...r.kernel.org
> Subject: Re: [PATCH 1/1] x86/platform/hyperv: When on Hyper-v use NULL
> legacy PIC
> 
> On Thu, Apr 03, 2014 at 06:16:33PM -0700, K. Y. Srinivasan wrote:
> > Use the NULL legacy PIC when on Hyper-V. With this change we can
> > support kexec even when booting on EFI firmware. This patch has been
> > tested on both EFI as well as non-EFI firmware stacks on Hyper-V.
> >
> > This patch is required to support kexec on EFI firmware on Hyper-V.
> > Please apply.
> 
> Can you give some more details about what's the problem we run into with
> kexec on EFI on hyper-V.
> 
> Now EFI should be enabled in kexeced kernel. That means
> efi_enabled(EFI_BOOT) should be true and that means you would set
> legacy_pic to null anyway.
> 
> So with this patch, what changed w.r.t kexec on EFI.

Vivek,

On Hyper-V EFI firmware stack we have to set the legacy PIC to NULL legacy PIC since
legacy PIC is not emulated and if this were not set to NULL legacy PIC, we would crash in
PIC based calibration code. Hypervisor gives us the calibration information so
we don't need PIC based calibration.

Even on non-EFI firmware, the hypervisor gives us the calibration information
and so, we can set the legacy PIC to NULL legacy PIC unconditionally.

The problem we were having is that the initial boot on the EFI firmware
would succeed as the legacy PIC would be NULL legacy PIC, however
in the kexeced kernel, the initial boot information is not available and so
we would not set the legacy PIC to NULL legacy PIC. Thus, we would crash in
PIC based calibration code in the kexeced kernel.

Since we don't need legacy PIC both on EFI and non-EFI firmware,
we can set the legacy  PIC to NULL legacy PIC unconditionally.

K. Y 
> 
> Thansk
> Vivek
> 
> >
> > Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> > Cc: <stable@...r.kernel.org>        [3.13+]
> > ---
> >  arch/x86/kernel/cpu/mshyperv.c |   10 ++--------
> >  1 files changed, 2 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c
> > b/arch/x86/kernel/cpu/mshyperv.c index 76f98fe..47359f7 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -133,14 +133,8 @@ static void __init ms_hyperv_init_platform(void)
> >  		printk(KERN_INFO "HyperV: LAPIC Timer Frequency: %#x\n",
> >  				lapic_timer_frequency);
> >
> > -		/*
> > -		 * On Hyper-V, when we are booting off an EFI firmware
> stack,
> > -		 * we do not have many legacy devices including PIC, PIT etc.
> > -		 */
> > -		if (efi_enabled(EFI_BOOT)) {
> > -			printk(KERN_INFO "HyperV: Using
> null_legacy_pic\n");
> > -			legacy_pic = &null_legacy_pic;
> > -		}
> > +		printk(KERN_INFO "HyperV: Using null_legacy_pic\n");
> > +		legacy_pic = &null_legacy_pic;
> >  	}
> >  #endif
> >
> > --
> > 1.7.4.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-kernel" in the body of a message to majordomo@...r.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ