Skip to contentSkip to conversation

fix 32-bit compilation

PATCH Applied Andrew Jones 3 participants 6 messages Jan 11, 2017 – Jan 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover fix 32-bit compilation

again... Is it time for a github mirror and travis-ci?

Andrew Jones (2):
pci: fix 32-bit compilation
lib/x86/apic: fix 32-bit compilation

 lib/pci-edu.c  | 4 ++--
 lib/pci.c      | 2 +-
 lib/x86/apic.c | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.9.3
#3 lore raw

PATCH 2/2 lib/x86/apic: fix 32-bit compilation

Use the proper name, as the improper one isn't defined... Also cleanup some trailing spaces.

---
 lib/x86/apic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/x86/apic.c +4 -4
index aec968ea5a65..6b5b06806923 100644
@@ -120,8 +120,8 @@ uint8_t apic_get_tpr(void)
 #ifdef __x86_64__
 	asm volatile ("mov %%cr8, %0" : "=r"(tpr));
 #else
-	tpr = apic_read(APIC_TPR) >> 4;
-#endif	
+	tpr = apic_read(APIC_TASKPRI) >> 4;
+#endif
 	return tpr;
 }
 
@@ -130,8 +130,8 @@ void apic_set_tpr(uint8_t tpr)
 #ifdef __x86_64__
 	asm volatile ("mov %0, %%cr8" : : "r"((unsigned long) tpr));
 #else
-	apic_write(APIC_TPR, tpr << 4);
-#endif	
+	apic_write(APIC_TASKPRI, tpr << 4);
+#endif
 }
 
 int enable_x2apic(void)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/2 pci: fix 32-bit compilation

In reply to Andrew Jones
---
 lib/pci-edu.c | 4 ++--
 lib/pci.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
lib/pci-edu.c +2 -2
index 809647093f72..f94962f0001a 100644
@@ -48,9 +48,9 @@ void edu_dma(struct pci_edu_dev *dev, iova_t iova,
 	assert(size <= EDU_DMA_SIZE_MAX);
 	assert(dev_offset < EDU_DMA_SIZE_MAX);
 
-	printf("edu device DMA start %s addr %p size 0x%lu off 0x%x\n",
+	printf("edu device DMA start %s addr 0x%" PRIx64 " size 0x%lu off 0x%x\n",
 	       from_device ? "FROM" : "TO",
-	       (void *)iova, size, dev_offset);
+	       iova, (ulong)size, dev_offset);
 
 	if (from_device) {
 		from = dev_offset + EDU_DMA_START;
lib/pci.c +1 -1
index 6416191d3d94..3435266bcf00 100644
@@ -67,7 +67,7 @@ bool pci_setup_msi(struct pci_dev *dev, uint64_t msi_addr, uint32_t msi_data)
 		pci_config_writel(addr, offset + PCI_MSI_DATA_32, msi_data);
 		printf("MSI: dev 0x%x init 32bit address: ", addr);
 	}
-	printf("addr=0x%lx, data=0x%x\n", msi_addr, msi_data);
+	printf("addr=0x%" PRIx64 ", data=0x%x\n", msi_addr, msi_data);
 
 	msi_control |= PCI_MSI_FLAGS_ENABLE;
 	pci_config_writew(addr, offset + PCI_MSI_FLAGS, msi_control);
Signature · 1 line
2.9.3
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH kvm-unit-tests 1/2] pci: fix 32-bit compilation

Quoted 2 lines · Andrew Jones
Quoted 37 lines
---
 lib/pci-edu.c | 4 ++--
 lib/pci.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
lib/pci-edu.c +2 -2
index 809647093f72..f94962f0001a 100644
@@ -48,9 +48,9 @@ void edu_dma(struct pci_edu_dev *dev, iova_t iova,
 	assert(size <= EDU_DMA_SIZE_MAX);
 	assert(dev_offset < EDU_DMA_SIZE_MAX);
 
-	printf("edu device DMA start %s addr %p size 0x%lu off 0x%x\n",
+	printf("edu device DMA start %s addr 0x%" PRIx64 " size 0x%lu off 0x%x\n",
 	       from_device ? "FROM" : "TO",
-	       (void *)iova, size, dev_offset);
+	       iova, (ulong)size, dev_offset);
 
 	if (from_device) {
 		from = dev_offset + EDU_DMA_START;
lib/pci.c +1 -1
index 6416191d3d94..3435266bcf00 100644
@@ -67,7 +67,7 @@ bool pci_setup_msi(struct pci_dev *dev, uint64_t msi_addr, uint32_t msi_data)
 		pci_config_writel(addr, offset + PCI_MSI_DATA_32, msi_data);
 		printf("MSI: dev 0x%x init 32bit address: ", addr);
 	}
-	printf("addr=0x%lx, data=0x%x\n", msi_addr, msi_data);
+	printf("addr=0x%" PRIx64 ", data=0x%x\n", msi_addr, msi_data);
 
 	msi_control |= PCI_MSI_FLAGS_ENABLE;
 	pci_config_writew(addr, offset + PCI_MSI_FLAGS, msi_control);
Signature · 1 line
2.9.3

-- peterx

maintainer
#5 lore raw
In reply to Andrew Jones
Quoted 1 line · Andrew Jones

again... Is it time for a github mirror and travis-ci?

Uhm, yes it is. :(

Paolo

Quoted 10 lines

Andrew Jones (2):
pci: fix 32-bit compilation
lib/x86/apic: fix 32-bit compilation

 lib/pci-edu.c  | 4 ++--
 lib/pci.c      | 2 +-
 lib/x86/apic.c | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
maintainer Applied
#4 lore raw

Re: [PATCH kvm-unit-tests 2/2] lib/x86/apic: fix 32-bit compilation

In reply to Andrew Jones
Quoted 26 lines · Andrew Jones

Use the proper name, as the improper one isn't defined... Also cleanup some trailing spaces.

---
 lib/x86/apic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/x86/apic.c +2 -2
index aec968ea5a65..6b5b06806923 100644
@@ -120,8 +120,8 @@ uint8_t apic_get_tpr(void)
 #ifdef __x86_64__
 	asm volatile ("mov %%cr8, %0" : "=r"(tpr));
 #else
-	tpr = apic_read(APIC_TPR) >> 4;
-#endif	
+	tpr = apic_read(APIC_TASKPRI) >> 4;
+#endif
 	return tpr;
 }
 

lib/x86/apic.c void apic_set_tpr(uint8_t tpr) · line 137

Quoted 10 lines
lib/x86/apic.c +2 -2
@@ -130,8 +130,8 @@ void apic_set_tpr(uint8_t tpr)
 #ifdef __x86_64__
 	asm volatile ("mov %0, %%cr8" : : "r"((unsigned long) tpr));
 #else
-	apic_write(APIC_TPR, tpr << 4);
-#endif	
+	apic_write(APIC_TASKPRI, tpr << 4);
+#endif
 }
 
 int enable_x2apic(void)

Queued both, thanks and sorry.

Paolo