From: "Jan Beulich" Subject: Re: [ANNOUNCE] backports for 4.0.4 and 4.1.3 stable releases Date: Fri, 13 Apr 2012 08:50:27 +0100 Message-ID: <4F87F6E4020000780007DB47@nat28.tlf.novell.com> References: <1334248235.16387.134.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartA9876CD3.0__=" Return-path: In-Reply-To: <1334248235.16387.134.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA9876CD3.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 12.04.12 at 18:30, Ian Campbell wrote: > The time has come for another round of stable releases. >=20 > Please send (or resend) any outstanding backport requests for 4.0.4 and > 4.1.3 before Friday 20 April. 4.1: 24996:396801f25e92 4.1 and 4.0: 25098:2e45b26bc412 + 25099:4bd752a4cdf3 25101:f06ff3dfde08 4.1 backports attached (apply with some offsets, since they're taken directly form our SLE11 SP2 tree). Jan --=__PartA9876CD3.0__= Content-Type: text/plain; name="24996-x86-cpuidle-array-overrun.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="24996-x86-cpuidle-array-overrun.patch" # HG changeset patch=0A# User Eric Chanudet = =0A# Date 1331222672 -3600=0A# Node ID 396801f25e922bdf1db5fd644435f4640758= 6524=0A# Parent 66de4220113e937811529b12ea7f6427c0848630=0AXENPF_set_proce= ssor_pminfo XEN_PM_CX overflows states array=0A=0ACalling XENPF_set_process= or_pminfo with XEN_PM_CX could cause states=0Aarray in "struct acpi_process= or_power" to exceed its limit.=0A=0AThe array used to be reset (by = function cpuidle_init_cpu()) for each=0Ahypercall. The patch puts it back = that way and adds an assertion to=0Amake it clear in case that happens = again.=0A=0ASigned-off-by: Eric Chanudet =0A= =0A- convert assertion to printk() & bail=0A- eliminate struct acpi_process= or_cx's valid member (not read anymore)=0A- further adjustments to = one-time-only vs each-time operations in=0A cpuidle_init_cpu()=0A- don't = use ACPI_STATE_Cn as array index anymore=0A=0ASigned-off-by: Jan Beulich = =0AAcked-by: Keir Fraser =0A=0A--- = a/xen/arch/x86/acpi/cpu_idle.c=0A+++ b/xen/arch/x86/acpi/cpu_idle.c=0A@@ = -70,10 +70,8 @@ static void lapic_timer_nop(void) { }=0A static void = (*lapic_timer_off)(void);=0A static void (*lapic_timer_on)(void);=0A = =0A-static uint64_t (*get_tick)(void);=0A-static uint64_t (*ticks_elapsed)(= uint64_t t1, uint64_t t2);=0A-static uint64_t (*tick_to_ns)(uint64_t = ticks);=0A-static uint64_t (*ns_to_tick)(uint64_t ticks);=0A+static = uint64_t (*__read_mostly tick_to_ns)(uint64_t) =3D acpi_pm_tick_to_ns;=0A+s= tatic uint64_t (*__read_mostly ns_to_tick)(uint64_t) =3D ns_to_acpi_pm_tick= ;=0A =0A extern void (*pm_idle) (void);=0A extern void (*dead_idle) = (void);=0A@@ -224,6 +222,10 @@ static uint64_t acpi_pm_ticks_elapsed(ui=0A = return ((0xFFFFFFFF - t1) + t2 +1);=0A }=0A =0A+static uint64_t = (*__read_mostly get_tick)(void) =3D get_acpi_pm_tick;=0A+static uint64_t = (*__read_mostly ticks_elapsed)(uint64_t, uint64_t)=0A+ =3D acpi_pm_ticks= _elapsed;=0A+=0A #define MWAIT_ECX_INTERRUPT_BREAK (0x1)=0A =0A /*=0A@@ = -609,7 +611,16 @@ static int cpuidle_init_cpu(int cpu)=0A acpi_power = =3D processor_powers[cpu];=0A if ( !acpi_power )=0A {=0A- = int i;=0A+ unsigned int i;=0A+=0A+ if ( cpu =3D=3D 0 && = boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )=0A+ {=0A+ = get_tick =3D get_stime_tick;=0A+ ticks_elapsed =3D stime_ticks_e= lapsed;=0A+ tick_to_ns =3D stime_tick_to_ns;=0A+ = ns_to_tick =3D ns_to_stime_tick;=0A+ }=0A+=0A acpi_power = =3D xmalloc(struct acpi_processor_power);=0A if ( !acpi_power )=0A = return -ENOMEM;=0A@@ -617,36 +628,15 @@ static int cpuidle_init= _cpu(int cpu)=0A =0A for ( i =3D 0; i < ACPI_PROCESSOR_MAX_POWER; = i++ )=0A acpi_power->states[i].idx =3D i;=0A- =0A- = acpi_power->states[ACPI_STATE_C1].type =3D ACPI_STATE_C1;=0A- = acpi_power->states[ACPI_STATE_C1].entry_method =3D ACPI_CSTATE_EM_HALT;=0A-= =0A- acpi_power->states[ACPI_STATE_C0].valid =3D 1;=0A- = acpi_power->states[ACPI_STATE_C1].valid =3D 1;=0A- =0A- = acpi_power->count =3D 2;=0A- acpi_power->safe_state =3D &acpi_power-= >states[ACPI_STATE_C1];=0A+=0A acpi_power->cpu =3D cpu;=0A = processor_powers[cpu] =3D acpi_power;=0A }=0A =0A- if ( cpu =3D=3D = 0 )=0A- {=0A- if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )=0A- = {=0A- get_tick =3D get_stime_tick;=0A- = ticks_elapsed =3D stime_ticks_elapsed;=0A- tick_to_ns =3D = stime_tick_to_ns;=0A- ns_to_tick =3D ns_to_stime_tick;=0A- = }=0A- else=0A- {=0A- get_tick =3D get_acpi_pm_ti= ck;=0A- ticks_elapsed =3D acpi_pm_ticks_elapsed;=0A- = tick_to_ns =3D acpi_pm_tick_to_ns;=0A- ns_to_tick =3D ns_to_acpi= _pm_tick;=0A- }=0A- }=0A+ acpi_power->count =3D 2;=0A+ = acpi_power->states[1].type =3D ACPI_STATE_C1;=0A+ acpi_power->states[1].= entry_method =3D ACPI_CSTATE_EM_HALT;=0A+ acpi_power->safe_state =3D = &acpi_power->states[1];=0A =0A return 0;=0A }=0A@@ -863,17 +853,25 @@ = static void set_cx(=0A if ( check_cx(acpi_power, xen_cx) !=3D 0 )=0A = return;=0A =0A- if ( xen_cx->type =3D=3D ACPI_STATE_C1 )=0A+ = switch ( xen_cx->type )=0A+ {=0A+ case ACPI_STATE_C1:=0A cx = =3D &acpi_power->states[1];=0A- else=0A- cx =3D &acpi_power->stat= es[acpi_power->count];=0A-=0A- if ( !cx->valid )=0A- acpi_power->= count++;=0A+ break;=0A+ default:=0A+ if ( acpi_power->coun= t >=3D ACPI_PROCESSOR_MAX_POWER )=0A+ {=0A+ case ACPI_STATE_C0:= =0A+ printk(XENLOG_WARNING "CPU%u: C%d data ignored\n",=0A+ = acpi_power->cpu, xen_cx->type);=0A+ return;=0A+ = }=0A+ cx =3D &acpi_power->states[acpi_power->count++];=0A+ = cx->type =3D xen_cx->type;=0A+ break;=0A+ }=0A =0A- = cx->valid =3D 1;=0A- cx->type =3D xen_cx->type;=0A- cx->addres= s =3D xen_cx->reg.address;=0A+ cx->address =3D xen_cx->reg.address;=0A = =0A switch ( xen_cx->reg.space_id )=0A {=0A--- a/xen/include/xen/cp= uidle.h=0A+++ b/xen/include/xen/cpuidle.h=0A@@ -40,7 +40,6 @@=0A struct = acpi_processor_cx=0A {=0A u8 idx;=0A- u8 valid;=0A u8 type;=0A = u32 address;=0A u8 entry_method; /* ACPI_CSTATE_EM_xxx */=0A --=__PartA9876CD3.0__= Content-Type: text/plain; name="25098-x86-emul-lock-UD.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="25098-x86-emul-lock-UD.patch" # HG changeset patch=0A# User Andrew Cooper =0A#= Date 1332535516 0=0A# Node ID 2e45b26bc412099a2b8f009bcf111e4b6c23847b=0A#= Parent 2ca43b65718fbe2d3f9ea36132e139ef774d9a11=0Ax86_emulate: raise #UD = rather than #GP on invalid use of LOCK prefix=0A=0AFrom: Andrew Cooper = =0ASigned-off-by: Keir Fraser =0AC= ommitted-by: Keir Fraser =0A=0A# HG changeset patch=0A# User = Keir Fraser =0A# Date 1332535908 0=0A# Node ID 4bd752a4cdf323= c41c50f8cd6286f566d67adeae=0A# Parent 2e45b26bc412099a2b8f009bcf111e4b6c23= 847b=0Ax86_emulate: Do not push an error code onto a #UD exception = stack=0A=0ASigned-off-by: Keir Fraser =0A=0A--- a/xen/arch/x8= 6/x86_emulate/x86_emulate.c=0A+++ b/xen/arch/x86/x86_emulate/x86_emulate.c= =0A@@ -1353,7 +1353,7 @@ x86_emulate(=0A }=0A =0A /* Lock prefix = is allowed only on RMW instructions. */=0A- generate_exception_if((d & = Mov) && lock_prefix, EXC_GP, 0);=0A+ generate_exception_if((d & Mov) && = lock_prefix, EXC_UD, -1);=0A =0A /* ModRM and SIB bytes. */=0A if = ( d & ModRM )=0A@@ -1572,12 +1572,12 @@ x86_emulate(=0A = lock_prefix &&=0A ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn = */=0A (b !=3D 0xc7), /* CMPXCHG{8,16}B */=0A- = EXC_GP, 0);=0A+ EXC_UD, -1);=0A dst.type =3D = OP_NONE;=0A break;=0A =0A case DstReg:=0A- generate_exce= ption_if(lock_prefix, EXC_GP, 0);=0A+ generate_exception_if(lock_pre= fix, EXC_UD, -1);=0A dst.type =3D OP_REG;=0A if ( d & = ByteOp )=0A {=0A@@ -1633,7 +1633,7 @@ x86_emulate(=0A dst = =3D ea;=0A if ( dst.type =3D=3D OP_REG )=0A {=0A- = generate_exception_if(lock_prefix, EXC_GP, 0);=0A+ generate_ex= ception_if(lock_prefix, EXC_UD, -1);=0A switch ( dst.bytes = )=0A {=0A case 1: dst.val =3D *(uint8_t *)dst.reg;= break;=0A@@ -3645,14 +3645,14 @@ x86_emulate(=0A struct segment_re= gister cs =3D { 0 }, ss =3D { 0 };=0A int rc;=0A =0A- = generate_exception_if(in_realmode(ctxt, ops), EXC_UD, 0);=0A- = generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, 0);=0A+ = generate_exception_if(in_realmode(ctxt, ops), EXC_UD, -1);=0A+ = generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);=0A =0A = /* Inject #UD if syscall/sysret are disabled. */=0A fail_if(ops->re= ad_msr =3D=3D NULL);=0A if ( (rc =3D ops->read_msr(MSR_EFER, = &msr_content, ctxt)) !=3D 0 )=0A goto done;=0A- = generate_exception_if((msr_content & EFER_SCE) =3D=3D 0, EXC_UD, 0);=0A+ = generate_exception_if((msr_content & EFER_SCE) =3D=3D 0, EXC_UD, = -1);=0A =0A if ( (rc =3D ops->read_msr(MSR_STAR, &msr_content, = ctxt)) !=3D 0 )=0A goto done;=0A --=__PartA9876CD3.0__= Content-Type: text/plain; name="25101-x86-hpet-disable.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="25101-x86-hpet-disable.patch" References: bnc#748896=0A=0A# HG changeset patch=0A# User Jan Beulich = =0A# Date 1332854423 -7200=0A# Node ID f06ff3dfde08ee563= 970cffba502742249ff5820=0A# Parent ed48258053aea953afd28b746b53af7b8b30531= b=0Ax86/hpet: disable before reboot or kexec=0A=0ALinux up to now is not = smart enough to properly clear the HPET when it=0Aboots, which is = particularly a problem when a kdump attempt from=0Arunning under Xen is = being made. Linux itself added code to work around=0Athis to its shutdown = paths quite some time ago, so let's do something=0Asimilar in Xen: Save = the configuration register settings during boot,=0Aand restore them during = shutdown. This should cover the majority of=0Acases where the secondary = kernel might not come up because timer=0Ainterrupts don't work.=0A=0ASigned= -off-by: Jan Beulich =0AAcked-by: Keir Fraser =0A=0A--- a/xen/arch/x86/crash.c=0A+++ b/xen/arch/x86/crash.c=0A@@ = -94,6 +94,7 @@ static void nmi_shootdown_cpus(void)=0A x2apic_enabled = =3D (current_local_apic_mode() =3D=3D APIC_MODE_X2APIC);=0A =0A = disable_IO_APIC();=0A+ hpet_disable();=0A }=0A =0A void machine_crash_sh= utdown(void)=0A--- a/xen/arch/x86/hpet.c=0A+++ b/xen/arch/x86/hpet.c=0A@@ = -721,12 +721,14 @@ int hpet_legacy_irq_tick(void)=0A return 1;=0A }=0A = =0A+static u32 *hpet_boot_cfg;=0A+=0A u64 hpet_setup(void)=0A {=0A = static u64 hpet_rate;=0A static u32 system_reset_latch;=0A u32 = hpet_id, hpet_period, cfg;=0A- int i;=0A+ unsigned int i, last;=0A = =0A if ( system_reset_latch =3D=3D system_reset_counter )=0A = return hpet_rate;=0A@@ -752,13 +754,20 @@ u64 hpet_setup(void)=0A = return 0;=0A }=0A =0A+ last =3D (hpet_id & HPET_ID_NUMBER) >> = HPET_ID_NUMBER_SHIFT;=0A+ hpet_boot_cfg =3D xmalloc_array(u32, 2 + = last);=0A+=0A cfg =3D hpet_read32(HPET_CFG);=0A+ if ( hpet_boot_cfg = )=0A+ *hpet_boot_cfg =3D cfg;=0A cfg &=3D ~(HPET_CFG_ENABLE | = HPET_CFG_LEGACY);=0A hpet_write32(cfg, HPET_CFG);=0A =0A- for ( i = =3D 0; i <=3D ((hpet_id >> 8) & 31); i++ )=0A+ for ( i =3D 0; i <=3D = last; ++i )=0A {=0A cfg =3D hpet_read32(HPET_Tn_CFG(i));=0A+ = if ( hpet_boot_cfg )=0A+ hpet_boot_cfg[i + 1] =3D cfg;=0A = cfg &=3D ~HPET_TN_ENABLE;=0A hpet_write32(cfg, HPET_Tn_CFG(i= ));=0A }=0A@@ -772,3 +781,21 @@ u64 hpet_setup(void)=0A =0A return = hpet_rate;=0A }=0A+=0A+void hpet_disable(void)=0A+{=0A+ unsigned int = i;=0A+ u32 id;=0A+=0A+ if ( !hpet_boot_cfg )=0A+ return;=0A+= =0A+ hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);=0A+=0A+ = id =3D hpet_read32(HPET_ID);=0A+ for ( i =3D 0; i <=3D ((id & = HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); ++i )=0A+ hpet_write32(hpe= t_boot_cfg[i + 1], HPET_Tn_CFG(i));=0A+=0A+ if ( *hpet_boot_cfg & = HPET_CFG_ENABLE )=0A+ hpet_write32(*hpet_boot_cfg, HPET_CFG);=0A+}= =0A--- a/xen/arch/x86/smp.c=0A+++ b/xen/arch/x86/smp.c=0A@@ -19,6 +19,7 = @@=0A #include =0A #include =0A = #include =0A+#include =0A #include =0A #include =0A =0A@@ -373,6 +374,7 @@ void smp_send_st= op(void)=0A local_irq_disable();=0A __stop_this_cpu();=0A = disable_IO_APIC();=0A+ hpet_disable();=0A local_irq_enable();=0A = }=0A =0A--- a/xen/include/asm-x86/hpet.h=0A+++ b/xen/include/asm-x86/hpet.h= =0A@@ -68,6 +68,11 @@ extern unsigned long hpet_address;=0A u64 hpet_setup(= void);=0A =0A /*=0A+ * Disable HPET hardware: restore it to boot time = state.=0A+ */=0A+void hpet_disable(void);=0A+=0A+/*=0A * Callback from = legacy timer (PIT channel 0) IRQ handler.=0A * Returns 1 if tick = originated from HPET; else 0.=0A */=0A --=__PartA9876CD3.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartA9876CD3.0__=--