diff mbox

[v3,1/4] x86: PIT connects to pin 2 of IOAPIC

Message ID 1354518064-3066-2-git-send-email-yang.z.zhang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang, Yang Z Dec. 3, 2012, 7:01 a.m. UTC
When PIT connects to IOAPIC, it route to pin 2 not pin 0.

Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
---
 virt/kvm/ioapic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Gleb Natapov Dec. 3, 2012, 9:42 a.m. UTC | #1
On Mon, Dec 03, 2012 at 03:01:01PM +0800, Yang Zhang wrote:
> When PIT connects to IOAPIC, it route to pin 2 not pin 0.
> 
This hack didn't work for a long time and nobody complained. It
should be safe to get rid of it.

> Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
> ---
>  virt/kvm/ioapic.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
> index cfb7e4d..166c450 100644
> --- a/virt/kvm/ioapic.c
> +++ b/virt/kvm/ioapic.c
> @@ -181,7 +181,7 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
>  
>  #ifdef CONFIG_X86
>  	/* Always delivery PIT interrupt to vcpu 0 */
> -	if (irq == 0) {
> +	if (irq == 2) {
>  		irqe.dest_mode = 0; /* Physical mode. */
>  		/* need to read apic_id from apic regiest since
>  		 * it can be rewritten */
> -- 
> 1.7.1

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang, Yang Z Dec. 4, 2012, 5:32 a.m. UTC | #2
Gleb Natapov wrote on 2012-12-03:
> On Mon, Dec 03, 2012 at 03:01:01PM +0800, Yang Zhang wrote:
>> When PIT connects to IOAPIC, it route to pin 2 not pin 0.
>> 
> This hack didn't work for a long time and nobody complained. It
> should be safe to get rid of it.
This hack is used to work around an issue about RHEL4. Not sure whether anyone still uses RHEL4.

>> Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
>> ---
>>  virt/kvm/ioapic.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index
>> cfb7e4d..166c450 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c
>> @@ -181,7 +181,7 @@ static int ioapic_deliver(struct kvm_ioapic
>> *ioapic, int irq)
>> 
>>  #ifdef CONFIG_X86
>>  	/* Always delivery PIT interrupt to vcpu 0 */
>> -	if (irq == 0) {
>> +	if (irq == 2) {
>>  		irqe.dest_mode = 0; /* Physical mode. */
>>  		/* need to read apic_id from apic regiest since
>>  		 * it can be rewritten */
>> --
>> 1.7.1
> 
> --
> 			Gleb.


Best regards,
Yang


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gleb Natapov Dec. 4, 2012, 12:55 p.m. UTC | #3
On Tue, Dec 04, 2012 at 05:32:31AM +0000, Zhang, Yang Z wrote:
> Gleb Natapov wrote on 2012-12-03:
> > On Mon, Dec 03, 2012 at 03:01:01PM +0800, Yang Zhang wrote:
> >> When PIT connects to IOAPIC, it route to pin 2 not pin 0.
> >> 
> > This hack didn't work for a long time and nobody complained. It
> > should be safe to get rid of it.
> This hack is used to work around an issue about RHEL4. Not sure whether anyone still uses RHEL4.
> 
Yes, I traced it back to 8c35f237, but the hack is broken for a long time
(~3 years?) and nobody complained. It is broken in rhel6 too and rhel4
is tested as a guest there, may be the problem was solved in rhel4. I
think we can remove it now. If problem re-appear, at least we will know
which guest exactly actually needs it.


> >> Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
> >> ---
> >>  virt/kvm/ioapic.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index
> >> cfb7e4d..166c450 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c
> >> @@ -181,7 +181,7 @@ static int ioapic_deliver(struct kvm_ioapic
> >> *ioapic, int irq)
> >> 
> >>  #ifdef CONFIG_X86
> >>  	/* Always delivery PIT interrupt to vcpu 0 */
> >> -	if (irq == 0) {
> >> +	if (irq == 2) {
> >>  		irqe.dest_mode = 0; /* Physical mode. */
> >>  		/* need to read apic_id from apic regiest since
> >>  		 * it can be rewritten */
> >> --
> >> 1.7.1
> > 
> > --
> > 			Gleb.
> 
> 
> Best regards,
> Yang
> 

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang, Yang Z Dec. 5, 2012, 1:28 a.m. UTC | #4
Gleb Natapov wrote on 2012-12-04:
> On Tue, Dec 04, 2012 at 05:32:31AM +0000, Zhang, Yang Z wrote:
>> Gleb Natapov wrote on 2012-12-03:
>>> On Mon, Dec 03, 2012 at 03:01:01PM +0800, Yang Zhang wrote:
>>>> When PIT connects to IOAPIC, it route to pin 2 not pin 0.
>>>> 
>>> This hack didn't work for a long time and nobody complained. It
>>> should be safe to get rid of it.
>> This hack is used to work around an issue about RHEL4. Not sure whether
>> anyone still uses RHEL4.
>> 
> Yes, I traced it back to 8c35f237, but the hack is broken for a long time
> (~3 years?) and nobody complained. It is broken in rhel6 too and rhel4
> is tested as a guest there, may be the problem was solved in rhel4. I
> think we can remove it now. If problem re-appear, at least we will know
> which guest exactly actually needs it.
Agree.

> 
>>>> Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
>>>> ---
>>>>  virt/kvm/ioapic.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index
>>>> cfb7e4d..166c450 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c
>>>> @@ -181,7 +181,7 @@ static int ioapic_deliver(struct kvm_ioapic
>>>> *ioapic, int irq)
>>>> 
>>>>  #ifdef CONFIG_X86
>>>>  	/* Always delivery PIT interrupt to vcpu 0 */
>>>> -	if (irq == 0) {
>>>> +	if (irq == 2) {
>>>>  		irqe.dest_mode = 0; /* Physical mode. */
>>>>  		/* need to read apic_id from apic regiest since
>>>>  		 * it can be rewritten */
>>>> --
>>>> 1.7.1
>>> 
>>> --
>>> 			Gleb.
>> 
>> 
>> Best regards,
>> Yang
>> 
> 
> --
> 			Gleb.
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Best regards,
Yang


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index cfb7e4d..166c450 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -181,7 +181,7 @@  static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
 
 #ifdef CONFIG_X86
 	/* Always delivery PIT interrupt to vcpu 0 */
-	if (irq == 0) {
+	if (irq == 2) {
 		irqe.dest_mode = 0; /* Physical mode. */
 		/* need to read apic_id from apic regiest since
 		 * it can be rewritten */